/* ═══════════════════════════════════════════════════════════
   HILDITCH & KEY — $20K DESIGN SYSTEM
   Velocity Atelier · 2026
   ═══════════════════════════════════════════════════════════ */

:root {
    /* Palette: Jermyn Nocturne */
    --void: #070504;
    --bone: #F2ECE2;
    --muted: #8A8278;
    --gold: #B8996E;
    --gold-dim: rgba(184, 153, 110, 0.15);
    --line: rgba(242, 236, 226, 0.08);
    --line-strong: rgba(242, 236, 226, 0.15);

    /* Type */
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Inter', -apple-system, sans-serif;

    /* Easing */
    --expo-out: cubic-bezier(0.19, 1, 0.22, 1);
    --expo-in-out: cubic-bezier(0.87, 0, 0.13, 1);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    background: var(--void); color: var(--bone);
    font-family: var(--sans); overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    cursor: none;
}
a { text-decoration: none; color: inherit; cursor: none; }
::selection { background: var(--gold); color: var(--void); }

/* ── Canvas Grain ── */
#grain-canvas {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9000; opacity: 0.035;
}

/* ── Mask Utility ── */
.title-mask { overflow: hidden; display: block; }
.title-mask .title-line { display: inline-block; will-change: transform; }

/* ══════════════════════════════════════════
   CUSTOM CURSOR
   ══════════════════════════════════════════ */
.custom-cursor {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 9998;
}
.cursor-dot {
    position: absolute; width: 5px; height: 5px;
    background: var(--gold); border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
}
.cursor-ring {
    position: absolute; width: 44px; height: 44px;
    border: 1px solid rgba(184, 153, 110, 0.35);
    border-radius: 50%; transform: translate(-50%, -50%);
    transition: width 0.5s var(--expo-out), height 0.5s var(--expo-out),
                border-color 0.4s, background 0.4s, opacity 0.3s;
}
.cursor-label {
    position: absolute; transform: translate(-50%, -50%);
    font-size: 0.55rem; letter-spacing: 0.25em; text-transform: uppercase;
    color: var(--void); opacity: 0; transition: opacity 0.3s;
    font-weight: 600;
}

/* States */
.custom-cursor.is-hover .cursor-ring {
    width: 64px; height: 64px;
    border-color: rgba(242, 236, 226, 0.5);
    background: rgba(242, 236, 226, 0.04);
}
.custom-cursor.is-drag .cursor-ring {
    width: 90px; height: 90px;
    background: var(--bone); border-color: transparent;
}
.custom-cursor.is-drag .cursor-dot { opacity: 0; }
.custom-cursor.is-drag .cursor-label { opacity: 1; }

/* ══════════════════════════════════════════
   LOADER
   ══════════════════════════════════════════ */
#loader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--void); z-index: 9500;
    display: flex; align-items: center; justify-content: center;
}
.loader-inner { text-align: center; }
.loader-stitch {
    width: 50vw; max-width: 400px; height: 1px;
    background: rgba(242, 236, 226, 0.06); margin: 0 auto 3rem;
    position: relative; overflow: hidden;
}
.stitch-line {
    position: absolute; top: 0; left: 0;
    width: 0%; height: 100%; background: var(--gold);
}
.loader-brand {
    display: flex; flex-direction: column; gap: 0.75rem; opacity: 0;
}
.lb-main {
    font-family: var(--serif); font-size: 1.5rem; letter-spacing: 0.08em;
}
.lb-sub {
    font-size: 0.6rem; letter-spacing: 0.35em; text-transform: uppercase; color: var(--muted);
}

/* ══════════════════════════════════════════
   VELOCITY TOAST
   ══════════════════════════════════════════ */
#velocity-toast {
    position: fixed; bottom: 2.5rem; left: 50%;
    transform: translateX(-50%) translateY(60px);
    z-index: 9100; pointer-events: none; opacity: 0;
    transition: transform 0.7s var(--expo-out), opacity 0.7s ease;
}
#velocity-toast.active { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast-glass {
    background: rgba(7, 5, 4, 0.92); backdrop-filter: blur(12px);
    border: 1px solid var(--gold); padding: 1rem 2rem;
    display: flex; flex-direction: column; align-items: center; gap: 0.35rem;
}
.toast-accent { font-family: var(--serif); color: var(--gold); font-size: 0.95rem; }
.toast-body { font-size: 0.6rem; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }

/* ══════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════ */
#nav {
    position: fixed; top: 0; left: 0; width: 100%;
    padding: 2rem 3.5rem; display: flex; justify-content: space-between; align-items: center;
    z-index: 5000; mix-blend-mode: difference;
    opacity: 0; /* revealed after loader */
}
.nav-brand { font-family: var(--serif); font-size: 1.4rem; letter-spacing: 0.04em; }
.nav-right { display: flex; gap: 2.5rem; align-items: center; }
.nav-link {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em;
    position: relative; padding: 0.25rem 0;
}
.nav-link::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 100%; height: 1px; background: var(--bone);
    transform: scaleX(0); transform-origin: right; transition: transform 0.5s var(--expo-out);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta {
    border: 1px solid rgba(242, 236, 226, 0.25);
    padding: 0.65rem 1.6rem; border-radius: 40px;
}
.nav-cta::after { display: none; }

/* Magnetic */
.magnetic-el { display: inline-block; position: relative; }
.magnetic-el > span { display: inline-block; pointer-events: none; }

/* ══════════════════════════════════════════
   HORIZONTAL PROGRESS BAR
   ══════════════════════════════════════════ */
#h-progress {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 2px;
    background: var(--line); z-index: 5000; opacity: 0;
    transition: opacity 0.4s;
}
#h-progress.visible { opacity: 1; }
.h-progress-bar { width: 0%; height: 100%; background: var(--gold); }

/* ══════════════════════════════════════════
   1. HERO
   ══════════════════════════════════════════ */
.s-hero {
    min-height: 100vh; padding: 18vh 3.5rem 6rem;
    display: flex; align-items: flex-end;
}
.hero-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 5rem;
    width: 100%; align-items: end;
}
.hero-meta-line {
    font-size: 0.7rem; letter-spacing: 0.25em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 2.5rem; overflow: hidden;
}
.hml-inner { display: inline-block; }
.hero-title {
    font-family: var(--serif); font-size: clamp(5rem, 10vw, 11rem);
    line-height: 0.88; font-weight: 400; letter-spacing: -0.03em;
    margin-bottom: 2.5rem;
}
.hero-body-mask { overflow: hidden; }
.hero-body {
    font-size: 1.15rem; line-height: 1.65; color: var(--muted);
    max-width: 420px; font-weight: 300;
}
.hero-scroll-cue {
    margin-top: 4rem; width: 1px; height: 55px;
    position: relative; overflow: hidden; background: var(--line);
}
.cue-line {
    width: 100%; height: 100%; background: var(--gold);
    animation: cueDrop 2.2s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
@keyframes cueDrop {
    0% { transform: translateY(-100%); }
    50% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

.hero-col-right { position: relative; }
.hero-img-outer { position: relative; height: 72vh; width: 100%; overflow: hidden; }
.hero-img-clip { width: 100%; height: 100%; overflow: hidden; position: relative; }
.hero-img-parallax {
    position: absolute; top: -15%; left: 0; width: 100%; height: 130%;
    background-size: cover; background-position: center;
    filter: brightness(0.65) contrast(1.15) grayscale(0.15);
    will-change: transform;
}
.hero-img-meta {
    display: flex; justify-content: space-between; margin-top: 1.5rem;
    font-size: 0.6rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}

/* ══════════════════════════════════════════
   2. MANIFESTO
   ══════════════════════════════════════════ */
.s-manifesto {
    padding: 20vh 3.5rem; display: flex; justify-content: center;
}
.manifesto-inner { max-width: 1000px; text-align: center; }
.manifesto-text {
    font-family: var(--serif); font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.35; font-weight: 400; font-style: italic;
}
/* Words within split-text will be wrapped by JS */
.manifesto-text .word {
    display: inline-block; white-space: nowrap; overflow: hidden;
    vertical-align: top; margin-right: 0.25em;
}
.manifesto-text .word .char {
    display: inline-block; will-change: transform;
}

/* ══════════════════════════════════════════
   3. HORIZONTAL BLUEPRINT
   ══════════════════════════════════════════ */
.s-horizontal { position: relative; height: 400vh; }
.h-sticky {
    position: sticky; top: 0; width: 100vw; height: 100vh; overflow: hidden;
}
.h-grid-lines {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 1;
}
.hgl { position: absolute; background: var(--line); }
.h-hline { top: 50%; left: 0; width: 0%; height: 1px; }
.h-vline { top: 0; left: 50%; width: 1px; height: 0%; }

.h-track {
    display: flex; height: 100%; width: max-content; align-items: center;
    padding: 0 12vw; gap: 12vw; position: relative; z-index: 10;
}
.h-panel { position: relative; flex-shrink: 0; }
.h-text-panel { width: 420px; }
.h-offset-down { transform: translateY(12vh); }
.h-offset-up { transform: translateY(-12vh); }

.hp-num {
    font-size: 0.8rem; letter-spacing: 0.25em; color: var(--gold);
    display: block; margin-bottom: 1.5rem;
}
.hp-title {
    font-family: var(--serif); font-size: clamp(3rem, 5vw, 4.5rem);
    line-height: 1; font-weight: 400; margin-bottom: 1.5rem;
}
.hp-body { font-size: 1.05rem; line-height: 1.65; color: var(--muted); font-weight: 300; }

.h-img-panel { width: 55vw; height: 65vh; position: relative; }
.h-img-wrap {
    width: 100%; height: 100%; overflow: hidden; position: relative;
    border: 1px solid var(--line);
}
.h-img-inner {
    width: 130%; height: 100%; position: absolute; top: 0; left: -15%;
    background-size: cover; background-position: center;
    filter: grayscale(0.35) contrast(1.1);
    will-change: transform;
}
.h-crosshair {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 50px; height: 50px; pointer-events: none;
}
.cross-h, .cross-v { position: absolute; background: var(--gold); opacity: 0.6; }
.cross-h { top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%); }
.cross-v { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }

/* ══════════════════════════════════════════
   4. NARRATIVE INTERLUDE
   ══════════════════════════════════════════ */
.s-interlude {
    padding: 25vh 3.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.interlude-inner {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8rem;
    max-width: 1300px; margin: 0 auto; align-items: center;
}
.interlude-left { text-align: right; }
.il-num {
    display: block; font-size: 0.7rem; letter-spacing: 0.3em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem;
}
.il-year {
    font-family: var(--serif); font-size: clamp(7rem, 14vw, 12rem);
    line-height: 0.85; font-weight: 400; color: rgba(242, 236, 226, 0.06);
}
.il-text {
    font-size: 1.25rem; line-height: 1.65; color: var(--muted);
    font-weight: 300; max-width: 500px;
}

/* ══════════════════════════════════════════
   5. ARCHIVE
   ══════════════════════════════════════════ */
.s-archive {
    padding: 18vh 3.5rem; max-width: 1400px; margin: 0 auto;
}
.archive-head {
    margin-bottom: 5rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line);
}
.archive-head .title-line {
    font-family: var(--serif); font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 400; line-height: 1.05;
}
.archive-sub { font-size: 1rem; color: var(--muted); margin-top: 1rem; font-weight: 300; }

/* Fluid Cursor Image */
.archive-float-img {
    position: fixed; top: 0; left: 0; width: 380px; height: 240px;
    pointer-events: none; z-index: 100; opacity: 0;
    will-change: transform;
}
.afi-inner {
    width: 100%; height: 100%; background-size: cover; background-position: center;
    filter: brightness(0.55) contrast(1.1) grayscale(0.2);
}

.archive-list { position: relative; z-index: 10; }
.archive-row {
    display: grid; grid-template-columns: 60px 1fr 180px; align-items: center;
    padding: 2.8rem 0; border-bottom: 1px solid var(--line);
    transition: color 0.4s;
}
.ar-num { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.15em; }
.ar-name {
    font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 400; transition: transform 0.5s var(--expo-out), color 0.4s;
}
.ar-price { font-size: 0.8rem; letter-spacing: 0.12em; color: var(--muted); text-align: right; }
.archive-row:hover { color: var(--gold); }
.archive-row:hover .ar-name { transform: translateX(1.5rem); }

/* ══════════════════════════════════════════
   6. PULL QUOTE
   ══════════════════════════════════════════ */
.s-quote {
    padding: 25vh 3.5rem; text-align: center;
    display: flex; flex-direction: column; align-items: center;
}
.quote-text {
    font-family: var(--serif); font-size: clamp(2.5rem, 5vw, 4.5rem);
    line-height: 1.2; font-weight: 400; font-style: italic;
    max-width: 1000px; margin-bottom: 2rem;
}
.quote-text .word { display: inline-block; white-space: nowrap; overflow: hidden; vertical-align: top; margin-right: 0.2em; }
.quote-text .word .char { display: inline-block; will-change: transform; }
.quote-cite {
    font-style: normal; font-size: 0.75rem; letter-spacing: 0.25em;
    text-transform: uppercase; color: var(--gold);
}

/* ══════════════════════════════════════════
   7. LOCATIONS
   ══════════════════════════════════════════ */
.s-locations {
    padding: 15vh 3.5rem; border-top: 1px solid var(--line);
}
.loc-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 4rem;
    max-width: 1200px; margin: 0 auto;
}
.loc-item { display: flex; flex-direction: column; gap: 0.75rem; }
.loc-city {
    font-family: var(--serif); font-size: 2.5rem; font-weight: 400;
}
.loc-address { font-size: 0.85rem; color: var(--muted); font-weight: 300; }
.loc-link {
    font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--gold); position: relative; display: inline-block; width: fit-content;
    padding-bottom: 0.2rem;
}
.loc-link::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 1px;
    background: var(--gold); transform: scaleX(0); transform-origin: right;
    transition: transform 0.4s var(--expo-out);
}
.loc-link:hover::after { transform: scaleX(1); transform-origin: left; }

/* ══════════════════════════════════════════
   8. COLOPHON FOOTER
   ══════════════════════════════════════════ */
.s-footer {
    position: relative; min-height: 90vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; overflow: hidden;
    padding: 6rem 3.5rem;
}
.footer-ghost {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    font-family: var(--serif); font-size: clamp(18rem, 38vw, 32rem);
    color: rgba(242, 236, 226, 0.015); line-height: 0.75; pointer-events: none;
    white-space: nowrap;
}
.footer-core { text-align: center; z-index: 10; position: relative; }
.footer-headline {
    font-family: var(--serif); font-size: clamp(3rem, 5.5vw, 5rem);
    font-weight: 400; margin-bottom: 2.5rem; cursor: none;
}
.footer-email-wrap { margin-bottom: 1rem; }
.footer-email {
    font-size: clamp(1.2rem, 2vw, 1.8rem); position: relative;
    display: inline-block; cursor: none; padding-bottom: 0.4rem;
}
.footer-email::after {
    content: ''; position: absolute; bottom: 0; left: 0;
    width: 100%; height: 1px; background: var(--bone);
    transform: scaleX(0); transform-origin: right;
    transition: transform 0.5s var(--expo-out);
}
.footer-email:hover::after { transform: scaleX(1); transform-origin: left; }
.footer-email-hint {
    display: block; margin-top: 0.5rem;
    font-size: 0.65rem; color: var(--gold); letter-spacing: 0.15em;
    font-style: italic;
}

.footer-colophon {
    position: absolute; bottom: 2rem; left: 3.5rem; right: 3.5rem;
    display: flex; justify-content: space-between;
    font-size: 0.6rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
    opacity: 0.6;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (max-width: 1024px) {
    #nav { padding: 1.5rem 2rem; }
    .nav-right { display: none; }
    .s-hero { padding: 20vh 2rem 4rem; }
    .hero-grid { grid-template-columns: 1fr; gap: 3rem; }
    .hero-img-outer { height: 45vh; }
    .hero-title { font-size: clamp(4rem, 14vw, 7rem); }
    .h-track { padding: 0 6vw; gap: 18vw; }
    .h-text-panel { width: 80vw; }
    .h-img-panel { width: 80vw; height: 45vh; }
    .s-manifesto { padding: 15vh 2rem; }
    .interlude-inner { grid-template-columns: 1fr; gap: 3rem; }
    .interlude-left { text-align: left; }
    .archive-row { grid-template-columns: 40px 1fr; }
    .ar-price { display: none; }
    .loc-grid { grid-template-columns: 1fr; gap: 3rem; }
    .footer-colophon { flex-direction: column; gap: 0.75rem; align-items: center; left: 2rem; right: 2rem; }
}
