/* =====================================================
   MudiasTira | Profil Saya
   Warna dasar + tema universe Spider-Man
   ===================================================== */

:root {
  --bg1: #0a0f1f;
  --bg2: #120e1d;
  --panel: rgba(19, 24, 39, 0.78);
  --panel-2: rgba(14, 17, 30, 0.94);
  --text: #f5f7ff;
  --muted: #d7dff6;

  --accent-rgb: 225 29 46;
  --accent-2-rgb: 15 91 216;
  --accent-3-rgb: 251 191 36;
  --accent: rgb(var(--accent-rgb));
  --accent-2: rgb(var(--accent-2-rgb));
  --accent-3: rgb(var(--accent-3-rgb));
  --accent-bright: #ff354d;
  --accent-text: rgb(var(--accent-2-rgb));
  --hl-1: #ff455b;
  --hl-2: #6da7ff;

  /* warna gradasi latar (r g b) */
  --g1: 196 30 58;
  --g2: 30 58 138;

  --success: #34d399;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.38);
  --red-soft: rgb(var(--accent-rgb) / 0.18);
  --blue-soft: rgb(var(--accent-2-rgb) / 0.18);

  --side-w: 250px;
}

/* Miles Morales */
:root[data-universe="1610"] {
  --accent-rgb: 220 38 38;
  --accent-2-rgb: 194 65 12;
  --accent-3-rgb: 251 191 36;
  --accent-bright: #ff5a5a;
  --accent-text: #ff9a6b;
  --hl-1: #ff5a5a;
  --hl-2: #ffb454;
  --g1: 150 15 30;
  --g2: 24 24 32;
}

/* Gwen Stacy */
:root[data-universe="65"] {
  --accent-rgb: 219 39 119;
  --accent-2-rgb: 8 145 178;
  --accent-3-rgb: 253 224 71;
  --accent-bright: #ff7bbd;
  --accent-text: #5fd8f0;
  --hl-1: #ff7bbd;
  --hl-2: #7be8ff;
  --g1: 190 40 120;
  --g2: 20 80 130;
}

/* Spider-Man 2099 */
:root[data-universe="2099"] {
  --accent-rgb: 37 99 235;
  --accent-2-rgb: 225 29 72;
  --accent-3-rgb: 34 211 238;
  --accent-bright: #6d9cff;
  --accent-text: #ff6b8a;
  --hl-1: #6d9cff;
  --hl-2: #ff6b8a;
  --g1: 20 40 140;
  --g2: 120 10 50;
}

/* Spider-Man Noir */
:root[data-universe="noir"] {
  --accent-rgb: 82 82 91;
  --accent-2-rgb: 113 113 122;
  --accent-3-rgb: 228 228 231;
  --accent-bright: #e4e4e7;
  --accent-text: #d4d4d8;
  --hl-1: #ffffff;
  --hl-2: #a1a1aa;
  --g1: 60 60 65;
  --g2: 20 20 24;
}

* { box-sizing: border-box; }

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    url('https://images.hdqwalls.com/download/spiderman-2-2023-5k-gy-1336x768.jpg') center/cover no-repeat fixed,
    linear-gradient(135deg, rgb(var(--g1) / 0.7) 0%, rgb(var(--g2) / 0.7) 50%, rgba(0, 0, 0, 0.8) 100%);
  background-blend-mode: overlay;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  body {
    background:
      url('https://images.hdqwalls.com/download/spiderman-2-2023-5k-gy-1336x768.jpg') center/cover no-repeat fixed,
      linear-gradient(135deg, rgb(var(--g1) / 0.8) 0%, rgb(var(--g2) / 0.8) 50%, rgba(0, 0, 0, 0.9) 100%);
    background-blend-mode: overlay;
  }
}

@media (max-width: 480px) {
  body {
    background:
      url('https://i.pinimg.com/originals/b5/75/a6/b575a6fb9c4bca0e3b1896ed670abe1d.jpg') center/cover no-repeat fixed,
      linear-gradient(135deg, rgb(var(--g1) / 0.85) 0%, rgb(var(--g2) / 0.85) 50%, rgba(0, 0, 0, 0.95) 100%);
    background-blend-mode: overlay;
  }
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

body::after {
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.08) 0 2px, transparent 3px);
  background-size: 32px 32px;
  opacity: 0.3;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* =====================================================
   Sidebar
   ===================================================== */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side-w);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px 16px;
  background: rgba(10, 15, 31, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 30px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
  scrollbar-width: none;
}

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

.side-brand {
  padding: 4px 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 900;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 1.2rem;
}

.side-brand span {
  color: var(--accent-bright);
  text-shadow: 0 0 18px rgb(var(--accent-rgb) / 0.8);
}

.side-nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-indicator {
  position: absolute;
  left: -14px;
  top: 0;
  width: 4px;
  height: 0;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--accent-bright), var(--accent-2));
  box-shadow: 0 0 14px var(--accent-bright);
  transition: transform 0.45s cubic-bezier(0.3, 1.3, 0.4, 1), height 0.45s ease;
  pointer-events: none;
}

.nav-item {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.98rem;
  color: rgba(245, 247, 255, 0.8);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-item svg,
.menu-toggle svg {
  width: 22px;
  height: 22px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover {
  color: white;
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.2), rgb(var(--accent-2-rgb) / 0.18));
}

.nav-item.is-active {
  color: white;
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.34), rgb(var(--accent-2-rgb) / 0.28));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.nav-item.is-active svg {
  color: var(--accent-bright);
}

.nav-item.pop svg {
  animation: iconSwing 0.6s ease;
}

.ripple {
  position: absolute;
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  pointer-events: none;
  background:
    radial-gradient(circle, transparent 0 46%, rgb(255 255 255 / 0.85) 47% 53%, transparent 54% 66%, rgb(255 255 255 / 0.7) 67% 72%, transparent 73%),
    repeating-conic-gradient(from 0deg, rgb(255 255 255 / 0.75) 0 4deg, transparent 4deg 45deg);
  animation: ripple 0.65s ease-out forwards;
}

/* tombol ganti universe */
.universe-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.universe-btn:hover {
  transform: translateY(-2px);
  background: rgb(var(--accent-rgb) / 0.16);
  border-color: rgb(var(--accent-rgb) / 0.5);
}

.universe-btn:active {
  transform: scale(0.97);
}

.uni-mask {
  width: 34px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 0 8px rgb(var(--accent-rgb) / 0.6));
}

.mask-face { fill: var(--accent); }
.mask-web { fill: none; stroke: rgba(10, 15, 31, 0.6); stroke-width: 0.9; }
.mask-eye { fill: #fff; stroke: #0a0f1f; stroke-width: 1; }

.uni-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.uni-text strong {
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.uni-text small {
  color: var(--muted);
  font-size: 0.78rem;
}

.uni-hint {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

/* tombol menu + latar gelap (hanya di layar kecil) */
.menu-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 55;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 15, 31, 0.8);
  backdrop-filter: blur(10px);
  color: white;
  cursor: pointer;
}

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.scrim.show {
  opacity: 1;
  pointer-events: auto;
}

/* =====================================================
   Area halaman (tanpa scroll, ganti lewat sidebar)
   ===================================================== */

.stage-wrap {
  position: relative;
  z-index: 1;
  margin-left: var(--side-w);
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.top-row {
  display: flex;
  justify-content: flex-end;
  padding: 14px clamp(20px, 3vw, 44px) 0;
}

.google-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 8px 12px;
  min-width: 220px;
  width: min(100%, 340px);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.google-search input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.92rem;
  outline: none;
}

.google-search input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.google-search button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.page {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: 12px clamp(20px, 3vw, 44px) 24px;
  overflow-y: auto;
  scrollbar-width: none;
}

.page::-webkit-scrollbar { display: none; }
.page:focus { outline: none; }

.page.is-active {
  display: flex;
  z-index: 2;
  animation: pageIn 0.7s 0.16s cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.page.is-active.is-settled {
  animation: none;
}

.page.is-leaving {
  display: flex;
  z-index: 1;
  pointer-events: none;
  animation: pageOut 0.3s ease-in both;
}

.page-inner {
  width: 100%;
  max-width: 1100px;
  margin: auto;
}

/* halaman yang isinya mengisi tinggi layar (AI dan Misi) */
.page-inner.is-fill {
  flex: 1;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.page-inner.is-fill > .ai-panel,
.page-inner.is-fill > .game {
  flex: 1;
  min-height: 0;
}

/* =====================================================
   Beranda
   ===================================================== */

.hero-wrap {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 30px;
  align-items: center;
}

.hero-copy {
  padding: 8px 0;
}

.eyebrow {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: linear-gradient(135deg, rgb(var(--accent-rgb) / 0.2), rgb(var(--accent-2-rgb) / 0.12));
  color: #ffe5e8;
  font-size: 0.8rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
  margin-bottom: 16px;
  box-shadow: 0 0 20px rgb(var(--accent-rgb) / 0.25);
}

h1 {
  font-size: clamp(2.2rem, min(4vw, 7vh), 4.4rem);
  line-height: 1.08;
  margin: 0 0 16px;
  text-shadow: 0 10px 25px rgba(0,0,0,0.25);
}

h1 .highlight {
  color: #f8fcff;
  background: linear-gradient(135deg, var(--hl-1), var(--hl-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
  max-width: 680px;
  margin: 0;
}

.cta-row {
  display: flex;
  gap: 14px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
}

.btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 15px 30px rgb(var(--accent-rgb) / 0.38);
}

.btn-secondary {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: white;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}

.btn-sense {
  border-color: rgb(var(--accent-rgb) / 0.55);
}

.btn-sense:hover {
  box-shadow: 0 0 22px rgb(var(--accent-rgb) / 0.5);
}

.btn-instagram {
  border: none;
  color: white;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  box-shadow: 0 15px 30px rgba(220, 39, 67, 0.32);
}

.btn-instagram svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
}

.btn-instagram .dot {
  fill: currentColor;
  stroke: none;
}

.profile-card {
  background: linear-gradient(180deg, rgb(var(--accent-rgb) / 0.18), rgba(18, 22, 39, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: visible;
}

.profile-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  pointer-events: none;
}

.portrait-media {
  position: relative;
  margin: 0 auto 16px;
  max-width: min(300px, 34vh);
}

.portrait-video {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgb(var(--accent-rgb) / 0.82), rgb(var(--accent-2-rgb) / 0.8)),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><rect width="200" height="200" fill="none"/><circle cx="100" cy="76" r="36" fill="%23f8fafc" opacity="0.75"/><path d="M46 170c10-28 36-42 54-42s44 14 54 42" fill="%23f8fafc" opacity="0.75"/></svg>') center/cover no-repeat;
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.16);
  box-shadow: 0 18px 30px rgb(var(--accent-2-rgb) / 0.24);
  object-fit: cover;
}

.portrait-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 8px 12px;
}

.portrait-controls label {
  font-size: 0.76rem;
  letter-spacing: 0.06rem;
  text-transform: uppercase;
  color: rgba(245,247,255,0.8);
}

.portrait-controls input[type="range"] {
  accent-color: #6da7ff;
  width: 100%;
  cursor: pointer;
}

.portrait-gif {
  position: absolute;
  width: 90px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  z-index: 2;
  pointer-events: none;
}

.portrait-gif-bottom {
  bottom: 120px;
  right: 20px;
  left: auto;
}

.portrait-gif-side {
  top: -18px;
  left: 10px;
  right: auto;
  transform: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat {
  padding: 12px 10px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: var(--accent-text);
}

/* tanda spider-sense di atas kartu */
.tingle {
  position: absolute;
  top: 2px;
  left: 15%;
  width: 70%;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 4px var(--accent-bright));
}

/* =====================================================
   Profil, Hobi, Kontak
   ===================================================== */

.section-header {
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: clamp(1.8rem, 2vw, 2.6rem);
  margin: 0 0 10px;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  max-width: 780px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.info-card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.info-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--accent-text);
}

.info-card p,
.info-card li {
  color: var(--muted);
  line-height: 1.8;
}

.info-card p { margin: 0 0 6px; }

.contact-card {
  max-width: 620px;
}

.contact-card .cta-row {
  margin-top: 16px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--accent-text);
  font-size: 0.85rem;
}

.timeline {
  display: grid;
  gap: 16px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255,255,255,0.07);
  padding: 16px 18px;
  border-radius: 18px;
}

.timeline-year {
  font-weight: 800;
  color: var(--accent-3);
  font-size: 1.1rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

/* =====================================================
   Umur
   ===================================================== */

.age-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.count-card {
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.12), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 20px 18px;
  text-align: center;
}

.count-card .value {
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  font-weight: 800;
  color: var(--accent-text);
}

.count-card .label {
  margin-top: 8px;
  color: var(--muted);
}

.age-notes {
  margin-top: 24px;
}

.age-notes p { margin: 0 0 8px; }

.age-line {
  font-size: 1.06rem;
  color: var(--text);
  line-height: 1.7;
}

.age-clock {
  font-size: 0.95rem;
  color: var(--muted);
}

/* =====================================================
   AI
   ===================================================== */

.ai-panel {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.08), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.chat-box {
  flex: 1;
  min-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 16px;
}

.msg {
  display: flex;
  max-width: 85%;
}

.msg.user {
  justify-content: flex-end;
  margin-left: auto;
}

.msg.bot {
  justify-content: flex-start;
}

.bubble {
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
}

.msg.user .bubble {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-bottom-right-radius: 6px;
}

.msg.bot .bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 6px;
}

.chat-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.chat-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.mode-btn,
.chip {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15, 23, 42, 0.7);
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: all 0.2s ease;
}

.chip {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-style: dashed;
}

.chip:hover {
  color: white;
  border-color: rgb(var(--accent-rgb) / 0.7);
  background: rgb(var(--accent-rgb) / 0.2);
}

.mode-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  border-color: transparent;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.chat-form input,
.google-search-inline input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
}

.google-search-inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 16px;
}

.google-search-inline button {
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  color: white;
  font-weight: 700;
  cursor: pointer;
  padding: 0 18px;
}

.chat-form input:focus {
  outline: 2px solid rgba(34, 211, 238, 0.35);
  border-color: rgba(34, 211, 238, 0.4);
}

.chat-form button {
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
  padding: 0 18px;
  cursor: pointer;
}

/* =====================================================
   Misi (mini game)
   ===================================================== */

.game {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hud-item {
  padding: 10px 12px;
  text-align: center;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255,255,255,0.08);
}

.hud-item span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.hud-item strong {
  font-size: 1.4rem;
  color: var(--accent-text);
}

.game-field {
  position: relative;
  flex: 1;
  min-height: 220px;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 50% 120%, rgb(var(--accent-rgb) / 0.2), transparent 60%),
    rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
  cursor: crosshair;
}

.game-field::before,
.game-field::after {
  content: "";
  position: absolute;
  top: 0;
  width: 130px;
  height: 130px;
  pointer-events: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><g fill='none' stroke='white' stroke-opacity='0.22' stroke-width='1'><path d='M0 0L100 0M0 0L100 40M0 0L100 100M0 0L40 100M0 0L0 100'/><path d='M22 0Q20 20 0 22M46 0Q40 40 0 46M72 0Q62 62 0 72'/></g></svg>") center/contain no-repeat;
}

.game-field::before { left: 0; }
.game-field::after { right: 0; transform: scaleX(-1); }

.game-field.flash-bad {
  box-shadow: inset 0 0 60px rgba(239, 68, 68, 0.6), var(--shadow);
}

.game-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
  background: rgba(10, 15, 31, 0.82);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  cursor: default;
}

.game-overlay.hidden { display: none; }

.game-overlay h3 {
  margin: 0;
  font-size: 1.6rem;
}

.game-overlay p {
  margin: 0;
  max-width: 420px;
  color: var(--muted);
  line-height: 1.6;
}

.target {
  position: absolute;
  z-index: 2;
  width: 58px;
  height: 58px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  line-height: 1;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgb(var(--accent-rgb) / 0.28);
  cursor: crosshair;
  animation: targetIn 0.18s ease-out;
}

.target::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  pointer-events: none;
  animation: targetRing var(--life, 1500ms) linear forwards;
}

.target.friend {
  background: rgba(52, 211, 153, 0.22);
  border-color: rgba(52, 211, 153, 0.6);
}

.target.caught {
  pointer-events: none;
  animation: targetCaught 0.2s ease-out forwards;
}

.float-score {
  position: absolute;
  z-index: 4;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-3);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  animation: floatUp 0.7s ease-out forwards;
}

/* =====================================================
   Efek Spider-Man (web, hop universe, spider-sense)
   ===================================================== */

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: hidden;
}

.fx-layer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.web-line {
  fill: none;
  stroke: rgb(255 255 255 / 0.92);
  stroke-width: 2;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 1;
  filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.8));
  animation: webDraw 0.22s ease-out forwards, webFade 0.5s 0.6s ease-in forwards;
}

.web-splat {
  fill: none;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linecap: round;
  opacity: 0;
  filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.6));
  animation: splat 0.9s 0.18s ease-out both;
}

.hop-flash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--hx) var(--hy), rgb(255 255 255 / 0.85) 0, rgb(var(--accent-rgb) / 0.55) 18%, rgb(var(--accent-2-rgb) / 0.35) 45%, transparent 72%),
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.08) 0 2px, transparent 2px 5px);
  animation: hop 0.85s ease-out both;
}

.universe-tint {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

:root[data-universe="noir"] .universe-tint {
  backdrop-filter: grayscale(1) contrast(1.08);
  -webkit-backdrop-filter: grayscale(1) contrast(1.08);
}

.sense-vignette {
  position: fixed;
  inset: 0;
  z-index: 70;
  pointer-events: none;
  opacity: 0;
  box-shadow: inset 0 0 140px 30px rgb(var(--accent-rgb) / 0.75);
}

.is-sensing .sense-vignette {
  animation: sensePulse 0.6s ease-in-out 3;
}

.is-sensing .stage {
  animation: senseShake 0.1s linear 10;
}

.is-sensing .tingle {
  animation: tingle 0.3s steps(2) 6;
}

/* laba-laba yang menggantung dan mengikuti kursor */
.dangler {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 45;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}

.dangler-thread {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 70px;
  background: linear-gradient(rgba(255,255,255,0.15), rgba(255,255,255,0.7));
}

.dangler-spider {
  position: absolute;
  left: 0;
  top: -6px;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  transform: translateY(70px);
}

.dangler-legs {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.dangler-body {
  fill: #141828;
  stroke: rgba(255, 255, 255, 0.7);
  stroke-width: 1;
}

.dangler-mark {
  fill: var(--accent-bright);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 100;
  max-width: min(90vw, 460px);
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgb(var(--accent-rgb) / 0.6);
  background: rgba(10, 15, 31, 0.94);
  box-shadow: 0 0 24px rgb(var(--accent-rgb) / 0.35);
  color: white;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 30px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =====================================================
   Animasi
   ===================================================== */

@keyframes pageIn {
  from {
    opacity: 0.15;
    transform: scale(1.03);
    clip-path: circle(0px at var(--cx, 50%) var(--cy, 50%));
  }
  to {
    opacity: 1;
    transform: none;
    clip-path: circle(170% at var(--cx, 50%) var(--cy, 50%));
  }
}

@keyframes pageOut {
  to {
    opacity: 0;
    transform: scale(0.97);
    filter: blur(4px);
  }
}

@keyframes iconSwing {
  0% { transform: rotate(0); }
  30% { transform: rotate(-22deg) scale(1.25); }
  60% { transform: rotate(14deg) scale(1.1); }
  100% { transform: none; }
}

@keyframes ripple {
  from { transform: scale(0); opacity: 0.9; }
  to { transform: scale(9); opacity: 0; }
}

@keyframes webDraw {
  to { stroke-dashoffset: 0; }
}

@keyframes webFade {
  to { opacity: 0; }
}

@keyframes splat {
  0% { opacity: 0; transform: scale(0.2); }
  20% { opacity: 1; transform: scale(1); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.15); }
}

@keyframes hop {
  0% { opacity: 1; clip-path: circle(0px at var(--hx) var(--hy)); }
  55% { opacity: 1; clip-path: circle(140% at var(--hx) var(--hy)); }
  100% { opacity: 0; clip-path: circle(140% at var(--hx) var(--hy)); }
}

@keyframes sensePulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

@keyframes senseShake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-3px, 2px); }
  50% { transform: translate(3px, -2px); }
  75% { transform: translate(-2px, -3px); }
  100% { transform: translate(0, 0); }
}

@keyframes tingle {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes targetIn {
  from { transform: scale(0.3); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes targetRing {
  from { transform: scale(1.35); opacity: 0.9; }
  to { transform: scale(0.85); opacity: 0.1; }
}

@keyframes targetCaught {
  to { transform: scale(1.6); opacity: 0; }
}

@keyframes floatUp {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(-36px); opacity: 0; }
}

/* =====================================================
   Responsif
   ===================================================== */

@media (max-height: 700px) {
  .lead { font-size: 1rem; line-height: 1.65; }
  .section-header p { line-height: 1.6; }
  .hero-copy .btn { padding: 11px 16px; }
  .cta-row { margin-top: 16px; }
  .info-card { padding: 18px; }
  .count-card { padding: 16px 14px; }
  .timeline-item { padding: 12px 16px; }
}

@media (max-width: 860px) {
  .sidebar {
    width: min(280px, 82vw);
    transform: translateX(-105%);
    transition: transform 0.35s cubic-bezier(0.3, 1, 0.4, 1);
  }

  .sidebar.is-open {
    transform: none;
  }

  .scrim { display: block; }
  .menu-toggle { display: grid; }

  .stage-wrap { margin-left: 0; }

  .top-row {
    padding-left: 68px;
    padding-right: 16px;
  }

  .google-search {
    width: 100%;
    min-width: 0;
  }

  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-wrap,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .age-box,
  .game-hud {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dangler { display: none; }
}

@media (max-width: 480px) {
  .chat-form,
  .google-search-inline {
    grid-template-columns: 1fr;
  }

  .chat-form button,
  .google-search-inline button {
    padding: 12px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .dangler { display: none; }
}
