/* ============================================================
   SUPLPLEX — THE WORLD BETWEEN
   Style Sheet
   ============================================================ */

/* ============================================================
   1. RESET
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================================
   2. VARIABLES
   ============================================================ */
:root {
  --bg: #000;
  --fg: #fff;
  --fg-dim: #a3a3a3;
  --fg-soft: #666;

  --font-hack: "Share Tech Mono", "Courier New", Consolas, monospace;

  --fs-num: clamp(1.9rem, 8vw, 5.5rem);
  --fs-body: clamp(0.9rem, 1.6vw, 1rem);
  --fs-small: clamp(0.72rem, 1.3vw, 0.82rem);

  --space-x: clamp(20px, 5vw, 48px);
  --space-y: clamp(72px, 12vw, 140px);

  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);

  --tap: 44px;
}

/* ============================================================
   3. BASE
   ============================================================ */
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: #000;
  scroll-padding-top: 80px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
a,
[role="button"] {
  touch-action: manipulation;
}

input,
select,
textarea {
  font-size: 16px;
}

/* ============================================================
   4. BACKGROUND LAYERS
   ============================================================ */

/* --- Circuit Board Canvas --- */
#circuitCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Hacker Text Layer --- */
#hackerLayer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  font-family: var(--font-hack);
}

.hack-text {
  position: absolute;
  color: #fff;
  font-family: var(--font-hack);
  white-space: nowrap;
  opacity: 0;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.15em;
  line-height: 1;
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.95),
    0 0 10px rgba(255, 255, 255, 0.7),
    0 0 22px rgba(255, 255, 255, 0.45);
  animation: hackAppear var(--dur, 4s) ease-in-out forwards;
  user-select: none;
  padding: 2px;
}

@keyframes hackAppear {
  0%   { opacity: 0; filter: blur(8px); transform: translateY(-10px) scale(0.94); }
  12%  { opacity: var(--peak, 0.85); filter: blur(0); transform: translateY(0) scale(1); }
  65%  { opacity: var(--peak, 0.85); filter: blur(0); transform: translateY(0) scale(1); }
  100% { opacity: 0; filter: blur(6px); transform: translateY(10px) scale(1.03); }
}

.hack-text.glitch {
  animation: hackGlitch var(--dur, 4s) steps(1, end) forwards;
}

@keyframes hackGlitch {
  0%   { opacity: 0; filter: blur(10px); transform: translate(-4px, 0) skewY(6deg); }
  8%   { opacity: var(--peak, 0.9); filter: blur(0); transform: translate(3px, -2px) skewY(-5deg); }
  12%  { opacity: var(--peak, 0.9); transform: translate(-3px, 2px) skewY(3deg); }
  16%  { opacity: var(--peak, 0.9); transform: translate(2px, 0) skewY(-2deg); }
  20%  { opacity: var(--peak, 0.9); transform: translate(0, 0) skewY(0); }
  68%  { opacity: var(--peak, 0.9); filter: blur(0); }
  100% { opacity: 0; filter: blur(7px); transform: translate(-3px, -4px); }
}

/* --- Vignette --- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 50% 50%,
    transparent 30%,
    rgba(0, 0, 0, 0.55) 70%,
    rgba(0, 0, 0, 0.92) 100%);
}

/* --- Halo --- */
body::after {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 100vmin;
  height: 100vmin;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.05), transparent 65%);
  animation: halo 8s ease-in-out infinite;
}

@keyframes halo {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.08); }
}

/* ============================================================
   5. FROSTED GLASS
   ============================================================ */
.frosted-glass {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;

  backdrop-filter: blur(1.6px) saturate(115%) brightness(1.02);
  -webkit-backdrop-filter: blur(1.6px) saturate(115%) brightness(1.02);

  background:
    radial-gradient(ellipse 60% 40% at 22% 18%, rgba(255, 255, 255, 0.018), transparent 65%),
    radial-gradient(ellipse 50% 60% at 78% 82%, rgba(255, 255, 255, 0.014), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.010), rgba(255, 255, 255, 0.004) 60%, transparent);

  box-shadow:
    inset 0 0 120px rgba(255, 255, 255, 0.020),
    inset 0 0 1px rgba(255, 255, 255, 0.10);
}

.frosted-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
  mix-blend-mode: screen;
}

.frosted-glass::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  mix-blend-mode: screen;
  background: radial-gradient(ellipse 45% 30% at 50% 50%,
    rgba(255, 255, 255, 0.035) 0%,
    rgba(255, 255, 255, 0.012) 40%,
    transparent 70%);
  animation: breathGlass 18s ease-in-out infinite;
}

@keyframes breathGlass {
  0%, 100% { transform: translate(-15%, -10%) scale(1); opacity: 0; }
  30%      { opacity: 0.6; }
  50%      { transform: translate(10%, 8%) scale(1.08); opacity: 0.9; }
  70%      { opacity: 0.4; }
}

/* ============================================================
   6. HEADER
   ============================================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px var(--space-x);
  padding-top: calc(10px + var(--sat));
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.logo {
  font-family: var(--font-hack);
  font-size: clamp(0.95rem, 2.4vw, 1.3rem);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  min-height: var(--tap);
  border-radius: 999px;
  background: linear-gradient(145deg, #1a1a1a, #000);
  box-shadow:
    4px 4px 12px rgba(0, 0, 0, 0.9),
    -2px -2px 8px rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  flex-shrink: 0;
}

.logo::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--fg);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 8px;
  flex: 1;
  justify-content: flex-end;
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  font-size: var(--fs-small);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 10px 14px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: var(--fg-dim);
  white-space: nowrap;
  flex-shrink: 0;
  background: linear-gradient(145deg, #0f0f0f, #000);
  box-shadow:
    inset 2px 2px 6px rgba(0, 0, 0, 0.9),
    inset -2px -2px 6px rgba(255, 255, 255, 0.04);
  transition: color 0.25s ease;
}

.nav a:hover,
.nav a:active {
  color: var(--fg);
}

/* ============================================================
   7. MAIN
   ============================================================ */
main {
  position: relative;
  z-index: 3;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* --- Hero --- */
.hero {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(100px + var(--sat)) calc(16px + var(--sar)) calc(50px + var(--sab)) calc(16px + var(--sal));
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-small);
  letter-spacing: 3px;
  text-transform: uppercase;
  padding: 8px 18px;
  border-radius: 999px;
  margin-bottom: clamp(20px, 4vw, 40px);
  background: linear-gradient(145deg, #141414, #000);
  box-shadow:
    6px 6px 16px rgba(0, 0, 0, 0.95),
    -3px -3px 12px rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--fg-dim);
}

.kicker .dot {
  width: 8px;
  height: 8px;
  background: var(--fg);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.9);
  animation: pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

.film-title {
  font-size: clamp(2rem, 11vw, 7rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: clamp(-2px, -0.6vw, -5px);
  text-transform: uppercase;
  margin-bottom: clamp(16px, 3vw, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.2vw, 14px);
}

.film-title .line {
  padding: clamp(6px, 1.4vw, 14px) clamp(16px, 3.5vw, 40px);
  border-radius: 999px;
  display: inline-block;
  background: linear-gradient(145deg, #141414, #000);
  box-shadow:
    8px 8px 20px rgba(0, 0, 0, 0.95),
    -4px -4px 14px rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.film-title .accent {
  color: var(--bg);
  background: linear-gradient(145deg, #fff, #c8c8c8);
  box-shadow:
    8px 8px 20px rgba(0, 0, 0, 0.95),
    -4px -4px 14px rgba(255, 255, 255, 0.1),
    inset 3px 3px 8px rgba(255, 255, 255, 0.9),
    inset -3px -3px 8px rgba(0, 0, 0, 0.2);
}

.tagline {
  font-size: var(--fs-body);
  color: var(--fg-dim);
  max-width: 44ch;
  margin: 0 auto clamp(28px, 5vw, 48px);
  font-style: italic;
}

.timer-label {
  font-size: var(--fs-small);
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--fg-soft);
  margin-bottom: clamp(14px, 2.5vw, 22px);
}

/* --- Timer --- */
.timer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1.8vw, 28px);
  width: 100%;
  max-width: 820px;
  margin: 0 auto clamp(24px, 4.5vw, 44px);
}

.time-unit {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #1c1c1c 0%, #0a0a0a 45%, #000 100%);
  box-shadow:
    10px 10px 22px rgba(0, 0, 0, 0.95),
    -6px -6px 16px rgba(255, 255, 255, 0.05),
    inset 5px 5px 12px rgba(255, 255, 255, 0.05),
    inset -5px -5px 12px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.12);
  animation: float 6s ease-in-out infinite;
}

.time-unit:nth-child(1) { animation-delay: 0s; }
.time-unit:nth-child(2) { animation-delay: 0.15s; }
.time-unit:nth-child(3) { animation-delay: 0.3s; }
.time-unit:nth-child(4) { animation-delay: 0.45s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.time-unit::before {
  content: "";
  position: absolute;
  top: 8%;
  left: 20%;
  width: 60%;
  height: 30%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center top, rgba(255, 255, 255, 0.18), transparent 70%);
  pointer-events: none;
  filter: blur(4px);
}

.time-unit::after {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.time-value {
  font-size: var(--fs-num);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  display: block;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(255, 255, 255, 0.15);
}

.time-label {
  font-size: var(--fs-small);
  color: var(--fg-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: clamp(4px, 1vw, 10px);
  position: relative;
  z-index: 1;
}

.time-value.flip {
  animation: flip 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes flip {
  0%   { opacity: 0; transform: translateY(-14px) scale(0.85); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Coming Soon --- */
.coming-soon {
  display: inline-block;
  font-size: clamp(0.85rem, 2.5vw, 1.3rem);
  font-weight: 900;
  letter-spacing: clamp(4px, 1vw, 8px);
  text-transform: uppercase;
  padding: clamp(10px, 1.6vw, 16px) clamp(22px, 4vw, 40px);
  border-radius: 999px;
  background: linear-gradient(145deg, #fff, #c8c8c8);
  color: var(--bg);
  margin-bottom: clamp(24px, 4vw, 40px);
  box-shadow:
    8px 8px 20px rgba(0, 0, 0, 0.95),
    -4px -4px 14px rgba(255, 255, 255, 0.1),
    inset 3px 3px 8px rgba(255, 255, 255, 0.9),
    inset -3px -3px 8px rgba(0, 0, 0, 0.2);
}

/* --- Progress --- */
.progress-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto clamp(28px, 5vw, 52px);
  padding: clamp(14px, 2.2vw, 20px) clamp(18px, 3vw, 26px);
  border-radius: 999px;
  background: linear-gradient(145deg, #101010, #000);
  box-shadow:
    8px 8px 20px rgba(0, 0, 0, 0.95),
    -4px -4px 14px rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-small);
  color: var(--fg-dim);
  margin-bottom: 8px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 0 4px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #000;
  border-radius: 999px;
  overflow: hidden;
  box-shadow:
    inset 3px 3px 8px rgba(0, 0, 0, 1),
    inset -2px -2px 6px rgba(255, 255, 255, 0.04);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #888, #fff, #fff);
  border-radius: 999px;
  transition: width 1s linear;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.7), inset 0 2px 4px rgba(255, 255, 255, 0.9);
}

/* --- Scroll Cue --- */
.scroll-cue {
  font-size: var(--fs-small);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  min-height: var(--tap);
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(145deg, #0f0f0f, #000);
  box-shadow:
    inset 2px 2px 6px rgba(0, 0, 0, 0.9),
    inset -2px -2px 6px rgba(255, 255, 255, 0.04);
  animation: bounce 2.6s ease-in-out infinite;
}

.scroll-cue::after {
  content: "↓";
  font-size: 1.1em;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* ============================================================
   8. SECTIONS
   ============================================================ */
.section {
  position: relative;
  z-index: 3;
  padding: var(--space-y) var(--space-x);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.section-label {
  display: inline-block;
  font-size: var(--fs-small);
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 20px;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(145deg, #0f0f0f, #000);
  box-shadow:
    inset 2px 2px 6px rgba(0, 0, 0, 0.9),
    inset -2px -2px 6px rgba(255, 255, 255, 0.04);
}

.section-title {
  font-size: clamp(1.5rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin-bottom: clamp(20px, 4vw, 40px);
  max-width: 22ch;
}

.section-text {
  font-size: var(--fs-body);
  color: var(--fg-dim);
  max-width: 62ch;
  line-height: 1.85;
  margin-bottom: 18px;
}

.section-text strong {
  color: var(--fg);
  font-weight: 700;
}

/* --- Story --- */
.story-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}

.story-visual {
  aspect-ratio: 4 / 5;
  border-radius: 32px;
  background: radial-gradient(circle at 30% 20%, #1c1c1c 0%, #0a0a0a 50%, #000 100%);
  box-shadow:
    14px 14px 36px rgba(0, 0, 0, 0.95),
    -8px -8px 22px rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hack);
  font-size: clamp(3.5rem, 12vw, 8rem);
  color: rgba(255, 255, 255, 0.1);
  letter-spacing: 4px;
}

/* --- Characters --- */
.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: clamp(14px, 3vw, 26px);
}

.char-card {
  padding: clamp(24px, 4vw, 38px) clamp(18px, 3vw, 26px);
  border-radius: 28px;
  background: linear-gradient(145deg, #0c0c0c, #000);
  box-shadow:
    10px 10px 24px rgba(0, 0, 0, 0.95),
    -5px -5px 16px rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .char-card:hover {
    transform: translateY(-8px);
    box-shadow:
      16px 18px 36px rgba(0, 0, 0, 1),
      -9px -9px 24px rgba(255, 255, 255, 0.06),
      inset 0 0 0 2px rgba(255, 255, 255, 0.15),
      0 0 40px rgba(255, 255, 255, 0.08);
  }
}

.char-card:active {
  transform: scale(0.97);
}

.char-avatar {
  width: clamp(72px, 14vw, 108px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  margin: 0 auto clamp(14px, 2.5vw, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900;
  background: radial-gradient(circle at 35% 30%, #1c1c1c 0%, #0a0a0a 45%, #000 100%);
  box-shadow:
    7px 7px 16px rgba(0, 0, 0, 0.95),
    -4px -4px 12px rgba(255, 255, 255, 0.05),
    inset 4px 4px 10px rgba(255, 255, 255, 0.05),
    inset -4px -4px 10px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.12);
}

.char-name {
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.char-role {
  font-size: var(--fs-small);
  color: var(--fg-soft);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --- Gallery --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: clamp(12px, 2.4vw, 20px);
}

.gallery-item {
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  background: linear-gradient(145deg, #0a0a0a, #000);
  box-shadow:
    10px 10px 24px rgba(0, 0, 0, 0.95),
    -5px -5px 16px rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  color: rgba(255, 255, 255, 0.14);
}

/* --- Notify --- */
.notify-section {
  text-align: center;
}

.notify-section .section-title {
  margin-left: auto;
  margin-right: auto;
  max-width: 24ch;
}

.notify-section .section-text {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: clamp(28px, 5vw, 44px);
}

.notify-form {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.notify-form input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  padding: 15px 22px;
  min-height: var(--tap);
  border-radius: 999px;
  border: none;
  background: linear-gradient(145deg, #0d0d0d, #000);
  color: var(--fg);
  font-family: inherit;
  outline: none;
  box-shadow:
    inset 4px 4px 12px rgba(0, 0, 0, 0.95),
    inset -4px -4px 12px rgba(255, 255, 255, 0.03),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.notify-form input::placeholder {
  color: var(--fg-soft);
}

.notify-form button {
  padding: 15px 28px;
  min-height: var(--tap);
  border-radius: 999px;
  border: none;
  background: linear-gradient(145deg, #fff, #c8c8c8);
  color: #000;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  box-shadow:
    7px 7px 18px rgba(0, 0, 0, 0.95),
    -4px -4px 14px rgba(255, 255, 255, 0.1),
    inset 2px 2px 6px rgba(255, 255, 255, 0.9),
    inset -2px -2px 6px rgba(0, 0, 0, 0.2);
}

.notify-form button:active {
  transform: scale(0.97);
}

/* ============================================================
   9. FOOTER
   ============================================================ */
footer {
  position: relative;
  z-index: 3;
  margin: 0 var(--space-x);
  margin-bottom: calc(clamp(16px, 3vw, 28px) + var(--sab));
  padding: clamp(14px, 2.5vw, 22px) clamp(20px, 4vw, 36px);
  border-radius: 999px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  font-size: var(--fs-small);
  color: var(--fg-dim);
  flex-wrap: wrap;
  background: linear-gradient(145deg, #101010, #000);
  box-shadow:
    8px 8px 20px rgba(0, 0, 0, 0.95),
    -4px -4px 14px rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.socials {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.socials a {
  padding: 10px 16px;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: var(--fs-small);
  background: linear-gradient(145deg, #1a1a1a, #000);
  box-shadow:
    3px 3px 10px rgba(0, 0, 0, 0.9),
    -2px -2px 8px rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ============================================================
   10. CHARACTER DETAIL OVERLAY
   ============================================================ */
#charPage {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

#charPage.is-open {
  opacity: 1;
  visibility: visible;
}

#charPage::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  background: repeating-linear-gradient(0deg,
    rgba(255, 255, 255, 0.02) 0px,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 1px,
    transparent 3px);
  mix-blend-mode: screen;
  transition: opacity 0.5s ease 0.2s;
}

#charPage.is-open::before {
  opacity: 1;
}

.scan-sweep {
  position: fixed;
  left: 0;
  right: 0;
  top: -20%;
  height: 20%;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  background: linear-gradient(180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.06) 40%,
    rgba(255, 255, 255, 0.16) 50%,
    rgba(255, 255, 255, 0.06) 60%,
    transparent 100%);
}

#charPage.is-open .scan-sweep {
  animation: scanSweep 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.15s forwards;
}

@keyframes scanSweep {
  0%   { top: -20%; opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.6; }
  100% { top: 120%; opacity: 0; }
}

.char-close {
  position: fixed;
  top: calc(16px + var(--sat));
  right: calc(16px + var(--sar));
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  color: #fff;
  background: linear-gradient(145deg, #1a1a1a, #000);
  font-family: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    6px 6px 16px rgba(0, 0, 0, 0.95),
    -3px -3px 12px rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.char-close:active {
  transform: scale(0.9);
}

@media (hover: hover) and (pointer: fine) {
  .char-close:hover {
    transform: rotate(90deg) scale(1.08);
  }
}

.char-back {
  position: fixed;
  top: calc(16px + var(--sat));
  left: calc(16px + var(--sal));
  z-index: 10;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: none;
  color: #fff;
  background: linear-gradient(145deg, #1a1a1a, #000);
  font-family: var(--font-hack);
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow:
    6px 6px 16px rgba(0, 0, 0, 0.95),
    -3px -3px 12px rgba(255, 255, 255, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.char-back::before {
  content: "←";
  font-size: 16px;
  line-height: 1;
}

.char-back:active {
  transform: scale(0.95);
}

.char-page-inner {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(90px + var(--sat)) calc(20px + var(--sar)) calc(60px + var(--sab)) calc(20px + var(--sal));
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}

.char-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.char-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-small);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--fg-soft);
  align-self: flex-start;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(145deg, #0f0f0f, #000);
  box-shadow:
    inset 2px 2px 6px rgba(0, 0, 0, 0.9),
    inset -2px -2px 6px rgba(255, 255, 255, 0.04);
}

.char-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  animation: pulse 1.6s ease-in-out infinite;
}

.char-title {
  font-size: clamp(2.2rem, 7vw, 5rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: clamp(-2px, -0.6vw, -4px);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.char-title-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hack);
  color: #000;
  background: linear-gradient(145deg, #fff, #c8c8c8);
  width: 0.9em;
  height: 0.9em;
  border-radius: 50%;
  font-size: 0.85em;
  letter-spacing: 0;
  box-shadow:
    6px 6px 16px rgba(0, 0, 0, 0.95),
    -3px -3px 12px rgba(255, 255, 255, 0.1),
    inset 2px 2px 6px rgba(255, 255, 255, 0.9),
    inset -2px -2px 6px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.char-subtitle {
  font-family: var(--font-hack);
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.char-divider {
  width: 64px;
  height: 2px;
  background: linear-gradient(90deg, #fff, transparent);
  border-radius: 2px;
}

.char-desc {
  font-size: var(--fs-body);
  color: var(--fg-dim);
  line-height: 1.85;
  max-width: 55ch;
}

.char-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.char-meta-item {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 18px;
  border-radius: 14px;
  background: linear-gradient(145deg, #0c0c0c, #000);
  box-shadow:
    5px 5px 14px rgba(0, 0, 0, 0.9),
    -3px -3px 10px rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.char-meta-item .k {
  font-size: 0.65rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--fg-soft);
}

.char-meta-item .v {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.char-gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  grid-template-areas:
    "hero hero small1"
    "hero hero small2"
    "wide wide tall";
  gap: clamp(8px, 1.4vw, 16px);
  width: 100%;
  aspect-ratio: 1 / 1.05;
  max-height: 78vh;
}

.char-tile {
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  user-select: none;
  background: radial-gradient(circle at 35% 30%, #1c1c1c 0%, #0a0a0a 50%, #000 100%);
  box-shadow:
    12px 12px 28px rgba(0, 0, 0, 0.95),
    -6px -6px 18px rgba(255, 255, 255, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-hack);
  color: rgba(255, 255, 255, 0.22);
  letter-spacing: 4px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.char-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 1px,
    transparent 4px);
}

.char-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.1), transparent 55%);
}

@media (hover: hover) and (pointer: fine) {
  .char-tile:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow:
      16px 18px 36px rgba(0, 0, 0, 1),
      -8px -8px 22px rgba(255, 255, 255, 0.07),
      inset 0 0 0 1px rgba(255, 255, 255, 0.22),
      0 0 40px rgba(255, 255, 255, 0.1);
  }
}

.char-tile:active {
  transform: scale(0.98);
}

.char-tile.hero-tile {
  grid-area: hero;
  font-size: clamp(4rem, 12vw, 9rem);
  color: rgba(255, 255, 255, 0.14);
  background: radial-gradient(circle at 40% 30%, #222 0%, #0a0a0a 45%, #000 100%);
}

.hero-letter {
  font-family: var(--font-hack);
  animation: heroFloat 5s ease-in-out infinite;
  text-shadow:
    0 0 20px rgba(255, 255, 255, 0.15),
    0 0 60px rgba(255, 255, 255, 0.08);
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50%      { transform: translateY(-8px); opacity: 1; }
}

.char-tile.small1 { grid-area: small1; font-size: clamp(1rem, 2vw, 1.4rem); }
.char-tile.small2 { grid-area: small2; font-size: clamp(1rem, 2vw, 1.4rem); }

.char-tile.wide-tile {
  grid-area: wide;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  background: radial-gradient(circle at 30% 40%, #1a1a1a 0%, #000 70%);
}

.char-tile.tall-tile {
  grid-area: tall;
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  background: radial-gradient(circle at 70% 30%, #1a1a1a 0%, #000 70%);
}

/* ============================================================
   11. CINEMATIC TRANSITION
   ============================================================ */
.transition-flash {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  background: #fff;
  opacity: 0;
  clip-path: circle(0% at var(--x, 50%) var(--y, 50%));
  transition:
    clip-path 0.55s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease 0.15s;
}

.transition-flash.is-expanding {
  clip-path: circle(160% at var(--x, 50%) var(--y, 50%));
  opacity: 1;
}

.transition-flash.is-fading {
  clip-path: circle(160% at var(--x, 50%) var(--y, 50%));
  opacity: 0;
  transition:
    clip-path 0s,
    opacity 0.4s ease;
}

/* --- Stagger: text column --- */
.char-info > * {
  opacity: 0;
  transform: translateY(16px);
  filter: blur(6px);
}

#charPage.is-open .char-info > * {
  animation: charReveal 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#charPage.is-open .char-info > *:nth-child(1) { animation-delay: 0.25s; }
#charPage.is-open .char-info > *:nth-child(2) { animation-delay: 0.32s; }
#charPage.is-open .char-info > *:nth-child(3) { animation-delay: 0.39s; }
#charPage.is-open .char-info > *:nth-child(4) { animation-delay: 0.46s; }
#charPage.is-open .char-info > *:nth-child(5) { animation-delay: 0.53s; }
#charPage.is-open .char-info > *:nth-child(6) { animation-delay: 0.60s; }
#charPage.is-open .char-info > *:nth-child(7) { animation-delay: 0.67s; }

@keyframes charReveal {
  0% {
    opacity: 0;
    transform: translateY(16px);
    filter: blur(6px);
  }
  60% { filter: blur(0); }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* --- Stagger: tiles --- */
.char-tile {
  opacity: 0;
  transform: scale(0.94) translateY(10px);
  filter: blur(8px);
}

#charPage.is-open .char-tile {
  animation: tileReveal 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

#charPage.is-open .char-tile.hero-tile { animation-delay: 0.20s; }
#charPage.is-open .char-tile.small1    { animation-delay: 0.34s; }
#charPage.is-open .char-tile.small2    { animation-delay: 0.42s; }
#charPage.is-open .char-tile.wide-tile { animation-delay: 0.50s; }
#charPage.is-open .char-tile.tall-tile { animation-delay: 0.58s; }

@keyframes tileReveal {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(10px);
    filter: blur(8px);
  }
  55% { filter: blur(0); }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

/* --- Close transition --- */
#charPage.is-closing .char-info,
#charPage.is-closing .char-gallery {
  animation: charExit 0.4s cubic-bezier(0.4, 0, 1, 1) forwards;
}

@keyframes charExit {
  0%   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  100% { opacity: 0; transform: translateY(-8px) scale(0.98); filter: blur(6px); }
}

/* --- Title glow pulse --- */
#charPage.is-open .char-title {
  animation: titlePulse 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.32s;
}

@keyframes titlePulse {
  0%   { text-shadow: 0 0 0 rgba(255, 255, 255, 0); }
  40%  { text-shadow:
           0 0 12px rgba(255, 255, 255, 0.5),
           0 0 30px rgba(255, 255, 255, 0.25); }
  100% { text-shadow: 0 0 0 rgba(255, 255, 255, 0); }
}

/* ============================================================
   12. RESPONSIVE
   ============================================================ */

/* --- Tablet --- */
@media (max-width: 900px) {
  .story-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .story-visual {
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
  }
  .char-page-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: calc(84px + var(--sat));
  }
  .char-gallery {
    aspect-ratio: 1 / 1;
    max-height: none;
    order: -1;
  }
  .char-title {
    font-size: clamp(2rem, 10vw, 4rem);
  }
}

/* --- Phone --- */
@media (max-width: 640px) {
  :root {
    --space-x: 18px;
    --space-y: 60px;
    --fs-num: clamp(1.7rem, 9vw, 2.6rem);
  }

  header {
    padding: 8px 14px;
    padding-top: calc(8px + var(--sat));
    gap: 8px;
  }

  .logo {
    padding: 6px 12px;
    letter-spacing: 2px;
  }

  .nav a {
    padding: 8px 11px;
    font-size: 0.65rem;
    letter-spacing: 1px;
  }

  .hero {
    padding-top: calc(84px + var(--sat));
  }

  .timer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 340px;
  }

  footer {
    flex-direction: column;
    text-align: center;
    border-radius: 26px;
    padding: 18px 22px;
    gap: 12px;
  }

  .socials {
    justify-content: center;
    width: 100%;
  }

  .notify-form {
    flex-direction: column;
    gap: 10px;
  }

  .notify-form input,
  .notify-form button {
    width: 100%;
  }

  .char-page-inner {
    padding-left: calc(16px + var(--sal));
    padding-right: calc(16px + var(--sar));
    gap: 24px;
  }

  .char-gallery {
    grid-template-columns: 1.3fr 1fr;
    grid-template-rows: 1.6fr 1fr 1fr;
    grid-template-areas:
      "hero hero"
      "wide wide"
      "small1 tall";
    aspect-ratio: 1 / 1.15;
  }

  .char-tile.small2 {
    display: none;
  }

  .char-title {
    font-size: clamp(1.9rem, 11vw, 3rem);
  }

  .char-close,
  .char-back {
    top: calc(12px + var(--sat));
    height: 44px;
  }

  .char-close {
    width: 44px;
    right: calc(12px + var(--sar));
  }

  .char-back {
    padding: 0 14px;
    left: calc(12px + var(--sal));
    font-size: 11px;
    letter-spacing: 2px;
  }
}

/* --- Small phone --- */
@media (max-width: 380px) {
  .nav a {
    padding: 7px 9px;
    font-size: 0.6rem;
    letter-spacing: 0.5px;
  }
}

/* --- Touch devices --- */
@media (pointer: coarse) {
  .frosted-glass {
    backdrop-filter: blur(1.2px) saturate(110%);
    -webkit-backdrop-filter: blur(1.2px) saturate(110%);
  }
  .frosted-glass::after {
    animation-duration: 24s;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .transition-flash { display: none !important; }
  #charPage::before { display: none !important; }
  .scan-sweep { display: none !important; }
  .char-info > *,
  .char-tile {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    animation: none !important;
  }
  #charPage.is-closing .char-info,
  #charPage.is-closing .char-gallery {
    animation: none !important;
  }
  #hackerLayer,
  #circuitCanvas { display: none !important; }
}