/* Godloom — site styles */

@font-face { font-family: "Cinzel"; src: url("../fonts/Cinzel-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/Jost-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ink: #0e1428;
  --ink-2: #141c36;
  --ink-3: #1c2748;
  --gold: #edd194;
  --gold-soft: rgba(237, 209, 148, 0.55);
  --gold-line: rgba(237, 209, 148, 0.28);
  --white: #fffdf7;
  --mist: rgba(255, 253, 247, 0.72);
  --faint: rgba(255, 253, 247, 0.5);
  --peach: #ffb87a;
  --sky: #5a9be0;
  --serif: "Cinzel", "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --measure: 34rem;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--white);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1.02rem, 0.96rem + 0.3vw, 1.16rem);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration-color: var(--gold-line); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--gold); }
:focus-visible { outline: 1.5px solid var(--gold); outline-offset: 4px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 50;
  background: var(--white); color: var(--ink); padding: 8px 14px; border-radius: 4px;
  font-weight: 500; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Type ---------- */

.eyebrow {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1.1rem;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; text-transform: uppercase; margin: 0; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.6vw, 2.3rem); letter-spacing: 0.14em; line-height: 1.25; }
h3 { font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.4rem); letter-spacing: 0.16em; line-height: 1.35; }

.rule {
  display: block; width: 64px; height: 1px; border: 0; margin: 1.4rem 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.center .rule, .rule.center { margin-left: auto; margin-right: auto; }

/* ---------- Top bar ---------- */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gutter);
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease, border-color 0.4s ease;
  border-bottom: 1px solid transparent;
}
.topbar.is-solid {
  background: rgba(14, 20, 40, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom-color: rgba(237, 209, 148, 0.1);
}
.wordmark {
  font-family: var(--serif); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.42em;
  color: var(--white); text-decoration: none; padding-left: 0.42em;
  opacity: 0; transform: translateY(-4px); transition: opacity 0.4s ease, transform 0.4s ease;
}
.topbar.is-solid .wordmark, .topbar.always .wordmark { opacity: 1; transform: none; }

.lang {
  display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid var(--gold-line); border-radius: 999px; padding: 3px;
}
.lang button, .lang a {
  font: 500 0.72rem/1 var(--sans); letter-spacing: 0.14em;
  color: var(--faint); background: transparent; border: 0; cursor: pointer;
  padding: 7px 11px; border-radius: 999px; text-decoration: none;
  min-width: 40px; min-height: 30px; display: inline-flex; align-items: center; justify-content: center;
}
.lang [aria-pressed="true"], .lang [aria-current="true"] { color: var(--ink); background: var(--gold); }

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

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: start center;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(120% 70% at 50% 110%, #1d2f5a 0%, transparent 60%),
    radial-gradient(80% 60% at 20% 0%, #151f3d 0%, transparent 70%),
    var(--ink);
}
.planet-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  display: block; touch-action: pan-y; cursor: grab;
}
.planet-canvas:active { cursor: grabbing; }

/* Fallback sphere when no canvas renderer is available */
.hero.no-canvas::before {
  content: ""; position: absolute; z-index: -1; left: 50%;
  width: 150vmax; height: 150vmax; top: 64%; transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 18%, #6fb5e8 0%, #2b6fb0 22%, #1a3f78 45%, #0e1f44 70%);
  box-shadow: 0 -10px 60px 10px rgba(255, 184, 122, 0.45), 0 -30px 160px 40px rgba(90, 155, 224, 0.25);
}

.hero-copy {
  position: relative;
  margin-top: clamp(18vh, 22vh, 26vh);
  padding: 0 var(--gutter);
  text-align: center;
  pointer-events: none;
}
.hero-copy > * { pointer-events: auto; }

.title {
  font-size: min(clamp(2.6rem, 1.2rem + 7.5vw, 7rem), calc((100vw - 2 * var(--gutter)) / 8.6));
  letter-spacing: 0.32em;
  white-space: nowrap;
  padding-left: 0.32em; /* optically re-centre the tracked word */
  line-height: 1;
  color: var(--white);
  text-shadow: 0 0 40px rgba(255, 220, 160, 0.35), 0 2px 24px rgba(14, 20, 40, 0.6);
}
.title .ch { display: inline-block; opacity: 0; transform: translateY(0.25em); filter: blur(8px); }
.is-ready .title .ch { animation: letter-in 1.4s cubic-bezier(0.2, 0.7, 0.1, 1) forwards; animation-delay: calc(0.9s + var(--i) * 0.11s); }
@keyframes letter-in { to { opacity: 1; transform: none; filter: blur(0); } }

.tagline {
  margin: 1.4rem auto 0;
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(0.78rem, 0.7rem + 0.4vw, 1rem);
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold);
}
.hero .rule { margin: 1.5rem auto 0; width: 0; transition: width 1.4s ease 2s; }
.is-ready .hero .rule { width: 96px; }

.fade-late { opacity: 0; transform: translateY(8px); transition: opacity 1.2s ease, transform 1.2s ease; }
.is-ready .fade-late { opacity: 1; transform: none; transition-delay: 2.1s; }
.is-ready .fade-later { transition-delay: 2.5s; }

.badge {
  display: inline-flex; align-items: center; gap: 12px;
  margin-top: 2rem; padding: 10px 20px 10px 14px;
  border: 1px solid var(--gold-soft); border-radius: 14px;
  background: rgba(14, 20, 40, 0.42);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--white); text-align: left; text-decoration: none;
}
.badge svg { width: 22px; height: 22px; flex: none; }
.badge small { display: block; font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); line-height: 1.3; }
.badge strong { display: block; font-weight: 500; font-size: 1.05rem; letter-spacing: 0.02em; line-height: 1.25; }
.devices { margin: 0.9rem 0 0; font-size: 0.82rem; letter-spacing: 0.14em; color: var(--faint); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  width: 1px; height: 44px; overflow: hidden;
  background: linear-gradient(var(--gold-line), transparent);
}
.scroll-hint::after {
  content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%;
  background: var(--gold); animation: drip 2.4s ease-in-out infinite 3s;
}
@keyframes drip { 0% { top: -40%; } 70%, 100% { top: 110%; } }

/* ---------- Sections ---------- */

main section { position: relative; padding: clamp(80px, 14vh, 160px) var(--gutter); }

.prologue { text-align: center; background: linear-gradient(var(--ink), var(--ink-2)); }
.prologue p {
  max-width: 30rem; margin: 0 auto 1.1em;
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.45rem); line-height: 1.7; color: var(--mist);
}
.prologue p.reveal-line { color: var(--white); font-family: var(--serif); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; font-size: clamp(1.05rem, 0.95rem + 0.8vw, 1.6rem); margin-top: 1.6em; }

.moments { background: linear-gradient(var(--ink-2), var(--ink) 40%, var(--ink-2)); }
.moments-head { text-align: center; margin-bottom: clamp(48px, 10vh, 110px); }

.moment {
  display: grid; gap: clamp(20px, 4vw, 72px); align-items: center;
  max-width: 1080px; margin: 0 auto clamp(72px, 14vh, 150px);
}
.moment:last-child { margin-bottom: 0; }
.moment .art {
  position: relative; aspect-ratio: 1; width: min(100%, 420px); justify-self: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 60%, rgba(237, 209, 148, 0.09), transparent 62%);
}
.moment .art::before {
  content: ""; position: absolute; inset: 6%; border-radius: 50%;
  border: 1px solid rgba(237, 209, 148, 0.12);
}
.moment .art svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.moment .num { font-family: var(--serif); font-weight: 600; color: var(--gold); letter-spacing: 0.3em; font-size: 0.78rem; }
.moment h3 { margin-top: 0.8rem; }
.moment p { color: var(--mist); max-width: var(--measure); margin: 1rem 0 0; }

@media (min-width: 820px) {
  .moment { grid-template-columns: 1fr 1fr; }
  .moment:nth-child(even) .art { order: 2; }
}
@media (max-width: 819px) {
  .moment { text-align: center; }
  .moment p { margin-left: auto; margin-right: auto; }
  .moment .art { width: min(78%, 340px); }
}

/* line-art illustration vocabulary */
.ln { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ln.w { stroke: var(--white); }
.ln.soft { stroke: var(--gold-soft); }
.ln.thin { stroke-width: 1; }
.fill-gold { fill: var(--gold); }
.fill-white { fill: var(--white); }

.draw .ln { stroke-dasharray: var(--len, 600); stroke-dashoffset: var(--len, 600); }
.draw.in-view .ln { animation: draw 2.2s cubic-bezier(0.4, 0.1, 0.2, 1) forwards; animation-delay: var(--d, 0s); }
@keyframes draw { to { stroke-dashoffset: 0; } }

.anim-smoke { animation: smoke 3.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.anim-smoke.s2 { animation-delay: 1.2s; } .anim-smoke.s3 { animation-delay: 2.4s; }
@keyframes smoke { 0% { opacity: 0; transform: translateY(6px) scale(0.6); } 30% { opacity: 0.9; } 100% { opacity: 0; transform: translateY(-26px) scale(1.25); } }

.anim-spin { animation: spin 14s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

.anim-wave { animation: wave 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: 10% 90%; }
@keyframes wave { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(26deg); } }

.anim-ripple { animation: ripple 2.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.anim-ripple.r2 { animation-delay: 0.9s; } .anim-ripple.r3 { animation-delay: 1.8s; }
@keyframes ripple { 0% { opacity: 0.9; transform: scale(0.2); } 100% { opacity: 0; transform: scale(1.6); } }

.anim-swell { animation: swell 5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes swell { 0%, 100% { transform: scaleY(0.82); } 50% { transform: scaleY(1.06); } }

.anim-sea { animation: sea 4s ease-in-out infinite; }
.anim-sea.b { animation-delay: -2s; }
@keyframes sea { 0%, 100% { transform: translateX(-8px); } 50% { transform: translateX(8px); } }

.anim-orbit { animation: spin 22s linear infinite; transform-origin: 200px 200px; }
.anim-orbit.rev { animation-direction: reverse; animation-duration: 34s; }

.anim-glow { animation: glow 3.2s ease-in-out infinite; }
@keyframes glow { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.anim-float { animation: float 6s ease-in-out infinite; }
.anim-float.f2 { animation-delay: -1.5s; } .anim-float.f3 { animation-delay: -3s; } .anim-float.f4 { animation-delay: -4.5s; }
@keyframes float { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(5px); } }

.anim-twinkle { animation: twinkle 2.6s ease-in-out infinite; }
.anim-twinkle.t2 { animation-delay: 0.8s; } .anim-twinkle.t3 { animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }

/* ---------- Coming soon strip ---------- */

.soon { text-align: center; overflow: hidden; background: var(--ink-2); padding-top: clamp(64px, 10vh, 110px); padding-bottom: clamp(64px, 10vh, 110px); }
.frames {
  display: flex; gap: 18px; justify-content: center; margin: 2.4rem auto 0;
  max-width: 100%;
}
.frame {
  flex: none; width: clamp(96px, 18vw, 170px); aspect-ratio: 9 / 19.5;
  border-radius: 22px; border: 1px solid var(--gold-line);
  background:
    radial-gradient(140% 60% at 50% 100%, rgba(90, 155, 224, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(255, 184, 122, 0.06), transparent 40%),
    var(--ink);
  position: relative; overflow: hidden;
}
.frame::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(237, 209, 148, 0.12) 50%, transparent 70%);
  transform: translateX(-100%); animation: sheen 4.5s ease-in-out infinite;
}
.frame:nth-child(2)::after { animation-delay: 0.4s; } .frame:nth-child(3)::after { animation-delay: 0.8s; }
.frame:nth-child(4)::after { animation-delay: 1.2s; } .frame:nth-child(5)::after { animation-delay: 1.6s; }
.frame:nth-child(odd) { transform: translateY(18px); }
@keyframes sheen { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@media (max-width: 640px) { .frame:nth-child(n+4) { display: none; } }

/* ---------- Promise ---------- */

.promise { text-align: center; background: radial-gradient(90% 70% at 50% 0%, #1b2a52, var(--ink) 70%); }
.pledges {
  list-style: none; padding: 0; margin: 3rem auto 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 56px) clamp(16px, 4vw, 48px);
  max-width: 880px;
}
@media (min-width: 820px) { .pledges { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pledges li { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pledges svg { width: 54px; height: 54px; }
.pledges span { font-family: var(--serif); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; }
.promise .vow { margin: clamp(48px, 9vh, 90px) auto 0; font-size: clamp(1.15rem, 1rem + 0.8vw, 1.6rem); color: var(--mist); font-weight: 300; }
.promise .vow em { font-style: normal; color: var(--gold); }

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

.footer {
  padding: clamp(56px, 10vh, 96px) var(--gutter) 40px;
  text-align: center; border-top: 1px solid rgba(237, 209, 148, 0.1);
  background: var(--ink);
}
.footer .badge { margin-top: 0; }
.footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin: 2rem 0 0; }
.footer nav a { color: var(--mist); text-decoration: none; font-size: 0.9rem; letter-spacing: 0.08em; padding: 6px 0; }
.footer nav a:hover { color: var(--gold); }
.footer .fine { margin: 2rem 0 0; font-size: 0.78rem; color: var(--faint); letter-spacing: 0.06em; }

/* ---------- Reveal ---------- */

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.2, 0.7, 0.1, 1); }
.reveal.in-view { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Document pages (privacy / support / 404) ---------- */

.doc {
  max-width: 44rem; margin: 0 auto; padding: 130px var(--gutter) 90px;
}
.doc h1 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.6rem); letter-spacing: 0.16em; line-height: 1.2; }
.doc .updated { color: var(--faint); font-size: 0.9rem; margin-top: 0.8rem; }
.doc h2 { font-size: clamp(1rem, 0.95rem + 0.4vw, 1.2rem); letter-spacing: 0.16em; margin-top: 2.6rem; color: var(--gold); }
.doc p, .doc li { color: var(--mist); }
.doc ul { padding-left: 1.2rem; }
.doc li + li { margin-top: 0.4rem; }
.doc .faq { margin-top: 2rem; }
.doc details { border-top: 1px solid var(--gold-line); padding: 18px 0; }
.doc details:last-child { border-bottom: 1px solid var(--gold-line); }
.doc summary { cursor: pointer; list-style: none; font-weight: 500; color: var(--white); display: flex; justify-content: space-between; gap: 16px; }
.doc summary::-webkit-details-marker { display: none; }
.doc summary::after { content: "+"; color: var(--gold); font-weight: 300; font-size: 1.3rem; line-height: 1; }
.doc details[open] summary::after { content: "−"; }
.doc details p { margin: 0.8rem 0 0; }
.doc .contact {
  margin-top: 3rem; padding: 24px; border: 1px solid var(--gold-line); border-radius: 16px;
  background: rgba(255, 253, 247, 0.02);
}
.doc .contact p { margin: 0.4rem 0 0; }
.doc .back { display: inline-block; margin-top: 3rem; letter-spacing: 0.1em; font-size: 0.9rem; }
.doc-hero-glow {
  position: fixed; inset: auto -20% -60vh -20%; height: 90vh; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(90, 155, 224, 0.18), transparent 70%);
}

.lost { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 0 var(--gutter); }
.lost h1 { font-size: clamp(3rem, 2rem + 6vw, 6rem); letter-spacing: 0.3em; padding-left: 0.3em; }
.lost p { color: var(--mist); }

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Extra motion ---------- */
.dust { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; mix-blend-mode: screen; }
h2.split .ch { display: inline-block; opacity: 0; transform: translateY(.5em) rotate(4deg); filter: blur(6px); }
.in-view h2.split .ch { animation: letter-in 1s cubic-bezier(0.2, 0.7, 0.1, 1) forwards; animation-delay: calc(var(--i) * 0.035s); }
.no-js h2.split .ch { opacity: 1; transform: none; filter: none; }
.orbit { position: absolute; inset: -4%; border-radius: 50%; border: 1px dashed rgba(237, 209, 148, 0.16); animation: spin 40s linear infinite; pointer-events: none; }
.orbit.o2 { inset: 12%; border-style: solid; border-color: rgba(237, 209, 148, 0.07); animation-duration: 26s; animation-direction: reverse; }
.orbit i { position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px 3px rgba(237, 209, 148, 0.55); }
.orbit.o2 i { width: 4px; height: 4px; margin-left: -2px; top: -2px; background: var(--white); box-shadow: 0 0 8px 2px rgba(255, 253, 247, 0.5); }
.moment .art { transition: transform .6s cubic-bezier(0.2, 0.7, 0.1, 1); }
.moment:hover .art { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Player guide */
.doc .toc { list-style: none; padding: 0; margin: 2rem 0 0; border-top: 1px solid var(--gold-line); }
.doc .toc li { margin: 0; border-bottom: 1px solid var(--gold-line); }
.doc .toc a { display: block; padding: 12px 0; letter-spacing: 0.06em; }
.doc.guide h2 { scroll-margin-top: 80px; }
.doc.guide h3 { font-size: 0.95rem; letter-spacing: 0.1em; color: var(--white); margin: 1.6rem 0 0.4rem; }
.doc.guide dl { margin: 1rem 0 0; }
.doc.guide dt { color: var(--white); font-weight: 500; margin-top: 0.9rem; }
.doc.guide dd { margin: 0.1rem 0 0; color: var(--mist); }
.shot { margin: 2rem auto; width: min(260px, 70vw); text-align: center; }
.shot img { display: block; width: 100%; height: auto; aspect-ratio: 900 / 1955; border-radius: 18px; background: rgba(14, 20, 40, 0.6); object-fit: cover; }
.shot figcaption { margin-top: 0.6rem; font-size: 0.8rem; color: var(--faint); }
.doc .back + .back, .doc .guide-link { display: block; margin-top: 2.2rem; letter-spacing: 0.1em; font-size: 0.9rem; }
.doc .guide-link + .back { margin-top: 0.8rem; }

/* In-game shots (index) */
.gshot { margin: 0; flex: none; width: clamp(96px, 18vw, 170px); }
.gshot img { display: block; width: 100%; height: auto; aspect-ratio: 900 / 1955; border-radius: 22px; border: 1px solid var(--gold-line); background: var(--ink); object-fit: cover; }
.gshot:nth-child(odd) { transform: translateY(18px); }
@media (max-width: 640px) { .gshot:nth-child(n+4) { display: none; } }
