/* ============================================================
   NIYA - niya.life
   The Fireplace. Hand-written CSS. No frameworks.
   ============================================================ */

:root {
  --night: #0d1b2a;
  --night-deep: #071120;
  --night-soft: #12233a;
  --amber: #f2b368;
  --amber-bright: #ffd9a0;
  --amber-dim: rgba(242, 179, 104, 0.14);
  --ink: #e9e3d8;
  --ink-muted: rgba(233, 227, 216, 0.62);
  --ink-faint: rgba(233, 227, 216, 0.38);
  --font-head: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 660px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--night);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--amber); color: var(--night-deep); }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--amber); text-decoration: none; }
a:hover, a:focus-visible { color: var(--amber-bright); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.005em;
}

.wrap { max-width: var(--max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.wrap--wide { max-width: 920px; }

section { position: relative; padding: 110px 0; }

/* ---------- Skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--amber); color: var(--night-deep);
  padding: 10px 18px; z-index: 200; border-radius: 4px;
}
.skip:focus { left: 12px; top: 12px; }

/* ============================================================
   THE EMBER CURSOR - warmth you carry down the page
   ============================================================ */
#ember-cursor {
  position: fixed;
  left: 0; top: 0;
  width: 520px; height: 520px;
  margin-left: -260px; margin-top: -260px;
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(242, 179, 104, 0.10) 0%,
    rgba(242, 179, 104, 0.05) 35%,
    rgba(242, 179, 104, 0) 70%);
  opacity: 0;
  transition: opacity 1.2s ease;
}
body.has-cursor #ember-cursor { opacity: 1; }

/* ============================================================
   HERO - the fire builds itself
   ============================================================ */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}

/* the mark draws itself in warm amber, then settles */
.logo-scene {
  position: relative;
  width: min(300px, 58vw);
  margin-bottom: 56px;
}
.logo-scene svg.logo-line {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 0 20px rgba(242, 179, 104, 0.22));
  transition: filter 1.8s ease;
}
.logo-scene.drawn svg.logo-line {
  filter: drop-shadow(0 0 16px rgba(242, 179, 104, 0.12));
}

/* The true mark is a closed outline. The line draws, then the mark fills to ivory. */
/* DEFAULT = the finished mark. If JS never runs, or rAF never fires,
   or the browser is old, the visitor still sees the logo. Failure is
   visible, not invisible.                                            */
svg.logo-line #niya-line {
  fill: var(--ink);
  fill-opacity: 1;
  stroke: var(--amber);
  stroke-width: 18;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-opacity: 0;
}
/* JS adds .drawing only once it knows it can actually animate. */
.logo-scene.drawing svg.logo-line #niya-line {
  fill-opacity: 0;
  stroke-opacity: 1;
  transition: fill-opacity 1.7s ease 0.1s, stroke-opacity 1.7s ease 0.1s;
}
.logo-scene.drawing.drawn svg.logo-line #niya-line {
  fill-opacity: 1;
  stroke-opacity: 0;
}

/* the glowing tip of the pen */
.draw-tip {
  position: absolute;
  left: 0; top: 0;
  width: 14px; height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle,
    var(--amber-bright) 0%, var(--amber) 55%, rgba(242,179,104,0) 78%);
  box-shadow: 0 0 24px 8px rgba(242, 179, 104, 0.5);
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
  z-index: 2;
}

/* the golden glow at the heart of the mark: centred, breathing, larger than the logo */
.mark-glow {
  position: absolute;
  left: 50%; top: 50%;
  width: 155%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%) scale(0.6);
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(242, 179, 104, 0.22) 0%,
    rgba(242, 179, 104, 0.08) 45%,
    rgba(242, 179, 104, 0) 70%);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.mark-glow.on {
  animation: mark-settle 2.2s ease forwards,
             mark-breathe 6.5s ease-in-out infinite 2.4s;
}
@keyframes mark-settle {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes mark-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
  50%      { transform: translate(-50%, -50%) scale(1.14); opacity: 0.78; }
}

/* ============================================================
   SECTION REVEALS
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 1.1s ease, transform 1.1s ease;
}
.reveal.in { opacity: 1; transform: none; }

.kicker {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 22px;
}

section h2 {
  font-size: clamp(1.7rem, 4.4vw, 2.5rem);
  margin-bottom: 28px;
}

section p + p { margin-top: 20px; }
.muted { color: var(--ink-muted); }
.big-line {
  font-family: var(--font-head);
  font-size: clamp(1.25rem, 3vw, 1.55rem);
  line-height: 1.5;
  color: var(--amber);
  margin-top: 44px;
}

/* ============================================================
   SEVEN QUESTIONS
   ============================================================ */
.begin-btn, .btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.08em;
  padding: 16px 44px;
  background: transparent;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}
.begin-btn:hover, .btn:hover,
.begin-btn:focus-visible, .btn:focus-visible {
  background: var(--amber);
  color: var(--night-deep);
  box-shadow: 0 0 44px rgba(242, 179, 104, 0.35);
  text-decoration: none;
}
.begin-btn { margin-top: 36px; }

#questions {
  position: fixed;
  inset: 0;
  background: var(--night-deep);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}
#questions.open { display: flex; }

.q-close {
  position: absolute;
  top: 22px; right: 26px;
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 8px;
}
.q-close:hover { color: var(--ink); }

.q-slide {
  display: none;
  max-width: 640px;
  margin: 0 auto;
}
.q-slide.active { display: block; animation: q-in 0.9s ease; }
@keyframes q-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
.q-slide p {
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 3.6vw, 1.9rem);
  line-height: 1.5;
}
.q-slide .q-num {
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  color: var(--amber);
  display: block;
  margin-bottom: 26px;
}
.q-nav { margin-top: 46px; }

.q-dots {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.q-dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(233, 227, 216, 0.18);
  transition: background 0.4s ease;
}
.q-dots i.on { background: var(--amber); }

.q-final p { color: var(--amber); }

/* ============================================================
   THE THREE - clean intentions / intuition / direction
   ============================================================ */
.three { margin-top: 44px; display: grid; gap: 34px; }
.three h3 {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--amber);
  margin-bottom: 8px;
}
.three p { color: var(--ink-muted); }

/* ============================================================
   NOWHERE - three doors that stay shut
   ============================================================ */
.nowhere { display: grid; gap: 26px; margin-top: 40px; }
.nowhere p strong { color: var(--ink); font-weight: 500; }
.nowhere p { color: var(--ink-muted); }

/* ============================================================
   HOW NIYA LIVES - the circle visual
   ============================================================ */
.circle-visual {
  width: 200px;
  height: 200px;
  margin: 46px auto;
  position: relative;
}
.circle-visual i {
  position: absolute;
  left: 50%; top: 50%;
  width: 13px; height: 13px;
  margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--amber-bright), var(--amber) 70%);
  box-shadow: 0 0 18px rgba(242, 179, 104, 0.5);
  opacity: 0;
  transform: scale(0.3);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.circle-visual i:nth-child(1) { --cx: 0px;   --cy: -78px; transition-delay: 0.1s; }
.circle-visual i:nth-child(2) { --cx: 68px;  --cy: -39px; transition-delay: 0.35s; }
.circle-visual i:nth-child(3) { --cx: 68px;  --cy: 39px;  transition-delay: 0.6s; }
.circle-visual i:nth-child(4) { --cx: 0px;   --cy: 78px;  transition-delay: 0.85s; }
.circle-visual i:nth-child(5) { --cx: -68px; --cy: 39px;  transition-delay: 1.1s; }
.circle-visual i:nth-child(6) { --cx: -68px; --cy: -39px; transition-delay: 1.35s; }
.circle-visual.in i {
  opacity: 1;
  transform: translate(var(--cx), var(--cy)) scale(1);
}
.circle-visual::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px solid rgba(242, 179, 104, 0.22);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 1.4s ease 1.7s, transform 1.4s ease 1.7s;
}
.circle-visual.in::after { opacity: 1; transform: scale(1); }

.lives { display: grid; gap: 28px; margin-top: 14px; }
.lives p strong { color: var(--amber); font-weight: 500; display: block; margin-bottom: 4px; }
.lives p { color: var(--ink-muted); }

/* ============================================================
   THE RULES - one voice at a time
   ============================================================ */
.rules-list { list-style: none; margin-top: 50px; display: grid; gap: 30px; }
.rules-list li {
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  opacity: 0;
  transform: translateX(-14px);
  transition: opacity 1s ease, transform 1s ease;
}
.rules-list li.in { opacity: 1; transform: none; }
.rules-list li::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 14px rgba(242, 179, 104, 0.55);
  position: relative;
  top: -2px;
}
.rules-list li:last-child { color: var(--amber); }
.rules-more { margin-top: 52px; }

/* ============================================================
   ORIGIN
   ============================================================ */
.origin p { max-width: 560px; }
.origin .big-line { margin-top: 40px; }

/* ============================================================
   WAITLIST - the fire fully built
   ============================================================ */
#waitlist {
  background:
    radial-gradient(ellipse 90% 60% at 50% 100%,
      rgba(242, 179, 104, 0.10) 0%,
      rgba(242, 179, 104, 0) 65%),
    var(--night-deep);
  padding-bottom: 140px;
}

.waitlist-form { margin-top: 46px; display: grid; gap: 20px; }
.waitlist-form label {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 8px;
}
.waitlist-form input,
.waitlist-form textarea {
  width: 100%;
  background: rgba(233, 227, 216, 0.04);
  border: 1px solid rgba(233, 227, 216, 0.16);
  border-radius: 8px;
  padding: 14px 16px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.3s ease;
}
.waitlist-form input:focus,
.waitlist-form textarea:focus {
  border-color: var(--amber);
  outline: none;
}
.waitlist-form textarea { min-height: 90px; resize: vertical; }
.waitlist-form .btn { justify-self: start; margin-top: 8px; }
.form-note { font-size: 0.9rem; color: var(--ink-faint); margin-top: 6px; }

/* honeypot */
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

.form-result { margin-top: 30px; }
.form-result p { font-family: var(--font-head); font-size: 1.3rem; color: var(--amber); }
.form-result .muted { font-family: var(--font-body); font-size: 1rem; color: var(--ink-muted); margin-top: 12px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid rgba(233, 227, 216, 0.1);
  padding: 60px 0 50px;
  font-size: 0.92rem;
  color: var(--ink-muted);
}
footer .mark {
  font-family: var(--font-head);
  font-size: 1.3rem;
  letter-spacing: 0.3em;
  color: var(--ink);
  margin-bottom: 18px;
}
footer nav { display: flex; flex-wrap: wrap; gap: 22px; margin: 22px 0; }
footer .fine { font-size: 0.85rem; color: var(--ink-faint); margin-top: 26px; }
footer .crisis {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(233, 227, 216, 0.08);
}

/* ============================================================
   MANIFESTO PAGE
   ============================================================ */
.page-head {
  padding-top: 140px;
  padding-bottom: 40px;
  text-align: center;
}
.page-head .mark-top {
  font-family: var(--font-head);
  letter-spacing: 0.3em;
  font-size: 1rem;
  color: var(--amber);
  display: inline-block;
  margin-bottom: 30px;
}
.manifesto-rule { padding: 56px 0; border-bottom: 1px solid rgba(233, 227, 216, 0.08); }
.manifesto-rule h2 { font-size: clamp(1.5rem, 3.6vw, 2rem); }
.manifesto-rule p { color: var(--ink-muted); max-width: 560px; }
.manifesto-close { padding: 90px 0 120px; }

/* ============================================================
   PRIVACY PAGE
   ============================================================ */
.legal h2 { font-size: 1.4rem; margin-top: 54px; }
.legal p, .legal li { color: var(--ink-muted); }
.legal ul { margin: 16px 0 0 20px; display: grid; gap: 10px; }

/* ============================================================
   REDUCED MOTION - the fire is already lit
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .hero h1 span, .hero p, .hero .scroll-cue { opacity: 1 !important; transform: none !important; }
  .reveal, .rules-list li { opacity: 1 !important; transform: none !important; }
  .circle-visual i {
    opacity: 1 !important;
    transform: translate(var(--cx), var(--cy)) scale(1) !important;
  }
  .circle-visual::after { opacity: 1 !important; transform: scale(1) !important; }
  .draw-tip { display: none; }
  svg.logo-line #niya-line { fill-opacity: 1 !important; stroke-opacity: 0 !important; transition: none !important; }
  .mark-glow.on { opacity: 1 !important; transform: translate(-50%, -50%) scale(1) !important; animation: none !important; }
  #ember-cursor { display: none; }
}

@media (max-width: 560px) {
  section { padding: 84px 0; }
  .logo-scene {
    margin-bottom: 44px;
    width: min(300px, 62vw);
    min-height: 180px;
  }
  .logo-scene svg.logo-line { min-height: 180px; }
  .mark-glow { width: 165%; }
  /* the pen must stay visible when the mark is scaled down */
  svg.logo-line #niya-line { stroke-width: 26; }
}
