/* ——————————————————————————————————————————————
   Ink on paper.
   EB Garamond for the voice, Geist for the margins.
   —————————————————————————————————————————————— */

:root {
    --paper: #f7f6f2;
    --ink: #1c1a18;
    --grey: #6b6862;
    --faint: #a39f97;
    --line: #e2dfd8;
    --wash: rgba(28, 26, 24, 0.05);
    --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --sans: 'Geist', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --void: #0a0908;
    --worklight: #cdbfa0;
}

[data-theme="dark"] {
    --paper: #131211;
    --ink: #d8d4cd;
    --grey: #8d8881;
    --faint: #57534e;
    --line: #282522;
    --wash: rgba(216, 212, 205, 0.05);
}

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

html { scroll-behavior: smooth; }

body {
    overflow-x: clip;
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.7;
    letter-spacing: 0.005em;
    -webkit-font-smoothing: antialiased;
    transition: background 0.4s ease, color 0.4s ease;
}

::selection { background: var(--ink); color: var(--paper); }

.container {
    max-width: 660px;
    margin: 0 auto;
    padding: 96px 24px 72px;
}

/* ——— headers ——— */

.masthead { margin-bottom: 72px; }

.name {
    font-family: var(--serif);
    font-size: 44px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: var(--ink);
}

.role {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--grey);
    margin-top: 14px;
}

.bio {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.6;
    color: var(--grey);
    max-width: 480px;
    margin-top: 28px;
    white-space: pre-line;
}

.bio em { color: var(--ink); font-style: italic; }

/* ——— sections ——— */

.section { margin-bottom: 88px; }

.section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--faint);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 36px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--line);
}

/* ——— links, quiet ——— */

a { color: inherit; }

.quiet-link {
    color: var(--grey);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.25s ease;
}

.quiet-link:hover { color: var(--ink); }

.back-link {
    display: inline-block;
    color: var(--grey);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.06em;
    margin-bottom: 56px;
    transition: color 0.25s ease;
}

.back-link::before {
    content: '←';
    margin-right: 8px;
    display: inline-block;
    transition: transform 0.25s ease;
}

.back-link:hover { color: var(--ink); }
.back-link:hover::before { transform: translateX(-3px); }

/* ——— index: the stage ——— */

.stage { margin-bottom: 24px; }

.stage svg {
    width: 100%;
    height: auto;
    display: block;
    color: var(--ink);
    overflow: visible;
}

.stage .scenery {
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.stage .drawn {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: draw 2.8s ease-out forwards;
}

.stage .drawn.late { animation-delay: 0.9s; }

@keyframes draw { to { stroke-dashoffset: 0; } }

#sisyphus { will-change: transform; }

.stage.ready #sisyphus {
    transition: transform 2.2s cubic-bezier(0.65, 0, 0.25, 1);
}

#sisyphus .figure-art {
    animation: strain 3.6s ease-in-out infinite;
}

@keyframes strain {
    0%, 100% { transform: translateX(0); }
    55% { transform: translateX(1.6px); }
    70% { transform: translateX(0.4px); }
}

#boulder {
    transition: transform 2.2s cubic-bezier(0.65, 0, 0.25, 1);
    transform-origin: center;
    transform-box: fill-box;
}

.leaf {
    fill: currentColor;
    stroke: none;
    opacity: 0;
    transform: scale(0);
    transform-origin: center;
    transform-box: fill-box;
    transition: opacity 1.2s ease 0.9s, transform 1.4s cubic-bezier(0.2, 0.8, 0.3, 1.2) 0.9s;
}

.stage[data-act="2"] .leaf:nth-of-type(1),
.stage[data-act="3"] .leaf:nth-of-type(1),
.stage[data-act="3"] .leaf:nth-of-type(2),
.stage[data-act="3"] .leaf:nth-of-type(3),
.stage[data-act="3"] .leaf:nth-of-type(4) {
    opacity: 0.85;
    transform: scale(1);
}

.stage-caption {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--faint);
    text-align: right;
    margin-bottom: 56px;
}

/* ——— index: the acts ——— */

.acts { display: flex; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.act-tab {
    flex: 1;
    background: none;
    border: none;
    border-right: 1px solid var(--line);
    padding: 18px 12px 16px;
    cursor: pointer;
    font-family: var(--sans);
    text-align: left;
    color: var(--grey);
    transition: color 0.3s ease, background 0.3s ease;
}

.act-tab:last-child { border-right: none; }

.act-numeral {
    font-family: var(--serif);
    font-size: 21px;
    display: block;
    line-height: 1;
    color: var(--faint);
    transition: color 0.3s ease;
}

.act-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-top: 8px;
}

.act-years {
    display: block;
    font-size: 11px;
    color: var(--faint);
    margin-top: 3px;
    letter-spacing: 0.04em;
}

.act-tab:hover { color: var(--ink); }

.act-tab[aria-selected="true"] { color: var(--ink); background: var(--wash); }
.act-tab[aria-selected="true"] .act-numeral { color: var(--ink); }

.act-panels { position: relative; min-height: 240px; }

.act-panel {
    position: absolute;
    inset: 0;
    padding-top: 36px;
    opacity: 0;
    clip-path: circle(0% at 24px 48px);
    pointer-events: none;
    visibility: hidden;
}

.act-panel.open {
    position: relative;
    opacity: 1;
    clip-path: circle(150% at 24px 48px);
    pointer-events: auto;
    visibility: visible;
    transition: clip-path 1.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
}

.act-title {
    font-family: var(--serif);
    font-size: 26px;
    font-weight: 500;
    font-style: italic;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.act-company {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--grey);
    margin-top: 10px;
}

.act-story {
    color: var(--grey);
    font-size: 15px;
    line-height: 1.75;
    margin-top: 20px;
    max-width: 560px;
    white-space: pre-line;
}

.act-more {
    display: inline-block;
    margin-top: 22px;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--faint);
    padding-bottom: 2px;
    transition: border-color 0.3s ease;
}

.act-more:hover { border-color: var(--ink); }

/* ——— index: writing list ——— */

.writing-item { display: block; text-decoration: none; padding: 14px 0; border-bottom: 1px solid var(--line); }
.writing-item:last-of-type { border-bottom: none; }

.writing-row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }

.writing-title {
    font-family: var(--serif);
    font-size: 19px;
    color: var(--ink);
    display: inline-block;
    transition: letter-spacing 0.4s ease, opacity 0.4s ease;
}

/* dissolve — letters drift apart, like a thought losing its shape */
.writing-item:hover .writing-title {
    letter-spacing: 0.04em;
    opacity: 0.8;
}

.writing-date {
    font-size: 12px;
    color: var(--faint);
    white-space: nowrap;
    letter-spacing: 0.04em;
}

.writing-excerpt { font-size: 14px; color: var(--grey); margin-top: 4px; max-width: 520px; }

/* ——— index: experiments ——— */

.experiment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.experiment:last-of-type { border-bottom: none; }

.experiment-row { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; }

.experiment-name {
    font-family: var(--serif);
    font-size: 18px;
    color: var(--ink);
    text-decoration: none;
    display: inline-block;
    transition: letter-spacing 0.4s ease, opacity 0.4s ease;
}

/* dissolve — letters drift apart, like a thought losing its shape */
.experiment-name:hover {
    letter-spacing: 0.04em;
    opacity: 0.8;
}

.experiment-status {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--faint);
    white-space: nowrap;
}

.experiment-desc { font-size: 14px; color: var(--grey); margin-top: 4px; max-width: 520px; }

/* ——— footer ——— */

.footer {
    border-top: 1px solid var(--line);
    padding-top: 32px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links { display: flex; gap: 24px; }

.colophon {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--faint);
}

/* ——— inner pages: essay ——— */

.essay-header { margin-bottom: 64px; }

.essay-kicker {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--faint);
    margin-bottom: 18px;
}

.essay-title {
    font-family: var(--serif);
    font-size: 40px;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.essay-date {
    font-size: 13px;
    color: var(--grey);
    margin-top: 16px;
    letter-spacing: 0.04em;
}

.prose {
    font-family: var(--serif);
    font-size: 19px;
    line-height: 1.75;
    color: var(--ink);
}

.prose p { margin-bottom: 26px; color: var(--ink); }

.prose > p:first-of-type::first-letter {
    font-size: 64px;
    line-height: 0.85;
    float: left;
    padding-right: 12px;
    padding-top: 6px;
    font-weight: 500;
}

.prose h1, .prose h2, .prose h3 {
    font-family: var(--serif);
    font-weight: 500;
    color: var(--ink);
    margin: 48px 0 18px;
    line-height: 1.25;
}

.prose h1 { font-size: 28px; }
.prose h2 { font-size: 24px; }
.prose h3 { font-size: 20px; font-style: italic; }

.prose ul, .prose ol { margin: 0 0 26px 22px; }
.prose li { margin-bottom: 10px; }

.prose blockquote {
    margin: 36px 0;
    padding-left: 24px;
    border-left: 1px solid var(--ink);
    font-style: italic;
    color: var(--grey);
}

.prose code {
    font-family: 'Geist Mono', 'SF Mono', Menlo, monospace;
    font-size: 0.78em;
    background: var(--wash);
    padding: 2px 6px;
    border-radius: 3px;
}

.prose pre {
    background: var(--wash);
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 26px;
    font-size: 14px;
    line-height: 1.5;
}

.prose pre code { background: none; padding: 0; }

.prose a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--faint);
    transition: border-color 0.25s ease;
}

.prose a:hover { border-color: var(--ink); }

.prose hr {
    border: none;
    margin: 48px 0;
    text-align: center;
}

.prose hr::after {
    content: '· · ·';
    color: var(--faint);
    letter-spacing: 0.6em;
    font-size: 14px;
}

.prose em { font-style: italic; }
.prose strong { font-weight: 600; }

/* ——— inner pages: work / act page ——— */

.act-page-header { margin-bottom: 56px; }

.act-page-numeral {
    font-family: var(--serif);
    font-size: 15px;
    letter-spacing: 0.3em;
    color: var(--faint);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.act-page-title {
    font-family: var(--serif);
    font-size: 38px;
    font-weight: 500;
    font-style: italic;
    line-height: 1.15;
    color: var(--ink);
}

.act-page-meta {
    margin-top: 18px;
    font-size: 13px;
    color: var(--grey);
    letter-spacing: 0.04em;
    line-height: 1.9;
}

.act-page-meta .co { text-transform: uppercase; letter-spacing: 0.16em; color: var(--ink); }

/* ——— listing pages ——— */

.page-title {
    font-family: var(--serif);
    font-size: 38px;
    font-weight: 500;
    color: var(--ink);
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-family: var(--serif);
    font-size: 17px;
    font-style: italic;
    color: var(--grey);
    margin-top: 14px;
    max-width: 480px;
}

.listing-header { margin-bottom: 56px; }

/* ——— theme toggle ——— */

.theme-toggle {
    position: fixed;
    top: 28px;
    right: 28px;
    width: 36px;
    height: 36px;
    border: none;
    background: none;
    color: var(--faint);
    font-size: 19px;
    cursor: pointer;
    z-index: 100;
    transition: color 0.3s ease, transform 0.5s ease;
    line-height: 1;
}

.theme-toggle:hover { color: var(--ink); transform: rotate(180deg); }

/* ——— the curtain (page transitions) ————
   A stage blackout between scenes: the light dims to nothing, a line
   is left hanging in the dark long enough to be read, then it lifts.
   A plain fade, on purpose — no shape, no seam, nothing to admire. */

.curtain {
    position: fixed;
    inset: 0;
    background: var(--void);
    z-index: 999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.curtain.lit { opacity: 1; }

.curtain-line {
    font-family: var(--serif);
    font-style: italic;
    font-size: 18px;
    line-height: 1.7;
    letter-spacing: 0.01em;
    color: var(--worklight);
    text-align: center;
    max-width: 440px;
    padding: 0 32px;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.curtain-line.show { opacity: 0.85; }

/* ——— motion respect ——— */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
    .stage .drawn { stroke-dashoffset: 0; animation: none; }
    .curtain { display: none; }
}

/* ——— small screens ——— */

@media (max-width: 600px) {
    .container { padding: 64px 20px 56px; }
    .name { font-size: 34px; }
    .essay-title { font-size: 30px; }
    .page-title, .act-page-title { font-size: 28px; }
    .prose { font-size: 17px; }
    .acts { flex-direction: column; }
    .act-tab { border-right: none; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 14px; padding: 14px 8px; }
    .act-tab:last-child { border-bottom: none; }
    .act-numeral { font-size: 17px; min-width: 24px; }
    .act-label { margin-top: 0; }
    .act-years { margin-left: auto; margin-top: 0; }
    .act-panels { min-height: 300px; }
    .writing-row, .experiment-row { flex-direction: column; gap: 2px; }
    .theme-toggle { top: 16px; right: 16px; }
}
