/* ============================================================
   Ambient Anatolics — landing site
   Aesthetic: Devs-grade sublime minimalism. Deterministic awe.
   Navy + muted statue-gold on warm off-white paper.
   ============================================================ */

:root {
  --paper:      #f1ede3;   /* warm off-white */
  --paper-deep: #e7e1d3;   /* recessed paper */
  --ink:        #14202e;   /* deep navy — primary ink */
  --ink-soft:   #2a3a4d;   /* softened navy */
  --navy:       #14202e;   /* alias used by tokens test / components */
  --gold:       #b08d45;   /* muted statue gold — the single accent */
  --gold-soft:  #c2a35a;
  --accent:     var(--gold);
  --mute:       rgba(20, 32, 46, 0.42);
  --hair:       rgba(20, 32, 46, 0.16);

  --serif: "Cormorant Garamond", Georgia, serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  --measure: 60ch;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(17px, 1.05vw + 13px, 21px);
  line-height: 1.6;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

/* ---- Grain overlay: atmosphere, not texture-for-its-own-sake ---- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.35'/%3E%3C/svg%3E");
}

/* ---- Mono micro-labels: the deterministic register ---- */
.eyebrow, .coord, .index, .portrait__role, .foot__mark, .foot__meta,
.scrollcue span, .tenets__num, .foot__row--fine {
  font-family: var(--mono);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

/* =========================== HERO =========================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  isolation: isolate;
}

.hero__frame {
  position: absolute;
  inset: clamp(1.5rem, 4vw, 3.5rem);
  pointer-events: none;
}
.coord {
  position: absolute;
  font-size: 0.62rem;
  letter-spacing: 0.32em;
  color: var(--mute);
}
.coord--tl { top: 0; left: 0; }
.coord--tr { top: 0; right: 0; }
.coord--bl { bottom: 0; left: 0; }
.coord--br { bottom: 0; right: 0; }

/* The generative vortex sits behind the type, oversized and centred. */
.hero__stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: -1;
}
.vortex {
  width: min(102vmin, 940px);
  height: min(102vmin, 940px);
  overflow: visible;
  transform: translateY(-9%);
}
.vortex__axes line {
  stroke: var(--ink);
  stroke-width: 1;
  stroke-dasharray: 1 9;
  stroke-linecap: round;
  opacity: 0.28;
}
.vortex__dots { fill: var(--ink); }
/* Each ring rotates at its own period — differential rotation about centre. */
.vortex__ring {
  transform-box: view-box;
  transform-origin: 500px 500px;
  animation: spin var(--dur, 300s) linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hero__type {
  position: relative;
  text-align: center;
  z-index: 1;
}
.eyebrow {
  font-size: 0.68rem;
  color: var(--gold);
  margin: 0 0 clamp(1.4rem, 3vw, 2.4rem);
  text-shadow: 0 0 14px var(--paper), 0 0 6px var(--paper);
}
.wordmark {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.04em;
  font-weight: 300;
  font-size: clamp(2.9rem, 11vw, 8.5rem);
  line-height: 0.92;
  letter-spacing: 0.16em;
  text-indent: 0.16em; /* optical-centre the tracked caps */
}
.wordmark span { display: block; }
.lede {
  max-width: 34ch;
  margin: clamp(2.4rem, 5vw, 3.6rem) auto 0;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.05rem, 1.4vw + 0.7rem, 1.5rem);
  line-height: 1.55;
  color: var(--ink-soft);
  /* Paper halo keeps the lede legible where it floats over the dot field. */
  text-shadow: 0 0 16px var(--paper), 0 0 16px var(--paper), 0 0 6px var(--paper);
}

.scrollcue {
  position: absolute;
  bottom: clamp(1.6rem, 4vw, 3rem);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  font-size: 0.58rem;
  color: var(--mute);
}
.scrollcue__line {
  width: 1px;
  height: 46px;
  background: linear-gradient(var(--ink), transparent);
  animation: drift 3.4s var(--ease) infinite;
  transform-origin: top;
}
@keyframes drift {
  0%, 100% { transform: scaleY(0.35); opacity: 0.3; }
  50%      { transform: scaleY(1);    opacity: 0.9; }
}

/* ======================== STRUCTURE ========================= */
main { position: relative; z-index: 1; }

section {
  max-width: 1180px;
  margin-inline: auto;
  padding: clamp(5rem, 13vw, 12rem) clamp(1.5rem, 5vw, 4rem);
}
.index {
  font-size: 0.66rem;
  color: var(--gold);
  margin: 0 0 clamp(2.2rem, 5vw, 4rem);
}

/* ---- Manifesto ---- */
.manifesto__grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.statement {
  margin: 0;
  font-weight: 300;
  font-size: clamp(1.8rem, 4vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: 0.005em;
}
.manifesto__body { max-width: var(--measure); }
.manifesto__body p { margin: 0 0 1.4em; color: var(--ink-soft); }
.manifesto__body p:last-child { margin-bottom: 0; }

/* ---- Tenets ---- */
.tenets { border-top: 1px solid var(--hair); }
.tenets__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.2rem);
  counter-reset: none;
}
.tenets__list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  align-items: baseline;
  gap: 1.4rem;
  padding-bottom: clamp(1.4rem, 3vw, 2.2rem);
  border-bottom: 1px solid var(--hair);
}
.tenets__list li:last-child { border-bottom: 0; padding-bottom: 0; }
.tenets__num { font-size: 0.7rem; color: var(--gold); letter-spacing: 0.18em; }
.tenets__text {
  font-weight: 300;
  font-size: clamp(1.4rem, 2.6vw, 2.4rem);
  line-height: 1.25;
}

/* ---- The Collective ----
   5 across × 2 rows = 10 slots, sized to sit within a single screen. */
.collective {
  border-top: 1px solid var(--hair);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(3rem, 7vh, 6rem);
}
.collective .index { margin-bottom: clamp(1.2rem, 3vh, 2.4rem); }
.collective__intro {
  max-width: 46ch;
  margin: 0 0 clamp(1.8rem, 5vh, 3.6rem);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  line-height: 1.4;
  color: var(--ink-soft);
}
.portraits {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(0.9rem, 1.6vw, 1.8rem) clamp(0.9rem, 1.8vw, 2rem);
}
.portrait {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.7rem;
}
.portrait__frame {
  width: 100%;
  /* Height in svh so two rows + captions + header fit one screen. */
  height: clamp(120px, 24svh, 220px);
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--hair);
  transition: border-color 0.6s var(--ease), transform 0.6s var(--ease);
}
.portrait:hover .portrait__frame {
  border-color: var(--gold);
  transform: translateY(-4px);
}
/* Each frame holds a unique generated flow-field composition (js/vortex.js). */
.portrait__art {
  display: block;
  width: 100%;
  height: 100%;
}
.portrait__art path {
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.portrait__art path.accent { stroke: var(--gold); }
.portrait:hover .portrait__art path.accent { stroke: var(--gold-soft); }
.portrait figcaption { text-align: center; }
.portrait__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(0.95rem, 1.2vw, 1.15rem);
  color: var(--ink);
}
.portrait__name--tbd { color: var(--mute); }

/* ---- Invocation ---- */
.invocation {
  text-align: center;
  border-top: 1px solid var(--hair);
}
.invocation__line {
  margin: 0;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.6rem, 4.5vw, 3.6rem);
  line-height: 1.2;
  color: var(--ink);
}

/* ============================ FOOTER ============================ */
.foot {
  border-top: 1px solid var(--hair);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4rem);
  max-width: 1180px;
  margin-inline: auto;
}
.foot__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.foot__mark { font-size: 0.72rem; letter-spacing: 0.34em; }
.foot__meta { font-size: 0.62rem; color: var(--mute); }
.foot__row--fine {
  margin-top: 1.6rem;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  color: var(--mute);
}
.foot__row--fine a { transition: color 0.4s var(--ease); }
.foot__row--fine a:hover { color: var(--gold); }

/* ====================== REVEAL ANIMATION ======================= */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* Staggered hero load */
.hero__type.reveal { transition-delay: 0.15s; }

/* ====================== RESPONSIVE ======================= */
@media (max-width: 860px) {
  .manifesto__grid { grid-template-columns: 1fr; }
  /* Below desktop the single-screen constraint relaxes; let the grid scroll. */
  .collective { min-height: 0; }
  .portraits { grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
  .portrait__frame { height: clamp(140px, 28vw, 220px); }
  .coord--bl, .coord--br { display: none; }
}
@media (max-width: 460px) {
  .portraits { grid-template-columns: repeat(2, 1fr); }
  .portrait__frame { height: 38vw; }
}

/* ============== MOTION / CONTRAST PREFERENCES ============== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .vortex__ring { animation: none; }
  .scrollcue__line { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
