:root {
    --text: #1a1a1a;
    --text-secondary: #555;
    --bg: #f7f6f2;
    --link: #0b4f6c;
    --link-hover: #073649;
    --border: #d8d5cc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 20px;
    background: var(--bg);
}

body {
    font-family: 'EB Garamond', Georgia, serif;
    background: transparent;
    color: var(--text);
    line-height: 1.65;
    padding: 3rem 1.5rem;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    isolation: isolate;
}

/* Static contour lines fade out before the reading column. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: url('topography.svg') center / cover no-repeat;
    -webkit-mask-image: linear-gradient(to right,
        #000, transparent calc(50% - 320px),
        transparent calc(50% + 320px), #000);
    mask-image: linear-gradient(to right,
        #000, transparent calc(50% - 320px),
        transparent calc(50% + 320px), #000);
}

header {
    margin-bottom: 2.5rem;
    position: relative;
}

header::after {
    content: "";
    display: block;
    height: 2px;
    width: 72px;
    margin-top: 0.75rem;
    background: var(--link);
}

h1 {
    font-size: 2.4rem;
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.tagline {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

nav {
    margin: 2rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 0.35rem 1rem;
    flex-wrap: wrap;
}

nav a {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--text);
    letter-spacing: 0.02em;
    transition: color 0.15s;
}

nav a:hover {
    color: var(--link-hover);
}

.bio {
    margin-bottom: 2rem;
    padding-top: 0;
    border-top: none;
}

.bio p {
    margin-bottom: 1rem;
}

.bio-more[hidden] {
    display: none;
}

.intro-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 1rem 0 1.5rem;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
}

.intro-links a,
nav a {
    display: inline-block;
    padding: 0.3rem 0;
}

:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 4px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -6rem;
    padding: 0.5rem 1rem;
    background: var(--bg);
    z-index: 10000;
}

.skip-link:focus {
    top: 0.5rem;
}

.bio-toggle {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.bio-toggle:hover {
    color: var(--text);
}

section {
    margin-bottom: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    scroll-margin-top: 1.5rem;
}

section p + p,
section p + ul,
section ul + p {
    margin-top: 0.85rem;
}

h2 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 1rem;
}

.endorsement {
    margin-bottom: 1.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--link);
}

.endorsement:last-child {
    margin-bottom: 0;
}

.endorsement blockquote {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 0.6rem;
}

.endorsement figcaption {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.endorsement figcaption strong {
    color: var(--text);
    font-weight: 500;
}

.endorsement-source {
    display: block;
    margin-top: 0.15rem;
}

ul {
    list-style: none;
}

li {
    margin-bottom: 0.6rem;
}

a {
    color: var(--link);
    text-decoration: underline;
    text-decoration-color: rgba(11, 79, 108, 0.35);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    border-bottom: none;
    transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
    color: var(--link-hover);
    text-decoration-color: rgba(11, 79, 108, 0.85);
}

.meta {
    display: block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    line-height: 1.5;
}

.post-list li {
    margin: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.post-list li:first-child {
    padding-top: 0;
}

.post-list li:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.post-list a {
    display: inline-block;
    line-height: 1.4;
}

#writing h3 {
    margin-top: 2rem;
    margin-bottom: 0.85rem;
}

#writing h2 + h3 {
    margin-top: 0;
}

.platform-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.platform-links li {
    margin: 0;
}

.book-list {
    display: grid;
    gap: 1.5rem;
}

.book {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.book img {
    display: block;
    width: 90px;
    height: auto;
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.1);
}

h3 {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 0.25rem;
}

.book h3 {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.15rem;
}

.book p,
.selected-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.book p {
    margin-bottom: 0.4rem;
}

.selected-description {
    display: block;
}

.now-section {
    background: #f0eee7;
    padding: 1.25rem;
    margin-bottom: 2.5rem;
    border-left: 3px solid var(--link);
}

.now-section h2 {
    margin-bottom: 0.75rem;
}

.now-section p {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.now-section p:last-child {
    margin-bottom: 0;
}

.subscribe-inline {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

footer a {
    color: var(--text-secondary);
}

@media (max-width: 800px) {
    body::before {
        display: none;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 18px;
    }
    
    body {
        padding: 2rem 1.25rem;
    }

    nav ul {
        gap: 0.35rem 1rem;
    }
}

/* Hidden CLI Easter Egg */
.cli-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    padding: 2rem;
    overflow-y: auto;
}

.cli-overlay.active {
    display: block;
}

.cli-terminal {
    max-width: 800px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #00ff00;
}

.cli-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #00ff00;
    opacity: 0.7;
}

#terminal-close {
    float: right;
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid currentColor;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.cli-overlay :focus-visible {
    outline: 2px solid #00ff00;
    outline-offset: 3px;
}

.cli-output {
    margin-bottom: 1rem;
    min-height: 200px;
}

.cli-line {
    margin: 0.25rem 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.cli-input-line {
    display: flex;
    align-items: center;
}

.cli-prompt {
    color: #00ff00;
    margin-right: 0.5rem;
}

.cli-input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    outline: none;
}

.cli-cursor {
    display: inline-block;
    width: 8px;
    height: 14px;
    background: #00ff00;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cli-cursor {
        animation: none;
    }

    a,
    nav a {
        transition: none;
    }
}

.cli-error {
    color: #ff5555;
}

.cli-success {
    color: #50fa7b;
}

.cli-info {
    color: #8be9fd;
}

.breadcrumbs { margin: 1.5rem 0; padding: 0; border: 0; font-family: 'IBM Plex Sans', sans-serif; font-size: 0.75rem; }
.breadcrumbs a { font-size: inherit; padding: 0; letter-spacing: normal; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; }
.breadcrumbs li + li::before { content: '/'; margin-right: 0.5rem; color: var(--text-secondary); }
.page-intro { margin-bottom: 2rem; }
.page-intro h1 { font-size: 2rem; line-height: 1.2; margin-bottom: 0.75rem; }
.page-intro p + p { margin-top: 0.85rem; }
.page-identity { font-family: 'EB Garamond', Georgia, serif; font-size: 1.6rem; text-decoration: none; color: var(--text); }
.topic-list > li { margin-bottom: 1.25rem; }
.topic-list h3 { margin-bottom: 0.35rem; }
.faq-list dt { font-family: 'IBM Plex Sans', sans-serif; font-size: 0.9rem; font-weight: 500; margin-top: 1.25rem; line-height: 1.5; }
.faq-list dt:first-child { margin-top: 0; }
.faq-list dd { margin-top: 0.4rem; }
.request-link { display: inline-block; font-family: 'IBM Plex Sans', sans-serif; font-size: 0.85rem; margin-top: 1rem; }
nav a[aria-current='page'] { text-decoration: underline; text-underline-offset: 4px; }
