/* ZABARI — main.css
   Obsidian, bone, champagne. Nothing else. */

:root {
  --obsidian: #0A0A0B;
  --bone: #E8E3D8;
  --bone-dim: rgba(232, 227, 216, .58);
  --bone-faint: rgba(232, 227, 216, .34);
  --gold: #C0A468;
  --gold-bright: #D8BE87;
  --gold-dim: rgba(192, 164, 104, .55);
  --hair: rgba(192, 164, 104, .22);
  --serif: 'Cormorant Garamond', 'Didot', 'Bodoni 72', Georgia, serif;
  --sans: 'Jost', 'Avenir Next', 'Century Gothic', sans-serif;
  --ease: cubic-bezier(.22, .61, .21, 1);
  --pad-x: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  background: var(--obsidian);
}

body {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--bone);
  background: var(--obsidian);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Atmosphere — vignette + grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(192, 164, 104, .075), transparent 55%),
    radial-gradient(95% 80% at 50% 115%, rgba(192, 164, 104, .045), transparent 60%);
}

body::after {
  content: "";
  position: fixed;
  inset: -50%;
  pointer-events: none;
  z-index: 100;
  opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--gold); color: var(--obsidian); }

/* The thread — a single hairline that descends as the visitor reads */
.thread {
  position: fixed;
  left: 50%;
  top: 0;
  width: 1px;
  height: 100vh;
  z-index: 0;
  transform-origin: top center;
  transform: scaleY(var(--p, 0));
  background: linear-gradient(to bottom, transparent, var(--hair) 25%, var(--hair) 75%, transparent);
  opacity: .55;
}

main, header, footer { position: relative; z-index: 1; }

/* ---------- Hero ---------- */

.hero {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding:
    calc(48px + var(--safe-top))
    calc(var(--pad-x) + var(--safe-right))
    calc(48px + var(--safe-bottom))
    calc(var(--pad-x) + var(--safe-left));
  position: relative;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seal {
  color: var(--gold);
  display: block;
  width: clamp(112px, 36vw, 148px);
  height: auto;
}

.seal-frame {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: seal-draw 1.7s var(--ease) .3s forwards;
}

.seal-z {
  opacity: 0;
  animation: soft-in 1.4s var(--ease) 1.1s forwards;
}

.word {
  margin-top: 56px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5.4vw, 3.1rem);
  letter-spacing: .45em;
  text-indent: .45em;
  line-height: 1;
  opacity: 0;
  animation: word-in 1.6s var(--ease) 1.6s forwards;
}

.sub {
  margin-top: 30px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: .66rem;
  letter-spacing: .40em;
  text-indent: .40em;
  text-transform: uppercase;
  color: var(--gold-dim);
  opacity: 0;
  animation: soft-rise 1.4s var(--ease) 2.2s forwards;
}

.aphorism {
  margin-top: 64px;
  font-style: italic;
  font-weight: 300;
  font-size: 1.3rem;
  color: var(--bone-faint);
  opacity: 0;
  animation: soft-rise 1.6s var(--ease) 2.7s forwards;
}

.cue {
  position: absolute;
  bottom: calc(36px + var(--safe-bottom));
  left: 50%;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--hair), transparent);
  opacity: 0;
  animation: soft-in 1.2s var(--ease) 3.4s forwards, cue-breathe 4s ease-in-out 4.6s infinite;
}

@keyframes seal-draw { to { stroke-dashoffset: 0; } }
@keyframes soft-in { to { opacity: 1; } }
@keyframes soft-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes word-in {
  from { opacity: 0; letter-spacing: .62em; text-indent: .62em; }
  to   { opacity: 1; letter-spacing: .45em; text-indent: .45em; }
}
@keyframes cue-breathe {
  0%, 100% { opacity: .25; }
  50%      { opacity: .8; }
}

/* ---------- Movements ---------- */

.movement {
  padding:
    min(32vh, 340px)
    calc(var(--pad-x) + var(--safe-right))
    0
    calc(var(--pad-x) + var(--safe-left));
  text-align: center;
}

.movement:first-of-type { padding-top: min(20vh, 220px); }

.m-inner {
  max-width: 580px;
  margin: 0 auto;
}

.label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 54px;
}

.label .num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: .18em;
  color: var(--gold);
}

.label .tick {
  width: 1px;
  height: 30px;
  background: var(--hair);
}

.label .title {
  font-family: var(--sans);
  font-weight: 400;
  font-size: .62rem;
  letter-spacing: .46em;
  text-indent: .46em;
  text-transform: uppercase;
  color: var(--bone-dim);
}

.prose {
  font-weight: 400;
  font-size: 1.32rem;
  line-height: 1.95;
  color: rgba(232, 227, 216, .88);
}

.prose + .prose { margin-top: 28px; }

.prose.dim {
  font-style: italic;
  font-weight: 300;
  color: var(--bone-faint);
  font-size: 1.18rem;
}

/* Fields of interest */
.fields {
  list-style: none;
}

.fields li {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: .035em;
  color: rgba(232, 227, 216, .92);
}

.fields li + li::before {
  content: "";
  display: block;
  width: 1px;
  height: 20px;
  background: var(--hair);
  margin: 18px auto;
}

.footnote {
  margin-top: 60px;
  font-family: var(--sans);
  font-size: .58rem;
  font-weight: 400;
  letter-spacing: .38em;
  text-indent: .38em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

/* Principles */
.principle {
  font-style: italic;
  font-weight: 300;
  font-size: 1.46rem;
  line-height: 1.5;
  color: rgba(232, 227, 216, .85);
}

.principle + .principle { margin-top: 34px; }

/* Correspondence */
.email {
  display: inline-block;
  margin-top: 44px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: .82rem;
  letter-spacing: .3em;
  text-indent: .3em;
  text-decoration: none;
  color: var(--gold);
  padding-bottom: 10px;
  position: relative;
}

.email::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  height: 1px;
  width: 100%;
  transform: translateX(-50%) scaleX(.35);
  background: var(--gold-dim);
  transition: transform .7s var(--ease), background .7s var(--ease);
}

.email:hover { color: var(--gold-bright); }
.email:hover::after { transform: translateX(-50%) scaleX(1); background: var(--gold); }

/* ---------- Footer ---------- */

footer {
  margin-top: min(30vh, 320px);
  padding:
    0
    calc(var(--pad-x) + var(--safe-right))
    calc(110px + var(--safe-bottom))
    calc(var(--pad-x) + var(--safe-left));
  text-align: center;
}

.foot-rule {
  width: 220px;
  height: 1px;
  margin: 0 auto 72px;
  background: linear-gradient(90deg, transparent, var(--hair), transparent);
}

.foot-seal {
  width: 34px;
  height: 34px;
  opacity: .6;
  margin: 0 auto;
}

.motto {
  margin-top: 34px;
  font-family: var(--sans);
  font-size: .6rem;
  font-weight: 400;
  letter-spacing: .52em;
  text-indent: .52em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.fine {
  margin-top: 26px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: .62rem;
  letter-spacing: .22em;
  color: var(--bone-faint);
}

.fine.faint {
  margin-top: 12px;
  color: rgba(232, 227, 216, .22);
}

/* ---------- Reveals ---------- */

/* Visible by default (no JS = no hiding); the .js root opts into reveals */
.reveal {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 1.3s var(--ease), transform 1.3s var(--ease);
}

html.js .reveal:not(.is-in) {
  opacity: 0;
  transform: translateY(16px);
}

.m-inner .reveal:nth-child(2) { transition-delay: .15s; }
.m-inner .reveal:nth-child(3) { transition-delay: .3s; }
.m-inner .reveal:nth-child(4) { transition-delay: .45s; }
.m-inner .reveal:nth-child(5) { transition-delay: .6s; }

/* ---------- Not public (404) ---------- */

.void {
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  padding:
    calc(24px + var(--safe-top))
    calc(var(--pad-x) + var(--safe-right))
    calc(24px + var(--safe-bottom))
    calc(var(--pad-x) + var(--safe-left));
}

.void .seal { width: 92px; height: 92px; }

.void h1 {
  margin-top: 48px;
  font-weight: 400;
  font-size: 1.7rem;
  letter-spacing: .03em;
}

.void .return {
  display: inline-block;
  margin-top: 52px;
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .34em;
  text-indent: .34em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold);
  border-bottom: 1px solid var(--hair);
  padding-bottom: 8px;
  transition: border-color .6s var(--ease), color .6s var(--ease);
}

.void .return:hover { color: var(--gold-bright); border-color: var(--gold); }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  .seal-frame, .seal-z, .word, .sub, .aphorism, .cue { animation: none; }
  .seal-frame { stroke-dashoffset: 0; }
  .seal-z, .word, .sub, .aphorism { opacity: 1; }
  .cue { opacity: .4; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .word { letter-spacing: .34em; text-indent: .34em; margin-top: 44px; }
  @keyframes word-in {
    from { opacity: 0; letter-spacing: .5em; text-indent: .5em; }
    to   { opacity: 1; letter-spacing: .34em; text-indent: .34em; }
  }
  .aphorism { margin-top: 48px; font-size: 1.16rem; }
  .prose { font-size: 1.18rem; line-height: 1.9; }
  .fields li { font-size: 1.3rem; }
  .principle { font-size: 1.28rem; }
  .movement { padding-top: 26vh; }
  .sub {
    letter-spacing: .26em;
    text-indent: .26em;
    line-height: 1.65;
    max-width: 18em;
  }
}

@media (max-width: 375px) {
  .hero {
    padding-top: calc(36px + var(--safe-top));
  }
  .seal { width: 108px; }
  .word { margin-top: 36px; }
  .sub {
    font-size: .7rem;
    letter-spacing: .2em;
    text-indent: .2em;
    max-width: 15em;
  }
  .aphorism { font-size: 1.1rem; margin-top: 40px; }
  .footnote { letter-spacing: .28em; text-indent: .28em; }
  .motto { letter-spacing: .38em; text-indent: .38em; }
}
