: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(3rem, min(18vw, 15vh), 9rem);
  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: linear-gradient(180deg, #ffffff 0%, #e4f6ff 44%, #8fd6fb 50%, #3aa9ea 100%);
  -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.02em;
  font-size: 0.9rem;
  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 {
  position: relative;
  z-index: 1;
  height: 1.3em;
  line-height: 1.3em;
  margin: 0 1.2rem;
  overflow: hidden;
  text-align: center;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent);
}
.slides { list-style: none; margin: 0; padding: 0; }
.slides li { height: 1.3em; white-space: nowrap; }

.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, .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; }
.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.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; }
/* 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%; } }

/* ================= Logon screen (intro) =================
   A Vista-style welcome screen over the live world. The desktop (windows,
   taskbar) stays hidden behind it until you log on. */
body.locked .page, body.locked .taskbar { opacity: 0; transform: scale(0.985); }
.page, .taskbar { transition: opacity 0.9s ease, transform 0.9s ease; }

.intro {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1rem 5rem;
  background: radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.5), rgba(225, 244, 255, 0.3) 55%, rgba(150, 210, 250, 0.26));
  -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] { display: none; }
.intro.done { opacity: 0; pointer-events: none; -webkit-backdrop-filter: blur(0) saturate(1); backdrop-filter: blur(0) saturate(1); }

.user {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  animation: user-in 0.7s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
@keyframes user-in { from { opacity: 0; transform: translateY(10px); } }

/* User tile: a picture in a glass frame, glowing on hover like Vista's. */
.tile {
  position: relative;
  width: 112px;
  height: 112px;
  padding: 7px;
  border-radius: 10px;
  border: 1px solid rgba(20, 90, 170, 0.5);
  background: linear-gradient(180deg, #ffffff 0%, #e6f5ff 48%, #cfe9fb 52%, #eef8ff 100%);
  box-shadow: 0 10px 24px rgba(16, 90, 170, 0.3), inset 0 1px 0 #fff;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.tile:hover, .tile:focus-visible {
  outline: none;
  box-shadow: 0 10px 24px rgba(16, 90, 170, 0.3), inset 0 1px 0 #fff,
    0 0 0 3px rgba(90, 190, 245, 0.55), 0 0 22px 4px rgba(150, 220, 255, 0.85);
}
.tile:active { transform: scale(0.98); }
.pic {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(20, 90, 170, 0.35);
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 34%),
    linear-gradient(118deg, rgba(255, 255, 255, 0) 38%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(ellipse at 75% 110%, #9ff0c8 0, rgba(159, 240, 200, 0) 55%),
    linear-gradient(165deg, #eafbff 0%, #8fd6fb 45%, #2a86d8 100%);
}
.pic::after { /* glass shine over the top half */
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.08));
}
.name {
  margin: 0.15rem 0 0;
  font-size: 1.5rem;
  color: var(--navy);
  text-shadow: 0 0 10px #fff, 0 1px 0 rgba(255, 255, 255, 0.8);
}

.logon-row { display: flex; align-items: center; justify-content: center; gap: 0.6rem; min-height: 40px; }
.logon-row[hidden] { display: none; }
.hint { font-size: 0.9rem; color: rgba(11, 47, 91, 0.75); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }

/* Round glass arrow button, as next to Vista's password box. */
.go {
  width: 34px;
  height: 34px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #1b5fae;
  background: linear-gradient(180deg, #a9ddff 0%, #6fc0f5 48%, #2a83d6 52%, #4fb0f0 100%);
  box-shadow: 0 3px 8px rgba(16, 90, 170, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: filter 0.2s, box-shadow 0.2s;
}
.go svg { width: 16px; height: 16px; filter: drop-shadow(0 1px 0 rgba(10, 50, 110, 0.5)); }
.go:hover, .go:focus-visible { outline: none; filter: brightness(1.1); box-shadow: 0 3px 8px rgba(16, 90, 170, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 12px 2px rgba(130, 210, 255, 0.9); }
.go:active { filter: brightness(0.95); }

/* "Welcome" with the busy ring. */
.ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: conic-gradient(rgba(63, 182, 242, 0) 0deg, rgba(63, 182, 242, 0.5) 200deg, #bdf0ff 330deg, #ffffff 360deg);
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 56%);
  mask: radial-gradient(circle, transparent 52%, #000 56%);
  filter: drop-shadow(0 0 3px rgba(120, 210, 255, 0.9));
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.welcome { font-size: 1.9rem; color: var(--navy); text-shadow: 0 0 12px #fff, 0 1px 0 rgba(255, 255, 255, 0.8); }
.status { margin: 0; min-height: 1.3em; font-size: 0.9rem; color: rgba(11, 47, 91, 0.75); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.status.swap { animation: status-in 0.35s ease both; }
@keyframes status-in { from { opacity: 0; } }

/* Bottom bar: quiet glass strip with the time on the left, power on the right. */
.logon-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 44px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(120, 190, 240, 0.16));
}
.logon-clock {
  font-size: 0.95rem;
  color: rgba(11, 47, 91, 0.8);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
}
#auto { font-size: 0.8rem; color: rgba(11, 47, 91, 0.75); text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); margin-top: 0.2rem; }
.status:empty { display: none; }
.power {
  justify-self: end;
  width: 26px;
  height: 26px;
  opacity: 0.85;
  border-radius: 50%;
  border: 1px solid #8a1a0a;
  background: linear-gradient(180deg, #ffb49e 0%, #f0664a 48%, #c9260e 52%, #ef5a36 100%);
  box-shadow: 0 3px 8px rgba(120, 30, 10, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
}
.power svg { width: 13px; height: 13px; }

/* ================= 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, .aerofill, .cursor { animation: none !important; }
  .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)); }
