:root {
  --accent: #ffd88a;
  --ink: #f4f1ea;
  --ink-dim: rgba(244, 241, 234, 0.62);
  --glass: rgba(8, 14, 24, 0.42);
  --glass-border: rgba(255, 255, 255, 0.14);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #06111f;
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(120% 90% at 50% 100%, #0d2237 0%, #06111f 60%, #030910 100%);
  transition: opacity 0.7s ease, visibility 0.7s;
}
.loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader.is-soft { background: rgba(3, 9, 16, 0.55); backdrop-filter: blur(6px); }
.loader-ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.12);
  border-top-color: var(--accent);
  animation: spin 1.1s linear infinite;
}
.loader-text { font-family: var(--serif); font-size: 22px; letter-spacing: 0.04em; color: var(--ink-dim); font-style: italic; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- hud ---------- */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud > * { pointer-events: none; }

.topbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px;
}
.brand {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: 0.06em;
}
.brand-mark {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, var(--accent) 45%, rgba(255,216,138,0.15) 100%);
  box-shadow: 0 0 18px var(--accent);
  transition: background 0.6s, box-shadow 0.6s;
}
.menu { pointer-events: auto; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.menu a {
  color: var(--ink-dim); text-decoration: none; font-size: 12.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 8px 14px; border-radius: 999px; transition: color 0.25s, background 0.25s;
}
.menu a:hover { color: var(--ink); }
.menu a.is-active { color: #0b1420; background: var(--accent); }

/* ---------- card ---------- */
.card {
  position: absolute; left: 32px; bottom: 36px; max-width: 460px;
  padding: 26px 30px 24px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.card.is-switching { opacity: 0; transform: translateY(14px); }
.card-kicker { font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; transition: color 0.6s; }
.card-title { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 5.2vw, 64px); line-height: 0.98; margin: 0 0 12px; letter-spacing: -0.01em; }
.card-lead { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink); opacity: 0.9; }
.card-blurb { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink-dim); }

/* ---------- hint ---------- */
.hint {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 12px; letter-spacing: 0.08em; color: var(--ink-dim);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.hint.is-hidden { opacity: 0; transform: translate(-50%, 10px); }
.hint-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.6; } }

/* ---------- arrows ---------- */
.arrow {
  pointer-events: auto;
  position: absolute;
  display: flex; align-items: center; gap: 12px;
  background: none; border: 0; padding: 10px; margin: 0;
  color: var(--ink); cursor: pointer; font: inherit;
  opacity: 0; transition: opacity 0.4s ease, transform 0.5s cubic-bezier(.2,.7,.2,1);
}
.arrow[hidden] { display: none; }
.arrow--up { top: 22px; left: 50%; flex-direction: column; transform: translate(-50%, -12px); }
.arrow--down { bottom: 22px; left: 50%; flex-direction: column; transform: translate(-50%, 12px); }
.arrow--left { left: 22px; top: 50%; flex-direction: row; transform: translate(-12px, -50%); }
.arrow--right { right: 22px; top: 50%; flex-direction: row; transform: translate(12px, -50%); }
.arrow.is-visible { opacity: 1; }
.arrow--up.is-visible, .arrow--down.is-visible { transform: translate(-50%, 0); }
.arrow--left.is-visible, .arrow--right.is-visible { transform: translate(0, -50%); }
.arrow-ring {
  display: grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), inset 0 0 0 0 var(--accent);
  transition: transform 0.35s cubic-bezier(.2,.7,.2,1), box-shadow 0.35s, background 0.35s, border-color 0.35s;
}
.arrow-ring svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.arrow-label { font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; transition: color 0.3s; }
.arrow:hover .arrow-ring, .arrow.is-armed .arrow-ring {
  transform: scale(1.12);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35), 0 0 32px color-mix(in srgb, var(--accent) 55%, transparent);
}
.arrow:hover .arrow-label, .arrow.is-armed .arrow-label { color: var(--ink); }
.arrow.is-armed .arrow-ring { background: color-mix(in srgb, var(--accent) 22%, var(--glass)); }
.arrow:focus-visible .arrow-ring { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- error ---------- */
.error {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  max-width: 560px; padding: 20px 24px; border-radius: 14px;
  background: rgba(60, 10, 10, 0.8); border: 1px solid rgba(255, 120, 120, 0.4);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; white-space: pre-wrap; color: #ffd9d9;
  pointer-events: auto;
}

/* ---------- responsive / input modes ---------- */
@media (pointer: coarse) {
  .arrow { opacity: 0.55; }
  .arrow--up, .arrow--down { transform: translate(-50%, 0); }
  .arrow--left, .arrow--right { transform: translate(0, -50%); }
  #gl { cursor: default; }
}
@media (max-width: 720px) {
  .topbar { padding: 14px 16px; }
  .brand-name { display: none; }
  .menu a { padding: 7px 9px; font-size: 11px; letter-spacing: 0.05em; }
  .card { left: 16px; right: 16px; bottom: 96px; max-width: none; padding: 20px 22px 18px; }
  .card-blurb { display: none; }
  .hint { bottom: 92px; font-size: 11px; }
  .arrow-ring { width: 50px; height: 50px; }
  .arrow-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .hint-dot { animation: none; }
}
