/* ==========================================================================
   Sanil Grover — editorial design system
   Light-first. Serif display / sans body / mono metadata.
   No frameworks, no build step. Respects prefers-reduced-motion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
    /* Paper */
    --paper:        #F4F1EA;
    --paper-2:      #EFEBE2;
    --paper-3:      #E8E3D8;
    --ink:          #171717;
    --muted:        #6F6B63;
    --faint:        #726D62;
    --rule:         #D8D4CA;
    --rule-strong:  #C6C1B4;
    --accent:       #3155FF;
    --accent-soft:  rgba(49, 85, 255, 0.10);
    --accent-rgb:   49, 85, 255;

    /* Type */
    --display: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Rhythm */
    --shell: 1180px;
    --gutter: clamp(1.25rem, 5vw, 4.5rem);
    --section-y: clamp(4.5rem, 11vw, 9.5rem);

    /* Motion */
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    color-scheme: light;
}

:root.dark {
    --paper:        #101010;
    --paper-2:      #151515;
    --paper-3:      #1B1B1B;
    --ink:          #F5F5F5;
    --muted:        #A5A5A5;
    --faint:        #8A8A8A;
    --rule:         #292929;
    --rule-strong:  #3A3A3A;
    --accent:       #5B6FFF;
    --accent-soft:  rgba(91, 111, 255, 0.14);
    --accent-rgb:   91, 111, 255;

    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    background: var(--paper);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.65;
    font-weight: 400;
    letter-spacing: -0.005em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; }

button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }

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

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

code {
    font-family: var(--mono);
    font-size: 0.88em;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    word-break: break-word;
}

hr { border: 0; border-top: 1px solid var(--rule); }

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    background: var(--ink);
    color: var(--paper);
    padding: 0.75rem 1.25rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.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;
}

/* --------------------------------------------------------------------------
   3. Typographic primitives
   -------------------------------------------------------------------------- */
.shell {
    width: 100%;
    max-width: var(--shell);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.display {
    font-family: var(--display);
    font-weight: 400;
    line-height: 1.06;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.label {
    font-family: var(--mono);
    font-size: clamp(0.62rem, 1.4vw, 0.7rem);
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.label-accent { color: var(--accent); }

.lede {
    font-size: clamp(1.02rem, 1.7vw, 1.2rem);
    line-height: 1.68;
    color: var(--muted);
    max-width: 62ch;
}

.meta {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
}

/* Rule with a number, used as a section divider */
.rule {
    border-top: 1px solid var(--rule);
    margin: 0;
}

/* --------------------------------------------------------------------------
   4. Navigation
   -------------------------------------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.navbar.is-stuck { border-bottom-color: var(--rule); }

@supports not (backdrop-filter: blur(1px)) {
    .navbar { background: var(--paper); }
}

.navbar-content {
    max-width: var(--shell);
    margin-inline: auto;
    padding: 0.9rem var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.navbar-brand {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.navbar-brand .star { color: var(--accent); font-size: 0.85em; }

.navbar-links {
    display: flex;
    gap: clamp(1rem, 2.6vw, 2.1rem);
    align-items: center;
}

.navbar-links a {
    position: relative;
    text-decoration: none;
    font-size: 0.88rem;
    color: var(--muted);
    padding: 0.2rem 0;
    transition: color 0.22s var(--ease);
}
.navbar-links a::after {
    content: "";
    position: absolute;
    left: 0; right: 100%;
    bottom: -2px;
    height: 1px;
    background: currentColor;
    transition: right 0.32s var(--ease);
}
.navbar-links a:hover { color: var(--ink); }
.navbar-links a:hover::after { right: 0; }
.navbar-links a.active { color: var(--ink); }
.navbar-links a.active::after { right: 0; background: var(--accent); }

.navbar-right { display: flex; align-items: center; gap: 0.65rem; }

.nav-resume {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    padding: 0.45rem 0.95rem;
    white-space: nowrap;
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.nav-resume:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-soft);
}

.theme-toggle,
.nav-burger {
    width: 34px; height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--rule);
    border-radius: 999px;
    color: var(--muted);
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.theme-toggle:hover,
.nav-burger:hover { color: var(--ink); border-color: var(--rule-strong); }
.theme-toggle svg, .nav-burger svg { width: 15px; height: 15px; }

.nav-burger { display: none; }

.mobile-nav {
    display: none;
    flex-direction: column;
    padding: 0 var(--gutter) 1.5rem;
    border-top: 1px solid var(--rule);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
    font-family: var(--display);
    font-size: 1.6rem;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule);
    color: var(--ink);
}
.mobile-nav a:last-child {
    font-family: var(--mono);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    border-bottom: 0;
    padding-top: 1rem;
}

@media (max-width: 900px) {
    .navbar-links { display: none; }
    .nav-burger { display: inline-flex; }
    .nav-resume { display: none; }
}

/* --------------------------------------------------------------------------
   5. Section scaffolding
   -------------------------------------------------------------------------- */
.section {
    max-width: var(--shell);
    margin-inline: auto;
    padding: var(--section-y) var(--gutter);
}
.section + .section { padding-top: 0; }

.section-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.9rem;
    margin-bottom: clamp(2.25rem, 5vw, 3.75rem);
    padding-top: 1.6rem;
    border-top: 1px solid var(--rule);
}

.section-label {
    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.section-label::before {
    content: "";
    width: 22px;
    height: 1px;
    background: var(--accent);
    flex: none;
}

.section-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.2rem, 6.2vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.022em;
    text-wrap: balance;
}

.section-lede {
    font-size: clamp(0.98rem, 1.5vw, 1.12rem);
    line-height: 1.7;
    color: var(--muted);
    max-width: 58ch;
}

/* --------------------------------------------------------------------------
   6. Buttons & links
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.78rem 1.4rem;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    color: var(--ink);
    background: transparent;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease),
                border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.btn:hover { transform: translateY(-1px); border-color: var(--ink); }

.btn-primary {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.btn-ghost { border-color: var(--rule); color: var(--muted); }
.btn-ghost:hover { color: var(--ink); }

/* Editorial inline link with animated underline */
.tlink {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    position: relative;
    padding-bottom: 2px;
}
.tlink::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: currentColor;
    transform-origin: right;
    transform: scaleX(1);
    transition: transform 0.35s var(--ease);
}
.tlink:hover::after { transform: scaleX(0); }
.tlink .arrow { transition: transform 0.3s var(--ease); }
.tlink:hover .arrow { transform: translateX(3px); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.22s var(--ease);
}
.back-link:hover { color: var(--accent); }

/* Microcopy line */
.microcopy {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: var(--faint);
}
.microcopy a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }

/* --------------------------------------------------------------------------
   7. Hero
   -------------------------------------------------------------------------- */
.hero {
    max-width: var(--shell);
    margin-inline: auto;
    padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(2.5rem, 6vw, 4.5rem);
}

.hero-kicker {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
}
.hero-kicker .star {
    color: var(--accent);
    font-size: 0.9em;
    animation: spin-slow 14s linear infinite;
    display: inline-block;
}
@keyframes spin-slow { to { transform: rotate(360deg); } }

.hero-headline {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.75rem, 9.2vw, 7.2rem);
    line-height: 1.05;
    letter-spacing: -0.028em;
    text-wrap: balance;
    margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}
.hero-headline .em { font-style: italic; }
.hero-headline .quiet { color: var(--muted); }

.hero-body {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.hero-name {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.9rem;
}

.hero-intro {
    font-size: clamp(1.02rem, 1.6vw, 1.16rem);
    line-height: 1.72;
    max-width: 46ch;
    color: var(--ink);
}
.hero-intro + .hero-intro { margin-top: 1rem; }

.hero-role {
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 1.25rem;
}
.hero-role .sep { color: var(--accent); margin: 0 0.55rem; }

.hero-domains {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1.5rem 0 0;
}
.hero-domain {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 2rem;
}

/* Portrait, treated editorially */
.hero-aside { position: relative; }

.hero-figure {
    position: relative;
    margin: 0;
}
.hero-figure::before {
    content: "";
    position: absolute;
    inset: -0.65rem -0.65rem auto auto;
    width: 84px;
    height: 84px;
    border: 1px solid var(--rule-strong);
    border-left: 0;
    border-bottom: 0;
    pointer-events: none;
}
.hero-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 22%;
    filter: grayscale(0.18) contrast(1.02);
    transition: filter 0.6s var(--ease), transform 0.9s var(--ease);
    will-change: transform;
}
.hero-figure:hover .hero-image { filter: grayscale(0) contrast(1); }

.hero-figcaption {
    margin-top: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    border-top: 1px solid var(--rule);
    padding-top: 0.6rem;
}
.hero-figcaption .dot {
    display: inline-block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 0.45rem;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .hero-body { grid-template-columns: 1fr; }
    .hero-aside { order: -1; max-width: 22rem; }
}

/* --------------------------------------------------------------------------
   9. Editorial statement + about
   -------------------------------------------------------------------------- */
.statement {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.85rem, 5.4vw, 3.6rem);
    line-height: 1.06;
    letter-spacing: -0.022em;
    text-wrap: balance;
    max-width: 20ch;
}
.statement .em { font-style: italic; color: var(--accent); }

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.about-intro {
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    max-width: 46ch;
}
.about-text {
    font-size: 1rem;
    line-height: 1.78;
    color: var(--muted);
    max-width: 50ch;
}
.about-text + .about-text { margin-top: 1rem; }

.about-meta {
    border-top: 1px solid var(--rule);
}
.about-meta-row {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
    align-items: baseline;
}
.about-meta-key {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}
.about-meta-val { font-size: 0.92rem; line-height: 1.6; }
.about-meta-val a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }

.interest-strip {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.75rem;
}
.interest-chip {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.interest-chip:hover { border-color: var(--accent); color: var(--accent); }

/* Fun-fact console — the one deliberate terminal reference on the site */
.fact-console {
    margin-top: 1.75rem;
    border: 1px solid var(--rule);
    background: var(--paper-2);
    padding: 1rem 1.1rem 0.9rem;
}
.fact-console-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.55rem;
    margin-bottom: 0.75rem;
}
.fact-console-line {
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.7;
    min-height: 2.7em;
    color: var(--ink);
}
.fact-console-line::before { content: "$ "; color: var(--accent); }
.fact-console-next {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    transition: color 0.22s var(--ease);
}
.fact-console-next:hover { color: var(--accent); }

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

/* --------------------------------------------------------------------------
   10. Numbered threads ("What I'm exploring")
   -------------------------------------------------------------------------- */
.threads { border-top: 1px solid var(--rule); }

.thread {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(1.25rem, 3.5vw, 3rem);
    padding: clamp(1.75rem, 4vw, 2.75rem) 0;
    border-bottom: 1px solid var(--rule);
    align-items: start;
    transition: background-color 0.35s var(--ease);
}
.thread:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }

.thread-num {
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    color: var(--accent);
    padding-top: 0.5rem;
}
.thread-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.55rem, 3.4vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
}
.thread-body { display: grid; gap: 1.25rem; }

.thread-item { }
.thread-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.3rem;
}
.thread-item p {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--muted);
}
.thread-tools {
    display: block;
    margin-top: 0.4rem;
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    color: var(--faint);
}

@media (max-width: 900px) {
    .thread { grid-template-columns: 3rem minmax(0, 1fr); }
    .thread-body { grid-column: 2 / -1; }
}

/* --------------------------------------------------------------------------
   11. Projects — editorial case studies
   -------------------------------------------------------------------------- */
.case {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
    gap: clamp(1.75rem, 4.5vw, 4rem);
    padding: clamp(2rem, 5vw, 3.5rem) 0;
    border-top: 1px solid var(--rule);
    align-items: start;
}
.case:last-of-type { border-bottom: 1px solid var(--rule); }
.case.reverse .case-visual { order: -1; }

.case-index {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 1.1rem;
}
.case-index .n { color: var(--accent); }

.case-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.9rem, 4.6vw, 3.1rem);
    line-height: 1.02;
    letter-spacing: -0.022em;
    margin-bottom: 1rem;
    text-wrap: balance;
}

.case-desc {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--muted);
    max-width: 52ch;
}
.case-desc + .case-desc { margin-top: 0.85rem; }

.case-rows { margin-top: 1.5rem; border-top: 1px solid var(--rule); }
.case-row {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--rule);
    align-items: baseline;
}
.case-key {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
}
.case-val { font-size: 0.9rem; line-height: 1.6; }

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1.35rem;
}
.tag-row span,
.featured-tags span {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.07em;
    color: var(--muted);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.28rem 0.55rem;
}

.case-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin-top: 1.6rem; }

.status-chip {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    margin-top: 1.25rem;
}

/* Big number block */
.metric-block {
    border: 1px solid var(--rule);
    background: var(--paper-2);
    padding: clamp(1.5rem, 3.5vw, 2.5rem);
}
.metric-label {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}
.metric-value {
    font-family: var(--display);
    font-size: clamp(3rem, 9vw, 5.25rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin: 0.5rem 0 0.75rem;
}
.metric-sub {
    font-family: var(--mono);
    font-size: 0.66rem;
    line-height: 1.8;
    letter-spacing: 0.06em;
    color: var(--muted);
    border-top: 1px solid var(--rule);
    padding-top: 0.75rem;
}

/* Pipeline diagram */
.pipeline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0;
    margin-top: 1.5rem;
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.pipeline-node { display: inline-flex; align-items: center; white-space: nowrap; }
.pipeline-node + .pipeline-node { margin-left: 0; }
.pipeline-step {
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.4rem 0.6rem;
    color: var(--muted);
    background: var(--paper);
}
.pipeline-node:last-child .pipeline-step { border-color: var(--accent); color: var(--accent); }
.pipeline-arrow { color: var(--faint); padding: 0 0.5rem; }

@media (max-width: 880px) {
    .case { grid-template-columns: 1fr; }
    .case.reverse .case-visual { order: 0; }
}

/* Compact project cards (also used by dynamically injected content) */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
}
.project-card {
    background: var(--paper);
    padding: clamp(1.4rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: background-color 0.3s var(--ease);
}
.project-card:hover { background: var(--paper-2); }
.project-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.45rem;
    line-height: 1.1;
    letter-spacing: -0.015em;
}
.project-meta {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}
.project-desc { font-size: 0.9rem; line-height: 1.7; color: var(--muted); }
.project-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.project-tag {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    color: var(--faint);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.22rem 0.45rem;
}
.project-link {
    margin-top: auto;
    padding-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
}
.project-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Legacy .featured-project shape, restyled (site-data.js may inject this) */
.featured-project {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
    gap: clamp(1.75rem, 4vw, 3.5rem);
    padding: clamp(2rem, 5vw, 3.25rem) 0;
    border-top: 1px solid var(--rule);
    align-items: start;
}
.featured-project:last-child { border-bottom: 1px solid var(--rule); }
.featured-content h3 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.8rem, 4.2vw, 2.8rem);
    line-height: 1.04;
    letter-spacing: -0.022em;
    margin-bottom: 0.9rem;
}
.featured-content > p { font-size: 1rem; line-height: 1.75; color: var(--muted); max-width: 52ch; }
.featured-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.35rem; }
@media (max-width: 880px) { .featured-project { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   12. Experience — large years
   -------------------------------------------------------------------------- */
.exp-list { border-top: 1px solid var(--rule); }

.exp-card {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: clamp(1.25rem, 3.5vw, 3rem);
    padding: clamp(1.75rem, 4vw, 2.85rem) 0;
    border-bottom: 1px solid var(--rule);
    align-items: start;
}

.exp-year {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2rem, 4.5vw, 3.1rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    color: var(--ink);
}
.exp-year small {
    display: block;
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
    margin-top: 0.5rem;
}

/* Fallback avatar block for dynamically injected experience cards */
.exp-avatar {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.4rem 0.6rem;
    display: inline-block;
    justify-self: start;
}

.exp-header { margin-bottom: 0.35rem; }
.exp-org {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
    display: block;
}
.exp-role {
    display: block;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 0.4rem;
}
.exp-date {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 1rem;
}

.exp-desc { font-size: 0.96rem; line-height: 1.75; color: var(--muted); max-width: 68ch; }
.exp-desc ul { list-style: none; display: grid; gap: 0.7rem; }
.exp-desc li { position: relative; padding-left: 1.35rem; }
.exp-desc li::before {
    content: "";
    position: absolute;
    left: 0; top: 0.72em;
    width: 8px; height: 1px;
    background: var(--accent);
}

.exp-stack { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 1.1rem; }
.exp-stack span {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.07em;
    color: var(--faint);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.22rem 0.45rem;
}

@media (max-width: 760px) {
    .exp-card { grid-template-columns: 1fr; gap: 1rem; }
    .exp-year { font-size: 2.1rem; }
}

/* --------------------------------------------------------------------------
   14. Research entries
   -------------------------------------------------------------------------- */
.research-list { border-top: 1px solid var(--rule); }
.research-item {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: clamp(1.25rem, 3.5vw, 3rem);
    padding: clamp(1.5rem, 3.5vw, 2.5rem) 0;
    border-bottom: 1px solid var(--rule);
    align-items: start;
}
.research-venue {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    line-height: 1.7;
}
.research-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.35rem, 2.9vw, 1.95rem);
    line-height: 1.14;
    letter-spacing: -0.018em;
    margin-bottom: 0.6rem;
}
.research-abstract { font-size: 0.95rem; line-height: 1.75; color: var(--muted); max-width: 66ch; }
@media (max-width: 760px) { .research-item { grid-template-columns: 1fr; gap: 0.75rem; } }

/* --------------------------------------------------------------------------
   14b. Homepage teaser rows (slim, clickable, link to full pages)
   -------------------------------------------------------------------------- */
.teaser-list { border-top: 1px solid var(--rule); }

.teaser-item {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr) auto;
    gap: clamp(1.25rem, 3.5vw, 3rem);
    padding: clamp(1.5rem, 3.5vw, 2.35rem) 0;
    border-bottom: 1px solid var(--rule);
    align-items: center;
}

/* shared clickable-row treatment across teaser / experience / research rows */
.teaser-item,
.exp-link,
.research-link {
    text-decoration: none;
    color: inherit;
    transition: background 0.3s ease;
}
.teaser-item:hover,
.exp-link:hover,
.research-link:hover,
.teaser-item:focus-visible,
.exp-link:focus-visible,
.research-link:focus-visible { background: var(--paper-2); }

.exp-link,
.research-link { grid-template-columns: 8.5rem minmax(0, 1fr) auto; }

/* meta column of the project teaser */
.teaser-meta {
    display: flex;
    flex-direction: column;
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.95;
}
.teaser-index { color: var(--accent); }
.teaser-stat { color: var(--faint); }

.teaser-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.35rem, 2.9vw, 1.95rem);
    line-height: 1.14;
    letter-spacing: -0.018em;
    transition: color 0.3s ease;
}
.teaser-sub {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 60ch;
}

/* one-line descriptions on the slimmed experience rows */
.exp-oneline {
    margin-top: 0.3rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--muted);
    max-width: 62ch;
}

/* make the hover-highlighted title shift to accent */
.exp-org,
.research-title { transition: color 0.3s ease; }
.research-link .research-title { margin-bottom: 0; }
.teaser-item:hover .teaser-title,
.exp-link:hover .exp-org,
.research-link:hover .research-title,
.teaser-item:focus-visible .teaser-title,
.exp-link:focus-visible .exp-org,
.research-link:focus-visible .research-title { color: var(--accent); }

/* arrow that slides in on hover */
.teaser-arrow {
    justify-self: end;
    align-self: center;
    color: var(--faint);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.3s ease;
}
.teaser-item:hover .teaser-arrow,
.exp-link:hover .teaser-arrow,
.research-link:hover .teaser-arrow,
.teaser-item:focus-visible .teaser-arrow,
.exp-link:focus-visible .teaser-arrow,
.research-link:focus-visible .teaser-arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--accent);
}

@media (max-width: 760px) {
    .teaser-item,
    .exp-link,
    .research-link { grid-template-columns: 1fr; }
    .teaser-arrow { display: none; }
}

/* --------------------------------------------------------------------------
   15. Skills / technical arsenal
   -------------------------------------------------------------------------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
}
.skill-card {
    background: var(--paper);
    padding: clamp(1.35rem, 3vw, 1.9rem);
}
.skill-title {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 0.75rem;
    margin-bottom: 0.95rem;
    border-bottom: 1px solid var(--rule);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tag {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: var(--ink);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.3rem 0.55rem;
    transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.skill-tag:hover { border-color: var(--accent); color: var(--accent); }

/* --------------------------------------------------------------------------
   16. Achievements / badges
   -------------------------------------------------------------------------- */
.badge-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
}
.badge {
    background: var(--paper);
    padding: clamp(1.35rem, 3vw, 1.9rem);
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}
.badge > i { color: var(--accent); font-size: 0.95rem; margin-top: 0.25rem; }
.badge-mark {
    font-family: var(--mono);
    font-size: 0.62rem;
    color: var(--accent);
    margin-top: 0.35rem;
    flex: none;
}
.badge-title { font-size: 0.98rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.badge-sub { font-size: 0.85rem; line-height: 1.65; color: var(--muted); margin-top: 0.3rem; }
.badge-verify {
    display: inline-block;
    margin-top: 0.5rem;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   17. Page headers (interior pages)
   -------------------------------------------------------------------------- */
.page-header {
    max-width: var(--shell);
    margin-inline: auto;
    padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) clamp(2rem, 5vw, 3.5rem);
}
.page-header-content { display: grid; gap: 1.1rem; }
.page-eyebrow {
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.7rem;
}
.page-eyebrow::before {
    content: "";
    width: 22px; height: 1px;
    background: var(--accent);
    flex: none;
}
.page-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2.6rem, 8vw, 5.25rem);
    line-height: 1.06;
    letter-spacing: -0.028em;
    text-wrap: balance;
}
.page-lede {
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    line-height: 1.7;
    color: var(--muted);
    max-width: 58ch;
}
.page-lede a { color: var(--accent); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }

/* --------------------------------------------------------------------------
   18. Gallery
   -------------------------------------------------------------------------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(1rem, 2.5vw, 2rem);
}
.gallery-item { grid-column: span 6; margin: 0; }
.gallery-item.feature { grid-column: span 12; }
.gallery-item.feature img { aspect-ratio: 12 / 5; }
.gallery-item img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    filter: grayscale(0.15);
    transition: filter 0.5s var(--ease), transform 0.6s var(--ease);
}
.gallery-item:hover img { filter: grayscale(0); transform: scale(1.012); }
.gallery-caption {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--rule);
    padding-top: 0.6rem;
}
.insta-tag {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}
.gallery-caption p { font-size: 0.88rem; line-height: 1.6; color: var(--muted); }

@media (max-width: 760px) {
    .gallery-item,
    .gallery-item.feature { grid-column: span 12; }
    .gallery-item.feature img { aspect-ratio: 4 / 3; }
}

/* Legacy carousel (kept so any injected carousel still works) */
.carousel { position: relative; }
.carousel-viewport { overflow: hidden; }
.carousel-track { display: flex; transition: transform 0.6s var(--ease); }
.carousel-slide { min-width: 100%; }
.carousel-slide img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.carousel-caption { display: grid; gap: 0.35rem; margin-top: 0.75rem; }
.carousel-btn {
    position: absolute;
    top: 40%;
    width: 38px; height: 38px;
    border-radius: 999px;
    border: 1px solid var(--rule-strong);
    background: var(--paper);
    color: var(--ink);
    display: flex; align-items: center; justify-content: center;
}
.carousel-btn.prev { left: 0.75rem; }
.carousel-btn.next { right: 0.75rem; }
.carousel-dots { display: flex; gap: 0.4rem; justify-content: center; margin-top: 1rem; }
.carousel-dot {
    width: 6px; height: 6px; border-radius: 999px;
    background: var(--rule-strong); border: 0;
}
.carousel-dot.active { background: var(--accent); }

/* --------------------------------------------------------------------------
   19. Blog
   -------------------------------------------------------------------------- */
.blog-featured-card {
    display: block;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: clamp(1.75rem, 4vw, 2.75rem) 0;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s var(--ease);
}
.blog-featured-card:hover { background: var(--paper-2); }
.blog-featured-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.blog-chip {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
}
.blog-time, .blog-meta {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
}
.blog-meta .accent { color: var(--accent); }
.blog-featured-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.9rem, 5vw, 3.25rem);
    line-height: 1.02;
    letter-spacing: -0.024em;
    margin-bottom: 0.85rem;
    text-wrap: balance;
}
.blog-featured-excerpt { font-size: 1.02rem; line-height: 1.72; color: var(--muted); max-width: 58ch; }
.blog-featured-card .back-link { margin: 1.25rem 0 0; }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
    gap: 1px;
    background: var(--rule);
    border-bottom: 1px solid var(--rule);
}
.blog-card {
    background: var(--paper);
    padding: clamp(1.4rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s var(--ease);
}
.blog-card:hover { background: var(--paper-2); }
.blog-card h3 {
    font-family: var(--display);
    font-weight: 400;
    font-size: 1.6rem;
    line-height: 1.08;
    letter-spacing: -0.018em;
}
.blog-card p { font-size: 0.92rem; line-height: 1.7; color: var(--muted); }
.blog-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.blog-tags span {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.07em;
    color: var(--faint);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 0.22rem 0.45rem;
}
.blog-card .back-link { margin: auto 0 0; }

/* Article body */
.blog-post-body {
    max-width: 40rem;
    margin: 0 auto;
    padding: 0 var(--gutter) var(--section-y);
    font-size: 1.06rem;
    line-height: 1.85;
}
.blog-post-body > * + * { margin-top: 1.35rem; }
.blog-post-body p { color: var(--ink); }
.blog-post-body h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-top: 2.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
}
.blog-post-body ul, .blog-post-body ol { padding-left: 0; list-style: none; display: grid; gap: 0.75rem; }
.blog-post-body li { position: relative; padding-left: 1.4rem; color: var(--muted); }
.blog-post-body li::before {
    content: "";
    position: absolute; left: 0; top: 0.78em;
    width: 9px; height: 1px; background: var(--accent);
}
.blog-post-body blockquote {
    font-family: var(--display);
    font-size: clamp(1.3rem, 3vw, 1.75rem);
    line-height: 1.3;
    letter-spacing: -0.015em;
    color: var(--ink);
    border-left: 2px solid var(--accent);
    padding: 0.25rem 0 0.25rem 1.5rem;
    margin: 2.25rem 0;
}

/* --------------------------------------------------------------------------
   20. Recommendations
   -------------------------------------------------------------------------- */
.testimonials-carousel { position: relative; }
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
}
.testimonial-card {
    background: var(--paper);
    padding: clamp(1.5rem, 3.2vw, 2.25rem);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.testimonial-quote-icon { color: var(--accent); font-size: 0.9rem; }
.testimonial-text {
    font-family: var(--display);
    font-size: 1.2rem;
    line-height: 1.4;
    letter-spacing: -0.012em;
}
.testimonial-author {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--rule);
}
.testimonial-role { font-size: 0.82rem; color: var(--muted); }
.testimonial-linkedin {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    text-decoration: none;
}
.testimonial-empty {
    background: var(--paper);
    padding: clamp(2rem, 5vw, 3.25rem);
    text-align: center;
    display: grid;
    gap: 1rem;
    justify-items: center;
}
.testimonial-empty p { color: var(--muted); max-width: 44ch; font-size: 0.95rem; }
.testimonial-note { margin-top: 1.25rem; font-family: var(--mono); font-size: 0.72rem; color: var(--muted); }
.testimonial-note a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }

.testi-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px; height: 36px;
    border-radius: 999px;
    border: 1px solid var(--rule-strong);
    background: var(--paper);
    display: flex; align-items: center; justify-content: center;
}
.testi-nav-prev { left: -18px; }
.testi-nav-next { right: -18px; }
.testi-dots { display: flex; gap: 0.4rem; justify-content: center; margin-top: 1rem; }
.testi-dots button,
.testi-dot {
    width: 6px; height: 6px; border-radius: 999px;
    background: var(--rule-strong); border: 0;
    padding: 0;
}
.testi-dots button.active,
.testi-dot.active { background: var(--accent); }

/* assets/site-data.js adds .carousel-mode when it paginates recommendations */
.testimonials-grid.carousel-mode {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}

/* --------------------------------------------------------------------------
   21. CTA band
   -------------------------------------------------------------------------- */
.cta-band {
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: clamp(2.5rem, 6vw, 4.5rem) 0;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: end;
}
.cta-band-text h2 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(1.9rem, 5.5vw, 3.4rem);
    line-height: 1.02;
    letter-spacing: -0.024em;
    margin-bottom: 0.85rem;
    text-wrap: balance;
}
.cta-band-text p { color: var(--muted); font-size: 1rem; line-height: 1.72; max-width: 48ch; }
.cta-band-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
@media (max-width: 820px) { .cta-band { grid-template-columns: 1fr; align-items: start; } }

/* --------------------------------------------------------------------------
   22. Forms
   -------------------------------------------------------------------------- */
.contact-section {
    max-width: 46rem;
    margin-inline: auto;
}
.contact-direct {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    margin-bottom: 2.5rem;
}
.contact-direct a {
    background: var(--paper);
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.04em;
    color: var(--ink);
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
    word-break: break-word;
}
.contact-direct a:hover { background: var(--paper-2); color: var(--accent); }

.contact-form { display: grid; gap: 1.25rem; }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: 1.25rem;
}
.form-group { display: grid; gap: 0.5rem; }
.form-label {
    font-family: var(--mono);
    font-size: 0.64rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}
.form-input, .form-textarea {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--rule-strong);
    padding: 0.65rem 0;
    font-size: 0.98rem;
    border-radius: 0;
    transition: border-color 0.25s var(--ease);
}
.form-textarea { min-height: 8.5rem; resize: vertical; line-height: 1.7; }
.form-input:focus, .form-textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--faint); }
.form-hint { font-family: var(--mono); font-size: 0.66rem; color: var(--faint); text-align: center; }
.form-status {
    font-family: var(--mono);
    font-size: 0.72rem;
    line-height: 1.6;
    padding: 0.6rem 0;
}
.form-status.success { color: var(--accent); }
.form-status.error { color: #c0392b; }
:root.dark .form-status.error { color: #ff8f80; }

/* --------------------------------------------------------------------------
   23. Footer
   -------------------------------------------------------------------------- */
footer {
    border-top: 1px solid var(--rule);
    background: var(--paper-2);
}
.footer-content {
    max-width: var(--shell);
    margin-inline: auto;
    padding: clamp(3rem, 7vw, 5rem) var(--gutter) 2rem;
}
.footer-top {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.8fr);
    gap: clamp(1.75rem, 4vw, 3rem);
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--rule);
}
.footer-title {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1;
    letter-spacing: -0.025em;
    margin-bottom: 0.85rem;
}
.footer-text { font-size: 0.92rem; line-height: 1.7; color: var(--muted); max-width: 40ch; }
.footer-col-title {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 0.9rem;
}
.footer-links { display: grid; gap: 0.45rem; }
.footer-links a {
    font-size: 0.88rem;
    text-decoration: none;
    color: var(--muted);
    width: fit-content;
    transition: color 0.22s var(--ease);
}
.footer-links a:hover { color: var(--accent); }

.social-links { display: flex; gap: 0.5rem; margin-top: 1.25rem; flex-wrap: wrap; }
.social-link {
    width: 36px; height: 36px;
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.social-link:hover { color: var(--accent); border-color: var(--accent); }
.social-link svg { width: 15px; height: 15px; }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.5rem;
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: var(--faint);
}
.footer-note { margin-top: 0.3rem; }
.footer-fingerprint { text-decoration: none; color: var(--faint); }
.footer-fingerprint .k { color: var(--accent); }
.footer-fingerprint:hover { color: var(--accent); }

@media (max-width: 780px) {
    .footer-top { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   24. Reveal animations
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: none; }

.reveal-stagger > * {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.reveal-stagger.in-view > * { opacity: 1; transform: none; }
.reveal-stagger.in-view > *:nth-child(1) { transition-delay: 0.04s; }
.reveal-stagger.in-view > *:nth-child(2) { transition-delay: 0.10s; }
.reveal-stagger.in-view > *:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger.in-view > *:nth-child(4) { transition-delay: 0.22s; }
.reveal-stagger.in-view > *:nth-child(5) { transition-delay: 0.28s; }
.reveal-stagger.in-view > *:nth-child(6) { transition-delay: 0.34s; }

/* Line-by-line headline reveal */
.reveal-lines .line { display: block; overflow: hidden; }
.reveal-lines .line > span {
    display: block;
    transform: translateY(105%);
    transition: transform 0.9s var(--ease);
}
.reveal-lines.in-view .line > span { transform: none; }
.reveal-lines.in-view .line:nth-child(2) > span { transition-delay: 0.08s; }
.reveal-lines.in-view .line:nth-child(3) > span { transition-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
    .reveal, .reveal-stagger > * { opacity: 1; transform: none; }
    .reveal-lines .line > span { transform: none; }
    .hero-kicker .star { animation: none; }
}
