/* Ruined God
   Colours are the game's own (Art Direction, Weaver + System UI palettes).
   Type: Grenze Gotisch for the name, Grenze italic for the few words, Geist Mono only for the god's voice,
   which is the in-world AI log and is set in Terminal Amber like it is in the game. */

@font-face {
  font-family: "Grenze Gotisch";
  src: url("../fonts/grenze-gotisch.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}
@font-face {
  font-family: "Grenze";
  src: url("../fonts/grenze-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../fonts/geist-mono.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --void: #0b1013;     /* Deep Void */
  --teal: #004853;     /* Circuit Board Teal */
  --cyan: #00f0ff;     /* Administrator Cyan */
  --white: #e0ffff;    /* Data White */
  --copper: #b87333;   /* Oxidized Copper */
  --amber: #ffb000;    /* Terminal Amber: the AI's logs */
  --dim: rgba(224, 255, 255, 0.58);

  --gothic: "Grenze Gotisch", "Iowan Old Style", Georgia, serif;
  --text: "Grenze", "Iowan Old Style", Georgia, serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --pad: clamp(1.25rem, 4vw, 3rem);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto;
  color: var(--white);
  /* The only light in the room comes from the halo. */
  background: radial-gradient(56vmax 42vmax at 50% 48%, rgba(0, 72, 83, 0.42), transparent 70%), var(--void);
  font-family: var(--text); font-style: italic;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; opacity: 0.5; mix-blend-mode: overlay;
  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='.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 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
p, h1 { margin: 0; font-weight: inherit; }
::selection { background: var(--cyan); color: var(--void); }
:focus-visible { outline: 1.5px solid var(--cyan); outline-offset: 5px; border-radius: 2px; }

/* Bars: quiet, sentence case. */
.bar {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1.4rem var(--pad);
  font-size: 1.05rem; color: var(--dim);
}
.bar a { transition: color 0.2s; }
.bar a:hover { color: var(--white); }
/* The studio signs once, small, top left. */
.studio img { display: block; height: 36px; width: auto; opacity: 0.82; transition: opacity 0.2s; }
.studio:hover img { opacity: 1; }

/* Stage */
.stage {
  position: relative; z-index: 1;
  display: grid; place-items: center; align-content: center;
  text-align: center;
  padding: 0.5rem 0;
  overflow-x: clip;
}
.stage > .halo, .stage > .copy { grid-area: 1 / 1; }
.copy { position: relative; display: grid; justify-items: center; padding-inline: var(--pad); }

/* The halo: arcs of hard light with constellation nodes, one piece knocked loose. */
.halo {
  width: min(68vmin, 640px); height: auto; overflow: visible;
  translate: var(--px, 0) var(--py, 0);
  transition: translate 1.2s var(--ease);
  filter: drop-shadow(0 0 5px rgba(0, 240, 255, 0.55)) drop-shadow(0 0 28px rgba(0, 240, 255, 0.18));
}
.halo path { fill: none; stroke: url(#g); stroke-width: 2; stroke-linecap: round; }
.halo circle { fill: var(--void); stroke: var(--cyan); stroke-width: 1.5; }
.halo circle.on { fill: var(--white); stroke: none; }
.halo__shard { transform: translate(-12px, -24px) rotate(-1.5deg); transform-origin: 200px 95px; }
.halo__shard path { stroke: var(--copper); }
.halo__spin { transform-origin: 300px 300px; }

/* The name, cracked: one piece of "God" has broken off and slipped. */
.title {
  display: grid;
  font-family: var(--gothic); font-style: normal; font-weight: 340;
  font-size: clamp(3.6rem, min(10vw, 15vmin), 8.8rem);
  line-height: 0.95; letter-spacing: 0.005em;
  /* Glow on the assembled name, so light leaks through the crack instead of stopping at it. */
  filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.28));
}
.title > span { grid-area: 1 / 1; padding: 0 0.08em; }
.title__whole { clip-path: polygon(0 0, 100% 0, 100% 31%, 89% 45%, 81% 43%, 72% 63%, 68% 77%, 64.5% 100%, 0 100%); }
.title__piece {
  clip-path: polygon(100% 31%, 100% 100%, 64.5% 100%, 68% 77%, 72% 63%, 81% 43%, 89% 45%);
  transform: translate(0.025em, 0.035em) rotate(0.8deg);
  transform-origin: 85% 70%;
}

.line {
  margin-top: 1.5rem;
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
  color: rgba(224, 255, 255, 0.78);
  text-wrap: balance;
}
.voice {
  margin-top: 1.4rem; min-height: 1.5em; max-width: 34ch; text-wrap: balance;
  font-family: var(--mono); font-style: normal;
  font-size: 0.9rem; letter-spacing: 0.01em;
  color: var(--amber); text-shadow: 0 0 12px rgba(255, 176, 0, 0.45);
  transition: opacity 0.4s;
}
.voice.is-clearing { opacity: 0; }
.caret { display: inline-block; width: 0.55em; height: 1.05em; margin-left: 3px; vertical-align: -0.15em; background: var(--amber); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hint { margin-top: 0.6rem; font-size: 1rem; color: var(--dim); }

/* The glimpse: a few seconds of the real game, cropped to the stage, no interface.
   It sits on the lower arc of the halo, its edges dissolving into the dark. */
.glimpse {
  grid-area: 2 / 1;
  position: relative; z-index: 2;
  width: min(620px, 90vw, 74vmin);
  margin: calc(-1 * clamp(2.5rem, 11vmin, 6.5rem)) 0 0;
}
.glimpse video {
  display: block; width: 100%; height: auto;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent), linear-gradient(transparent, #000 22%, #000 80%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent), linear-gradient(transparent, #000 22%, #000 80%, transparent);
  mask-composite: intersect;
}
.glimpse figcaption { margin-top: -0.4rem; font-size: 0.95rem; color: var(--dim); }

/* The one moment: the halo lights, the name appears whole and then cracks, then it speaks. */
@media (prefers-reduced-motion: no-preference) {
  .halo__ring path, .halo__shard path { stroke-dasharray: 1; animation: draw 1.6s var(--ease) both; }
  .halo__ring path:nth-child(2) { animation-delay: 0.15s; }
  .halo__ring path:nth-child(3) { animation-delay: 0.3s; }
  .halo__ring path:nth-child(4) { animation-delay: 0.45s; }
  .halo__shard path { animation-delay: 0.6s; }
  .halo circle { animation: fade 0.6s 1.4s both; }
  .halo__spin { animation: spin 240s linear 2s infinite; }
  .title { animation: fade 1.2s 0.5s both; }
  .title__piece { animation: crack 0.5s 1.9s cubic-bezier(0.5, 0, 0.7, 1.4) both; }
  .line { animation: fade 1s 2.3s both; }
  .voice, .hint { animation: fade 1s 3s both; }
  .glimpse { animation: fade 1.4s 3.4s both; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes crack { from { transform: none; } }

@media (max-width: 640px) {
  .bar { font-size: 0.95rem; }
  .studio img { height: 24px; }
  .halo { width: 96vmin; }
  .glimpse { width: 94vw; }
  .line { max-width: 20ch; }
  .voice { font-size: 0.82rem; max-width: 28ch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
