:root {
    --cream: #f4ede1;
    --cream-ink: #1a1410;
    --cream-mute: #6b5f52;
    --black: #0a0a0a;
    --black-soft: #141414;
    --green: #7dff9a;
    --green-dim: #4a9f5e;
    --mono-ink: #e8e8e8;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Fraunces', Georgia, serif;
    background: var(--black);
    color: var(--mono-ink);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ---------- grain overlay ---------- */
.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: .18;
    mix-blend-mode: overlay;
}

/* ---------- split layout ---------- */
.split {
    display: flex;
    width: 100vw;
    /* dvh matters here too: a phone in landscape is wider than the 780px
       breakpoint, so it lands on this rule with overflow:hidden — cut-off
       content would not even be scrollable. */
    height: 100vh;
    height: 100dvh;
    position: relative;
}

.half {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    transition: flex-basis .7s var(--ease), filter .7s var(--ease);
    padding: clamp(2rem, 5vw, 5rem) clamp(1.5rem, 4vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* hover expansion */
@media (hover: hover) and (min-width: 780px) {
    .split:has(.left:hover) .left { flex-basis: 62%; }
    .split:has(.left:hover) .right { flex-basis: 38%; filter: brightness(.55) saturate(.7); }
    .split:has(.right:hover) .right { flex-basis: 62%; }
    .split:has(.right:hover) .left { flex-basis: 38%; filter: brightness(.85) saturate(.85); }
}

/* divider rule — attached to the left half so it follows the flex boundary */
.left::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; right: 0;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(125,255,154,.25) 20%, rgba(26,20,16,.25) 80%, transparent);
    z-index: 5;
    pointer-events: none;
}

/* ===========================================================
   LEFT — photographer
   =========================================================== */
.left {
    background: var(--cream);
    color: var(--cream-ink);
    font-family: 'Fraunces', Georgia, serif;
}

.left::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(195, 140, 70, .10), transparent 55%),
        radial-gradient(ellipse at 70% 90%, rgba(80, 40, 10, .08), transparent 60%);
    pointer-events: none;
}

.l-top, .l-mid, .l-foot { position: relative; z-index: 2; }

/* call to action and socials share the bottom of the panel as one group */
.l-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.6rem, 4vh, 2.8rem);
}

.l-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: .72rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--cream-mute);
    font-weight: 500;
}

.l-top .marks {
    display: flex;
    gap: .35rem;
    align-items: center;
}
.l-top .marks span {
    width: 10px; height: 10px;
    border: 1px solid var(--cream-mute);
    display: inline-block;
}
.l-top .marks span:nth-child(2),
.l-top .marks span:nth-child(4) { background: var(--cream-ink); border-color: var(--cream-ink); }

.wordmark {
    font-family: 'Fraunces', serif;
    font-weight: 300;
    font-size: clamp(3.5rem, 9vw, 8.5rem);
    line-height: .88;
    letter-spacing: -.04em;
    margin: 0;
    font-variation-settings: "opsz" 144, "SOFT" 50;
}
.wordmark em {
    font-style: italic;
    font-weight: 500;
    font-variation-settings: "opsz" 144, "SOFT" 100;
}

/* ---------- dictionary entry (pronunciation + senses) ---------- */
/* the wordmark's .88 line-height crops its descenders, so this clears them */
.l-entry { margin: clamp(1.3rem, 2.2vw, 2rem) 0 0 .15rem; }

.l-say {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .55rem;
    margin: 0;
    font-family: 'Gentium Book Plus', 'Charis SIL', Georgia, serif;
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    color: var(--cream-ink);
}
.l-say .sep { color: var(--cream-mute); }

/* speaker glyph — align-self centres it against the baseline-aligned text.
   Box is kept at 1.4rem for a comfortable tap target; only the glyph shows. */
.l-hear {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    color: var(--cream-ink);
    width: 1.4rem;
    height: 1.4rem;
    padding: 0;
    flex: 0 0 auto;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity .25s var(--ease);
}
.l-hear svg { width: 100%; height: 100%; display: block; }
.l-hear:hover { opacity: .55; }
.l-hear.is-playing { opacity: .4; }
.l-hear:focus-visible { outline: 2px solid var(--cream-ink); outline-offset: 3px; }
.l-say .resp {
    font-family: 'JetBrains Mono', monospace;
    font-size: .68rem;
    letter-spacing: .12em;
    color: var(--cream-mute);
}
.l-senses {
    list-style: none;
    margin: .85rem 0 0;
    padding: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem;
    letter-spacing: .1em;
    line-height: 1.95;
    color: var(--cream-mute);
}
.l-senses li { display: flex; align-items: baseline; gap: .6rem; }
.l-senses .n { color: var(--cream-ink); }

/* usage labels, set like a dictionary's — line-height:1 keeps the taller
   serif from stretching the line box it shares with the mono */
.l-senses .lbl {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 500;
    font-size: .88rem;
    line-height: 1;
    letter-spacing: 0;
}

/* a line of copy, not a control — the Instagram and Foto links below carry
   the action, so no underline or hover state that would imply clickability */
.l-cta {
    display: inline-block;
    /* the negative right margin cancels the trailing letter-space, so the caps
       centre on their glyphs rather than sitting a half-space left of the icons */
    margin: 0 -.3em 0 0;
    font-family: 'JetBrains Mono', monospace;
    font-style: normal;
    font-weight: 400;
    font-size: .72rem;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--cream-mute);
    align-self: center;
}

.l-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(2rem, 3.5vw, 3.5rem);
}
.l-social a {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: .68rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--cream-ink);
    transition: opacity .3s var(--ease);
}
.l-social a:hover { opacity: .55; }
.l-social a:focus-visible { outline: 2px solid var(--cream-ink); outline-offset: 6px; }
.l-social svg { width: 1.15rem; height: 1.15rem; display: block; }

/* ===========================================================
   RIGHT — developer
   =========================================================== */
.right {
    background: var(--black);
    color: var(--mono-ink);
    font-family: 'JetBrains Mono', monospace;
}

.right::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(125,255,154,.025) 0 1px, transparent 1px 3px),
        radial-gradient(ellipse at 70% 30%, rgba(125,255,154,.06), transparent 60%);
    pointer-events: none;
}

.r-mid { position: relative; z-index: 2; }

.term {
    font-size: clamp(.82rem, 1.05vw, 1rem);
    line-height: 1.7;
    color: var(--mono-ink);
}

.term .gap {
    display: block;
    height: .6em;
}

.term .line {
    display: block;
    opacity: 0;
    animation: typein .5s var(--ease) forwards;
    padding-left: 2ch;
    text-indent: -2ch;
    white-space: normal;
    word-break: break-word;
}
.term .line:nth-child(1) { animation-delay: .25s; }
.term .line:nth-child(2) { animation-delay: .55s; }
.term .line:nth-child(3) { animation-delay: .85s; }
.term .line:nth-child(4) { animation-delay: 1.05s; }
.term .line:nth-child(5) { animation-delay: 1.25s; }
.term .line:nth-child(6) { animation-delay: 1.45s; }
.term .line:nth-child(7) { animation-delay: 1.65s; }
.term .line:nth-child(8) { animation-delay: 1.85s; }
.term .line:nth-child(9) { animation-delay: 2.05s; }
.term .line:nth-child(10) { animation-delay: 2.25s; }
.term .line:nth-child(11) { animation-delay: 2.45s; }
.term .line:nth-child(12) { animation-delay: 2.65s; }
.term .line:nth-child(13) { animation-delay: 2.85s; }
.term .line:nth-child(14) { animation-delay: 3.05s; }
.term .line:nth-child(15) { animation-delay: 3.25s; }

@keyframes typein {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.prompt { color: var(--green); user-select: none; }
.prompt::before { content: "$ "; }
.out { color: var(--mono-ink); }
.out::before { content: "  "; white-space: pre; }
.c { color: #5a6a5e; }

/* ongoing work — brackets, not a pill, so it still reads as terminal output.
   nowrap keeps the tag whole: .line uses word-break:break-word to wrap the
   long lines, which would otherwise split it across the name and the comment. */
.wip {
    color: var(--green-dim);
    font-size: .88em;
    letter-spacing: .04em;
    white-space: nowrap;
}

.term a {
    color: var(--mono-ink);
    border-bottom: 1px dashed transparent;
    transition: color .25s, border-color .25s;
}
.term a:hover { color: var(--green); border-bottom-color: var(--green); }
.term a:focus-visible { outline: 1px solid var(--green); outline-offset: 3px; }

.r-wordmark {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.3rem, 2.1vw, 1.8rem);
    letter-spacing: -.02em;
    color: var(--green);
    margin: 0 0 1.4rem 0;
}
.r-wordmark::before { content: "> "; color: var(--green-dim); }

.caret {
    display: inline-block;
    width: .55em;
    height: 1em;
    background: var(--green);
    vertical-align: -2px;
    margin-left: .25rem;
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- load reveal ---------- */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: reveal .9s var(--ease) forwards;
}
.reveal.d1 { animation-delay: .05s; }
.reveal.d2 { animation-delay: .20s; }
.reveal.d3 { animation-delay: .40s; }
.reveal.d4 { animation-delay: .60s; }
.reveal.d5 { animation-delay: .80s; }

@keyframes reveal {
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- short viewports (a phone in landscape) ----------
   These are wider than the 780px breakpoint, so they take the side-by-side
   layout with overflow:hidden. If the panel does not fit, the overflow is
   clipped AND unscrollable. Let the page scroll instead of swallowing it. */
@media (max-height: 520px) {
    /* height:auto as well as overflow:auto — with height:100% the body becomes
       a fixed-height internal scroller, so the document itself never scrolls
       and mobile browsers never collapse their toolbars. */
    html, body { height: auto; overflow: auto; }
    .split {
        height: auto;
        /* svh for the same reason as the mobile block below: this layout
           scrolls, so a dvh floor would grow mid-scroll as the toolbars go. */
        min-height: 100vh;
        min-height: 100svh;
    }
}

/* ---------- mobile ---------- */
@media (max-width: 780px) {
    html, body { height: auto; overflow: auto; }
    .split {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        min-height: 100svh;
    }
    .half {
        flex: 0 0 auto;
        /* 100vh on a phone is the LARGE viewport — the height with the browser
           toolbars hidden. With them showing, anything anchored to the bottom of
           the box (the social row) falls below the fold.
           svh, not dvh: svh is the viewport with the toolbars EXPANDED, so the
           social row still clears the fold — but it is a fixed number. dvh is
           re-measured as those toolbars retract mid-scroll, which re-sizes both
           panels under the reader and drags the divider between them along with
           the boundary. The vh line above stays as a fallback. */
        min-height: 100vh;
        min-height: 100svh;
        transition: none;
    }
    .left::after {
        top: auto; bottom: 0; left: 0; right: 0;
        width: 100%; height: 1px;
        background: linear-gradient(90deg, transparent, rgba(26,20,16,.3), rgba(125,255,154,.3), transparent);
    }
    .wordmark { font-size: clamp(3rem, 15vw, 5.5rem); }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .split:has(.left:hover) .left,
    .split:has(.right:hover) .right,
    .split:has(.left:hover) .right,
    .split:has(.right:hover) .left {
        flex-basis: 50%;
        filter: none;
    }
}
