/* ============================================================================
   BD MEDIA — base.css
   Direction: Dark Instrument + stretched grotesk display.
   The entire palette pivots on ONE token: --accent. Swap it, reskin the site.
   ========================================================================== */

/* ---- self-hosted fonts (no third-party calls; subset to Latin + used punctuation) ---- */
@font-face {
  font-family: "Archivo";
  src: url("/assets/fonts/Archivo-var.woff2") format("woff2");
  font-weight: 100 900;          /* variable weight */
  font-stretch: 62% 125%;        /* variable width → expanded display via font-stretch:125% */
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/assets/fonts/SpaceMono-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("/assets/fonts/SpaceMono-Bold.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ---- tokens --------------------------------------------------------------- */
:root {
  /* surfaces */
  --bg:          #0B0C0E;
  --bg-raise:    #131418;
  --bg-raise-2:  #1A1C20;

  /* ink */
  --ink:         #ECE9E3;            /* 16.2:1 on --bg */
  --ink-dim:     #9A968D;            /* 6.6:1  — secondary body/caption text */
  --ink-faint:   #8B867D;            /* 5.0:1  — small mono labels (must stay AA) */
  --ink-ghost:   #5C5851;            /* sub-AA: decoration only, never text meaning */

  /* hairlines */
  --hair:        rgba(236, 233, 227, 0.10);
  --hair-2:      rgba(236, 233, 227, 0.20);

  /* accent — the single scalpel. Swappable. (default: electric cobalt) */
  --accent:      #2F5BFF;            /* marks, rules, fills, LARGE display only (3.8:1) */
  --accent-text: #6E8BFF;            /* the accent for SMALL text — AA at ~6:1 on --bg.
                                        if you change --accent to a light hue, set this to
                                        a same-family value that clears 4.5:1 on near-black */
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --accent-ink:  #FFFFFF;            /* text that sits ON the accent */

  /* the motion field reads these */
  --field-ink:   var(--accent);
  --field-bg:    var(--bg);

  /* type */
  --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-exp:  "Archivo", system-ui, sans-serif;   /* expanded via font-stretch:125% (see below) */
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* rhythm */
  --wrap:   1280px;
  --gutter: clamp(20px, 5vw, 64px);
  --section-y: clamp(88px, 13vh, 188px);

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur:  0.7s;
}

/* ---- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.62;
  font-weight: 400;
  letter-spacing: 0.002em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; }

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

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

.skip {
  position: fixed; top: -120%; left: 16px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: 10px 16px; border-radius: 6px; font: 600 0.9rem var(--font-sans);
}
.skip:focus { top: 16px; }

/* ---- layout --------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); position: relative; }
.section + .section { border-top: 1px solid var(--hair); }

.section__head { margin-bottom: clamp(28px, 4vw, 56px); }

/* ---- shared type ---------------------------------------------------------- */
.mono-meta,
.index-label,
.eyebrow {
  font-family: var(--font-mono);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--ink-faint);
}
.index-label { color: var(--ink-dim); }

/* the expanded display register — variable Archivo pushed to wdth 125% */
.hero__title, .contact__title, .statement,
.specimen__name, .specimen__line, .principle__body h3 {
  font-stretch: 125%;
}

/* the editorial "statement" lines */
.statement {
  font-family: var(--font-exp);
  font-weight: 600;
  font-size: clamp(1.65rem, 1rem + 2.9vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  max-width: 18ch;
  color: var(--ink);
}
.statement em { color: var(--accent); }   /* the punchline carries the accent (large text → AA) */

/* ---- nav ------------------------------------------------------------------ */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  padding-block: 18px;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease), padding 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in oklab, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom-color: var(--hair);
  padding-block: 12px;
}
.nav__row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-weight: 700;
  letter-spacing: 0.16em; font-size: 0.82rem; color: var(--ink);
  padding-block: 6px;            /* ≥34px touch target */
}
.wordmark__mark { color: var(--ink); flex: none; }
.wordmark__dot { fill: var(--accent); }
.wordmark__text { white-space: nowrap; }
/* ≥44×44 hit area for the home link without enlarging the visual mark */
.nav .wordmark { position: relative; }
.nav .wordmark::before {
  content: ""; position: absolute; top: 50%; left: 0;
  width: 100%; min-width: 44px; height: 44px; transform: translateY(-50%);
}

.nav__links { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav__links a {
  font-family: var(--font-mono); font-size: 0.78rem;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-dim);
  position: relative; padding-block: 4px;
  transition: color 0.25s var(--ease);
}
/* invisible ≥44×44 hit expander — keeps the visual link compact (AAA target) */
.nav__links a::before {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 100%; min-width: 44px; height: 44px; transform: translate(-50%, -50%);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.32s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

/* ---- hero ----------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 96px;
  overflow: clip;
}
.hero__field {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
  --field-ink: var(--accent);
  --field-bg: var(--bg);
  /* vignette so the type stays the focus */
  -webkit-mask-image: radial-gradient(120% 90% at 60% 38%, #000 38%, transparent 86%);
          mask-image: radial-gradient(120% 90% at 60% 38%, #000 38%, transparent 86%);
  opacity: 0.9;
}
.hero__inner { position: relative; z-index: 1; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 12px; margin-bottom: clamp(22px, 4vh, 40px); }
.eyebrow__tick {
  width: 7px; height: 7px; background: var(--accent); border-radius: 1px;
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: pulse 3.2s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .eyebrow__tick { animation: none; } }

.hero__title {
  font-family: var(--font-exp);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.3rem, 0.4rem + 10vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.018em;
  margin-bottom: clamp(26px, 4vh, 44px);
  color: var(--ink);
}
.hero__title .line { display: block; }
.hero__title em { color: var(--accent); }

.hero__lead {
  max-width: 46ch;
  font-size: clamp(1.05rem, 0.98rem + 0.5vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-dim);
}

.hero__actions {
  margin-top: clamp(30px, 5vh, 52px);
  display: flex; align-items: center; gap: clamp(20px, 4vw, 40px); flex-wrap: wrap;
}

.hero__foot {
  position: relative; z-index: 1;
  margin-top: clamp(40px, 8vh, 96px);
  display: flex; justify-content: space-between; gap: 16px;
  border-top: 1px solid var(--hair); padding-top: 16px;
}
.hero__scroll { color: var(--ink-dim); }
.hero__scroll span { display: inline-block; animation: nudge 2.4s var(--ease) infinite; }
@keyframes nudge { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .hero__scroll span { animation: none; } }

/* ---- buttons / links ------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 0.82rem; font-weight: 700;
  color: var(--bg); background: var(--ink);
  padding: 15px 24px; border-radius: 100px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
  will-change: transform;
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.btn__arrow { transition: transform 0.3s var(--ease); }
.btn:hover .btn__arrow { transform: translateY(3px); }

.link-mono {
  font-family: var(--font-mono); font-size: 0.84rem;
  letter-spacing: 0.04em; color: var(--ink-dim);
  border-bottom: 1px solid var(--hair-2); padding-bottom: 3px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.link-mono:hover { color: var(--ink); border-color: var(--accent); }

/* ---- ethos ---------------------------------------------------------------- */
.ethos .statement { margin-bottom: clamp(48px, 7vw, 92px); max-width: 22ch; }

.principles { list-style: none; padding: 0; }
.principle {
  display: grid;
  grid-template-columns: minmax(56px, 0.6fr) minmax(0, 4fr);
  gap: clamp(16px, 4vw, 56px);
  padding-block: clamp(26px, 3.4vw, 40px);
  border-top: 1px solid var(--hair);
  align-items: start;
}
.principle:last-child { border-bottom: 1px solid var(--hair); }
.principle__no {
  font-family: var(--font-mono); font-size: 0.82rem; color: var(--accent-text);
  letter-spacing: 0.1em; padding-top: 0.5em;
}
.principle__body { max-width: 62ch; }
.principle__body h3 {
  font-family: var(--font-exp); font-weight: 600;
  font-size: clamp(1.35rem, 1rem + 1.4vw, 2rem);
  letter-spacing: -0.01em; line-height: 1.1; margin-bottom: 12px;
}
.principle__body p { color: var(--ink-dim); max-width: 56ch; }

/* ---- work / specimen ------------------------------------------------------ */
.specimen {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
}
.specimen__frame { position: relative; }
.phone {
  position: relative;
  border: 1px solid var(--hair-2);
  border-radius: 28px;
  background: var(--bg-raise);
  padding: 10px;
  overflow: hidden;
  max-width: 340px;
  margin-inline: auto;
  box-shadow: 0 40px 120px -50px rgba(0,0,0,0.8);
}
.phone::after { /* hairline inner ring */
  content: ""; position: absolute; inset: 10px; border-radius: 20px;
  box-shadow: inset 0 0 0 1px var(--hair); pointer-events: none;
}
.phone img { border-radius: 20px; width: 100%; }
.phone__tag { display: block; text-align: center; margin-top: 16px; }

.specimen__head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.specimen__name {
  font-family: var(--font-exp); font-weight: 700; text-transform: uppercase;
  font-size: clamp(2.2rem, 1rem + 4vw, 4rem); letter-spacing: -0.02em; line-height: 1;
}
.badge {
  font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--accent-text);
  border: 1px solid var(--accent); border-radius: 100px; padding: 5px 11px;
  white-space: nowrap;
}
.specimen__line {
  font-family: var(--font-exp); font-weight: 600;
  font-size: clamp(1.1rem, 0.9rem + 0.9vw, 1.55rem); line-height: 1.25;
  margin-bottom: 18px; max-width: 28ch;
}
.specimen__body { color: var(--ink-dim); max-width: 50ch; margin-bottom: 30px; }

.spec-meta {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 1px; background: var(--hair); border: 1px solid var(--hair);
}
.spec-meta > div { background: var(--bg); padding: 16px 18px; }
.spec-meta dt {
  font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase;
  letter-spacing: 0.16em; color: var(--ink-faint); margin-bottom: 6px;
}
.spec-meta dd { font-size: 0.96rem; color: var(--ink); }
.spec-meta dd.is-accent { color: var(--accent-text); }

.workshop-note {
  display: grid; grid-template-columns: minmax(56px, 0.6fr) minmax(0, 4fr);
  gap: clamp(16px, 4vw, 56px);
  margin-top: clamp(48px, 7vw, 96px); padding-top: clamp(26px, 3vw, 40px);
  border-top: 1px solid var(--hair); align-items: baseline;
}
.workshop-note > span:last-child { color: var(--ink-dim); max-width: 56ch; font-size: 1.05rem; }

/* ---- approach ------------------------------------------------------------- */
.approach .statement { margin-bottom: 28px; }
.approach__body { color: var(--ink-dim); max-width: 62ch; font-size: clamp(1.02rem, 0.97rem + 0.4vw, 1.2rem); }

.facts {
  list-style: none; padding: 0; margin-top: clamp(44px, 6vw, 80px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--hair); border: 1px solid var(--hair);
}
.fact { background: var(--bg); padding: clamp(22px, 2.4vw, 32px); display: flex; flex-direction: column; gap: 12px; }
.fact__k { color: var(--accent-text); }
.fact__v { color: var(--ink-dim); }

/* ---- contact -------------------------------------------------------------- */
.contact { text-align: left; }
.contact__inner { display: flex; flex-direction: column; }
.contact__title {
  font-family: var(--font-exp); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.4rem, 0.5rem + 8.5vw, 8rem); line-height: 0.92; letter-spacing: -0.02em;
  margin-block: clamp(20px, 3vw, 36px) clamp(14px, 2vw, 22px);
}
.contact__sub {
  color: var(--ink-dim); max-width: 40ch;
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.18rem);
  margin-bottom: clamp(30px, 5vw, 56px);
}
.contact__email {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.05rem, 0.8rem + 1.8vw, 2.2rem); letter-spacing: 0.01em;
  color: var(--accent-text); width: max-content; max-width: 100%;
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 6px; transition: border-color 0.3s var(--ease);
  word-break: break-word;
}
.contact__email:hover { border-color: var(--accent); }

/* ---- footer --------------------------------------------------------------- */
.footer { border-top: 1px solid var(--hair); padding-block: 28px; }
.footer__row { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.wordmark--foot .wordmark__text { color: var(--ink-dim); }

/* ---- cursor follower ------------------------------------------------------ */
.cursor {
  position: fixed; top: 0; left: 0; z-index: 300; pointer-events: none;
  width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0; transform: translate3d(-100px, -100px, 0);  /* translate+scale composed in ui.js */
  transition: opacity 0.3s var(--ease), background 0.25s var(--ease);
  mix-blend-mode: screen;
}
body.has-cursor .cursor { opacity: 1; }
body.has-cursor.cursor-hot .cursor { background: var(--accent-soft); }

/* ---- reveal --------------------------------------------------------------- */
/* Content is VISIBLE by default. Only once the inline head script confirms motion
   is OK (sets html.motion-ok before first paint) do reveal elements start hidden
   and animate in. No-JS or reduced-motion → nothing is ever hidden. */
.motion-ok [data-reveal] {
  opacity: 0; transform: translateY(16px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  will-change: opacity, transform;
}
.motion-ok [data-reveal].is-in { opacity: 1; transform: none; will-change: auto; }

/* ---- responsive ----------------------------------------------------------- */
@media (max-width: 880px) {
  .specimen { grid-template-columns: 1fr; gap: 40px; }
  .specimen__frame { order: -1; }
  .facts { grid-template-columns: 1fr; }
  .principle { grid-template-columns: 1fr; gap: 8px; }
  .principle__no { padding-top: 0; }
  .workshop-note { grid-template-columns: 1fr; gap: 10px; }
  .spec-meta { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .nav__links { gap: 16px; }
  .nav__links a { font-size: 0.7rem; letter-spacing: 0.1em; }
  .wordmark__text { font-size: 0.78rem; }
  .hero__foot { flex-wrap: wrap; gap: 10px; }
  .hero__foot .mono-meta:nth-child(2) { order: 3; }
  .spec-meta { grid-template-columns: 1fr; }
  .footer__row { justify-content: flex-start; }
}
@media (max-width: 400px) {
  /* keep the mark, drop ONLY the header wordmark text so nav never overflows
     (scoped to .nav so the footer brand stays visible) */
  .nav .wordmark__text { display: none; }
  .nav__links { gap: 14px; }
  .nav__links a { font-size: 0.66rem; letter-spacing: 0.08em; }
  .hero__title em { display: inline-block; }   /* let "care." drop to its own line cleanly */
}

/* respect explicit reduced-motion at the system level too */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .nav, .nav__links a::after { transition: none; }
}
