:root {
  --navy: #0b2f5b;
  --ink: #0d3a6e;
  --glass-hi: rgba(255, 255, 255, 0.72);
  --glass-lo: rgba(214, 240, 255, 0.34);
  --edge: rgba(255, 255, 255, 0.85);
  --shade: rgba(16, 90, 170, 0.32);
  --aqua: #3fb6f2;
  --green-a: #b6f27a;
  --green-b: #3fb418;
  --font: "Lucida Grande", "Lucida Sans Unicode", "Segoe UI", Frutiger, "Frutiger Linotype", Tahoma, sans-serif;
  --sheen: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 100%);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  color: var(--navy);
  background: #7fd0f7;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* ================= Background =================
   The environment is rendered by scene.js (WebGL). This gradient is what you
   see for a moment before it starts, and if WebGL is unavailable. */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(140deg, #f2fbff 0%, #c4ecff 28%, #86d3f8 58%, #4aaeee 82%, #2e93dc 100%);
}
.sky canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.6s ease; }
.sky canvas.ready { opacity: 1; }

/* ================= Page ================= */
.page {
  height: calc(100% - 40px);
  overflow: hidden;
  justify-content: center;
  max-width: 44rem;
  margin: 0 auto;
  padding: 1rem 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

/* Glossy glass lettering with a mirrored reflection. */
.wordmark {
  margin: 0 0 0.55em;
  display: flex;
  align-items: baseline;
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(3.5rem, min(24vw, 21vh), 12rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.03em;
  -webkit-box-reflect: below -0.08em linear-gradient(transparent 55%, rgba(255, 255, 255, 0.4));
}
.wordmark span {
  background-image:
    linear-gradient(100deg, rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 80%),
    linear-gradient(180deg, #ffffff 0%, #e4f6ff 44%, #8fd6fb 50%, #3aa9ea 100%);
  background-size: 240px 100%, 100% 100%;
  background-repeat: no-repeat;
  background-position: -9999px 0, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px rgba(20, 110, 200, 0.55);
  filter: drop-shadow(0 0 14px rgba(255, 255, 255, 0.95)) drop-shadow(0 10px 12px rgba(16, 90, 170, 0.35));
  animation: float 5s ease-in-out infinite;
}
.wordmark span:nth-child(2) { animation-delay: 0.3s; }
.wordmark span:nth-child(3) { animation-delay: 0.6s; }
@keyframes float { 50% { transform: translateY(-9px); } }

/* Glass strip */
.marquee {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  padding: 0.4rem 0;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--edge);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(170, 224, 255, 0.4) 50%, rgba(120, 205, 250, 0.45) 51%, rgba(200, 240, 255, 0.5));
  box-shadow: 0 6px 16px var(--shade), inset 0 1px 0 #fff;
}
.marquee { position: relative; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
.marquee-track {
  margin: 0 1.2rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.marquee span { display: inline-block; padding-left: 100%; animation: scroll 32s linear infinite; }
@keyframes scroll { to { transform: translateX(-100%); } }

.windows { width: 100%; display: flex; flex-direction: column; gap: 1.5rem; align-items: center; }

/* ================= Aero glass windows ================= */
.win {
  width: 100%;
  max-width: 30rem;
  border-radius: 12px;
  border: 1px solid var(--edge);
  position: relative;
  background:
    radial-gradient(120% 70% at 0% 0%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 55%),
    linear-gradient(160deg, var(--glass-hi), var(--glass-lo) 60%, rgba(255, 255, 255, 0.5));
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow:
    0 14px 34px var(--shade),
    0 2px 6px rgba(16, 90, 170, 0.12),
    inset 0 1px 0 #fff,
    inset 1px 0 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(20, 90, 170, 0.22),
    inset 0 0 0 1px rgba(120, 200, 250, 0.35);
  padding: 4px;
}

/* The shared travelling light (light.js sets --sweep-x per surface). It sits
   in the glass, beneath the content, so it lights the surface not the text. */
.titlebar, .win-body, .marquee-track, .start, .tray { position: relative; z-index: 1; }
.win::before, .marquee::before, .taskbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: var(--sheen) no-repeat;
  background-size: 240px 100%;
  background-position: var(--sweep-x, -9999px) 0;
}
.titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 4px 3px 10px;
  border-radius: 8px 8px 4px 4px;
  color: var(--navy);
  font-weight: 600;
  text-shadow: 0 0 8px #fff, 0 0 3px #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0 48%, rgba(150, 215, 252, 0.45) 50%, rgba(190, 232, 255, 0.55));
}
.btns { display: flex; gap: 3px; }
.btns i {
  font-style: normal;
  width: 26px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--navy);
  text-shadow: none;
  border-radius: 4px;
  border: 1px solid rgba(20, 90, 170, 0.55);
  background: linear-gradient(180deg, #fff 0 48%, #bfe6ff 50%, #e9f8ff);
  box-shadow: inset 0 1px 0 #fff;
}
.btns i:last-child {
  width: 40px;
  color: #fff;
  border-color: #7c1010;
  background: linear-gradient(180deg, #ffb0a0 0 48%, #e0341c 50%, #ff7a5a);
}
.win-body { padding: 1rem 1.1rem 1.2rem; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55); }
.win-body p { margin: 0 0 0.6rem; }
.win-body p:last-child { margin-bottom: 0; }
.win-body.center { display: flex; flex-direction: column; align-items: center; gap: 0.9rem; }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Gel button */
.gel-btn {
  font: inherit;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 2.6rem;
  color: #0c3d05;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  border: 1px solid #2c8a10;
  background: linear-gradient(180deg, #e5ffc8 0 48%, var(--green-a) 50%, #6fd83c);
  box-shadow: 0 6px 14px rgba(30, 110, 20, 0.35), inset 0 1px 0 #fff, inset 0 -3px 6px rgba(40, 140, 20, 0.35);
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.gel-btn:hover, .gel-btn:focus-visible { filter: brightness(1.08) saturate(1.1); transform: translateY(-2px); outline: none; }
.gel-btn:active { transform: translateY(1px); filter: brightness(0.96); }

.skip { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; cursor: pointer; }
.skip input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  display: inline-grid;
  place-content: center;
  border-radius: 5px;
  border: 1px solid rgba(20, 90, 170, 0.6);
  background: linear-gradient(180deg, #fff 0 48%, #d3edff 50%, #f1faff);
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(16, 90, 170, 0.25);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.skip input::before {
  content: "";
  width: 11px;
  height: 11px;
  background: #1c5f08;
  clip-path: polygon(12% 50%, 0 64%, 40% 100%, 100% 18%, 86% 4%, 39% 72%);
  transform: scale(0) rotate(-12deg);
  transition: transform 0.22s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.skip input:checked {
  border-color: #2c8a10;
  background: linear-gradient(180deg, #e5ffc8 0 48%, var(--green-a) 50%, #6fd83c);
  box-shadow: inset 0 1px 0 #fff, 0 1px 4px rgba(30, 110, 20, 0.35);
}
.skip input:checked::before { transform: scale(1) rotate(0deg); }
.skip input:focus-visible { outline: 2px solid var(--aqua); outline-offset: 2px; }
.say { font-size: 1rem; text-align: center; min-height: 1.4em; }
.pct { font-size: 1.4rem; font-weight: 700; }

/* Smooth glossy progress bar */
.aerobar {
  width: 100%;
  height: 22px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(20, 90, 170, 0.55);
  background: linear-gradient(180deg, rgba(210, 236, 255, 0.9), rgba(255, 255, 255, 0.9));
  box-shadow: inset 0 2px 4px rgba(20, 90, 170, 0.3);
  overflow: hidden;
}
.aerofill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.65) 0 46%, transparent 50%),
    linear-gradient(90deg, var(--green-b), var(--green-a), var(--green-b)) 0 0 / 200% 100%;
  animation: run 1.6s linear infinite;
}
.aerofill.sweep { width: 45%; animation: run 1.6s linear infinite, slide 3.4s ease-in-out infinite alternate; }
@keyframes run { to { background-position: 0 0, -200% 0; } }
@keyframes slide { from { margin-left: 0; } to { margin-left: 55%; } }

.ball {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid rgba(20, 110, 200, 0.6);
  background: radial-gradient(circle at 35% 26%, #fff 0 14%, rgba(255, 255, 255, 0.25) 30%, transparent 32%), radial-gradient(circle at 50% 90%, #b8f6ff, #38a8ee 70%);
  box-shadow: 0 8px 14px rgba(16, 90, 170, 0.3), inset 0 -6px 10px rgba(255, 255, 255, 0.5);
  animation: hop 0.7s ease-in-out infinite alternate;
}
@keyframes hop { to { transform: translateY(-10px); } }

/* ================= Intro overlay ================= */
.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.55), rgba(225, 244, 255, 0.34) 55%, rgba(150, 210, 250, 0.3));
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
  transition: opacity 0.7s ease, backdrop-filter 0.7s ease, -webkit-backdrop-filter 0.7s ease;
}
.intro[hidden], .intro .win[hidden] { display: none; }
.intro.done { opacity: 0; pointer-events: none; -webkit-backdrop-filter: blur(0) saturate(1); backdrop-filter: blur(0) saturate(1); }
.intro-win { max-width: 22rem; }

/* ================= Taskbar ================= */
.taskbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0 48%, rgba(70, 150, 225, 0.55) 50%, rgba(40, 120, 210, 0.65));
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--edge);
  box-shadow: 0 -6px 18px rgba(16, 90, 170, 0.22);
}
.start, .tray {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  font-weight: 700;
  color: var(--navy);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(180deg, #fff 0 48%, #bfe6ff 50%, #e9f8ff);
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(16, 90, 170, 0.3);
}
.tray { font-weight: 500; font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) {
  .wordmark span, .marquee span, .aerofill, .ball, .cursor { animation: none !important; }
  .marquee span { padding-left: 0; }
  .intro { display: none; }
}

/* ================= Cursor (cursor.js) =================
   Only active once the script adds .custom-cursor, so the native cursor is
   the fallback everywhere else. */
html.custom-cursor, html.custom-cursor * { cursor: none !important; }

.gcur {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 2147483647;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  will-change: transform;
}
.gcur.on { opacity: 1; }
.gcur > * {
  position: absolute;
  left: -34px;
  top: -34px;
  overflow: visible;
  pointer-events: none;
}
.gcur-shadow { will-change: transform, filter; }
/* The body really refracts what's behind it: blurred, brightened, saturated. */
.gcur-glass {
  -webkit-backdrop-filter: blur(1.4px) saturate(1.9) brightness(1.16) contrast(1.05);
  backdrop-filter: blur(1.4px) saturate(1.9) brightness(1.16) contrast(1.05);
}
.gcur-body { filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, 0.7)); }
