/* ============================================================
   Ben Audry portfolio, Direction B: Precision minimal
   Single family: Geist (variable), khaki #BDB76B locked.
   ============================================================ */

:root {
    --bg: #0a0a0b;
    --bg-raised: #121214;
    --surface: rgba(255, 255, 255, 0.025);
    --surface-hover: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(255, 255, 255, 0.06);
    --hairline: rgba(255, 255, 255, 0.06);
    --hairline-bright: rgba(255, 255, 255, 0.12);
    --inner-highlight: rgba(255, 255, 255, 0.08);

    --text: #f2f2f3;
    --text-dim: #a8a8ac;
    --text-faint: #6e6e74;

    --accent: #BDB76B;
    --accent-bright: #D4C896;
    --accent-deep: #8B864E;
    --accent-glow: rgba(189, 183, 107, 0.14);
    --accent-glow-soft: rgba(189, 183, 107, 0.06);

    --blue-soft: #6B8AAB;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(189, 183, 107, 0.1);

    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.18s var(--ease);
    --t: 0.32s var(--ease);
    --t-slow: 0.6s var(--ease);

    --container: 1320px;
    --gutter: 1.5rem;
    --h-header: 68px;
}

@media (min-width: 768px) {
    :root { --gutter: 2rem; }
}

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

html {
    scroll-behavior: smooth;
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Geist', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    font-weight: 400;
    font-feature-settings: 'ss01', 'cv11';
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

section[id] { scroll-margin-top: calc(var(--h-header) + 1.5rem); }
a { color: inherit; text-decoration: none; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }

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

/* ====================== Ambient background ====================== */

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(1000px 600px at 85% -10%, var(--accent-glow-soft), transparent 60%),
        radial-gradient(800px 500px at 10% 110%, rgba(107, 138, 171, 0.04), transparent 60%);
}

.shader-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    display: none;
    opacity: 0.7;
}
body.shader-on .shader-bg { display: block; }
body.shader-on::before { display: none; }

.grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.035;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ====================== Layout primitives ====================== */

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
    position: relative;
    z-index: 2;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 1rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--bg);
    border-radius: var(--radius-sm);
    font-weight: 500;
    z-index: 9999;
}
.skip-link:focus { left: 1rem; }

/* Focus ring applies to every interactive element */
a:focus-visible,
button:focus-visible,
.tile:focus-visible,
.contact-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* ====================== Header ====================== */

.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--h-header);
    background: rgba(10, 10, 11, 0.55);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid transparent;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.site-header.is-scrolled {
    background: rgba(10, 10, 11, 0.8);
    border-bottom-color: var(--hairline);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    letter-spacing: -0.01em;
    font-size: 0.95rem;
}
.brand-mark { display: none; }
.brand-name {
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
}
.brand-name::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    transform: scaleX(0.4);
    transform-origin: right;
    transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.brand:hover .brand-name::after {
    transform: scaleX(1);
    box-shadow: 0 0 12px var(--accent-glow);
}

.nav {
    display: none;
    gap: 2rem;
}
@media (min-width: 720px) { .nav { display: flex; } }

.nav-link {
    font-size: 0.875rem;
    color: var(--text-dim);
    font-weight: 500;
    position: relative;
    padding: 0.25rem 0;
    transition: color var(--t-fast);
}
.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--t);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

.header-cta { display: none; }
@media (min-width: 720px) { .header-cta { display: inline-flex; } }

/* ====================== Buttons ====================== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
    will-change: transform;
}
.btn-sm { padding: 0.55rem 0.85rem; font-size: 0.825rem; }

.btn-primary {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 0 1px var(--accent-bright) inset, 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
    background: var(--accent-bright);
    box-shadow: 0 0 0 1px var(--accent-bright) inset, 0 6px 32px var(--accent-glow);
}
.btn-primary .btn-arrow { transition: transform var(--t-fast); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }

.btn-ghost {
    color: var(--text);
    border-color: var(--hairline-bright);
    background: var(--surface);
}
.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--surface-hover);
}

/* ====================== Eyebrow / kicker ====================== */

.kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.kicker-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-glow);
}
.kicker-dot-live {
    animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(189, 183, 107, 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(189, 183, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(189, 183, 107, 0); }
}

/* ====================== Reveal on scroll ====================== */

/* Default: content is visible. Only when JS is active + reduced motion OFF
   does .reveal start hidden, waiting for IntersectionObserver. This keeps
   the site usable with JS disabled and prevents blank sections if the
   observer never fires. */
.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.js .reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

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

.hero {
    padding-top: calc(var(--h-header) + 1.5rem);
    padding-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
@media (min-width: 768px) {
    .hero { padding-top: calc(var(--h-header) + 2rem); padding-bottom: 2.5rem; }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 2;
}
@media (min-width: 980px) {
    .hero-grid { grid-template-columns: 1.25fr 0.85fr; gap: 4rem; }
}

.hero-content > * + * { margin-top: 1.5rem; }

.hero-title {
    font-size: clamp(2rem, 3.2vw + 1rem, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
    color: var(--text);
}
.hero-title .line { display: block; }
.hero-title .accent { color: var(--accent); }

.hero-lede {
    max-width: 52ch;
    font-size: clamp(1rem, 0.6vw + 0.85rem, 1.125rem);
    color: var(--text-dim);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Hero visual card (replaces old schematic) */
.hero-visual {
    position: relative;
    aspect-ratio: 1 / 1.05;
    max-width: 460px;
    margin-left: auto;
    width: 100%;
}
.hero-card {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(189, 183, 107, 0.08), rgba(189, 183, 107, 0) 40%),
        var(--bg-raised);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 0 0 1px var(--hairline),
        var(--shadow-lg);
    overflow: hidden;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
}
.hero-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: radial-gradient(600px 400px at var(--mx, 50%) var(--my, 0%), var(--accent-glow), transparent 55%);
    pointer-events: none;
    opacity: 0.9;
}
.hero-card-eyebrow {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 500;
}
.hero-card-body {
    position: relative;
    z-index: 1;
}
.hero-card-headline {
    font-size: clamp(1.75rem, 3vw + 0.5rem, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
    margin-bottom: 0.6rem;
}
.hero-card-sub {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.5;
}
.hero-card-foot {
    position: relative;
    z-index: 1;
    padding-top: 1rem;
    border-top: 1px solid var(--hairline);
}
.hero-card-link {
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
    transition: gap var(--t-fast);
}
.hero-card-link:hover { color: var(--accent-bright); }

/* ====================== Section heads ====================== */

.section {
    padding: 1.5rem 0;
    position: relative;
    z-index: 2;
}
@media (min-width: 768px) { .section { padding: 2.25rem 0; } }

.section-head {
    max-width: 720px;
    margin-bottom: 1rem;
}
.section-head > * + * { margin-top: 0.75rem; }

.section-title {
    font-size: clamp(2rem, 3.5vw + 0.5rem, 3.25rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
}
.section-title .accent { color: var(--accent); }

.section-sub {
    font-size: 1.0625rem;
    color: var(--text-dim);
    max-width: 58ch;
    line-height: 1.6;
}

/* ====================== Bento grid (uniform) ====================== */

.bento {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
@media (min-width: 640px) {
    .bento { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}
@media (min-width: 980px) {
    .bento { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    min-height: 220px;
    border-radius: var(--radius-lg);
    background: var(--bg-raised);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 0 0 1px var(--hairline),
        var(--shadow-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--t), box-shadow var(--t);
    will-change: transform;
    isolation: isolate;
}
.tile::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(400px 280px at var(--mx, 50%) var(--my, 50%), var(--accent-glow), transparent 55%);
    opacity: 0;
    transition: opacity var(--t);
    pointer-events: none;
    z-index: 1;
}
.tile::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image: radial-gradient(circle at center, rgba(189, 183, 107, 0.07) 1px, transparent 1px);
    background-size: 4px 4px;
    opacity: 0;
    transition: opacity var(--t);
    pointer-events: none;
    z-index: 1;
}
.tile:hover {
    transform: translateY(-4px);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 0 0 1px var(--hairline-bright),
        var(--shadow-lg),
        var(--shadow-glow);
}
.tile:hover::before { opacity: 1; }
.tile:hover::after { opacity: 1; }

.tile-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tile-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--surface-strong);
    color: var(--accent);
    flex-shrink: 0;
    transition: background var(--t-fast), color var(--t-fast);
}
.tile:hover .tile-icon {
    background: linear-gradient(135deg, var(--accent-glow), var(--surface-strong));
    color: var(--accent-bright);
}

.tile-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tile-title {
    font-size: 1rem;
    line-height: 1.3;
    letter-spacing: -0.015em;
    font-weight: 600;
    color: var(--text);
}
.tile-meta {
    margin-left: 0.5rem;
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-faint);
    letter-spacing: 0;
}

.tile-sum {
    color: var(--text-dim);
    font-size: 0.875rem;
    line-height: 1.55;
    font-weight: 425;
}

.tile-foot {
    position: relative;
    z-index: 2;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    min-width: 0;
}
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 6px;
    transition: background var(--t-fast), color var(--t-fast);
}
.tile:hover .chip {
    background: var(--surface-hover);
    color: var(--text);
}

.tile-cta {
    color: var(--text-faint);
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity var(--t-fast), transform var(--t-fast), color var(--t-fast);
    flex-shrink: 0;
}
.tile:hover .tile-cta {
    opacity: 1;
    transform: translateX(0);
    color: var(--accent);
}

/* ====================== About ====================== */

.about {
    position: relative;
}
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}
@media (min-width: 900px) {
    .about-grid { grid-template-columns: 0.9fr 1.1fr; gap: 4rem; }
}

.about-media {
    position: relative;
    aspect-ratio: 4 / 5;
    max-width: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-raised);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 0 0 1px var(--hairline),
        var(--shadow-md);
}
.about-media img { width: 100%; height: 100%; object-fit: cover; }
.about-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(10, 10, 11, 0.4));
    pointer-events: none;
}

.about-body p + p { margin-top: 1rem; }
.about-body p {
    font-size: clamp(1.05rem, 0.5vw + 0.9rem, 1.2rem);
    color: var(--text-dim);
    line-height: 1.65;
}
.about-body p strong { color: var(--text); font-weight: 500; }
.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--hairline);
}
.about-stat-num {
    font-size: clamp(1.5rem, 1.5vw + 0.5rem, 2rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--accent-bright);
}
.about-stat-label {
    font-size: 0.75rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.3rem;
}

/* ====================== Testimonials carousel ====================== */

.testimonials {
    position: relative;
}

.testimonial-carousel {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.testimonial-track-c {
    position: relative;
}

.testimonial-card {
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-raised);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 0 0 1px var(--hairline),
        var(--shadow-md);
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
    pointer-events: none;
    z-index: 0;
}
@media (min-width: 720px) { .testimonial-card { padding: 2.5rem 2.75rem; } }

.testimonial-card.is-active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 1;
    position: relative;
    inset: auto;
}

.testimonial-head {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--hairline);
}
.testimonial-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-strong);
    border: 1px solid var(--hairline-bright);
    box-shadow: 0 0 0 3px rgba(189, 183, 107, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.testimonial-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.testimonial-id {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.testimonial-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.01em;
}
.testimonial-role {
    font-size: 0.85rem;
    color: var(--text-dim);
}
.testimonial-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-top: 0.25rem;
    transition: color var(--t-fast);
}
.testimonial-linkedin:hover { color: var(--accent); }

.testimonial-body {
    position: relative;
}
.testimonial-quote-mark {
    position: absolute;
    top: -6px;
    left: -8px;
    color: var(--accent);
    opacity: 0.18;
}
.testimonial-body p {
    font-size: 0.975rem;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 0.75rem;
    position: relative;
}
.testimonial-body p:last-child { margin-bottom: 0; }

.testimonial-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--hairline);
}
.t-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--accent-glow-soft);
    border: 1px solid rgba(189, 183, 107, 0.18);
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.testimonial-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.75rem;
}
.t-btn {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-raised);
    border: 1px solid var(--hairline);
    color: var(--text-dim);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.t-btn:hover {
    background: var(--surface-hover);
    color: var(--accent);
    border-color: var(--accent);
}
.t-btn:active { transform: scale(0.94); }

.testimonial-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.t-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hairline-bright);
    border: 0;
    padding: 0;
    transition: background var(--t-fast), width var(--t-fast);
    cursor: pointer;
}
.t-dot:hover { background: var(--text-dim); }
.t-dot.is-active {
    background: var(--accent);
    width: 22px;
    border-radius: 4px;
}

/* ====================== Contact ====================== */

.contact {
    position: relative;
}
.contact-lede {
    font-size: clamp(1.5rem, 2vw + 0.8rem, 2rem);
    line-height: 1.25;
    letter-spacing: -0.025em;
    font-weight: 500;
    color: var(--text);
    max-width: 24ch;
    margin-bottom: 2.5rem;
}
.contact-lede .accent { color: var(--accent); }

.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 600px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }

.contact-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-raised);
    border: 1px solid var(--hairline);
    box-shadow: inset 0 1px 0 var(--inner-highlight), var(--shadow-md);
    transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.contact-card:hover {
    background: var(--bg-raised);
    border-color: var(--hairline-bright);
    transform: translateY(-2px);
}
.contact-card-icon {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--surface-strong);
    color: var(--accent);
}
.contact-card-label {
    font-size: 0.75rem;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.contact-card-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
    word-break: break-word;
}
.contact-card-copy {
    position: absolute;
    top: 1rem; right: 1rem;
    padding: 0.3rem 0.55rem;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--hairline);
    color: var(--text-dim);
    background: var(--bg);
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.contact-card-copy:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.contact-card-copy.is-copied {
    color: var(--accent-bright);
    border-color: var(--accent-bright);
}

/* ====================== Footer ====================== */

.site-footer {
    margin-top: 0;
    padding: 3rem 0 2.5rem;
    border-top: 1px solid var(--hairline);
    position: relative;
    z-index: 2;
    background: linear-gradient(to bottom, transparent, var(--bg) 35%);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}
@media (min-width: 720px) {
    .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; }
}
.footer-col h3,
.footer-col h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    font-weight: 500;
    margin-bottom: 1rem;
}
.footer-col p {
    color: var(--text-dim);
    font-size: 0.95rem;
    line-height: 1.55;
}
.footer-links { display: flex; flex-direction: column; gap: 0.5rem; }
.footer-link {
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: color var(--t-fast);
}
.footer-link:hover { color: var(--accent); }
.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--hairline);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    color: var(--text-faint);
    font-size: 0.825rem;
}

/* ====================== Detail pages ====================== */

.detail-hero {
    padding-top: calc(var(--h-header) + 4rem);
    padding-bottom: 3rem;
    position: relative;
    z-index: 2;
}
.detail-back {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-dim);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    transition: color var(--t-fast), gap var(--t-fast);
}
.detail-back:hover { color: var(--accent); gap: 0.65rem; }

.detail-title {
    font-size: clamp(2rem, 3.5vw + 0.8rem, 3.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
    margin: 1rem 0 1rem;
    max-width: 22ch;
}
.detail-sum {
    font-size: clamp(1.05rem, 0.6vw + 0.85rem, 1.25rem);
    color: var(--text-dim);
    max-width: 58ch;
    line-height: 1.6;
}

.detail-hero-media {
    margin-top: 3rem;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-raised);
    box-shadow: inset 0 1px 0 var(--inner-highlight), 0 0 0 1px var(--hairline), var(--shadow-lg);
}
.detail-hero-media:has(.flow) {
    aspect-ratio: auto;
}
.detail-hero-media img,
.detail-hero-media .tile-placeholder { width: 100%; height: 100%; object-fit: cover; }

/* Output schema (file flow visual on detail hero) */
.output-schema {
    margin-top: 3rem;
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, var(--bg-raised), var(--bg));
    border: 1px solid var(--hairline-bright);
    box-shadow: inset 0 1px 0 var(--inner-highlight), var(--shadow-md);
}
.output-schema-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.output-schema-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    font-weight: 500;
}
.output-schema-hint {
    font-size: 0.875rem;
    color: var(--text-faint);
}
.output-schema-rows {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.output-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hairline);
}
.output-row:last-child { border-bottom: 0; padding-bottom: 0; }
.output-step {
    width: 9rem;
    flex-shrink: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    text-align: right;
    padding-right: 0.85rem;
    border-right: 2px solid var(--hairline-bright);
    line-height: 1.3;
}
.output-files {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.output-item {
    background: var(--surface);
    border: 1px solid var(--hairline-bright);
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    color: var(--text);
    white-space: nowrap;
}
.output-item.is-final {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-bright);
    font-weight: 500;
}
.output-arrow {
    color: var(--text-faint);
    font-size: 0.85rem;
    flex-shrink: 0;
}
@media (max-width: 720px) {
    .output-schema { padding: 1.25rem; margin-top: 2rem; }
    .output-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .output-step {
        width: auto;
        text-align: left;
        padding-right: 0;
        padding-bottom: 0.4rem;
        border-right: 0;
        border-bottom: 1px solid var(--hairline-bright);
        align-self: stretch;
    }
}

.detail-body {
    padding: 3rem 0 0;
    position: relative;
    z-index: 2;
}
.detail-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}
@media (min-width: 980px) {
    .detail-layout { grid-template-columns: 1fr 320px; gap: 4rem; }
}

.detail-block + .detail-block { margin-top: 2.5rem; }
.detail-block h2 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1rem;
}
.detail-block h3 {
    font-size: clamp(1.35rem, 1vw + 0.9rem, 1.75rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 600;
    margin-bottom: 0.75rem;
}
.detail-block p,
.detail-block li {
    font-size: 1rem;
    color: var(--text-dim);
    line-height: 1.65;
}
.detail-block p + p { margin-top: 0.9rem; }
.detail-block ul { margin: 0.75rem 0 0 1.2rem; display: flex; flex-direction: column; gap: 0.5rem; }
.detail-block strong { color: var(--text); font-weight: 500; }

.detail-figure {
    margin: 1.5rem 0 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-raised);
    border: 1px solid var(--hairline);
    box-shadow: inset 0 1px 0 var(--inner-highlight), var(--shadow-md);
}
.detail-figure img {
    display: block;
    width: 100%;
    height: auto;
}
.detail-figure figcaption {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--hairline);
    font-size: 0.8rem;
    color: var(--text-faint);
    background: var(--surface);
}

.detail-metric {
    padding: 1.5rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent-glow-soft), transparent 70%), var(--surface);
    border: 1px solid var(--hairline-bright);
    margin-top: 1rem;
}
.detail-metric-num {
    font-size: clamp(1.75rem, 2vw + 1rem, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--accent-bright);
    line-height: 1.1;
}
.detail-metric-label { color: var(--text-dim); margin-top: 0.4rem; font-size: 0.95rem; }

.detail-loom {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-raised);
    box-shadow: inset 0 1px 0 var(--inner-highlight), 0 0 0 1px var(--hairline), var(--shadow-md);
    margin-top: 1rem;
}
.detail-loom iframe { width: 100%; height: 100%; border: 0; }

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-self: start;
    position: sticky;
    top: calc(var(--h-header) + 1.5rem);
}
.detail-sidebar-block {
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--hairline);
}
.detail-sidebar-block h3,
.detail-sidebar-block h4 {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    font-weight: 500;
    margin-bottom: 0.75rem;
}
.detail-sidebar-block p { color: var(--text); font-size: 0.9rem; }
.detail-sidebar-block ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.detail-sidebar-block a {
    color: var(--text-dim);
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: color var(--t-fast);
}
.detail-sidebar-block a:hover { color: var(--accent); }

.detail-next {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    margin-top: 2.5rem;
    border-top: 1px solid var(--hairline);
    flex-wrap: wrap;
}
.detail-next-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--t-fast), gap var(--t-fast);
}
.detail-next-link:hover { color: var(--accent); gap: 0.8rem; }
.detail-next-link.is-next { color: var(--text); }
.detail-next-link.is-next:hover { color: var(--accent); }

/* ====================== Flow diagram ====================== */

.flow {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
    align-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 20% 10%, var(--accent-glow-soft), transparent 55%),
        var(--bg-raised);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    width: 100%;
    height: 100%;
}
@media (min-width: 560px) {
    .flow {
        grid-template-columns: repeat(var(--flow-cols, 5), minmax(0, 1fr));
        gap: 0.5rem;
    }
}
.flow-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--hairline);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 500;
    line-height: 1.25;
    transition: background var(--t-fast), border-color var(--t-fast);
}
.flow-step-accent {
    background: linear-gradient(135deg, rgba(189, 183, 107, 0.18), rgba(189, 183, 107, 0.04));
    border-color: var(--accent-deep);
    color: var(--accent-bright);
}
.flow-step-icon {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--accent);
}
.flow-step-num {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    color: var(--text-faint);
    font-weight: 400;
}
.flow-step-label { display: block; }
.flow-step-sub {
    display: block;
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 400;
    margin-top: 0.1rem;
}
.flow-arrow {
    display: none;
    color: var(--text-faint);
    justify-self: center;
}
@media (min-width: 560px) { .flow-arrow { display: block; } }

/* Flow fits inside tile-media without aspect-ratio collapse */
.tile-media .flow {
    border: 0;
    border-radius: 0;
    padding: 1.25rem;
    box-shadow: none;
}

/* Detail-page flow block */
.detail-flow {
    margin-top: 1rem;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-raised);
    border: 1px solid var(--hairline);
    box-shadow: inset 0 1px 0 var(--inner-highlight);
}
.detail-flow-steps {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-top: 1rem;
}
@media (min-width: 720px) {
    .detail-flow-steps { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
.detail-flow-step {
    position: relative;
    padding: 1rem 1rem 1rem 2.5rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
}
.detail-flow-step::before {
    content: counter(step);
    counter-increment: step;
    position: absolute;
    left: 0.9rem;
    top: 0.9rem;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    font-size: 0.75rem;
    font-weight: 600;
}
.detail-flow-steps { counter-reset: step; }
.detail-flow-step h3,
.detail-flow-step h4 {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.detail-flow-step p {
    font-size: 0.875rem;
    color: var(--text-dim);
    line-height: 1.5;
    margin: 0 !important;
}

/* ====================== Reduced motion ====================== */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
    .tile:hover { transform: none; }
    .tile:hover .tile-media img,
    .tile:hover .tile-media .tile-placeholder { transform: none; }
    .testimonial-card {
        opacity: 1 !important;
        transform: none !important;
        position: static !important;
        pointer-events: auto !important;
        margin-bottom: 1.5rem;
    }
    .testimonial-controls { display: none; }
    .shader-bg { display: none !important; }
    body.shader-on::before { display: block; }
}

/* ====================== Tools band (moving logos) ====================== */

.tools-band { padding: 1.5rem 0 2.5rem; }
@media (min-width: 768px) { .tools-band { padding: 2.25rem 0 3rem; } }

.tools-marquee {
    position: relative;
    margin-top: 2rem;
    padding: 8px 0;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--bg) 8%, var(--bg) 92%, transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, var(--bg) 8%, var(--bg) 92%, transparent 100%);
}

.tools-track {
    display: flex;
    gap: 1.25rem;
    width: max-content;
    animation: tools-scroll 60s linear infinite;
}
.tools-marquee:hover .tools-track { animation-play-state: paused; }

@keyframes tools-scroll {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-50%, 0, 0); }
}

.tool-item {
    flex: 0 0 auto;
    width: 144px;
    height: 88px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-raised);
    border: 1px solid var(--hairline);
    box-shadow: inset 0 1px 0 var(--inner-highlight);
    transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.tool-item:hover {
    border-color: rgba(189, 183, 107, 0.35);
    background: #1a1a1c;
    transform: translateY(-2px);
}
.tool-item img {
    max-width: 100%;
    max-height: 40px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.85;
    transition: opacity var(--t-fast);
}
.tool-item:hover img { opacity: 1; }

/* ====================== Bento tile normalization ====================== */

.bento { grid-auto-rows: 1fr; }
.tile { height: 100%; }
.tile-body { min-height: 0; }
.tile-sum {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.chip { white-space: nowrap; }

/* ====================== Screenshot borders (dark-on-dark fix) ====================== */

.detail-hero-media {
    border: 1px solid rgba(189, 183, 107, 0.18);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 0 0 1px rgba(189, 183, 107, 0.08),
        0 24px 64px rgba(0, 0, 0, 0.55);
    transition: border-color var(--t), box-shadow var(--t);
}
.detail-hero-media:hover {
    border-color: rgba(189, 183, 107, 0.35);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 0 0 1px rgba(189, 183, 107, 0.22),
        0 0 48px rgba(189, 183, 107, 0.12),
        0 24px 64px rgba(0, 0, 0, 0.6);
}

.detail-figure {
    border-color: rgba(189, 183, 107, 0.16);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 8px 28px rgba(0, 0, 0, 0.45);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.detail-figure:hover {
    border-color: rgba(189, 183, 107, 0.32);
    box-shadow:
        inset 0 1px 0 var(--inner-highlight),
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 32px rgba(189, 183, 107, 0.1);
}

/* ====================== Feature cards (detail pages) ====================== */

.detail-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 1rem;
}
@media (min-width: 600px) {
    .detail-features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
    .detail-features { grid-template-columns: repeat(3, 1fr); }
}
.feature-card {
    padding: 1.1rem 1.15rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--hairline);
    box-shadow: inset 0 1px 0 var(--inner-highlight);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.feature-card:hover {
    border-color: rgba(189, 183, 107, 0.3);
    background: var(--surface-hover);
}
.feature-card-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.feature-card-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface-strong);
    color: var(--accent);
}
.feature-card-icon svg { width: 16px; height: 16px; }
.feature-card h3,
.feature-card h4 {
    font-size: 0.92rem !important;
    line-height: 1.3 !important;
    color: var(--text) !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
    margin: 0 !important;
    text-transform: none !important;
}
.feature-card p {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
    color: var(--text-dim) !important;
    margin: 0 !important;
}

.detail-features { counter-reset: feat; }
.feature-card { counter-increment: feat; }
.feature-card-head::before {
    content: counter(feat, decimal-leading-zero);
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-glow-soft);
    border: 1px solid var(--accent-glow);
    border-radius: 999px;
    padding: 0.15rem 0.5rem;
    letter-spacing: 0.04em;
    line-height: 1;
}

/* ====================== Reduced motion (additions) ====================== */

@media (prefers-reduced-motion: reduce) {
    .tools-track { animation: none !important; }
}

/* ====================== Utilities ====================== */

.accent { color: var(--accent); }
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
