/* ==========================================================================
   faller.one
   ========================================================================== */

:root {
    color-scheme: dark;

    --bg: #0a0e14;
    --veil: rgba(10, 14, 20, 0.84);
    --surface: rgba(19, 25, 35, 0.66);
    --surface-solid: #121822;
    --line: rgba(148, 163, 184, 0.14);
    --line-strong: rgba(148, 163, 184, 0.3);
    --text: #e8ebf0;
    --text-2: #aeb6c3;
    --muted: #848e9d;
    --accent: #f4b740;
    --accent-ink: #1b1305;
    --accent-soft: rgba(244, 183, 64, 0.13);
    --spot: rgba(255, 255, 255, 0.035);
    --dot: rgba(148, 163, 184, 0.13);
    --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);

    /* Lights Out cells */
    --cell-off: #1a2230;
    --cell-line: rgba(148, 163, 184, 0.12);

    /* Canvas colors, as "r, g, b" so scripts can add alpha */
    --bubble: 110, 205, 228;
    --bubble-shine: 255, 255, 255;
    --glow: 244, 183, 64;
    --trace: 148, 163, 184;

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    --radius: 20px;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --max: 1160px;
    --gutter: clamp(16px, 4vw, 40px);
}

:root[data-theme="light"] {
    color-scheme: light;

    --bg: #f5f3ee;
    --veil: rgba(245, 243, 238, 0.86);
    --surface: rgba(255, 255, 255, 0.72);
    --surface-solid: #ffffff;
    --line: rgba(20, 24, 33, 0.1);
    --line-strong: rgba(20, 24, 33, 0.22);
    --text: #13171e;
    --text-2: #3f4754;
    --muted: #646c79;
    --accent: #a35d00;
    --accent-ink: #ffffff;
    --accent-soft: rgba(196, 122, 10, 0.12);
    --spot: rgba(20, 24, 33, 0.03);
    --dot: rgba(20, 24, 33, 0.09);
    --shadow: 0 30px 80px -40px rgba(60, 50, 30, 0.35);

    --cell-off: #e7e3da;
    --cell-line: rgba(20, 24, 33, 0.08);

    --bubble: 22, 120, 150;
    --bubble-shine: 255, 255, 255;
    --glow: 214, 140, 20;
    --trace: 70, 80, 95;
}

/* ---------- base ---------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 400 16px/1.65 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

body.is-locked { overflow: hidden; }

/* <html data-gate="off"> skips the door; the puzzle stays implemented */
[data-gate="off"] .gate { display: none; }
[data-gate="off"] body.is-locked { overflow: auto; }

[hidden] { display: none !important; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, figure { margin: 0; }

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

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 8px;
}

.mono { font-family: var(--font-mono); }

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.surface {
    background: var(--surface);
    border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

#flow {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    z-index: 0;
    pointer-events: none;
}

.site { position: relative; z-index: 1; }

/* ---------- shared controls ---------- */

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(0.94); }

[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon { display: none; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 22px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    transition: transform 0.3s var(--ease-out), border-color 0.2s, box-shadow 0.3s, background-color 0.2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--text-2); }
.btn--primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent;
}
.btn--primary:hover { border-color: transparent; }
.btn__ext { font-size: 12px; opacity: 0.6; }

.linkbtn {
    background: none;
    border: 0;
    padding: 6px 2px;
    cursor: pointer;
    color: inherit;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: color 0.2s, text-decoration-color 0.2s;
}
.linkbtn:hover { color: var(--text); text-decoration-color: currentColor; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, transform 0.3s var(--ease-out);
}
.chip i { color: var(--muted); width: 1em; text-align: center; }
.chip:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-2px); }

/* ---------- reveal on scroll ---------- */

.reveal {
    opacity: 0;
    transform: translateY(24px);
    --delay: calc(var(--d, 0) * 80ms);
    transition: opacity 0.9s var(--ease-out) var(--delay), transform 0.9s var(--ease-out) var(--delay);
}
.reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Gate: Lights Out
   ========================================================================== */

.gate {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    overflow-y: auto;
    background: var(--veil);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
}
.gate.is-fading { opacity: 0; transition: opacity 0.6s ease; }

.gate__theme { position: absolute; top: 16px; right: 16px; }

.gate__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    text-align: center;
}

.gate__brand {
    font-size: clamp(2.4rem, 8vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    animation: rise 0.9s var(--ease-out) both;
}
.gate__brand span { color: var(--accent); }

.gate__rule {
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-top: -8px;
    animation: rise 0.9s 0.1s var(--ease-out) both;
}

.board {
    --cell: clamp(46px, 13.5vw, 62px);
    --gap: clamp(6px, 1.8vw, 10px);
    display: grid;
    grid-template-columns: repeat(5, var(--cell));
    gap: var(--gap);
    padding: calc(var(--gap) * 1.6);
    border-radius: 24px;
    background: var(--surface-solid);
    border: 1px solid var(--line);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    animation: rise 0.9s 0.2s var(--ease-out) both;
}

.cell {
    width: var(--cell);
    aspect-ratio: 1;
    padding: 0;
    border-radius: 13px;
    border: 1px solid var(--cell-line);
    background: var(--cell-off);
    cursor: pointer;
    transition: background-color 0.25s, box-shadow 0.3s, border-color 0.25s, transform 0.12s;
}
.cell:hover { border-color: var(--line-strong); }
.cell:active { transform: scale(0.92); }
.cell.is-on {
    background: radial-gradient(circle at 50% 38%, #fff4cf 0%, #ffd06a 34%, #f2a51f 78%);
    border-color: rgba(255, 205, 100, 0.9);
    box-shadow: 0 0 24px rgba(244, 183, 64, 0.5), inset 0 0 6px rgba(255, 240, 200, 0.7);
}
.cell.is-wave { animation: wave 0.55s ease both; }

.gate__bar {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--muted);
    animation: rise 0.9s 0.3s var(--ease-out) both;
}
.gate__bar b { color: var(--text); font-weight: 500; }

@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: none; }
}

@keyframes wave {
    0%, 100% { transform: none; }
    45% { transform: scale(0.82); box-shadow: 0 0 30px rgba(244, 183, 64, 0.8); }
}

/* hint dialog */

.hint {
    width: min(380px, calc(100vw - 32px));
    padding: 30px 26px 24px;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: var(--surface-solid);
    color: var(--text);
    box-shadow: var(--shadow);
    text-align: center;
}
.hint::backdrop {
    background: rgba(5, 8, 12, 0.55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.hint__close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; }
.hint__title { font-size: 1.25rem; letter-spacing: -0.02em; margin-bottom: 8px; }
.hint__text { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.hint__text--small { margin-top: 16px; font-size: 13px; }
.hint__head,
.hint__row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: center;
}
.hint__head {
    margin: 22px 0 12px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.hint__table { display: grid; gap: 10px; }
.hint__dots { display: flex; gap: 4px; justify-content: center; }
.hint__dot {
    width: 14px; height: 14px;
    border-radius: 4px;
    background: var(--cell-off);
    border: 1px solid var(--cell-line);
}
.hint__dot.is-on { background: #f4b740; border-color: #f4b740; box-shadow: 0 0 8px rgba(244, 183, 64, 0.5); }
.hint__arrow { color: var(--muted); font-size: 11px; }

/* ==========================================================================
   Navigation
   ========================================================================== */

.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 20;
    border-bottom: 1px solid transparent;
    transition: background-color 0.3s, border-color 0.3s;
}
.nav.is-scrolled {
    background: var(--veil);
    border-color: var(--line);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}
.nav__inner {
    max-width: calc(var(--max) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 14px var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.logo__mark {
    display: grid;
    place-items: center;
    width: 38px; height: 38px;
    border-radius: 12px;
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: -0.04em;
}
.logo__text { font-size: 15px; }

.nav__links {
    display: flex;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.nav__links a {
    display: block;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    text-decoration: none;
    transition: color 0.2s, background-color 0.2s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a.is-active { color: var(--text); background: var(--line); }

.nav__actions { display: flex; gap: 8px; }
.nav__menu { display: none; }

@media (max-width: 760px) {
    .logo__text { display: none; }
    .nav__menu { display: inline-grid; }
    .nav__links {
        position: absolute;
        top: calc(100% + 6px);
        left: var(--gutter);
        right: var(--gutter);
        flex-direction: column;
        padding: 8px;
        border-radius: 20px;
        background: var(--surface-solid);
        box-shadow: var(--shadow);
        opacity: 0;
        transform: translateY(-8px);
        pointer-events: none;
        transition: opacity 0.25s, transform 0.25s var(--ease-out);
    }
    .nav__links.is-open { opacity: 1; transform: none; pointer-events: auto; }
    .nav__links a { padding: 12px 16px; font-size: 16px; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding: 120px var(--gutter) 110px;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: radial-gradient(var(--dot) 1px, transparent 1px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
}

.hero__inner { max-width: var(--max); margin: 0 auto; width: 100%; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text-2);
    font-size: 13px;
    letter-spacing: 0.04em;
}
.eyebrow__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.hero__name {
    margin: 28px 0 30px;
    font-size: clamp(3.4rem, 17vw, 10rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.05em;
    outline: none;
}

.hero__lead {
    max-width: 36ch;
    font-size: clamp(1.15rem, 2.3vw, 1.55rem);
    line-height: 1.5;
    color: var(--text-2);
}

.hero__also {
    margin-top: 22px;
    font-size: 14px;
    color: var(--muted);
}
.typer { color: var(--text); }
.typer::after {
    content: "";
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    margin-left: 3px;
    vertical-align: -0.2em;
    background: var(--muted);
    animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.hero__scroll,
.hero__flow {
    position: absolute;
    bottom: 32px;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.hero__scroll {
    left: max(var(--gutter), calc((100% - var(--max)) / 2));
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: color 0.2s;
}
.hero__scroll:hover { color: var(--text); }
.hero__scroll i { animation: nudge 2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(4px); } }
.hero__flow { right: max(var(--gutter), calc((100% - var(--max)) / 2)); }

@media (max-width: 640px) {
    .hero__flow { display: none; }
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section { position: relative; padding: clamp(80px, 12vw, 150px) var(--gutter); }
.section__inner { max-width: var(--max); margin: 0 auto; }

.section__head {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 6px 14px;
    margin-bottom: clamp(36px, 6vw, 64px);
}
.section__idx { font-size: 13px; color: var(--muted); }
.section__kicker {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.section__kicker::before { content: "— "; }
.section__title {
    grid-column: 1 / -1;
    margin-top: 10px;
    max-width: 18ch;
    font-size: clamp(2.3rem, 6vw, 4.4rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.045em;
}

/* ---------- about ---------- */

.about {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(32px, 6vw, 80px);
    align-items: start;
}
.about__lead {
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.03em;
}
.about__body > p {
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    line-height: 1.7;
    color: var(--text-2);
}

.facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 36px 0 0;
}
.fact { padding: 18px 20px; border-radius: 16px; }
.fact dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 6px;
}
.fact dd { margin: 0; font-size: 15px; line-height: 1.45; }

@media (max-width: 860px) {
    .about { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .facts { grid-template-columns: 1fr; }
}

/* ---------- research ---------- */

.pubs {
    list-style: none;
    margin: 0;
    padding: 6px clamp(18px, 3vw, 32px);
    border-radius: var(--radius);
}
.pub {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 6px 22px;
    align-items: baseline;
    padding: 22px 0;
    border-bottom: 1px solid var(--line);
}
.pub:last-child { border-bottom: 0; }
.pub__year { font-size: 13px; color: var(--muted); }
.pub.is-same-year .pub__year { visibility: hidden; }
.pub__title {
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -0.01em;
}
.pub__authors { margin-top: 6px; font-size: 14px; color: var(--text-2); }
.pub__authors strong { color: var(--text); font-weight: 600; }
.pub__venue { margin-top: 2px; font-size: 14px; font-style: italic; color: var(--muted); }
.pub__links { display: flex; gap: 6px; }
.pub__links a {
    font-size: 12px;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--text-2);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.pub__links a:hover { border-color: var(--text-2); color: var(--text); }

@media (max-width: 560px) {
    .pub { grid-template-columns: minmax(0, 1fr); }
    .pub.is-same-year .pub__year { display: none; }
    .pub__links { margin-top: 8px; }
    .pub__links:empty { display: none; }
}

/* ---------- interests ---------- */

.bento {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 14px;
}

.card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 26px 26px 28px;
    border-radius: var(--radius);
    /* hover moves with `translate` so it doesn't fight the reveal's `transform` */
    transition: opacity 0.9s var(--ease-out) var(--delay, 0s), transform 0.9s var(--ease-out) var(--delay, 0s),
        translate 0.5s var(--ease-out), border-color 0.3s;
}
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), var(--spot), transparent 50%);
    opacity: 0;
    transition: opacity 0.35s;
}
.card:hover { border-color: var(--line-strong); }
.card:hover::before { opacity: 1; }
.card:hover { translate: 0 -3px; }

.card--wide { grid-column: span 2; }
.card--tall { grid-row: span 2; display: flex; flex-direction: column; }
.card--full { grid-column: 1 / -1; }

.card__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px; height: 44px;
    border-radius: 13px;
    background: var(--line);
    color: var(--text-2);
    font-size: 18px;
    margin-bottom: 20px;
}
.card__tag {
    position: absolute;
    top: 30px; right: 26px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}
.badge {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 500;
    letter-spacing: 0.08em;
}
.card__mark {
    position: absolute;
    right: -24px;
    bottom: -40px;
    z-index: -1;
    font-size: 190px;
    color: var(--text);
    opacity: 0.035;
    transition: transform 1.2s var(--ease-out);
}
.card:hover .card__mark { transform: rotate(-12deg) scale(1.05); }
.card--new:hover .card__mark { transform: rotate(180deg); }

.card h3 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; margin-bottom: 10px; }
.card--wide h3,
.card--full h3 { font-size: 1.45rem; }
.card p { font-size: 15px; line-height: 1.65; color: var(--text-2); }
.card--wide p,
.card--full p { max-width: 62ch; }
.card a {
    color: var(--text);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s;
}
.card a:hover { text-decoration-color: currentColor; }
.card a.card__pdf { font-size: 12px; text-decoration: none; color: var(--muted); }

.card__figure {
    display: block;
    margin-top: 20px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}
/* tall card: the figure sinks to the bottom, keeping at least 20px under the text */
.card--tall > p:not(.card__caption) { margin-bottom: 20px; }
.card--tall .card__figure { margin-top: auto; }
.card__figure img { mix-blend-mode: multiply; transition: transform 0.8s var(--ease-out); }
.card__figure:hover img { transform: scale(1.04); }
/* dark theme: gaps vanish into the card, squares stay a quiet gray */
[data-theme="dark"] .card__figure img {
    mix-blend-mode: screen;
    filter: invert(1) brightness(0.8);
}
.card__caption { margin-top: 10px; font-size: 11px; color: var(--muted); }

/* AI & Physics: two-phase slug flow running through a pipe */
.pipe {
    position: relative;
    height: 32px;
    margin-top: 26px;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    overflow: hidden;
}
.pipe__flow {
    position: absolute;
    inset: 0;
    background: rgb(var(--bubble));
    opacity: 0.5;
    -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='30' viewBox='0 0 420 30'><g fill='%23000' fill-opacity='.22' stroke='%23000' stroke-width='1.2'><path d='M22 4.5h100a8.5 8.5 0 0 1 0 17H22a4 8.5 0 0 1 0-17z'/><path d='M238 5.5h62a7.5 7.5 0 0 1 0 15h-62a3.5 7.5 0 0 1 0-15z'/><circle cx='150' cy='10' r='2.6'/><circle cx='163' cy='18' r='1.8'/><circle cx='178' cy='9' r='3.1'/><circle cx='194' cy='16' r='1.9'/><circle cx='209' cy='11' r='2.3'/><circle cx='222' cy='21' r='1.5'/><circle cx='330' cy='15' r='2.4'/><circle cx='345' cy='9' r='1.7'/><circle cx='361' cy='17' r='3'/><circle cx='380' cy='10' r='2'/><circle cx='398' cy='19' r='1.6'/><circle cx='409' cy='12' r='2.2'/></g></svg>") 0 50% / 420px 30px repeat-x;
    mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='30' viewBox='0 0 420 30'><g fill='%23000' fill-opacity='.22' stroke='%23000' stroke-width='1.2'><path d='M22 4.5h100a8.5 8.5 0 0 1 0 17H22a4 8.5 0 0 1 0-17z'/><path d='M238 5.5h62a7.5 7.5 0 0 1 0 15h-62a3.5 7.5 0 0 1 0-15z'/><circle cx='150' cy='10' r='2.6'/><circle cx='163' cy='18' r='1.8'/><circle cx='178' cy='9' r='3.1'/><circle cx='194' cy='16' r='1.9'/><circle cx='209' cy='11' r='2.3'/><circle cx='222' cy='21' r='1.5'/><circle cx='330' cy='15' r='2.4'/><circle cx='345' cy='9' r='1.7'/><circle cx='361' cy='17' r='3'/><circle cx='380' cy='10' r='2'/><circle cx='398' cy='19' r='1.6'/><circle cx='409' cy='12' r='2.2'/></g></svg>") 0 50% / 420px 30px repeat-x;
    animation: slug 9s linear infinite;
}
@keyframes slug {
    to { -webkit-mask-position: 420px 50%; mask-position: 420px 50%; }
}

@media (max-width: 960px) {
    .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    /* two columns leave one free cell at the end: the podcast card fills it */
    .card--full { grid-column: auto; }
}
@media (max-width: 620px) {
    .bento { grid-template-columns: 1fr; }
    .card--wide { grid-column: auto; }
    .card--tall { grid-row: auto; }
}

/* ---------- playground ---------- */

.play {
    display: grid;
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
}
.frame { padding: 12px; border-radius: 24px; container-type: inline-size; }
/* the puzzle stays in view while the project list scrolls past */
@media (min-width: 861px) {
    .frame { position: sticky; top: 96px; }
}
.frame iframe {
    display: block;
    width: 100%;
    aspect-ratio: 5 / 6;
    border: 0;
    border-radius: 14px;
    background: var(--surface-solid);
}
/* fit the frame's content exactly (header + board + footer = width + 46px), no blank strip */
@supports (height: 1cqw) {
    .frame iframe { aspect-ratio: auto; height: calc(100cqw + 46px); }
}
.frame figcaption { padding: 12px 6px 2px; font-size: 12px; color: var(--muted); }
.frame figcaption a { color: var(--text-2); }

.projects { display: grid; gap: 12px; }
.project {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 20px 22px;
    border-radius: var(--radius);
    text-decoration: none;
    transition: opacity 0.9s var(--ease-out) var(--delay, 0s), transform 0.9s var(--ease-out) var(--delay, 0s),
        translate 0.5s var(--ease-out), border-color 0.3s;
}
.project .card__icon { margin: 0; }
.project:hover { border-color: var(--line-strong); }
.project:hover { translate: 4px 0; }
.project__body { display: grid; gap: 2px; }
.project__title { font-weight: 650; font-size: 1.1rem; letter-spacing: -0.015em; }
.project__text { font-size: 14px; color: var(--text-2); }
.project__arrow { color: var(--muted); transition: transform 0.3s var(--ease-out), color 0.2s; }
.project:hover .project__arrow { color: var(--text); transform: translateX(4px); }

.challenge { margin-top: 18px; }
.challenge p { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 12px; }
.challenge__links { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 860px) {
    .play { grid-template-columns: 1fr; }
    .frame { max-width: 440px; width: 100%; margin: 0 auto; }
}

/* ---------- contact ---------- */

.section--contact { padding-bottom: clamp(60px, 8vw, 100px); }

.contact__mail {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 18px;
}
.contact__address {
    font-size: clamp(1.5rem, 4.5vw, 3rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 0.18em;
    overflow-wrap: anywhere;
    transition: text-decoration-color 0.3s, color 0.3s;
}
.contact__address:hover { text-decoration-color: currentColor; }
.contact__copied { font-size: 12px; color: var(--text-2); }

.socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 40px 0 0;
    padding: 0;
}

/* ---------- footer ---------- */

.footer { position: relative; }
#pcb { display: block; width: 100%; height: 150px; }
.footer__bar {
    max-width: calc(var(--max) + 2 * var(--gutter));
    margin: 0 auto;
    padding: 20px var(--gutter) 32px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 24px;
    font-size: 13px;
    color: var(--muted);
}
.footer__bar a { text-decoration: none; transition: color 0.2s; }
.footer__bar a:hover { color: var(--text); }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
    .reveal { opacity: 1; transform: none; }
}
