/* ============================================================
   Depthia — editorial luxury tokens (deepjudge-inspired)
   ============================================================ */

/* ---------- Self-hosted fonts (no third-party requests, GDPR-clean) ----------
   Originals from Google Fonts but served from this origin so visitor IPs
   are never sent to Google. Run fonts/_download.sh once to populate. */

/* Instrument Serif — latin */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-regular-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Instrument Serif — latin-ext (Polish, German, French, etc.) */
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-regular-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Instrument Serif Italic — latin */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Instrument Serif Italic — latin-ext */
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/instrument-serif-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Inter — latin (variable file, 100–900) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Inter — latin-ext */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

:root {
  /* Colors */
  --bg:          #EDE9E5;  /* warm cream — body */
  --bg-soft:     #E6E0DB;  /* card background */
  --bg-softer:   #F2F0ED;  /* secondary surface */
  --ink:         #1A1A1A;  /* primary text */
  --ink-soft:    #5A554F;  /* muted body */
  --ink-pill:    #242422;  /* nav pill / dark CTA */
  --accent:      #2c1fea;  /* deep blue — used sparingly */
  --accent-soft: #BDD0F9;  /* pale blue (G > R = no lavender cast) */
  --hairline:    #D8D2CB;  /* faint separators */
  --white:       #FFFFFF;

  /* Type */
  --font-serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans:  "Inter", system-ui, Arial, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, monospace;

  /* Scale */
  --h1:    clamp(56px, 8vw, 104px);
  --h2:    clamp(38px, 5vw, 64px);
  --h3:    28px;
  --body:  17px;
  --label: 12px;

  /* Layout */
  --maxw: 1280px;
  --pad:  clamp(24px, 6vw, 96px);
  --gap-section: clamp(96px, 14vw, 200px);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--body);
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* visible focus ring in accent */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- shared ---------- */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad); }

.serif  { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.01em; }
.mono   { font-family: var(--font-mono); }

/* section marker: ● LABEL */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  margin: 0;
}
.eyebrow::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.section { padding-block: var(--gap-section); }
.section-head { max-width: 760px; }
.section-head .h2 { margin: 22px 0 0; }

.h1 { font-family: var(--font-serif); font-weight: 400; font-size: var(--h1); line-height: 0.98; letter-spacing: -0.02em; margin: 0; }
.h2 { font-family: var(--font-serif); font-weight: 400; font-size: var(--h2); line-height: 1.02; letter-spacing: -0.015em; margin: 0; }
.h3 { font-family: var(--font-serif); font-weight: 400; font-size: var(--h3); line-height: 1.1; margin: 0; }
em.flow { font-style: italic; color: var(--accent); }

/* ---------- pill buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55em;
  font-family: var(--font-sans); font-size: 15px; font-weight: 500;
  padding: 14px 24px; border-radius: 999px; border: 0; cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
  white-space: nowrap;
}
.btn-dark  { background: var(--ink-pill); color: #fff; }
.btn-dark:hover  { background: #000; transform: translateY(-1px); }
.btn-dark:active { transform: translateY(0) scale(.985); }
.btn-light { background: var(--white); color: var(--ink); }
.btn-light:hover { transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); padding-inline: 4px; }
.btn-ghost .arrow { transition: transform .2s ease; }
.btn-ghost:hover .arrow { transform: translateX(4px); }

/* ============================================================
   NAV — floating pill
   ============================================================ */
.nav-wrap {
  position: fixed; top: 18px; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: center; padding-inline: 16px;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--ink-pill); color: #fff;
  border-radius: 999px;
  padding: 8px 8px 8px 22px;
  box-shadow: 0 6px 30px rgba(20,18,16,0.14);
  max-width: calc(var(--maxw) - 32px); width: 100%;
}
.nav .brand { font-family: var(--font-serif); font-size: 22px; letter-spacing: -0.01em; margin-right: auto; }
.nav .brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  font-size: 13.5px; color: rgba(255,255,255,.74);
  padding: 9px 14px; border-radius: 999px; transition: color .15s, background .15s;
}
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav .nav-cta { background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 500; padding: 10px 18px; border-radius: 999px; transition: transform .15s; white-space: nowrap; flex: none; }
.nav .nav-cta:hover { transform: translateY(-1px); }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav { padding-left: 20px; }
}

/* ============================================================
   HERO
   ============================================================ */
.hero { padding-top: clamp(108px, 14vw, 140px); padding-bottom: clamp(80px, 12vw, 150px); position: relative; overflow: hidden; }
.hero-text { max-width: var(--maxw); }
.hero .h1 { max-width: 14ch; }
.hero-sub { max-width: 520px; color: var(--ink-soft); font-size: 18px; margin: 0 0 36px; }
.hero-cta { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero-eyebrow { margin-bottom: 34px; }

/* --- Depth bars (barcode-style, deepjudge-inspired) -----------------
   Two stacked rows of full-height vertical bars.
   Solid colours only — black + blue, mixed. Width is the only variable.
   The rhythm of widths + the colour mix is what carries the composition.
------------------------------------------------------------------- */
.depth-band {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  /* Sits inline between h1 and sub-copy — balanced top/bottom rhythm */
  margin-top: clamp(40px, 6vw, 72px);
  margin-bottom: clamp(40px, 6vw, 72px);
  /* 25% shorter than before: previous clamp(300, 38vw, 460) */
  height: clamp(225px, 28.5vw, 345px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.depth-row {
  flex: 1;
  display: flex;
  align-items: stretch;
  overflow: hidden;          /* clip the marquee track inside */
  min-width: 0;
}

/* The marquee track holds 2× cloned bars and scrolls horizontally.
   When it reaches -50% the clones land exactly where the originals were —
   seamless loop. Each row drifts at a different rate and direction.
   No inline padding: bars run edge-to-edge so the row always looks full. */
.bars-track {
  flex: 0 0 auto;            /* keep natural (max-content) width */
  display: flex;
  align-items: stretch;
  gap: clamp(5px, 0.72vw, 12px);   /* +50% wider again */
  height: 100%;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  will-change: transform;
}

.depth-row:nth-child(1) .bars-track { animation-name: marqueeRight; animation-duration: 772s; animation-delay:    0s; }   /* +75% slower */
.depth-row:nth-child(2) .bars-track { animation-name: marqueeLeft;  animation-duration: 938s; animation-delay: -305s; }
.depth-row:nth-child(3) .bars-track { animation-name: marqueeRight; animation-duration: 644s; animation-delay: -189s; }

@keyframes marqueeRight {
  from { transform: translateX(-50%); }   /* clones at left */
  to   { transform: translateX(0);    }   /* originals at left  ⇒ bars appear to move RIGHT */
}
@keyframes marqueeLeft {
  from { transform: translateX(0);    }
  to   { transform: translateX(-50%); }   /* bars appear to move LEFT */
}

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

.depth-row .bar {
  --sx: 1;             /* horizontal scale — bumped on hover for the second layer */
  --tr-dur: .9s;       /* slow during draw-in; switched to .22s after sweep */
  flex: 0 0 auto;
  height: 100%;
  background: var(--ink);
  border-radius: 1px;
  transform: scaleX(var(--sx)) scaleY(0);
  transform-origin: center bottom;
  transition:
    transform var(--tr-dur) cubic-bezier(.2, .7, .2, 1),
    background-color .45s ease;
  will-change: transform, background-color;
}

/* Layered states (source order = priority chain):
   - is-ambient : slow autoplay drift (colour only)
   - is-blue  : statically blue from build (rare, decorative)
   - is-near    : mouse spotlight (colour + scaleX boost)  ← second layer wins
*/
.depth-row .bar.is-ambient { background: var(--accent); }
.depth-row .bar.is-blue  { background: var(--accent); }
.depth-row .bar.is-near    { background: var(--accent); --sx: 1.9; }

.depth-band.is-in      .depth-row .bar { transform: scaleX(var(--sx)) scaleY(1); }
.depth-band.is-settled .depth-row .bar { --tr-dur: .22s; }   /* snappy after draw-in */

@media (max-width: 760px) {
  .depth-band {
    height: clamp(165px, 45vw, 270px);   /* 25% shorter */
    margin-top: 32px;
    margin-bottom: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .depth-row .bar {
    transform: scaleX(var(--sx)) scaleY(1);
    transition: background-color .35s ease;
  }
}

/* ============================================================
   SERVICES
   ============================================================ */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 64px; }
.card {
  background: var(--bg-soft); border-radius: 24px;
  padding: 40px 36px 44px; display: flex; flex-direction: column; gap: 16px;
  min-height: 280px;
}
.card .num { font-family: var(--font-mono); font-size: 13px; color: var(--ink-soft); letter-spacing: 0.04em; }
.card .h3 { margin-top: 6px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 16px; max-width: 32ch; }
@media (max-width: 860px) { .cards-3 { grid-template-columns: 1fr; } }

/* ============================================================
   SELECTED WORK
   ============================================================ */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 56px; background: var(--hairline); border-radius: 24px; overflow: hidden; }
.work-item {
  background: var(--bg); padding: 34px 32px 30px;
  display: flex; flex-direction: column; gap: 12px; min-height: 220px;
  transition: background .2s ease;
  position: relative;
}
.work-item:hover { background: var(--bg-softer); }
.work-item .cat { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); }
.work-item .name { font-family: var(--font-serif); font-size: 30px; line-height: 1.04; }
.work-item .desc { color: var(--ink-soft); font-size: 15px; margin: 0; max-width: 30ch; }
.work-item .go {
  margin-top: auto; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink);
  opacity: 0; transform: translateY(4px); transition: opacity .2s ease, transform .2s ease;
}
.work-item:hover .go { opacity: 1; transform: translateY(0); }
.work-item .go .arrow { transition: transform .2s ease; }
.work-item:hover .go .arrow { transform: translateX(3px); }
.work-item.soon { color: var(--ink-soft); }
.work-item.soon .name { color: var(--ink-soft); }
@media (max-width: 860px) { .work-grid { grid-template-columns: 1fr; } }

/* ============================================================
   NUMBERS
   ============================================================ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 60px; }
.stat { background: var(--bg-soft); border-radius: 24px; padding: 36px 32px 34px; display: flex; flex-direction: column; gap: 14px; }
.stat .figure { font-family: var(--font-serif); font-size: clamp(56px, 6vw, 80px); line-height: 0.9; letter-spacing: -0.02em; display: flex; align-items: flex-start; }
.stat .figure sup { font-family: var(--font-mono); font-size: 0.22em; font-weight: 500; letter-spacing: 0.04em; color: var(--accent); margin-left: 4px; margin-top: 0.55em; }
.stat .stat-label { color: var(--ink-soft); font-size: 15px; max-width: 26ch; }
@media (max-width: 960px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }

/* ============================================================
   CONTACT — inverted block on accent background
   ------------------------------------------------------------
   WCAG contrast on #2c1fea:
     #FFFFFF     → 8.43:1   AAA pass everywhere
     #BDD0F9     → 5.43:1   AA pass  (decorative links only)
   Primary text uses solid white. Hierarchy comes from
   typography (size/weight/case), not opacity.
   ============================================================ */
.contact-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(40px, 7vw, 110px); margin-top: 22px; align-items: start; }
.contact-lead { font-size: 18px; color: var(--ink-soft); max-width: 42ch; margin: 0 0 32px; }

/* Editorial mailto link (replaces the contact form) */
.contact-mailto {
  display: inline-flex; align-items: baseline; gap: 10px;
  font-family: var(--font-serif);
  font-size: clamp(21px, 3.1vw, 36px);   /* 30% smaller */
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 4px 0 18px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 7px;
  transition: text-underline-offset .2s ease, color .15s ease;
}
.contact-mailto .arrow {
  font-family: var(--font-sans);
  font-size: 0.5em;
  display: inline-block;
  transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.contact-mailto:hover { text-underline-offset: 10px; }
.contact-mailto:hover .arrow { transform: translate(3px, -3px); }

.contact-note { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; color: var(--ink-soft); margin: 16px 0 0; }

.contact-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; }
.contact-card dt { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-soft); padding-top: 2px; }
.contact-card dd { margin: 0; font-size: 16px; line-height: 1.55; }
.contact-card dd a { border-bottom: 1px solid var(--hairline); transition: border-color .15s; }
.contact-card dd a:hover { border-color: var(--accent); }
.contact-card .maplink { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); border: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; margin-top: 4px; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; gap: 48px; } }

/* ---- Inverted overrides for #contact ---- */
#contact {
  position: relative;
  color: #fff;
  isolation: isolate;
}
/* Full-bleed accent background — extends edge-to-edge while content
   stays inside the container's max-width */
#contact::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; width: 100vw; margin-left: -50vw;
  background: var(--accent);
  z-index: -1;
}

#contact .eyebrow,
#contact .h2,
#contact .contact-lead { color: #fff; }   /* 8.43:1  AAA */

#contact .contact-mailto { color: #fff; text-decoration-color: rgba(255,255,255,0.5); }
#contact .contact-mailto:hover { text-decoration-color: #fff; }
#contact .contact-note { color: #fff; opacity: 0.78; }  /* AA — small mono label */

#contact .contact-card dt {
  color: #fff;
  opacity: 0.78;                          /* ~5.6:1  still AA, AAA for large */
}
#contact .contact-card dd { color: #fff; }
#contact .contact-card dd a {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.45);
}
#contact .contact-card dd a:hover { border-bottom-color: #fff; }
#contact .contact-card .maplink   { color: var(--accent-soft); }  /* 5.43:1 AA */
#contact .contact-card .maplink:hover { color: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--ink-pill); color: rgba(255,255,255,.7); }
.footer .row { display: flex; align-items: center; gap: 32px; padding-block: 44px; flex-wrap: wrap; }
.footer .f-brand { font-family: var(--font-serif); font-size: 24px; color: #fff; }
.footer .f-brand .dot { color: var(--accent); }
.footer .f-tag { font-size: 13px; margin-left: 14px; }
.footer .f-nav { display: flex; gap: 22px; margin-inline: auto; }
.footer .f-nav a { font-size: 13.5px; transition: color .15s; }
.footer .f-nav a:hover { color: #fff; }
.footer .f-legal { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.03em; color: rgba(255,255,255,.5); text-align: right; }
@media (max-width: 760px) {
  .footer .row { flex-direction: column; align-items: flex-start; gap: 22px; }
  .footer .f-nav { margin-inline: 0; }
  .footer .f-legal { text-align: left; }
}

/* ============================================================
   MOTION — fade up on scroll
   ============================================================ */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s cubic-bezier(.2,.6,.2,1), transform .6s cubic-bezier(.2,.6,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
