:root {
  --radius: 28px;
  color-scheme: dark;

  /* ----- Dark (default) ----- */
  --ink: #dfeaed;
  --ink-soft: #dfeaedc4;
  --bg: #03070c;
  --sky: linear-gradient(180deg, #02050a 0%, #040a10 55%, #07131c 100%);
  --vignette: #000000b3;
  --grid: #8fb3bc08;
  --grain-opacity: 0.16;
  --glow: radial-gradient(ellipse 50% 100% at 50% 100%, #2f667559 0%, #1c46553d 32%, #0f2a3619 62%, transparent 100%);

  --wm-glow: #4e7f8c;
  --wm-glow-opacity: 0.28;
  --wm-fill: linear-gradient(180deg, #d7e6ea 6%, #97b5be 40%, #5d8391 76%, #37535f 100%);
  --wm-shadow:
    drop-shadow(0 0.025em 0 #061219)
    drop-shadow(0 0.06em 0.05em #030c12b3)
    drop-shadow(0 0.16em 0.22em #000000a6);

  --veil: #03070c8c;
  --pane-light: #b4d0d71f;
  --pane-border: #a9c6cd26;
  --pane-shadow: inset 0 1px 0 #ffffff3d, inset 0 -1px 0 #ffffff0f, 0 30px 80px #00000099;
  --title-shadow: 0 2px 16px #00000073;
  --aura-opacity: 0.7;

  --btn-bg: #ffffff0f;
  --btn-bg-hover: #ffffff1c;
  --btn-border: #ffffff26;

  /* Used only if JS is off; script.js animates the real one */
  --ring-static: conic-gradient(from 0deg, #eaf9ff, #4f9fc8, #143550, #0f2a3f, #2f78a6, #eaf9ff);
}

:root[data-theme="light"] {
  color-scheme: light;

  --ink: #0b1d2a;
  --ink-soft: #0b1d2ab8;
  --bg: #e3edf3;
  --sky: linear-gradient(180deg, #f5f9fb 0%, #e3edf3 55%, #c9dce7 100%);
  --vignette: #0b1d2a24;
  --grid: #0b1d2a0d;
  --grain-opacity: 0.1;
  --glow: radial-gradient(ellipse 50% 100% at 50% 100%, #ffffffe0 0%, #e4f1f8a8 32%, #cfe4ef40 62%, transparent 100%);

  --wm-glow: #5fa4c6;
  --wm-glow-opacity: 0.3;
  --wm-fill: linear-gradient(180deg, #0b1d2a 6%, #1b4463 42%, #2f6e92 78%, #4f92b5 100%);
  --wm-shadow:
    drop-shadow(0 0.025em 0 #ffffffcc)
    drop-shadow(0 0.06em 0.06em #0b1d2a26)
    drop-shadow(0 0.16em 0.25em #0b1d2a40);

  --veil: #e9f1f5a6;
  --pane-light: #ffffffb3;
  --pane-border: #ffffffb3;
  --pane-shadow: inset 0 1px 0 #ffffffe6, inset 0 -1px 0 #0b1d2a14, 0 30px 80px #0b1d2a40;
  --title-shadow: none;
  --aura-opacity: 0.5;

  --btn-bg: #ffffff8c;
  --btn-bg-hover: #ffffffcc;
  --btn-border: #0b1d2a1f;

  --ring-static: conic-gradient(from 0deg, #0a2f52, #4a9cc4, #cfe6f0, #4a9cc4, #0a2f52);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }

body {
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
.is-locked { overflow: hidden; }

/* ---------- Background: very dark blue, soft light from below ---------- */
.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 0%, transparent 35%, var(--vignette) 100%),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg,  var(--grid) 0 1px, transparent 1px 64px),
    var(--sky);
}

/* A wide, gentle wash of light rising from the bottom edge */
.glow {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 150vw;
  height: 80vh;
  translate: -50% 0;
  background: var(--glow);
}

.grain {
  position: absolute;
  inset: 0;
  opacity: var(--grain-opacity);
  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='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ---------- Wordmark ---------- */
.page {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: clamp(72px, 11vh, 100px) clamp(20px, 6vw, 100px) 0;
}

.wordmark {
  position: relative;
  margin: 0;
  font-family: "Unbounded", "Syne", system-ui, sans-serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 13vw, 11rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-align: center;
}

.wordmark__glow {
  position: absolute;
  inset: 0;
  color: var(--wm-glow);
  filter: blur(34px);
  opacity: var(--wm-glow-opacity);
  transform: translateY(0.06em);
}

.wordmark__text {
  position: relative;
  display: block;
  background: var(--wm-fill);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: var(--wm-shadow);
}

/* ---------- Blur veil ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--veil);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  animation: fade-in 0.6s ease-out both;
}

/* ---------- Glass notice ----------
   .notice has no backdrop-filter or opacity animation of its own, so the
   pane inside it can see the page behind. */
.notice {
  --mx: 50%;
  --my: 0%;
  position: fixed;
  z-index: 11;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  width: min(560px, calc(100vw - 32px));
  border-radius: var(--radius);
  outline: none;
  animation: notice-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s both;
}

/* The glass. url(#lg) bends light only along the edge band (see script.js);
   the interior stays undistorted. */
.notice__pane {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(260px circle at var(--mx) var(--my), var(--pane-light), transparent 70%);
  -webkit-backdrop-filter: url(#lg) blur(3px) saturate(180%);
  backdrop-filter: url(#lg) blur(3px) saturate(180%);
  border: 1px solid var(--pane-border);
  box-shadow: var(--pane-shadow);
}

/* ---------- Endless light around the edge ----------
   One continuous band of icy blues runs around the whole border.
   script.js writes the gradient into --ring on the two pieces below,
   spacing the colours evenly along the perimeter so the light moves at
   a constant speed. */
.notice__ring,
.notice__aura::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: var(--w);
  pointer-events: none;
  background: var(--ring, var(--ring-static));
  /* keep only the ring: paint the whole box, subtract the inside */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  mask-composite: exclude;
}

.notice__ring { --w: 2px; z-index: 1; }

/* Same ring, blurred, for the glow */
.notice__aura {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  filter: blur(9px);
  opacity: var(--aura-opacity);
}
.notice__aura::before { --w: 4px; }

.notice__body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(24px, 5vw, 40px);
}

.notice__title {
  margin: 0;
  font-family: "Syne", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-shadow: var(--title-shadow);
}

.notice__text {
  margin: 0;
  max-width: 44ch;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-soft);
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  position: fixed;
  z-index: 12;
  top: clamp(14px, 3vh, 28px);
  right: clamp(14px, 3vw, 28px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  border-radius: 50%;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background 0.2s;
}
.theme-toggle:hover { background: var(--btn-bg-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* Dark shows the sun (switch to light); light shows the moon */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@keyframes fade-in   { from { opacity: 0; } }
/* Transform only: fading opacity would flatten the glass while it plays */
@keyframes notice-in { from { transform: translateY(16px) scale(0.98); } }

/* Browsers without SVG filters in backdrop-filter: plain frosted glass */
@supports not (backdrop-filter: url(#lg)) {
  .notice__pane {
    -webkit-backdrop-filter: blur(3px) saturate(180%);
    backdrop-filter: blur(3px) saturate(180%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .veil { animation: none; }
  .notice { animation: none; }
}