/* VOCIS — Cinematic. Ink Navy and Sand.
   Palette is fixed: use the tokens below and nothing else. */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 300 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Hanken Grotesk";
  src: url("/assets/fonts/hanken-grotesk.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --deep: #1C2735;
  --on-deep: #E7DBC4;
  --slate: #5E7183;
  --sand: #D8C5A4;
  --linen: #E8DFCF;
  --bone: #F4EEE4;
  --brass: #A89266;

  /* Glow stops (hero field) */
  --glow-1: #1C2735;
  --glow-2: #2D3E52;
  --glow-3: #8D7B62;
  --glow-4: #D8C5A4;

  /* Derived from the palette */
  --text: var(--on-deep);
  --text-soft: color-mix(in srgb, var(--on-deep) 80%, var(--deep));
  --hair: color-mix(in srgb, var(--brass) 55%, var(--deep));
  --hair-quiet: color-mix(in srgb, var(--slate) 55%, var(--deep));

  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-slow: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 5vw, 64px);
  --nav-h: 64px;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--deep);
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--deep);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(15px, 0.3vw + 14.25px, 18px);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  overflow-x: hidden;
}

/* Film grain: felt, not seen */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 200px 200px;
  opacity: 0.045;
  mix-blend-mode: soft-light;
}

::selection { background: var(--sand); color: var(--deep); }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 1px solid var(--brass);
  outline-offset: 5px;
  border-radius: 1px;
}

p, h1, h2, h3, dl, dd, ol { margin: 0; }

/* ---------- Atoms ---------- */

.wm {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.36em;
  padding-left: 0.36em; /* optical centring */
  line-height: 1;
  white-space: nowrap;
}

.label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.display {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(36px, 4.6vw + 12px, 72px);
  line-height: 1.04;
  letter-spacing: -0.005em;
  text-wrap: balance;
  color: var(--text);
}

.foil {
  background: linear-gradient(100deg, var(--brass) 0%, var(--sand) 42%, var(--brass) 58%, var(--sand) 78%, var(--brass) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.skip {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 60;
  padding: 10px 14px;
  background: var(--on-deep);
  color: var(--deep);
  font: 600 12px/1 var(--sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip:focus { transform: none; }

main:focus { outline: none; }
.nowrap { white-space: nowrap; }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  height: calc(var(--nav-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  transition: background-color 0.6s var(--ease), border-color 0.6s var(--ease), opacity 1s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--deep) 92%, transparent);
  border-bottom-color: var(--hair);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.nav__inner {
  height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-left, 0px)) 0 max(var(--gutter), env(safe-area-inset-right, 0px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav__mark {
  font-size: 15px;
  padding-left: 0;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.nav.is-past .nav__mark,
.nav__mark:focus-visible { opacity: 1; }
html:not(.js) .nav__mark { opacity: 1; }
.nav__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: clamp(18px, 3.4vw, 44px);
}
.nav__links a {
  display: inline-block;
  padding: 12px 0;
  font: 600 11px/1 var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-soft);
  position: relative;
  transition: color 0.3s var(--ease);
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0.24em;
  bottom: 6px;
  height: 1px;
  background: var(--brass);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.nav__links a:hover,
.nav__links a.is-current { color: var(--text); }
.nav__links a:hover::after,
.nav__links a.is-current::after { transform: scaleX(1); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  /* No-JS fallback: a still, intentional field */
  background:
    radial-gradient(ellipse 55% 50% at 96% 98%, color-mix(in srgb, var(--glow-3) 24%, transparent) 0%, transparent 100%),
    radial-gradient(ellipse 50% 45% at 30% 34%, color-mix(in srgb, var(--glow-2) 70%, transparent) 0%, transparent 100%),
    radial-gradient(ellipse 45% 42% at 72% 56%, color-mix(in srgb, var(--glow-2) 55%, transparent) 0%, transparent 100%),
    radial-gradient(ellipse 45% 30% at 52% 88%, color-mix(in srgb, var(--glow-2) 45%, transparent) 0%, transparent 100%),
    var(--glow-1);
}
.js .hero { background: var(--glow-1); }

.hero__field {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  z-index: -2;
  display: block;
}
.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 110% 85% at 50% 48%, transparent 50%, color-mix(in srgb, var(--deep) 75%, transparent) 100%),
    linear-gradient(to bottom, transparent 88%, var(--deep) 100%);
}

.hero__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 var(--gutter);
  margin-top: -4vh;
}
.hero__mark {
  margin: 0;
  font-size: clamp(54px, 11vw + 8px, 176px);
  color: var(--on-deep);
}
.hero__line {
  margin-top: clamp(22px, 3vw, 36px);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(20px, 1.4vw + 14px, 32px);
  line-height: 1.25;
  color: var(--text);
  text-wrap: balance;
}
.hero__focus {
  margin-top: clamp(26px, 3.4vw, 44px);
  color: var(--sand);
  text-wrap: balance;
}
.hero__coords {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: color-mix(in srgb, var(--on-deep) 70%, var(--deep));
  padding: 0 var(--gutter);
}

/* Load sequence: light rises (canvas), then mark, line, focus, coords, nav. Runs once. */
.js .hero__mark,
.js .hero__line,
.js .hero__focus,
.js .hero__coords,
.js .nav { opacity: 0; }
.js .hero__mark { letter-spacing: 0.5em; padding-left: 0.5em; filter: blur(8px); }
.js .hero__line,
.js .hero__focus { transform: translateY(10px); }

.is-ready .hero__mark {
  opacity: 1;
  letter-spacing: 0.36em;
  padding-left: 0.36em;
  filter: blur(0);
  transition:
    opacity 1.6s var(--ease) 0.7s,
    filter 1.6s var(--ease) 0.7s,
    letter-spacing 2.4s var(--ease-slow) 0.7s,
    padding-left 2.4s var(--ease-slow) 0.7s;
}
.is-ready .hero__line {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s var(--ease) 1.6s, transform 1.2s var(--ease) 1.6s;
}
.is-ready .hero__focus {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s var(--ease) 1.9s, transform 1.2s var(--ease) 1.9s;
}
.is-ready .hero__coords {
  opacity: 1;
  transition: opacity 1.4s var(--ease) 2.2s;
}
.is-ready .nav {
  opacity: 1;
  transition: opacity 1.2s var(--ease) 2.3s, background-color 0.6s var(--ease), border-color 0.6s var(--ease);
}
.is-settled .nav { transition: background-color 0.6s var(--ease), border-color 0.6s var(--ease); }

/* ---------- Chapters ---------- */

main { position: relative; }

.chapter {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(112px, 22vh, 240px) var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  isolation: isolate;
}
.chapter::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--hair);
}

.chapter__index {
  display: flex;
  align-items: baseline;
  gap: 14px;
  color: var(--brass);
}
.chapter__index .label { color: var(--brass); }

.chapter__body {
  display: flex;
  flex-direction: column;
  gap: 1.35em;
  max-width: 62ch;
}
.chapter__body > .display { margin-bottom: 0.35em; max-width: 18ch; }
.chapter__body > .chapter__body > p { color: var(--text-soft); max-width: 58ch; }
.chapter__body > .lede {
  color: var(--text);
  font-size: 1.12em;
  line-height: 1.6;
  max-width: 46ch;
}

@media (min-width: 900px) {
  .chapter {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
  }
  .chapter__index {
    flex-direction: column;
    gap: 10px;
    align-self: start;
    padding-top: 0.9em;
  }
  .chapter__body { max-width: 760px; }
}

/* Approach: a faint, slow echo of the hero light */
/* Full-bleed so the glow is never clipped, with the same content column as the other chapters. */
.chapter--approach {
  --edge: max(var(--gutter), calc((100% - 1240px) / 2 + var(--gutter)));
  max-width: none;
  overflow: hidden;
  padding-left: var(--edge);
  padding-right: var(--edge);
}
.chapter--approach::before { left: var(--edge); right: var(--edge); }
.chapter--approach > .chapter__index,
.chapter--approach > .chapter__body { position: relative; }
.echo {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.echo::before {
  content: "";
  position: absolute;
  width: 120vmax;
  height: 120vmax;
  left: 50%;
  top: 50%;
  margin: -60vmax 0 0 -60vmax;
  background:
    radial-gradient(circle at 62% 58%, color-mix(in srgb, var(--glow-3) 22%, transparent) 0%, transparent 32%),
    radial-gradient(circle at 40% 44%, color-mix(in srgb, var(--glow-2) 70%, transparent) 0%, transparent 46%);
  filter: blur(40px);
  animation: drift 48s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate3d(-6%, 3%, 0) rotate(0deg) scale(1); }
  50%  { transform: translate3d(4%, -2%, 0) rotate(8deg) scale(1.06); }
  100% { transform: translate3d(7%, 4%, 0) rotate(-4deg) scale(0.98); }
}

/* Principles */
.principles {
  list-style: none;
  padding: 0;
  margin-top: 2.2em;
  border-bottom: 1px solid var(--hair-quiet);
}
.principles li {
  padding: 28px 0;
  border-top: 1px solid var(--hair-quiet);
}
.principles h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 1.2vw + 18px, 32px);
  line-height: 1.12;
  margin: 0 0 8px;
  color: var(--text);
}
.principles p { color: var(--text-soft); }

/* Services */
.services { margin-top: 1.4em; border-bottom: 1px solid var(--hair-quiet); }
.services > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 32px 0;
  border-top: 1px solid var(--hair-quiet);
}
.services dt {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(28px, 2vw + 18px, 44px);
  line-height: 1.06;
  color: var(--text);
}
.services dd { color: var(--text-soft); max-width: 44ch; }
@media (min-width: 720px) {
  .services > div {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr);
    gap: 32px;
    align-items: baseline;
  }
}
.coda {
  margin-top: 1.6em;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(24px, 1.4vw + 16px, 36px) !important;
  line-height: 1.2;
  color: var(--sand) !important;
  text-wrap: balance;
}

/* ---------- Footer ---------- */

.foot {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(96px, 16vh, 180px) var(--gutter) calc(48px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--hair);
}
.foot__mark { font-size: 22px; margin-bottom: 18px; }
.foot .label { color: color-mix(in srgb, var(--on-deep) 70%, var(--deep)); font-size: 10px; font-weight: 500; }
.foot__copy { margin-top: 18px; }

/* ---------- Reveal on scroll ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- 404 ---------- */

.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--gutter);
  background:
    radial-gradient(ellipse 50% 30% at 62% 88%, color-mix(in srgb, var(--glow-3) 40%, transparent) 0%, transparent 70%),
    radial-gradient(ellipse 80% 60% at 35% 35%, color-mix(in srgb, var(--glow-2) 80%, transparent) 0%, transparent 70%),
    var(--glow-1);
}
.lost__inner { display: flex; flex-direction: column; align-items: center; gap: 28px; }
.lost__mark { font-size: clamp(40px, 7vw, 84px); }
.lost__line { font-family: var(--serif); font-style: italic; font-weight: 300; font-size: clamp(22px, 2vw + 12px, 32px); }
.lost__home { color: var(--sand); padding: 10px 0; border-bottom: 1px solid var(--brass); }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js .hero__mark,
  .js .hero__line,
  .js .hero__focus,
  .js .hero__coords,
  .js .nav,
  .js [data-reveal] {
    opacity: 1;
    transform: none;
    filter: none;
  }
  .js .hero__mark { letter-spacing: 0.36em; padding-left: 0.36em; }
}

@media (max-width: 420px) {
  .nav__links { gap: 16px; }
  .nav__links a { font-size: 10px; letter-spacing: 0.2em; }
  .nav__mark { font-size: 13px; letter-spacing: 0.3em; }
}

@media print {
  body::after, .hero__field, .echo, .nav { display: none; }
  .js [data-reveal], .js .hero__mark, .js .hero__line, .js .hero__focus, .js .hero__coords { opacity: 1; transform: none; filter: none; }
}
