*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #000; color: #fff; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg, canvas { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }
#stage { min-height: 100vh; min-height: 100dvh; outline: none; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 1000; background: #fff; color: #000; padding: 10px 14px; border-radius: 6px; font: 600 14px system-ui; transition: top .2s; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid #67e8f9; outline-offset: 3px; }

/* ---------- Dial: one control bar, skinned per era through CSS variables ---------- */
.dial {
  --d-bg: rgba(18, 18, 26, .74); --d-border: rgba(255, 255, 255, .1); --d-fg: rgba(255, 255, 255, .64); --d-strong: #fff;
  --d-hover: rgba(255, 255, 255, .08); --d-on-bg: #fff; --d-on-fg: #0b0b12; --d-radius: 16px; --d-inner: 11px;
  --d-accent: linear-gradient(135deg, #67e8f9, #a78bfa); --d-accent-fg: #0b0a1c;
  --d-font: 600 13px/1 "Space Grotesk", system-ui, sans-serif; --d-track: .05em;
  --d-shadow: 0 12px 40px -12px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .06);
  --d-blur: blur(16px) saturate(1.5);
  position: fixed; z-index: 900; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 3px; padding: 5px;
  max-width: calc(100vw - 24px);
  background: var(--d-bg); border: 1px solid var(--d-border); border-radius: var(--d-radius);
  box-shadow: var(--d-shadow); backdrop-filter: var(--d-blur); -webkit-backdrop-filter: var(--d-blur);
  font: var(--d-font); letter-spacing: var(--d-track); color: var(--d-fg);
}
.dial__label { font-size: 10px; text-transform: uppercase; padding: 0 6px 0 8px; white-space: nowrap; opacity: .7; }
.dial__track { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.dial__track::-webkit-scrollbar { display: none; }
.dial button, .dial a { -webkit-tap-highlight-color: transparent; }
.dial__year, .dial__act, .dial__sound, .dial__step, .dial__now {
  position: relative; border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit;
  min-height: 36px; border-radius: var(--d-inner); transition: background .2s, color .2s, transform .15s;
}
.dial__year { padding: 0 12px; }
.dial__year:hover, .dial__act:hover, .dial__sound:hover, .dial__step:hover { background: var(--d-hover); color: var(--d-strong); }
.dial__year[aria-selected="true"] { background: var(--d-on-bg); color: var(--d-on-fg); }
.dial__year:active, .dial__act:active, .dial__step:active, .dial__now:active { transform: scale(.95); }
.dial__sep { width: 1px; height: 22px; margin: 0 4px; background: var(--d-border); flex: none; }
.dial__act { display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; text-decoration: none; white-space: nowrap; }
.dial__act svg, .dial__sound svg, .dial__step svg { width: 18px; height: 18px; flex: none; }
.dial__contact { background: var(--d-accent); color: var(--d-accent-fg); }
.dial__contact:hover { background: var(--d-accent); color: var(--d-accent-fg); filter: brightness(1.08); }
.dial__sound { width: 36px; display: grid; place-items: center; flex: none; }
.dial__sound.is-off .wave { opacity: 0; }
.dial__sound.is-off::after { content: ""; position: absolute; width: 20px; height: 2px; background: currentColor; transform: rotate(-45deg); }
.dial__step, .dial__now { display: none; }

/* era skins */
body[data-era="1986"] .dial { --d-bg: #000; --d-border: #1f6f2a; --d-fg: #39ff6acc; --d-strong: #39ff6a; --d-hover: #0b2a12; --d-on-bg: #39ff6a; --d-on-fg: #000; --d-radius: 0; --d-inner: 0; --d-accent: #39ff6a; --d-accent-fg: #000; --d-font: 400 20px/1 "VT323", monospace; --d-track: .04em; --d-shadow: 0 0 24px rgba(57, 255, 106, .15); --d-blur: none; }
body[data-era="1996"] .dial { --d-bg: #c0c0c0; --d-border: #fff; --d-fg: #000080; --d-strong: #000; --d-hover: #d8d8d8; --d-on-bg: #000080; --d-on-fg: #ff0; --d-radius: 0; --d-inner: 0; --d-accent: #ff22ff; --d-accent-fg: #ffef4f; --d-font: 700 13px/1 "Times New Roman", serif; --d-track: .02em; --d-shadow: 2px 2px 0 #000; --d-blur: none; border-style: outset; border-width: 2px; }
body[data-era="2006"] .dial { --d-bg: linear-gradient(#5b6670, #3b444c); --d-border: #2b3238; --d-fg: #e8eef4; --d-on-bg: linear-gradient(#fff, #e1ebf5); --d-on-fg: #1f5fae; --d-radius: 13px; --d-inner: 9px; --d-accent: linear-gradient(#ffaa3a 0%, #ff8a00 50%, #f07400 51%, #ff9a20 100%); --d-accent-fg: #fff; --d-font: 700 13px/1 "Lucida Grande", "Trebuchet MS", sans-serif; --d-track: 0; --d-blur: none; }
body[data-era="2016"] .dial { --d-bg: rgba(255, 255, 255, .94); --d-border: #e5e7eb; --d-fg: #6b7280; --d-strong: #111827; --d-hover: #f3f4f6; --d-on-bg: #10b981; --d-on-fg: #fff; --d-radius: 6px; --d-inner: 4px; --d-accent: #10b981; --d-accent-fg: #fff; --d-font: 600 13px/1 Montserrat, sans-serif; --d-track: .02em; --d-shadow: 0 8px 30px -10px rgba(0, 0, 0, .18); }
body[data-era="2036"] .dial { --d-bg: rgba(3, 20, 22, .78); --d-border: rgba(94, 234, 212, .22); --d-fg: rgba(204, 251, 241, .7); --d-strong: #e6fffb; --d-hover: rgba(94, 234, 212, .1); --d-on-bg: #5eead4; --d-on-fg: #021313; --d-accent: linear-gradient(90deg, #67e8f9, #a78bfa); --d-accent-fg: #021313; --d-font: 600 13px/1 Sora, sans-serif; }
body[data-era="2046"] .dial { --d-bg: rgba(255, 255, 255, .72); --d-border: rgba(0, 0, 0, .07); --d-fg: rgba(0, 0, 0, .42); --d-strong: #000; --d-hover: rgba(0, 0, 0, .05); --d-on-bg: #000; --d-on-fg: #fff; --d-accent: #000; --d-accent-fg: #fff; --d-font: 600 11px/1 Orbitron, sans-serif; --d-track: .1em; --d-shadow: 0 10px 40px -16px rgba(0, 0, 0, .2); }

/* mid widths: icons only for the actions */
@media (min-width: 641px) and (max-width: 940px) {
  .dial__label { display: none; }
  .dial__act span { display: none; }
  .dial__act { padding: 0 10px; }
  .dial__year { padding: 0 9px; }
}

/* phones: a bottom dock with prev / current decade / next, CV and Contact */
@media (max-width: 640px) {
  .dial {
    top: auto; left: max(10px, env(safe-area-inset-left)); right: max(10px, env(safe-area-inset-right)); transform: none;
    bottom: calc(10px + env(safe-area-inset-bottom)); max-width: none; padding: 6px; gap: 4px; border-radius: max(var(--d-radius), 0px);
  }
  .dial__label, .dial__track, .dial__sep, .dial__sound { display: none; }
  .dial__step { display: grid; place-items: center; width: 40px; min-height: 46px; flex: none; }
  .dial__step:disabled { opacity: .3; pointer-events: none; }
  .dial__now {
    display: flex; flex: 1; min-width: 0; min-height: 46px; align-items: center; justify-content: center; gap: 8px; padding: 0 10px;
    background: var(--d-hover); color: var(--d-strong);
  }
  .dial__now-y { font-size: 1.25em; letter-spacing: .02em; }
  .dial__now-n { opacity: .7; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .dial__now svg { width: 16px; height: 16px; flex: none; opacity: .7; }
  .dial__act { width: 46px; min-height: 46px; padding: 0; justify-content: center; flex: none; }
  .dial__act span { display: none; }
  body[data-era="1986"] .dial__now-y { font-size: 1.15em; }
}

/* ---------- decade sheet (opened from the phone dock) ---------- */
.sheet { position: fixed; inset: 0; z-index: 975; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, 0); transition: background .25s; }
.sheet.is-open { background: rgba(0, 0, 0, .55); }
.sheet__panel {
  width: min(560px, 100%); max-height: 86dvh; overflow: auto; overscroll-behavior: contain;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  background: #101017; color: #f1f1f6; border-radius: 24px 24px 0 0; border: 1px solid rgba(255, 255, 255, .08); border-bottom: 0;
  box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); font: 15px/1.4 "Space Grotesk", system-ui, sans-serif;
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.sheet.is-open .sheet__panel { transform: none; }
.sheet__grab { display: block; width: 40px; height: 5px; margin: 0 auto 12px; border-radius: 99px; background: rgba(255, 255, 255, .22); }
.sheet__head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 4px 10px; }
.sheet__t { margin: 0; font-size: 18px; font-weight: 700; }
.sheet__progress { font-size: 12px; color: rgba(241, 241, 246, .55); }
.sheet__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sheet__item {
  width: 100%; display: grid; grid-template-columns: 10px 64px 1fr auto; align-items: center; gap: 12px; text-align: left;
  min-height: 60px; padding: 8px 14px 8px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .03); color: inherit; font: inherit; cursor: pointer; transition: background .2s, border-color .2s, transform .15s;
}
.sheet__item:active { transform: scale(.98); }
.sheet__item:hover { background: rgba(255, 255, 255, .07); }
.sheet__item[aria-current="true"] { border-color: rgba(103, 232, 249, .5); background: rgba(103, 232, 249, .08); }
.sheet__sw { width: 10px; height: 36px; border-radius: 99px; background: var(--c); box-shadow: 0 0 12px var(--c); }
.sheet__y { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sheet__n b { display: block; font-size: 14.5px; font-weight: 600; }
.sheet__n small { display: block; font-size: 12.5px; color: rgba(241, 241, 246, .55); }
.sheet__seen { font-size: 12px; color: rgba(241, 241, 246, .45); }
.sheet__foot { display: flex; gap: 8px; margin-top: 12px; }
.sheet__foot > * { flex: 1; min-height: 46px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); color: inherit; font: 600 14px "Space Grotesk", system-ui, sans-serif; text-decoration: none; cursor: pointer; }

/* ---------- Warp ---------- */
.warp { position: fixed; inset: 0; z-index: 950; pointer-events: none; opacity: 0; transition: opacity .35s ease; }
.warp.is-on { opacity: 1; pointer-events: all; }
.warp.is-fade { opacity: 1; background: #000; transition: opacity .15s; }
.warp__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.warp__year { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 12px; }
.warp__digits {
  font: 800 clamp(72px, 18vw, 220px)/1 "Space Grotesk", system-ui; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums; color: #fff;
  text-shadow: 0 0 40px rgba(103, 232, 249, .8), 0 0 120px rgba(192, 132, 252, .6);
}
.warp__note { font: 400 13px "JetBrains Mono", monospace; color: rgba(255, 255, 255, .6); letter-spacing: .05em; }
.warp.is-fade .warp__year { display: none; }

.hint {
  position: fixed; right: 16px; bottom: 14px; z-index: 800; margin: 0;
  font: 500 11px "JetBrains Mono", monospace; color: rgba(255, 255, 255, .4);
  pointer-events: none; mix-blend-mode: difference;
}
@media (max-width: 640px), (hover: none) { .hint { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

[hidden] { display: none !important; }

/* ---------- visited marks on the dial ---------- */
.dial__year.is-seen::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: currentColor; opacity: .5; }
.dial__year[aria-selected="true"]::after { display: none; }
body.is-new .dial { animation: dial-pulse 1.6s ease-in-out 3; }
@keyframes dial-pulse { 50% { box-shadow: 0 0 0 6px rgba(103, 232, 249, .35), 0 10px 40px -10px rgba(0, 0, 0, .6); } }

/* ---------- toasts ---------- */
.toasts { position: fixed; z-index: 960; left: 50%; top: calc(66px + env(safe-area-inset-top)); transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  font: 500 13px/1.4 "Space Grotesk", system-ui, sans-serif; color: #fff; text-align: center;
  padding: 10px 16px; border-radius: 12px; background: rgba(18, 18, 28, .86); border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(12px); box-shadow: 0 12px 40px -12px rgba(0, 0, 0, .6);
  animation: toast-in .35s cubic-bezier(.2, .8, .2, 1) both;
}
.toast.out { animation: toast-out .4s ease both; }
.toast--badge { font-size: 15px; font-weight: 600; padding: 14px 20px; background: linear-gradient(135deg, rgba(103, 232, 249, .95), rgba(167, 139, 250, .95)); color: #0b0a1c; border: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }
@media (max-width: 640px) { .toasts { top: max(14px, env(safe-area-inset-top)); } }

/* ---------- shortcuts panel ---------- */
.keys { position: fixed; inset: 0; z-index: 970; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.keys__card { width: min(420px, 100%); background: #11111a; color: #eee; border: 1px solid rgba(255, 255, 255, .12); border-radius: 18px; padding: 22px 24px; font: 14px/1.5 "Space Grotesk", system-ui, sans-serif; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.keys__t { margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.keys dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0 0 16px; align-items: center; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: rgba(238, 238, 238, .75); }
kbd { display: inline-block; min-width: 26px; text-align: center; padding: 3px 7px; border-radius: 6px; font: 600 12px "JetBrains Mono", monospace; background: #22222e; border: 1px solid #383848; border-bottom-width: 3px; }
.keys__eggs { font-size: 13px; color: rgba(238, 238, 238, .7); margin: 0 0 16px; }
.keys__close { min-height: 44px; padding: 0 20px; border: 0; border-radius: 10px; background: #fff; color: #111; font-weight: 700; }
