/* ---------------------------------------------------
   Tokens
--------------------------------------------------- */
:root {
  /* tells the browser this page handles both schemes itself, so
     "force dark" modes don't recolour the light theme (or vice versa) */
  color-scheme: light dark;
  --font-display: 'Space Mono', 'Courier New', monospace;
  --font-body: 'Inter', Arial, Helvetica, sans-serif;
  --cursor-auto: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cpolygon fill='%23000' points='1,1 1,18 6,14 9,22 13,20 10,13 17,13'/%3E%3Cpolygon fill='%23fff' points='3,3 3,16 7,13 10,20 12,19 9,12 15,12'/%3E%3C/svg%3E") 1 1, auto;
  --cursor-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cpath fill='%23000' d='M8 1h3v10h2V6h3v5h2V8h3v11h-2v3h-3v2H7v-2H4v-3H2V10h3V4h3z'/%3E%3Cpath fill='%23fff' d='M9 2h1v10h3V7h1v5h3V9h1v9h-1v3h-3v2H8v-2H5v-3H3v-8h2V5h4z'/%3E%3C/svg%3E") 8 1, pointer;
}

:root[data-theme="light"] {
  --bg: #E9EFE9;
  --surface: #FBFBF5;
  --text: #14181C;
  --text-muted: #4B5750;
  --accent: #0F6E6A;
  --accent-strong: #0B4F4C;
  --accent2: #7A2E8C;
  --border: #14181C;
  --shadow-color: rgba(20, 24, 28, 0.85);
  --on-accent: #FBFBF5;
  --on-accent2: #FBFBF5;
  --deco-line: #1c1c1c;
  --deco-flake: #2d5f99;
  --deco-bat: #1a1210;
}

:root[data-theme="dark"] {
  --bg: #0E1418;
  --surface: #161F24;
  --text: #E7EEE9;
  --text-muted: #9AAAA4;
  --accent: #4FE0D0;
  --accent-strong: #7FEDE1;
  --accent2: #9A1FC2;
  --border: #4FE0D0;
  --shadow-color: rgba(79, 224, 208, 0.35);
  --on-accent: #0E1418;
  --on-accent2: #F4EAFA;
  --deco-line: #ececec;
  --deco-flake: #f4fbff;
  --deco-bat: #f2f2f2;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-body);
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  cursor: var(--cursor-auto);
}

img {
  -webkit-user-drag: none;
  user-drag: none;
}

input,
textarea {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

button { color: inherit; }

/* dark-aware hint for browsers that look for a prefers-color-scheme rule */
@media (prefers-color-scheme: dark) {
  :root { color-scheme: light dark; }
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
html::-webkit-scrollbar {
  display: none;
}

/* ---------------------------------------------------
   Load-in reveal: page starts as pure background colour, then a
   soft ripple opens from a focal point and uncovers everything
--------------------------------------------------- */
@property --reveal-r {
  syntax: '<percentage>';
  inherits: false;
  initial-value: -4%;
}

#preload-curtain {
  position: fixed;
  inset: 0;
  z-index: 999;
  background-color: var(--bg, #E9EFE9);
  -webkit-mask-image: radial-gradient(
    circle farthest-corner at 50% 42%,
    transparent var(--reveal-r),
    #000 calc(var(--reveal-r) + 0.4%)
  );
  mask-image: radial-gradient(
    circle farthest-corner at 50% 42%,
    transparent var(--reveal-r),
    #000 calc(var(--reveal-r) + 0.4%)
  );
  transition: --reveal-r 1.9s cubic-bezier(0.22, 0.6, 0.28, 1), opacity 0.6s ease 1.5s;
  /* failsafe: never leave the page covered if scripts fail to run */
  animation: curtain-failsafe 0.01s linear 12s forwards;
}
#preload-curtain.revealed {
  --reveal-r: 112%;
  opacity: 0;
  pointer-events: none;
}
@keyframes curtain-failsafe {
  to { opacity: 0; visibility: hidden; pointer-events: none; }
}

/* water drop: falls to the focal point, then rings spread outward
   in step with the reveal (same duration + easing as the mask hole) */
#preload-drop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
  --pd-ring-size: 3000px;
  animation: curtain-failsafe 0.01s linear 12s forwards;
}
.pd-drop {
  position: absolute;
  left: 50%;
  top: -8%;
  width: 16px;
  height: 24px;
  margin-left: -8px;
  color: var(--accent, #0F6E6A);
  opacity: 0;
  transform-origin: 50% 100%;
}
#preload-drop.is-falling .pd-drop {
  animation: pd-fall 0.85s cubic-bezier(0.5, 0, 0.85, 0.5) forwards;
}
#preload-drop.is-impact .pd-drop {
  animation: none;
  opacity: 0;
}
@keyframes pd-fall {
  0%   { top: -8%; opacity: 0; transform: scaleY(0.92); }
  12%  { opacity: 1; }
  100% { top: calc(42% - 24px); opacity: 1; transform: scaleY(1.15); }
}
.pd-ring {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 0;
  height: 0;
  border: 1.5px solid var(--accent, #0F6E6A);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  --ring-o: 0.75;
}
#preload-drop.is-impact .pd-ring {
  animation: pd-ring 1.9s cubic-bezier(0.22, 0.6, 0.28, 1) forwards;
}
#preload-drop.is-impact .pd-ring:nth-of-type(1) { --ring-o: 0.75; }
#preload-drop.is-impact .pd-ring:nth-of-type(2) { --ring-o: 0.55; animation-delay: 0.22s; }
#preload-drop.is-impact .pd-ring:nth-of-type(3) { --ring-o: 0.4;  animation-delay: 0.44s; }
#preload-drop.is-impact .pd-ring:nth-of-type(4) { --ring-o: 0.28; animation-delay: 0.66s; }
@keyframes pd-ring {
  0%   { width: 0; height: 0; opacity: var(--ring-o); }
  100% { width: var(--pd-ring-size); height: var(--pd-ring-size); opacity: 0; }
}

body {
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.25s ease, color 0.25s ease;
  cursor: var(--cursor-auto);
}

a,
button,
.cta-button,
.highlight,
.theme-toggle,
.rail-item a,
.icon-box-btn {
  cursor: var(--cursor-pointer);
}

input,
textarea {
  cursor: text;
}

/* subtle CRT scanline texture, dark mode only */
:root[data-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 3px
  );
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------------------------------------------------
   Theme toggle
--------------------------------------------------- */
.current-site-link {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 50;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow-color);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  transition: transform 0.15s ease;
}
.current-site-link:hover { transform: translate(-1px, -1px); }
.current-site-link:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-color); }

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 50;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow-color);
  cursor: var(--cursor-pointer);
  transition: transform 0.15s ease;
}
.theme-toggle:hover { transform: translate(-1px, -1px); }
.theme-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-color); }
.theme-toggle .icon { width: 20px; height: 20px; fill: none; stroke: var(--text); stroke-width: 1.6; }
.theme-toggle .icon-moon { fill: var(--text); stroke: none; display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.season-toggle {
  right: 70px;
}
/* language toggle sits to the left of the season + theme buttons */
.lang-toggle {
  right: 122px;
}
.lang-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text);
  pointer-events: none;
}
.season-icon {
  width: 20px;
  height: 20px;
  display: none;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.6;
}
.season-icon-off { fill: var(--text); stroke: none; }
.season-icon-hall { fill: #e07020; stroke: #14181C; }
:root[data-season="none"] .season-icon-off,
:root:not([data-season]) .season-icon-off { display: block; }
:root[data-season="christmas"] .season-icon-xmas { display: block; }
:root[data-season="halloween"] .season-icon-hall { display: block; }

/* ---------------------------------------------------
   Seasonal decorations
--------------------------------------------------- */
.season-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 35;
  overflow: hidden;
}
.season-web-layer {
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  opacity: 0.20;
  transition: opacity 0.6s ease;
  background:
    radial-gradient(circle at 0 0, rgba(0, 0, 0, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 100% 0, rgba(0, 0, 0, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 0 100%, rgba(0, 0, 0, 0.3) 0%, transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(0, 0, 0, 0.3) 0%, transparent 42%);
}
:root[data-theme="dark"] .season-web-layer {
  mix-blend-mode: screen;
  opacity: 0.24;
  background:
    radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.4) 0%, transparent 42%),
    radial-gradient(circle at 100% 0, rgba(255, 255, 255, 0.4) 0%, transparent 42%),
    radial-gradient(circle at 0 100%, rgba(255, 255, 255, 0.35) 0%, transparent 42%),
    radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.35) 0%, transparent 42%);
}
.season-web {
  position: absolute;
  width: min(280px, 42vw);
  height: min(280px, 42vw);
  opacity: 0.92;
  color: var(--deco-line);
}
.season-web svg {
  display: block;
  width: 100%;
  height: 100%;
}
.season-web-tl { top: 0; left: 0; }
.season-web-tr { top: 0; right: 0; transform: scaleX(-1); }
.season-web-bl { bottom: 0; left: 0; transform: scaleY(-1); }
.season-web-br { bottom: 0; right: 0; transform: scale(-1); }

.season-flake {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 8px;
  background: var(--deco-flake);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--deco-flake);
  animation-name: season-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.season-flake.crystal {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.season-flake.crystal::before,
.season-flake.crystal::after {
  content: "";
  position: absolute;
  inset: 40% 0;
  background: var(--deco-flake);
  box-shadow: 0 0 4px var(--deco-flake);
}
.season-flake.crystal::after {
  inset: 0 40%;
}
.season-bat {
  position: absolute;
  width: 28px;
  height: 14px;
  color: var(--deco-bat);
  transition: opacity 0.6s ease;
  animation-name: season-fly;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.season-bat svg { display: block; width: 100%; height: 100%; }
.season-overlay.qte-on .season-web-layer,
.season-overlay.qte-on .season-bat { opacity: 0 !important; }
html.qte-lock { overflow: hidden; }

.retro-window {
  position: relative;
}
.frame-pumpkin {
  display: none;
  position: absolute;
  z-index: 4;
  top: -18px;
  width: 38px;
  height: 34px;
  filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, 0.35));
  cursor: var(--cursor-pointer);
}
.frame-pumpkin-left { left: 10px; }
.frame-pumpkin-right { right: 10px; transform: scaleX(-1); }
:root[data-season="halloween"] .frame-pumpkin { display: block; }

.frame-pumpkin-inner {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
}
.frame-pumpkin.is-smashed { cursor: var(--cursor-auto); }
.frame-pumpkin-inner.splat-pop {
  animation: splat-pop 0.14s ease-out;
}
@keyframes splat-pop {
  0%   { transform: scale(0.5, 0.35); }
  100% { transform: scale(1, 1); }
}
.frame-chunk {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 2px;
  pointer-events: none;
  animation: chunk-fly 0.6s cubic-bezier(0.2, 0.7, 0.4, 1) forwards;
}
@keyframes chunk-fly {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.4); opacity: 0; }
}

/* ---------------------------------------------------
   Giant pumpkin: tap it 100 times before time runs out
--------------------------------------------------- */
.boss-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 20px;
  background: rgba(10, 12, 14, 0.82);
  touch-action: none;
  animation: boss-fade-in 0.25s ease-out;
}
.boss-overlay.is-leaving {
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}
@keyframes boss-fade-in { from { opacity: 0; } to { opacity: 1; } }

.boss-skip {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 8px 12px;
  font-family: var(--font-display);
  font-size: 12px;
  color: #fff;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.55);
  cursor: var(--cursor-pointer);
}
.boss-skip:hover { border-color: #fff; }

.boss-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.55);
  letter-spacing: 0.02em;
  text-align: center;
}
.boss-title.is-fail { color: #ff8a70; }

.boss-pumpkin {
  position: relative;
  width: min(280px, 64vw);
  aspect-ratio: 40 / 36;
  padding: 0;
  background: none;
  border: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: var(--cursor-pointer);
  filter: drop-shadow(5px 7px 0 rgba(0, 0, 0, 0.4));
  animation: boss-pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.boss-pumpkin:focus-visible { outline: 3px solid #fff; outline-offset: 6px; }
@keyframes boss-pop { from { transform: scale(0); } to { transform: scale(1); } }
.boss-art,
.boss-cracks {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}
.boss-art svg,
.boss-cracks svg { display: block; width: 100%; height: 100%; }
.boss-overlay.is-idle .boss-art { animation: boss-idle 1.1s ease-in-out infinite; }
@keyframes boss-idle { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.boss-cracks path {
  fill: none;
  stroke: #3a1a05;
  stroke-width: 0.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.boss-pumpkin.stage-1 .crack-1,
.boss-pumpkin.stage-2 .crack-1,
.boss-pumpkin.stage-2 .crack-2,
.boss-pumpkin.stage-3 .crack-1,
.boss-pumpkin.stage-3 .crack-2,
.boss-pumpkin.stage-3 .crack-3 { opacity: 1; }
.boss-pumpkin.is-exploding { animation: boss-burst 0.14s ease-out forwards; }
@keyframes boss-burst { to { transform: scale(1.5); opacity: 0; } }

.boss-hud {
  width: min(360px, 86vw);
  padding: 12px 16px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow-color);
  font-family: var(--font-display);
  color: var(--text);
}
.boss-bar {
  height: 16px;
  border: 2px solid var(--border);
  background: var(--bg);
}
.boss-bar-fill {
  display: block;
  width: 0%;
  height: 100%;
  background: #e07020;
  transition: width 0.06s linear;
}
.boss-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 14px;
}
.boss-time.is-low { color: #d64535; font-weight: 700; }
.boss-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.boss-flash {
  position: absolute;
  inset: 0;
  background: #fff6e0;
  opacity: 0;
  pointer-events: none;
}
.boss-flash.go { animation: boss-flash 0.6s ease-out forwards; }
@keyframes boss-flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }

.boss-shock {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 4px solid #e07020;
  border-radius: 50%;
  opacity: 0.9;
  pointer-events: none;
  animation: boss-shock 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes boss-shock { to { transform: scale(60); opacity: 0; border-width: 1px; } }

.boss-chunk {
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  animation: boss-chunk 1.1s cubic-bezier(0.15, 0.6, 0.35, 1) forwards;
}
@keyframes boss-chunk {
  0%   { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); opacity: 0; }
}
.boss-overlay.is-shaking { animation: boss-shake 0.4s ease-out; }
@keyframes boss-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 5px); }
  40% { transform: translate(7px, -6px); }
  60% { transform: translate(-5px, 4px); }
  80% { transform: translate(3px, -2px); }
}

.frame-lights {
  display: none;
  position: absolute;
  z-index: 4;
  left: -6px;
  right: -6px;
  top: -10px;
  height: 16px;
  pointer-events: none;
}
:root[data-season="christmas"] .frame-lights { display: flex; justify-content: space-around; align-items: flex-end; }
.frame-lights .wire {
  position: absolute;
  left: 4px;
  right: 4px;
  top: 4px;
  height: 2px;
  background: #2a2a2a;
  border-radius: 2px;
}
.frame-lights .bulb {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  cursor: var(--cursor-pointer);
  width: 9px;
  height: 12px;
  border-radius: 50% 50% 45% 45%;
  background: #c0392b;
  box-shadow: 0 0 8px currentColor;
  animation: bulb-twinkle 1.4s ease-in-out infinite;
}
.frame-lights .bulb:nth-child(3n) { background: #27ae60; animation-delay: 0.2s; }
.frame-lights .bulb:nth-child(3n+1) { background: #f1c40f; animation-delay: 0.45s; }
.frame-lights .bulb:nth-child(3n+2) { background: #e74c3c; animation-delay: 0.7s; }
.frame-lights .bulb:nth-child(4n) { background: #3498db; animation-delay: 0.95s; }
/* bigger invisible hit area so the small bulbs are easy to press */
.frame-lights .bulb::before {
  content: "";
  position: absolute;
  inset: -6px -5px;
}
/* broken: dark glass with a jagged top, no glow, no twinkle */
.frame-lights .bulb.is-broken {
  background: #2b2b2b !important;
  box-shadow: none;
  animation: none;
  opacity: 1;
  filter: none;
  cursor: var(--cursor-auto);
  clip-path: polygon(0 42%, 18% 22%, 34% 44%, 52% 18%, 70% 42%, 86% 24%, 100% 40%, 100% 100%, 0 100%);
}
.bulb-shard {
  position: absolute;
  left: 50%;
  top: 40%;
  pointer-events: none;
  animation: shard-fly 0.55s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}
@keyframes shard-fly {
  0%   { transform: translate(-50%, -50%) rotate(0deg); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)); opacity: 0; }
}

@keyframes season-fall {
  to { transform: translateY(120vh) translateX(18px); }
}
@keyframes season-fly {
  from { transform: translateX(-10vw); }
  to { transform: translateX(110vw); }
}
@keyframes bulb-twinkle {
  0%, 100% { opacity: 1; filter: brightness(1.1); }
  50% { opacity: 0.45; filter: brightness(0.7); }
}

/* ---------------------------------------------------
   Hero - landing
--------------------------------------------------- */
.landing-page {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: var(--bg);
  padding: 80px 24px;
}
.hero-content { max-width: 817px; }

.eyebrow {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 49px;
  line-height: 1.25;
  margin-bottom: 18px;
  font-weight: 700;
}
.hero .highlight {
  color: var(--accent2);
  font-weight: 700;
  text-decoration: none;
  cursor: var(--cursor-pointer);
}
.hero p { font-size: 18px; margin-bottom: 22px; color: var(--text-muted); }

.cta-buttons {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.cta-button {
  font-family: var(--font-display);
  font-size: 16px;
  padding: 15px 30px;
  background-color: var(--accent);
  color: var(--on-accent);
  border: 2px solid var(--border);
  box-shadow: 4px 4px 0 var(--shadow-color);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cta-button:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-color); }
.cta-button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow-color); }
.cta-button.secondary { background-color: var(--accent2); color: var(--on-accent2); }

/* ---------------------------------------------------
   Two-column sections
--------------------------------------------------- */
.hero-content2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1492px;
  width: 100%;
  gap: 6%;
}
.text-content { flex: 1; }
.text-content h1 {
  font-family: var(--font-display);
  font-size: 48px;
  margin-bottom: 24px;
}
.text-content p { font-size: 21px; margin-bottom: 19px; color: var(--text-muted); line-height: 1.65; }
.text-content .highlight { color: var(--accent2); font-weight: 700; }

.image-content { flex: 1; max-width: 47.5%; }
.retro-window {
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 6px 6px 0 var(--shadow-color);
  width: 95%;
}
.retro-titlebar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
}
.retro-dots { display: flex; gap: 5px; }
.retro-dots i {
  width: 8px;
  height: 8px;
  background: var(--on-accent);
  display: block;
}
.retro-window img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------------------------------------------------
   contact
--------------------------------------------------- */
.contact-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 8px;
}
.contact-icons .icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow-color);
  transition: transform 0.15s ease;
}
:root[data-theme="dark"] .contact-icons .icon-box { border-color: var(--accent2); }
.contact-icons img { display: block; width: 100%; height: 100%; }
:root[data-theme="dark"] .contact-icons img { filter: invert(1); }
.contact-icons a:hover .icon-box,
.contact-icons .icon-box-btn:hover .icon-box { transform: translate(-1px, -1px); }
.contact-icons a:active .icon-box,
.contact-icons .icon-box-btn:active .icon-box { transform: translate(2px, 2px); }

.icon-box-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

/* ---------------------------------------------------
   Mail modal
--------------------------------------------------- */
.mail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 24, 28, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.mail-backdrop.is-open { opacity: 1; pointer-events: auto; }
.mail-backdrop[hidden] { display: flex; }

.mail-panel {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 8px 8px 0 var(--shadow-color);
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.mail-backdrop.is-open .mail-panel { transform: translateY(0) scale(1); opacity: 1; }

.mail-panel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 13px;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
}
.mail-panel-close {
  background: none;
  border: none;
  color: var(--on-accent);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  font-family: var(--font-display);
}

.mail-to-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  font-family: var(--font-display);
  font-size: 13px;
}
.mail-to-label { color: var(--text-muted); }
.mail-to-address {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.mail-copy-btn {
  position: relative;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.mail-copy-btn:hover { transform: translate(-1px, -1px); }
.mail-copy-btn:active { transform: translate(1px, 1px); }
.copy-icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.6;
}
.copy-toast {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 11px;
  padding: 4px 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.copy-toast.show { opacity: 1; }

.mail-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.mail-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-muted);
}
.mail-field input,
.mail-field textarea {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
}
.mail-field input:focus,
.mail-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.mail-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.mail-actions .cta-button { padding: 12px 24px; font-size: 15px; }
.mail-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-display);
}

.confirm-panel .mail-form {
  padding: 20px;
}
.confirm-panel p {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 16px;
}
.confirm-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.confirm-actions .cta-button { padding: 12px 24px; font-size: 15px; }

/* ---------------------------------------------------
   Easter egg: hero shoots 3 aliens above the name
--------------------------------------------------- */
.egg-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
}
.egg-hero,
.egg-alien {
  position: fixed;
  width: 24px;
  height: 24px;
}
.egg-alien { width: 20px; height: 20px; }
.egg-hero svg,
.egg-alien svg { display: block; width: 100%; height: 100%; }

.egg-hero.egg-appear {
  animation: egg-pop-in 0.18s ease-out both;
}
.egg-alien.egg-appear {
  animation: egg-pop-in 0.18s ease-out both;
}
.egg-alien.egg-hit {
  animation: egg-alien-hit 0.25s ease-in forwards;
}

.egg-bullet {
  position: fixed;
  width: 4px;
  height: 10px;
  background: var(--accent2);
  border-radius: 1px;
}
.egg-bullet.egg-fire {
  animation: egg-bullet-fly 0.22s linear forwards;
}

.egg-score {
  position: fixed;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent2);
  transform: translate(-50%, 0);
  opacity: 0;
  animation: egg-score-pop 0.8s ease-out forwards;
}

@keyframes egg-pop-in {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes egg-alien-hit {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}
@keyframes egg-bullet-fly {
  0% { transform: translate(0, 0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)); opacity: 1; }
}
@keyframes egg-score-pop {
  0% { opacity: 0; transform: translate(-50%, 0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}

/* ---------------------------------------------------
   Scroll-down hint (after a minute lingering on a section)
--------------------------------------------------- */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 138px;
  transform: translateX(-50%);
  z-index: 45;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow-color);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.15s ease, bottom 0.45s ease;
}
.scroll-hint svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}
.scroll-hint.show {
  opacity: 1;
  pointer-events: auto;
  animation: scroll-hint-pulse 1.8s ease-in-out infinite;
}
.scroll-hint:hover { transform: translateX(-50%) translateY(-2px); }
@keyframes scroll-hint-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media only screen and (min-width: 1500px) {
  .scroll-hint { bottom: 178px; width: 48px; height: 48px; }
  .scroll-hint svg { width: 24px; height: 24px; }
}

/* nav hidden -> nothing to clear, so the arrow sits lower */
html.nav-idle .scroll-hint { bottom: 28px; }
@media only screen and (min-width: 1500px) {
  html.nav-idle .scroll-hint { bottom: 40px; }
}

.egg-levelup {
  position: fixed;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  transform: translate(-50%, 0);
  opacity: 0;
  text-shadow: 2px 2px 0 var(--shadow-color);
  animation: egg-levelup-pop 1.1s ease-out forwards;
}
@keyframes egg-levelup-pop {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -6px) scale(1.15); }
  40% { transform: translate(-50%, -10px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(1); }
}

/* ---------------------------------------------------
   Section navigation - timeline rail, used at every size
--------------------------------------------------- */
.rail {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 16px;
  justify-content: center;
  z-index: 40;
  transition: opacity 0.5s ease, visibility 0s linear 0s;
}
/* after 30s without activity the nav fades away (see script.js) */
html.nav-idle .rail {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}
.rail-list {
  position: relative;
  list-style: none;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 26px;
  padding: 0 10px;
}
.rail-list::before {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 15px;
  height: 2px;
  background: var(--border);
  opacity: 0.35;
}
.rail-item {
  position: relative;
}
.rail-item a {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px 8px;
  min-width: 44px;
  min-height: 44px;
}
.rail-index { display: none; }
.rail-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 2px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.2s ease;
}
.rail-item.active .rail-dot {
  background: var(--accent);
  transform: scale(1.2);
}
.rail-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) scale(0.75);
  font-family: var(--font-display);
  font-size: 0;
  opacity: 0;
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  color: var(--accent);
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow-color);
  padding: 0;
  pointer-events: none;
  transition: max-width 0.22s ease, opacity 0.22s ease, padding 0.22s ease, transform 0.22s ease;
}
.rail-item.active .rail-label {
  font-size: 12px;
  max-width: 140px;
  opacity: 1;
  padding: 6px 10px;
  transform: translateX(-50%) scale(1);
  animation: rail-pop 0.25s ease-out;
}

@keyframes rail-pop {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.hero { padding-bottom: 108px; }

/* big desktop: same nav, scaled up */
@media only screen and (min-width: 1500px) {
  .rail { bottom: 26px; }
  .rail-list { gap: 40px; padding: 0 16px; }
  .rail-item a { padding: 14px 10px; min-width: 56px; min-height: 56px; }
  .rail-dot { width: 15px; height: 15px; }
  .rail-label { font-size: 0; bottom: calc(100% + 10px); }
  .rail-item.active .rail-label { font-size: 16px; max-width: 200px; padding: 9px 14px; }
  .hero { padding-bottom: 140px; }
}

/* ---------------------------------------------------
   Responsive
--------------------------------------------------- */
@media only screen and (max-width: 768px) {
  .hero { padding: 64px 20px 108px; min-height: 100vh; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 15px; }

  .hero-content2 {
    flex-direction: column;
    gap: 28px;
  }
  .image-content { max-width: 95%; }
  .text-content h1 { font-size: 25px; }

  .current-site-link { top: 14px; left: 14px; width: 38px; height: 38px; }
  .theme-toggle { top: 14px; right: 14px; width: 38px; height: 38px; }
  .season-toggle { right: 60px; }
  .lang-toggle { right: 106px; }
}

@media only screen and (max-width: 420px) {
  .hero h1 { font-size: 25px; }
}
