/* princy.ran.re — tokens first, then layout, then sections. */

@font-face {
    font-family: "Archivo";
    src: url("/fonts/archivo-latin.woff2") format("woff2");
    font-weight: 300 900;
    font-stretch: 62% 125%;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Archivo";
    src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
    font-weight: 300 900;
    font-stretch: 62% 125%;
    font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "JetBrains Mono";
    src: url("/fonts/jetbrains-mono-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-display: swap;
}

/* ------------------------------------------------------------ tokens */
:root {
    /* brand (from the original landing page and favicon) */
    --blue: #1c34dd;
    --blue-deep: #0f1f96;
    --blue-hi: #3c55ff;
    --ice: #e9eefb;
    --sun: #ffd23f;
    --sun-deep: #b08700;
    --night: #070b26;

    /* theme: light */
    --bg: #f4f6fd;
    --surface: #ffffff;
    --raised: #e6ebfa;
    --text: #0b1240;
    --mute: #47527e;
    --line: rgba(11, 18, 64, 0.14);
    --line-strong: rgba(11, 18, 64, 0.3);
    --accent: #1c34dd;
    --accent-ink: #ffffff;
    --focus: #1c34dd;
    --todo: #b3261e;

    --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;

    /* modular scale 1.25 */
    --fs-0: 1rem;
    --fs-1: 1.25rem;
    --fs-2: 1.563rem;
    --fs-3: 1.953rem;
    --fs-4: 2.441rem;
    --fs-5: 3.052rem;

    --r-s: 3px;
    --r-m: 10px;
    --r-l: 20px;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
    --d-fast: 0.18s;
    --d-base: 0.4s;
    --d-slow: 0.8s;

    --gutter: clamp(1rem, 4vw, 2.5rem);
    --nav-h: 4rem;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #070b26;
        --surface: #0d1440;
        --raised: #141d55;
        --text: #e9eefb;
        --mute: #a2acd3;
        --line: rgba(233, 238, 251, 0.14);
        --line-strong: rgba(233, 238, 251, 0.32);
        --accent: #ffd23f;
        --accent-ink: #10173f;
        --focus: #ffd23f;
        --todo: #ff8a80;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #070b26;
    --surface: #0d1440;
    --raised: #141d55;
    --text: #e9eefb;
    --mute: #a2acd3;
    --line: rgba(233, 238, 251, 0.14);
    --line-strong: rgba(233, 238, 251, 0.32);
    --accent: #ffd23f;
    --accent-ink: #10173f;
    --focus: #ffd23f;
    --todo: #ff8a80;
    color-scheme: dark;
}

/* ------------------------------------------------------------ base */
*,
*::before,
*::after {
    box-sizing: border-box;
}
* {
    margin: 0;
}
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 1rem);
    -webkit-text-size-adjust: 100%;
}
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img,
svg {
    display: block;
    max-width: 100%;
}
ul,
ol {
    padding: 0;
    list-style: none;
}
a {
    color: inherit;
    text-underline-offset: 0.2em;
}
button,
input,
textarea {
    font: inherit;
    color: inherit;
}
button {
    cursor: pointer;
}
:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: var(--r-s);
}
[hidden] {
    display: none !important;
}
.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.narrow {
    max-width: 780px;
}
.muted {
    color: var(--mute);
}
.small {
    font-size: 0.9rem;
}
.icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: none;
}
.icon-sm {
    width: 1rem;
    height: 1rem;
}
.todo {
    font-family: var(--mono);
    font-size: 0.85em;
    color: var(--todo);
    border: 1px dashed currentColor;
    border-radius: var(--r-s);
    padding: 0 0.35em;
}

/* ------------------------------------------------------------ buttons & chips */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.9rem;
    padding: 0.7rem 1.3rem;
    font-weight: 700;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--r-s);
    transition: background-color var(--d-fast), color var(--d-fast), border-color var(--d-fast);
}
.btn-small {
    min-height: 2.6rem;
    padding: 0.45rem 1rem;
    font-size: 0.95rem;
}
.btn-sun {
    background: var(--sun);
    color: #10173f;
    border-color: var(--sun);
}
.btn-sun:hover {
    background: var(--ice);
    border-color: var(--ice);
}
.btn-line {
    border-color: var(--ice);
    color: var(--ice);
}
.btn-line:hover {
    background: var(--ice);
    color: var(--blue);
}
.btn-blue {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}
.btn-blue:hover {
    background: transparent;
    color: var(--text);
}
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--r-m);
    transition: border-color var(--d-fast), background-color var(--d-fast);
}
.icon-btn:hover {
    border-color: var(--line-strong);
    background: var(--raised);
}
.chip {
    min-height: 2.75rem;
    padding: 0.4rem 0.95rem;
    font-size: 0.92rem;
    font-weight: 600;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    transition: background-color var(--d-fast), color var(--d-fast), border-color var(--d-fast);
}
.chip:hover {
    border-color: var(--text);
}
.chip[aria-pressed="true"] {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-m);
}

/* ------------------------------------------------------------ navbar */
.skip {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.7rem 1rem;
    background: var(--sun);
    color: #10173f;
    font-weight: 700;
    border-radius: var(--r-s);
}
.skip:focus {
    top: 1rem;
}
.nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    height: var(--nav-h);
    color: var(--ice);
    --focus: var(--sun);
    transition: background-color var(--d-base) var(--ease-out), color var(--d-base), box-shadow var(--d-base);
}
.nav .icon-btn {
    border-color: rgba(233, 238, 251, 0.28);
}
.nav .icon-btn:hover {
    background: rgba(233, 238, 251, 0.12);
}
.nav.is-solid {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    box-shadow: 0 1px 0 var(--line);
    --focus: var(--accent);
}
.nav.is-solid .icon-btn {
    border-color: var(--line);
}
.nav.is-solid .icon-btn:hover {
    background: var(--raised);
}
.nav-in {
    height: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 800;
    font-stretch: 112%;
    text-decoration: none;
    min-height: 44px;
}
.mark {
    width: 2rem;
    height: 2rem;
}
.nav-links {
    position: relative;
    margin-left: auto;
}
.nav-links ul {
    display: flex;
    gap: 0.25rem;
}
.nav-links a {
    display: block;
    padding: 0.7rem 0.75rem;
    font-weight: 600;
    font-size: 0.97rem;
    text-decoration: none;
    opacity: 0.85;
}
.nav-links a:hover,
.nav-links a[aria-current="true"] {
    opacity: 1;
}
.nav-ind {
    position: absolute;
    left: 0;
    bottom: 0.3rem;
    height: 2px;
    width: 0;
    background: var(--sun);
    opacity: 0;
    transition: transform 0.3s var(--ease-io), width 0.3s var(--ease-io), opacity 0.2s;
}
.nav.is-solid .nav-ind {
    background: var(--accent);
}
.nav-tools {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.nav-cta {
    background: var(--sun);
    color: #10173f;
    border-color: var(--sun);
}
.nav-cta:hover {
    background: transparent;
    color: inherit;
}
.nav.is-solid .nav-cta {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}
.nav.is-solid .nav-cta:hover {
    background: transparent;
    color: var(--text);
}
.i-moon {
    display: none;
}
:root[data-theme="dark"] .i-sun {
    display: none;
}
:root[data-theme="dark"] .i-moon {
    display: block;
}
.nav-burger {
    display: none;
}
.mmenu {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: var(--blue);
    color: var(--ice);
    --focus: var(--sun);
    padding: 5rem var(--gutter) 2rem;
    overflow-y: auto;
}
.mmenu-close {
    position: absolute;
    top: 0.65rem;
    right: var(--gutter);
    border-color: rgba(233, 238, 251, 0.3);
}
.mmenu ul {
    display: grid;
    gap: 0.25rem;
}
.mmenu a {
    display: block;
    padding: 0.5rem 0;
    font-size: var(--fs-4);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1.1;
    text-decoration: none;
}
.mmenu a:hover {
    color: var(--sun);
}
@media (max-width: 960px) {
    .nav-links,
    .nav-cta {
        display: none;
    }
    .nav-tools {
        margin-left: auto;
    }
    .nav-burger {
        display: inline-grid;
    }
}

/* ------------------------------------------------------------ hero (signature) */
.hero {
    position: relative;
    background: var(--blue);
    color: var(--ice);
    --focus: var(--sun);
    padding: calc(var(--nav-h) + clamp(2.5rem, 7vw, 5rem)) 0 clamp(3rem, 7vw, 5.5rem);
    overflow: hidden;
}
.hero-in {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: 3rem;
    align-items: center;
}
.hero h1 {
    display: grid;
    gap: 1.4rem;
}
.hero-name {
    font-weight: 900;
    font-stretch: 62%;
    font-size: clamp(2.4rem, 6.3vw, 6.6rem);
    line-height: 0.86;
    letter-spacing: -0.01em;
    text-wrap: balance;
}
.hero-line {
    max-width: 30ch;
    font-size: clamp(1.3rem, 2.2vw, var(--fs-2));
    font-weight: 600;
    line-height: 1.3;
    color: var(--sun);
}
.hero-intro {
    max-width: 52ch;
    margin-top: 1.4rem;
    font-size: var(--fs-1);
    color: rgba(233, 238, 251, 0.9);
}
.hero-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: 2.2rem;
}
.hero-alt {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0 0.25rem;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid rgba(233, 238, 251, 0.35);
}
.hero-alt:hover {
    border-color: var(--sun);
}
.stack {
    width: 100%;
    max-width: 30rem;
    justify-self: center;
}
.stack svg {
    overflow: visible;
}
.stack figcaption {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    text-align: center;
    color: rgba(233, 238, 251, 0.75);
}
.slab {
    cursor: pointer;
    outline: none;
}
.slab > g {
    transition: transform 0.35s var(--ease-out);
    transform-box: fill-box;
}
.slab-line {
    stroke: rgba(233, 238, 251, 0.35);
    stroke-width: 1.5;
    fill: none;
    transition: stroke var(--d-fast);
}
.slab-tag {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 600;
    fill: var(--ice);
    transition: fill var(--d-fast);
}
.slab:hover > g,
.slab:focus-visible > g {
    transform: translateY(-8px);
}
.slab:hover .slab-line,
.slab:focus-visible .slab-line {
    stroke: var(--sun);
}
.slab:hover .slab-tag,
.slab:focus-visible .slab-tag {
    fill: var(--sun);
    text-decoration: underline;
}

/* A1: the stack assembles once on load (layer by layer), then rests. */
.js .slab {
    animation: slab-in 0.9s var(--ease-out) both;
}
.js .slab.s1 {
    animation-delay: 0.15s;
}
.js .slab.s2 {
    animation-delay: 0.45s;
}
.js .slab.s3 {
    animation-delay: 0.75s;
}
.js .slab-tag,
.js .slab-line {
    animation: fade-in 0.4s ease both;
    animation-delay: 1.3s;
}
@keyframes slab-in {
    from {
        transform: translateY(-90px);
        opacity: 0;
    }
    60% {
        opacity: 1;
    }
    to {
        transform: none;
        opacity: 1;
    }
}
@keyframes fade-in {
    from {
        opacity: 0;
    }
}

/* ------------------------------------------------------------ sections */
.sec {
    padding: clamp(4rem, 9vw, 7.5rem) 0;
    border-top: 1px solid var(--line);
}
.sec-title {
    font-size: clamp(2.6rem, 6vw, 4.6rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.95;
    letter-spacing: -0.005em;
    margin-bottom: 1.25rem;
}
.sec-title[tabindex="-1"]:focus {
    outline: none;
}
.sec-path {
    font-family: var(--mono);
    font-weight: 400;
    font-size: 0.42em;
    vertical-align: 0.55em;
    margin-right: 0.3em;
    color: var(--mute);
}
.sec-intro {
    max-width: 60ch;
    color: var(--mute);
    font-size: var(--fs-1);
    margin-bottom: 2.5rem;
}
.mini-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mute);
    margin-bottom: 0.9rem;
}
.block-title {
    font-size: var(--fs-2);
    font-weight: 800;
    font-stretch: 85%;
    line-height: 1.15;
}
.block-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.work-block {
    margin-top: clamp(3rem, 6vw, 4.5rem);
}
.work-block > .block-title {
    margin-bottom: 1.25rem;
}

/* ------------------------------------------------------------ profile */
.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    margin-top: 1.5rem;
}
.profile-grid:not(:has(.profile-side)) {
    grid-template-columns: minmax(0, 1fr);
}
.quote p {
    font-size: var(--fs-3);
    font-weight: 700;
    font-stretch: 80%;
    line-height: 1.2;
    max-width: 30ch;
}
.quote {
    padding-left: 1.25rem;
    border-left: 4px solid var(--sun);
    margin-bottom: 1.75rem;
}
.bio {
    max-width: 65ch;
    font-size: var(--fs-1);
    margin-bottom: 2rem;
}
.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.badge {
    padding: 0.4rem 0.85rem;
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--raised);
    border-radius: var(--r-s);
}
/* A3 */
.js [data-stagger] > * {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity var(--d-base) var(--ease-out), transform var(--d-base) var(--ease-out);
    transition-delay: calc(var(--i, 0) * 40ms);
}
.js [data-stagger].is-in > * {
    opacity: 1;
    transform: none;
}
.profile-side {
    display: grid;
    gap: 1rem;
    align-content: start;
}
.portrait {
    width: 100%;
    height: auto;
    border-radius: var(--r-l);
    background: var(--raised);
}
.now {
    padding: 1.25rem 1.4rem;
}
.now-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--mute);
}
.now-label i,
.dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    background: #1fbf75;
    margin-right: 0.45rem;
}
.now-title {
    font-size: var(--fs-1);
    font-weight: 700;
    margin-top: 0.3rem;
}

/* timeline: horizontal snap on desktop, vertical on mobile (A4) */
.tl {
    margin-top: clamp(3rem, 6vw, 4.5rem);
    position: relative;
}
.tl-track {
    position: relative;
    height: 2px;
    background: var(--line);
    margin: 0.5rem 0 0;
}
.tl-fill {
    position: absolute;
    inset: 0;
    background: var(--accent);
    transform-origin: left;
    transform: scaleX(var(--p, 0));
}
.tl-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(16rem, 22rem);
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    padding: 0 0 1rem;
    margin-top: -0.4rem;
    scrollbar-width: thin;
}
.tl-item {
    scroll-snap-align: start;
    position: relative;
    padding-top: 1.5rem;
}
.tl-dot {
    position: absolute;
    top: 0;
    left: 0;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--line-strong);
    transition: background-color var(--d-fast), border-color var(--d-fast);
}
.tl-item.is-active .tl-dot {
    background: var(--accent);
    border-color: var(--accent);
}
.tl-year {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--mute);
}
.tl-title {
    font-size: var(--fs-1);
    font-weight: 700;
    line-height: 1.25;
    margin: 0.2rem 0 0.4rem;
}
.tl-text {
    color: var(--mute);
}
@media (max-width: 767px) {
    .tl-track {
        position: absolute;
        left: 0.38rem;
        top: 2.4rem;
        bottom: 0;
        width: 2px;
        height: auto;
        margin: 0;
    }
    .tl-fill {
        transform-origin: top;
        transform: scaleY(var(--p, 0));
    }
    .tl-list {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        overflow: visible;
        scroll-snap-type: none;
        margin-top: 0;
        gap: 2rem;
    }
    .tl-item {
        padding: 0 0 0 2rem;
    }
    .tl-dot {
        top: 0.35rem;
    }
}

/* ------------------------------------------------------------ services (master-detail, A5/A6) */
.svc {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: start;
}
.svc-list {
    position: relative;
    display: grid;
    border-left: 2px solid var(--line);
}
.svc-tab {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    min-height: 3.5rem;
    padding: 0.8rem 1.2rem;
    text-align: left;
    font-size: var(--fs-2);
    font-weight: 800;
    font-stretch: 80%;
    background: transparent;
    border: 0;
    color: var(--mute);
    transition: color var(--d-fast);
}
.svc-tab:hover,
.svc-tab[aria-selected="true"] {
    color: var(--text);
}
.svc-num {
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 400;
}
.svc-ind {
    position: absolute;
    left: -2px;
    top: 0;
    width: 2px;
    height: 0;
    background: var(--accent);
    transition: transform 0.35s var(--ease-io), height 0.35s var(--ease-io);
}
.svc-panels {
    min-height: 16rem;
}
.svc-panel {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-l);
}
.svc-panel.is-entering {
    animation: panel-in 0.35s var(--ease-out);
}
@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}
.svc-title {
    font-size: var(--fs-3);
    font-weight: 900;
    font-stretch: 70%;
    line-height: 1.1;
}
.svc-text {
    max-width: 60ch;
    margin-top: 0.6rem;
    color: var(--mute);
}
.tool-group {
    margin-top: 1.75rem;
}
.tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
    gap: 0.6rem;
}
.tool {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 3rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--r-m);
    font-weight: 600;
    font-size: 0.95rem;
    transition: border-color var(--d-fast), background-color var(--d-fast);
}
.tool:hover,
.tool:focus-visible {
    border-color: var(--accent);
    background: var(--raised);
}
.tool-ic {
    width: 1.35rem;
    height: 1.35rem;
    flex: none;
}
.tool-mono {
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    flex: none;
    font-family: var(--mono);
    font-size: 0.72rem;
    border-radius: var(--r-s);
    background: var(--raised);
}
.tool-label {
    min-width: 0;
    overflow-wrap: anywhere;
}
@media (max-width: 767px) {
    .svc {
        grid-template-columns: 1fr;
    }
    .svc-list {
        grid-auto-flow: column;
        grid-auto-columns: 1fr;
        border-left: 0;
        border-bottom: 2px solid var(--line);
        overflow-x: auto;
    }
    .svc-tab {
        justify-content: center;
        font-size: var(--fs-1);
        padding: 0.6rem;
    }
    .svc-num {
        display: none;
    }
    .svc-ind {
        top: auto;
        bottom: -2px;
        left: 0;
        height: 2px;
        width: 0;
        transition: transform 0.35s var(--ease-io), width 0.35s var(--ease-io);
    }
}

/* ------------------------------------------------------------ work: bento */
.bento {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: minmax(9rem, auto);
    gap: 1rem;
}
.bento-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1.4rem;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-m);
    transition: border-color var(--d-fast);
}
.bento-card:hover {
    border-color: var(--line-strong);
}
.bento-hero {
    grid-column: span 2;
    grid-row: span 2;
    background: var(--blue);
    color: var(--ice);
    border-color: var(--blue);
    border-radius: var(--r-l);
    --focus: var(--sun);
}
.bento-hero:hover {
    border-color: var(--sun);
}
.bento-hero .muted {
    color: rgba(233, 238, 251, 0.8);
}
.bento-card:not(.bento-hero) {
    grid-column: span 2;
}
.bento-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.bento-name {
    font-weight: 800;
    font-size: var(--fs-1);
}
.bento-arrow {
    margin-left: auto;
    transition: transform var(--d-fast) var(--ease-out);
}
.bento-card:hover .bento-arrow {
    transform: translate(2px, -2px);
}
.bento-handle {
    font-family: var(--mono);
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}
.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 2.5rem;
    margin-top: auto;
    padding-top: 1.5rem;
}
.stats div {
    display: flex;
    flex-direction: column-reverse;
}
.stats dd {
    font-size: clamp(2.4rem, 5vw, 3.6rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1;
    color: var(--sun);
    font-variant-numeric: tabular-nums;
}
.stats dt {
    font-size: 0.9rem;
    opacity: 0.85;
}
@media (max-width: 767px) {
    .bento {
        grid-template-columns: 1fr 1fr;
    }
    .bento-card:not(.bento-hero) {
        grid-column: span 1;
    }
    .bento-hero {
        grid-column: 1 / -1;
        grid-row: auto;
    }
}
@media (max-width: 420px) {
    .bento {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------ work: projects carousel (A7/A8) */
.car-nav {
    display: flex;
    gap: 0.5rem;
}
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.car {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(17rem, 24rem);
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    padding: 0.5rem 0.25rem 1.25rem;
    margin: 0 -0.25rem;
    scrollbar-width: thin;
    cursor: grab;
}
.car.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    user-select: none;
}
.car.is-dragging a {
    pointer-events: none;
}
.proj {
    scroll-snap-align: start;
    perspective: 900px;
}
.proj.is-hidden {
    display: none;
}
.proj-in {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-m);
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.25s var(--ease-out), border-color var(--d-fast);
}
.proj:hover .proj-in,
.proj:focus-within .proj-in {
    border-color: var(--line-strong);
}
.proj-cat {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--mute);
}
.proj-title {
    font-size: var(--fs-2);
    font-weight: 800;
    font-stretch: 85%;
    line-height: 1.15;
}
.proj-text {
    color: var(--mute);
}
.proj-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.proj-badges li {
    padding: 0.15rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
    background: var(--sun);
    color: #10173f;
    border-radius: var(--r-s);
}
.proj-layers {
    display: flex;
    gap: 0.35rem;
}
.lyr {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
}
.lyr::before {
    content: "";
    width: 0.7rem;
    height: 0.7rem;
    transform: rotate(45deg) scaleY(0.6);
    border-radius: 1px;
}
.lyr + .lyr {
    margin-left: 0.5rem;
}
.lyr-interface::before {
    background: var(--sun);
}
.lyr-api::before {
    background: #b4c0ea;
}
.lyr-database::before {
    background: var(--blue-hi);
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.5rem;
}
.tag {
    font-family: var(--mono);
    font-size: 0.78rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--r-s);
    transition: border-color var(--d-fast), background-color var(--d-fast);
}
.proj:hover .tag,
.proj:focus-within .tag {
    border-color: var(--line-strong);
    background: var(--raised);
}
.proj-links {
    display: flex;
    gap: 1.25rem;
}
.proj-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    font-weight: 700;
}

/* ------------------------------------------------------------ work: accordion, communities, gallery */
.acc {
    border-top: 1px solid var(--line);
}
.acc-item {
    border-bottom: 1px solid var(--line);
}
.acc-item summary {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    min-height: 3.5rem;
    padding: 1rem 0;
    cursor: pointer;
    list-style: none;
}
.acc-item summary::-webkit-details-marker {
    display: none;
}
.acc-item summary::before {
    content: "+";
    font-family: var(--mono);
    width: 1rem;
    color: var(--mute);
}
.acc-item[open] summary::before {
    content: "−";
}
.acc-name {
    font-size: var(--fs-1);
    font-weight: 700;
}
.acc-count {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--mute);
}
.acc-list {
    display: grid;
    gap: 0.5rem;
    padding: 0 0 1.25rem 2rem;
}
.acc-list li {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
}
.acc-title {
    font-weight: 600;
}
.comm {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
}
.comm-card {
    display: grid;
    gap: 0.2rem;
    padding: 1.2rem 1.3rem;
    height: 100%;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: var(--r-m);
}
a.comm-card:hover {
    border-color: var(--line-strong);
}
.comm-name {
    font-weight: 800;
}
.comm-role {
    color: var(--mute);
}
.comm-status {
    justify-self: start;
    font-family: var(--mono);
    font-size: 0.78rem;
    padding: 0.1rem 0.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--r-s);
}
.masonry {
    columns: 3 16rem;
    column-gap: 1rem;
}
.masonry li {
    break-inside: avoid;
    margin-bottom: 1rem;
}
.shot {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--raised);
    border-radius: var(--r-m);
    overflow: hidden;
}
.shot img {
    width: 100%;
    height: auto;
}
.lightbox {
    max-width: min(92vw, 1400px);
    max-height: 92vh;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}
.lightbox::backdrop {
    background: rgba(7, 11, 38, 0.88);
}
.lightbox[open] {
    animation: lb-in 0.4s var(--ease-out);
}
@keyframes lb-in {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
}
.lightbox img {
    max-height: 88vh;
    width: auto;
    border-radius: var(--r-m);
}
.lb-close {
    position: absolute;
    top: -3.25rem;
    right: 0;
    color: var(--ice);
    border-color: rgba(233, 238, 251, 0.4);
}

/* ------------------------------------------------------------ contact */
.contact {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}
.socials {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.socials a {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-height: 3.5rem;
    padding: 0.6rem 0;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.socials a > span {
    display: grid;
}
.socials a:hover b {
    text-decoration: underline;
}
.avail {
    display: grid;
    gap: 0.9rem;
    padding: 1.2rem 1.4rem;
}
.avail dt {
    font-size: 0.88rem;
    color: var(--mute);
}
.avail dd {
    display: flex;
    align-items: center;
    font-weight: 700;
}
.form {
    display: grid;
    gap: 1.1rem;
    padding: clamp(1.25rem, 3vw, 2rem);
    border-radius: var(--r-l);
}
.field {
    display: grid;
    gap: 0.35rem;
}
.field label {
    font-weight: 700;
}
.field input,
.field textarea {
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.9rem;
    background: var(--bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-s);
    transition: border-color var(--d-fast);
}
.field textarea {
    resize: vertical;
}
.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
}
.field [aria-invalid="true"] {
    border-color: var(--todo);
    border-width: 2px;
}
.check {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 0.7rem;
}
.check input {
    width: 1.3rem;
    height: 1.3rem;
    min-height: 0;
    margin-top: 0.2rem;
    accent-color: var(--accent);
}
.check label {
    font-weight: 400;
    font-size: 0.95rem;
}
.check:has([aria-invalid="true"]) label {
    color: var(--todo);
}
.counter {
    justify-self: end;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--mute);
    font-variant-numeric: tabular-nums;
    transition: color var(--d-fast);
}
.counter.is-near {
    color: var(--todo);
}
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.form .btn {
    justify-self: start;
}
.form-status {
    min-height: 1.6em;
    font-weight: 600;
}
.form-status[data-state="success"] {
    color: #148a55;
}
:root[data-theme="dark"] .form-status[data-state="success"] {
    color: #4fd59a;
}
.form-status[data-state="error"] {
    color: var(--todo);
}
@media (max-width: 860px) {
    .contact {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------ terminal */
.term {
    --t-bg: #0a1033;
    --t-text: #dfe5fa;
    --t-mute: #8f9ac4;
    max-width: 920px;
    background: var(--t-bg);
    color: var(--t-text);
    border: 1px solid #1f2a6b;
    border-radius: var(--r-m);
    font-family: var(--mono);
    font-size: 0.92rem;
    line-height: 1.55;
    overflow: hidden;
    --focus: var(--sun);
}
.term-bar {
    display: flex;
    font-size: 0.78rem;
    font-weight: 700;
    border-bottom: 1px solid #1f2a6b;
}
.term-seg {
    position: relative;
    padding: 0.35rem 1.1rem 0.35rem 0.9rem;
}
.term-seg::after {
    content: "";
    position: absolute;
    right: -0.55rem;
    top: 0;
    bottom: 0;
    width: 0.55rem;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    background: inherit;
    z-index: 1;
}
.seg-user {
    background: var(--sun);
    color: #10173f;
}
.seg-host {
    background: var(--ice);
    color: #10173f;
    padding-left: 1.3rem;
}
.seg-dir {
    background: var(--blue-hi);
    color: #fff;
    padding-left: 1.3rem;
}
.term-out {
    height: 22rem;
    overflow-y: auto;
    padding: 1rem 1.1rem 0.25rem;
    overscroll-behavior: contain;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.term-out .t-cmd {
    color: var(--t-text);
}
.term-out .t-cmd b {
    color: var(--sun);
    font-weight: 700;
}
.term-out .t-mute {
    color: var(--t-mute);
}
.term-out .t-hi {
    color: var(--sun);
}
.term-out .t-ok {
    color: #7ee2b0;
}
.term-out .t-err {
    color: #ff9a8a;
}
.term-out a {
    color: #a9b7ff;
}
.term-out > div + div {
    margin-top: 0.15rem;
}
.term-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.1rem 1rem;
}
.prompt {
    flex: none;
    display: flex;
    gap: 0;
    font-weight: 700;
}
.p-user {
    color: var(--sun);
}
.p-at {
    color: var(--t-mute);
}
.p-dir {
    color: #a9b7ff;
    margin-left: 0.35rem;
}
.p-arrow {
    color: var(--sun);
    margin-left: 0.4rem;
}
.term-line input {
    flex: 1;
    min-width: 0;
    min-height: 2.2rem;
    background: transparent;
    border: 0;
    color: var(--t-text);
    caret-color: var(--sun);
    font-family: var(--mono);
}
.term-line input:focus {
    outline: none;
}
.term:focus-within {
    border-color: var(--sun);
}
.term-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}
.term-quick .chip {
    font-family: var(--mono);
    font-weight: 400;
}
.matrix {
    color: #7ee2b0;
    opacity: 0.85;
}

/* ------------------------------------------------------------ footer & pages */
.foot {
    border-top: 1px solid var(--line);
    padding: 2rem 0 2.5rem;
    font-size: 0.95rem;
    color: var(--mute);
}
.foot-in {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 2rem;
}
.foot nav {
    display: flex;
    gap: 1.25rem;
}
.foot a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}
.foot a:hover {
    color: var(--text);
}
.page .nav {
    background: var(--blue);
}
.page-main {
    padding: calc(var(--nav-h) + 4rem) 0 5rem;
    min-height: 70vh;
}
.prose {
    max-width: 68ch;
}
.prose h1 {
    font-size: clamp(2.4rem, 6vw, 3.8rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 1;
    margin-bottom: 0.5rem;
}
.prose h2 {
    font-size: var(--fs-2);
    font-weight: 800;
    margin: 2.25rem 0 0.6rem;
}
.prose h3,
.prose h4 {
    font-size: var(--fs-1);
    margin: 1.75rem 0 0.5rem;
}
.prose p,
.prose ul,
.prose ol,
.prose blockquote,
.prose pre {
    margin-bottom: 1rem;
}
.prose ul {
    list-style: disc;
    padding-left: 1.25rem;
}
.prose ol {
    list-style: decimal;
    padding-left: 1.25rem;
}
.prose blockquote {
    border-left: 4px solid var(--sun);
    padding-left: 1rem;
    color: var(--mute);
}
.prose code {
    font-family: var(--mono);
    font-size: 0.9em;
    background: var(--raised);
    padding: 0.1em 0.35em;
    border-radius: var(--r-s);
}
.prose pre {
    background: #0a1033;
    color: #dfe5fa;
    padding: 1rem 1.2rem;
    border-radius: var(--r-m);
    overflow-x: auto;
}
.prose pre code {
    background: none;
    padding: 0;
}
.prose img {
    border-radius: var(--r-m);
}
.posts {
    display: grid;
    border-top: 1px solid var(--line);
}
.posts a {
    display: grid;
    gap: 0.2rem;
    padding: 1.25rem 0;
    text-decoration: none;
    border-bottom: 1px solid var(--line);
}
.posts time {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--mute);
}
.post-title {
    font-size: var(--fs-1);
    font-weight: 700;
}
.posts a:hover .post-title {
    text-decoration: underline;
}
.back {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    margin-bottom: 1rem;
}
.nf {
    display: grid;
    justify-items: start;
    gap: 1rem;
}
.nf-mark {
    width: 5rem;
    height: 5rem;
}
.nf h1 {
    font-size: clamp(2.6rem, 8vw, 5rem);
    font-weight: 900;
    font-stretch: 62%;
    line-height: 0.95;
}

/* ------------------------------------------------------------ responsive hero */
@media (max-width: 860px) {
    .hero-in {
        grid-template-columns: 1fr;
    }
    .hero-name {
        font-size: clamp(2.3rem, 12.4vw, 5.6rem);
    }
    .stack {
        max-width: 21rem;
        order: -1;
        margin: -1rem auto 0;
    }
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

/* ------------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
    }
    .js [data-stagger] > * {
        transform: none;
    }
    .proj-in {
        transform: none !important;
    }
    .slab:hover > g,
    .slab:focus-visible > g {
        transform: none;
    }
}
