/* Jovana Medical — CloneX-inspired dark medical aesthetic */
:root {
  --bg-0: #05060d;
  --bg-1: #0a0c18;
  --bg-2: #11142a;
  --panel: rgba(18, 21, 44, 0.72);
  --panel-solid: #12152c;
  --line: rgba(120, 130, 220, 0.16);
  --line-strong: rgba(140, 150, 240, 0.32);
  --ink-0: #f4f5ff;
  --ink-1: #c8ccf0;
  --ink-2: #8a8fc4;
  --ink-3: #5b609a;
  --blue: #3a6cff;
  --blue-bright: #5e8bff;
  --purple: #8b5cff;
  --purple-bright: #a986ff;
  --magenta: #c060ff;
  --pulse: #45d4ff;
  --warn: #ff9a3d;
  --bad: #ff5d7a;
  --good: #2bd9a4;
  --grad-1: linear-gradient(135deg, #3a6cff 0%, #8b5cff 60%, #c060ff 100%);
  --grad-2: linear-gradient(120deg, #1d2552 0%, #3a2466 100%);
  --grad-text: linear-gradient(120deg, #6e9bff 0%, #b08aff 50%, #d68aff 100%);
  --mono: 'JetBrains Mono', 'Roboto Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --sans: 'Inter', 'Noto Sans HK', 'PingFang TC', 'Microsoft JhengHei', 'Helvetica Neue', sans-serif;
  --serif: 'Instrument Serif', 'Cormorant Garamond', 'Noto Serif HK', serif;
  --tc: 'Noto Serif HK', 'Source Han Serif TC', 'PingFang TC', serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-0);
  color: var(--ink-1);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}
:lang(zh), .zh, [lang^='zh'] { font-family: var(--tc), var(--sans); }
h1, h2, h3, .qtitle, .footer-tag, .v { font-family: var(--serif); }

/* Page background — subtle nebula tint that bleeds out from hero */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(58,108,255,0.08), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(192,96,255,0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-0), var(--bg-1) 40%, var(--bg-0));
}

main, header, nav, footer { position: relative; z-index: 1; }

/* TOP NAV */
.topnav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: linear-gradient(180deg, rgba(5,6,13,0.4), rgba(5,6,13,0.15));
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.topnav.scrolled {
  background: rgba(5,6,13,0.85);
  border-bottom-color: var(--line);
}
.topnav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex; align-items: center; gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text {
  display: flex; flex-direction: column; line-height: 1;
}
.brand-text .b1 { font-family: var(--sans); font-weight: 700; font-size: 15px; color: var(--ink-0); letter-spacing: 0.18em; }
.brand-text .b2 { font-family: var(--mono); font-size: 9.5px; color: var(--ink-2); letter-spacing: 0.32em; margin-top: 4px; }
/* Exam switcher dropdown — sits between brand and nav-links */
.exam-switcher {
  position: relative;
  margin-left: 24px;
}
.exam-switcher-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(168,80,255,0.28);
  color: var(--ink-1);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  transition: border-color 0.2s, background 0.2s;
}
.exam-switcher-btn:hover { border-color: rgba(168,80,255,0.55); background: rgba(168,80,255,0.10); }
.exam-switcher-btn .es-label { color: var(--ink-3); font-size: 9.5px; letter-spacing: 0.28em; }
.exam-switcher-btn .es-value { color: var(--ink-0); font-family: var(--serif); font-style: italic; font-size: 16px; letter-spacing: 0; text-transform: none; }
.exam-switcher-btn .es-caret { color: var(--ink-3); font-size: 10px; transition: transform 0.2s; }
.exam-switcher.open .exam-switcher-btn .es-caret { transform: rotate(180deg); }
.exam-switcher-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 320px;
  background: rgba(12,8,28,0.96);
  border: 1px solid rgba(168,80,255,0.32);
  border-radius: 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 48px -12px rgba(0,0,0,0.7), 0 0 0 1px rgba(168,80,255,0.10);
  padding: 6px;
  z-index: 60;
}
.exam-switcher-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink-1);
  padding: 12px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--sans);
}
.exam-switcher-item:hover { background: rgba(168,80,255,0.10); }
.exam-switcher-item.active { background: rgba(168,80,255,0.16); }
.exam-switcher-item .es-id {
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--serif); font-style: italic; font-size: 22px;
  color: var(--ink-0);
  text-align: center;
  border-right: 1px solid rgba(168,80,255,0.18);
  padding-right: 14px;
}
.exam-switcher-item .es-title {
  font-size: 14px; color: var(--ink-0); font-weight: 600;
}
.exam-switcher-item .es-focus {
  font-size: 11.5px; color: var(--ink-2); margin-top: 2px;
}

.nav-links {
  display: flex; gap: 4px; margin-left: auto;
}
.nav-links a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.2s;
}
.nav-links a:hover { color: var(--ink-0); background: rgba(255,255,255,0.04); }
.nav-cta {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 9px 16px;
  border-radius: 6px;
  background: var(--grad-1);
  color: white !important;
  border: 0;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset, 0 8px 24px -8px rgba(139,92,255,0.5);
}

/* HERO */
/* ===== HERO COMMANDER (Phantom Troupe energy) ===== */
.hero--commander {
  width: 100%;
  margin: 0;
  padding: 100px 0 90px;
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  place-items: center;
}

.hero--commander .hero-stage {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 58% 70% at 50% 38%, #5a2d8a 0%, #3a1a66 24%, #1f0e3e 52%, #0e0620 78%, #050210 100%),
    #050208;
}

/* Backlight: heavy radial halo behind the figure (pushed up to upper torso) */
.aura-back {
  position: absolute; left: 50%; top: 38%;
  width: 1100px; height: 1100px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(190,140,240,0.72) 0%, rgba(150,90,220,0.48) 22%, rgba(95,45,165,0.26) 42%, rgba(50,20,100,0.10) 60%, transparent 75%);
  filter: blur(45px);
  animation: aura-pulse 5s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes aura-pulse {
  0% { opacity: 0.85; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}
/* Front aura: a tighter rim-light edge bloom */
.aura-front {
  position: absolute; left: 50%; top: 42%;
  width: 720px; height: 720px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, transparent 36%, rgba(210,150,255,0.30) 42%, rgba(170,100,230,0.12) 52%, transparent 64%);
  filter: blur(10px);
  pointer-events: none;
  mix-blend-mode: screen;
  animation: aura-pulse 3.4s ease-in-out infinite alternate;
}

/* Big nebula wash — unified violet, no more pink/blue color noise */
.hero--commander .nebula {
  position: absolute; inset: -10%;
  background:
    radial-gradient(circle at 30% 35%, rgba(120,70,200,0.32), transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(150,90,220,0.30), transparent 50%),
    radial-gradient(circle at 50% 45%, rgba(180,130,240,0.22), transparent 45%);
  filter: blur(80px);
  animation: nebula-drift 28s ease-in-out infinite alternate;
  mix-blend-mode: screen;
  z-index: 0;
}
@keyframes nebula-drift {
  0% { transform: translate(0,0) rotate(0deg) scale(1); }
  50% { transform: translate(2%,-2%) rotate(6deg) scale(1.06); }
  100% { transform: translate(-2%,2%) rotate(-5deg) scale(1.03); }
}
.hero--commander .smoke {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 45% 30% at 35% 82%, rgba(140,80,210,0.20), transparent 65%),
    radial-gradient(ellipse 50% 30% at 68% 22%, rgba(110,70,180,0.16), transparent 65%);
  filter: blur(60px);
  animation: smoke-shift 18s ease-in-out infinite alternate;
}
@keyframes smoke-shift {
  0% { opacity: 0.7; transform: translateX(0); }
  100% { opacity: 1; transform: translateX(-3%); }
}

/* THE FIGURE — full center commander */
.hero-figure {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  height: 92vh; max-height: 920px;
  z-index: 2;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  filter:
    drop-shadow(0 14px 26px rgba(20,8,40,0.40))
    drop-shadow(0 0 38px rgba(150,90,220,0.30))
    drop-shadow(0 -6px 20px rgba(200,150,255,0.18));
  animation: figure-breath 6s ease-in-out infinite alternate;
  opacity: 0.62;
}
.hero-figure img {
  height: 100%; width: auto; object-fit: contain;
}
@keyframes figure-breath {
  0%   { transform: translate(-50%, -50%) scale(1); }
  100% { transform: translate(-50%, -51.2%) scale(1.012); }
}

/* Rune rings spinning behind the figure (Chrollo's grimoire vibes) */
.rune-ring {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: screen;
}
.rune-ring svg { display: block; }
.rune-ring--outer {
  width: 92vh; height: 92vh; max-width: 920px; max-height: 920px;
  animation: spin-cw 80s linear infinite;
  opacity: 0.9;
}
.rune-ring--inner {
  width: 64vh; height: 64vh; max-width: 640px; max-height: 640px;
  animation: spin-ccw 50s linear infinite;
  opacity: 0.95;
}
@keyframes spin-cw  { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes spin-ccw { to { transform: translate(-50%, -50%) rotate(-360deg); } }

/* Floating sigils */
.sigil {
  position: absolute;
  font-family: 'Instrument Serif', 'Noto Serif HK', serif;
  color: rgba(220,180,255,0.7);
  text-shadow: 0 0 16px rgba(168,80,255,0.9), 0 0 30px rgba(232,90,200,0.6);
  z-index: 3;
  pointer-events: none;
  animation: sigil-float 7s ease-in-out infinite alternate;
}
.sigil--n      { top: 14%;  left: 22%; font-size: 56px; font-style: italic; animation-delay: -1s; }
.sigil--cross  { top: 22%;  right: 18%; font-size: 38px; animation-delay: -2.5s; }
.sigil--diamond{ bottom: 22%; left: 18%; font-size: 28px; animation-delay: -3s; color: rgba(120,180,255,0.8); }
.sigil--star   { top: 38%;  right: 12%; font-size: 22px; animation-delay: -4s; }
.sigil--ankh   { bottom: 30%; right: 24%; font-size: 44px; animation-delay: -1.5s; }
.sigil--alpha  { top: 30%;  left: 12%; font-size: 32px; font-style: italic; animation-delay: -5s; color: rgba(255,140,210,0.75); }
@keyframes sigil-float {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.5; }
  50%  { opacity: 1; }
  100% { transform: translateY(-18px) rotate(4deg); opacity: 0.7; }
}

/* Banner streaks behind the figure (cape echoes) */
.banner-streak {
  position: absolute;
  top: 20%; bottom: 4%;
  width: 140px;
  background: linear-gradient(180deg, transparent 0, rgba(155,95,225,0.50) 20%, rgba(115,60,195,0.70) 55%, rgba(75,32,150,0.50) 85%, transparent 100%);
  filter: blur(6px);
  z-index: 1;
  mix-blend-mode: screen;
  pointer-events: none;
}
.banner-streak--l { left: 36%; transform: rotate(-3deg) skewY(-2deg); animation: banner-sway 8s ease-in-out infinite alternate; }
.banner-streak--r { right: 36%; transform: rotate(3deg) skewY(2deg); animation: banner-sway 8s 2s ease-in-out infinite alternate; }
@keyframes banner-sway {
  0%   { transform: rotate(-4deg) skewY(-3deg) translateY(0); opacity: 0.6; }
  100% { transform: rotate(-2deg) skewY(-2deg) translateY(-10px); opacity: 0.9; }
}

/* Grain & scanlines & vignette on top */
.hero--commander .grain {
  position: absolute; inset: 0; opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  z-index: 5;
  pointer-events: none;
}
.hero--commander .vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 38%, transparent 30%, rgba(0,0,0,0.50) 72%, rgba(0,0,0,0.95) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.35) 0%, transparent 22%, transparent 70%, rgba(0,0,0,0.55) 100%);
  z-index: 4;
  pointer-events: none;
}
.hero--commander .scanlines {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(0,0,0,0.18) 3px, transparent 4px);
  opacity: 0.3; z-index: 5; pointer-events: none;
}

/* Content placement: title on the left, meta below the figure */
.hero-content--commander {
  position: relative;
  z-index: 6;
  width: 100%;
  max-width: 1500px;
  padding: 0 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 32px;
}
.hero-content--commander .hero-tag,
.hero-content--commander h1,
.hero-content--commander .hero-sub {
  grid-column: 1;
}
.hero-content--commander .hero-meta {
  grid-column: 1 / -1;
  align-self: end;
  margin-top: 56px;
  max-width: none;
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
  background: rgba(168,80,255,0.16);
  border: 1px solid rgba(168,80,255,0.32);
  backdrop-filter: blur(14px);
}
.hero-content--commander h1 {
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
.hero-content--commander .hero-sub {
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
  color: #e6e6f0;
}
.hero-content--commander .hero-tag {
  background: rgba(20,8,40,0.7);
  backdrop-filter: blur(8px);
}

@media (max-width: 1080px) {
  .hero-content--commander { grid-template-columns: 1fr; padding: 0 28px; }
  .hero-content--commander .hero-meta { grid-column: 1; }
  .hero-figure { height: 70vh; opacity: 0.55; }
}
/* Cinematic stage layers */
.hero-stage {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 70% 35%, #1a0a3a 0%, #0a0518 40%, #050208 80%);
}
.nebula {
  position: absolute; inset: -20%;
  background:
    radial-gradient(circle at 25% 30%, rgba(58,108,255,0.55), transparent 45%),
    radial-gradient(circle at 75% 60%, rgba(168,80,255,0.5), transparent 50%),
    radial-gradient(circle at 60% 20%, rgba(232,90,200,0.4), transparent 40%),
    radial-gradient(circle at 35% 80%, rgba(80,40,180,0.45), transparent 45%);
  filter: blur(60px);
  animation: nebula-drift 28s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
@keyframes nebula-drift {
  0% { transform: translate(0,0) rotate(0deg) scale(1); }
  50% { transform: translate(3%,-2%) rotate(8deg) scale(1.08); }
  100% { transform: translate(-2%,3%) rotate(-6deg) scale(1.04); }
}
.smoke {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 30% 70%, rgba(255,90,200,0.18), transparent 60%),
    radial-gradient(ellipse 50% 30% at 70% 30%, rgba(120,180,255,0.15), transparent 60%);
  filter: blur(40px);
  animation: smoke-shift 18s ease-in-out infinite alternate;
}
@keyframes smoke-shift {
  0% { opacity: 0.7; transform: translateX(0); }
  100% { opacity: 1; transform: translateX(-4%); }
}
.grain {
  position: absolute; inset: 0; opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}
.vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 90% 80% at 50% 50%, transparent 40%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}
.scanlines {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(0,0,0,0.18) 3px, transparent 4px);
  opacity: 0.35; pointer-events: none;
}
/* Vertical side codes flanking the stage */
.hero-side, .hero-codes {
  position: absolute; top: 50%;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.5em;
  text-transform: uppercase; color: var(--ink-2);
  writing-mode: vertical-rl; transform: translateY(-50%) rotate(180deg);
  padding: 16px 0;
  z-index: 2;
}
.hero-side { left: 18px; }
.hero-codes { right: 18px; color: var(--purple-bright); opacity: 0.7; }

.hero-character {
  position: absolute; top: 0; right: 0; bottom: 100px;
  width: 52%; max-width: 720px;
  z-index: 0;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.hero-character img {
  height: 88%; width: auto; object-fit: contain;
  filter: drop-shadow(0 20px 60px rgba(168,80,255,0.45)) drop-shadow(0 0 40px rgba(58,108,255,0.3));
  animation: float-char 8s ease-in-out infinite alternate;
}
@keyframes float-char {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-18px) scale(1.015); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 820px;
  padding-top: 40px;
}

.hero h1 .line {
  display: block;
  overflow: visible;
  padding: 0.05em 0 0.18em;
}
.hero h1 .line > span {
  display: inline-block;
  animation: rise-in 1.1s cubic-bezier(0.2, 0.7, 0.1, 1) backwards;
}
.hero h1 .line:nth-child(1) > span { animation-delay: 0.1s; }
.hero h1 .line:nth-child(2) > span { animation-delay: 0.25s; }
.hero h1 .line:nth-child(3) > span { animation-delay: 0.4s; }
@keyframes rise-in {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Animated pulse line at bottom of hero */
.hero-pulseline {
  position: absolute;
  left: 0; right: 0; bottom: 70px;
  height: 80px;
  z-index: 1;
  pointer-events: none;
  display: flex; align-items: center;
  padding: 0 32px;
  opacity: 0.85;
}
.hero-pulseline svg { width: 100%; height: 100%; }

/* Bottom infinite marquee */
.hero-marquee {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  border-top: 1px solid rgba(168,80,255,0.25);
  border-bottom: 1px solid rgba(168,80,255,0.25);
  background: linear-gradient(180deg, rgba(10,5,30,0.7), rgba(20,8,50,0.5));
  backdrop-filter: blur(8px);
  overflow: hidden;
  z-index: 2;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.hero-marquee .track {
  display: inline-flex; align-items: center;
  white-space: nowrap;
  animation: marquee 60s linear infinite;
  padding: 14px 0;
  gap: 28px;
}
.hero-marquee .track span {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.32em;
  color: var(--ink-2); text-transform: uppercase;
  white-space: nowrap;
}
.hero-marquee .track span em {
  color: var(--purple-bright); font-style: normal; margin-left: 6px;
}
.hero-marquee .track .dot-sep {
  color: var(--purple-bright); font-size: 6px; letter-spacing: 0;
  opacity: 0.7;
}
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.hero-tag {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ink-1);
  background: rgba(255,255,255,0.03);
}
.hero-tag .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--pulse);
  box-shadow: 0 0 12px var(--pulse);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(48px, 8vw, 110px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 28px 0 24px;
  font-weight: 400;
  color: var(--ink-0);
}
.hero h1 .grad {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
  display: inline-block;
  padding-right: 0.18em;
  margin-right: -0.06em;
}
.hero-sub {
  max-width: 720px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink-1);
  margin-bottom: 40px;
}
.hero-meta {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: rgba(168,80,255,0.2);
  border: 1px solid rgba(168,80,255,0.25);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 48px;
  max-width: 720px;
  backdrop-filter: blur(12px);
}
.hero-meta .cell {
  background: linear-gradient(180deg, rgba(20,10,50,0.85), rgba(10,5,25,0.85));
  padding: 32px 36px;
}
.hero-meta .k {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 16px;
}
.hero-meta .v {
  font-family: var(--serif); font-size: 40px; line-height: 1.2;
  color: var(--ink-0);
  font-weight: 400;
}
.hero-meta .v small {
  font-family: var(--sans); font-size: 12px; color: var(--ink-2);
  margin-left: 6px; font-weight: normal;
}



/* SECTION */
section.block {
  max-width: 1440px;
  margin: 0 auto;
  padding: 80px 32px;
}
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 40px;
  gap: 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
}
.section-head .label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--ink-2);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
}
.section-head .label::before {
  content: '';
  width: 24px; height: 1px; background: var(--ink-3);
}
.section-head h2 {
  font-family: var(--serif);
  font-size: clamp(40px, 5.5vw, 72px);
  line-height: 1.15;
  letter-spacing: -0.018em;
  margin: 0;
  padding: 0.08em 0 0.16em;
  overflow: visible;
}
  line-height: 1;
  letter-spacing: -0.018em;
  margin: 0;
  font-weight: 400;
  color: var(--ink-0);
}
.section-lede {
  color: var(--ink-1); max-width: 760px; margin-bottom: 32px;
  font-size: 15px; line-height: 1.7;
}
.section-head h2 em {
  font-style: italic;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  padding-right: 0.22em;
  margin-right: -0.08em;
}
.section-head .right {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  color: var(--ink-3); text-transform: uppercase;
  white-space: nowrap;
}

/* REVISION CARDS */
.rev-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-bottom: 32px;
}
.rev-card {
  background: linear-gradient(180deg, rgba(20,24,52,0.55), rgba(10,12,24,0.55));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px 24px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  transition: 0.2s;
}
.rev-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.rev-card .rev-num {
  position: absolute; top: 18px; right: 22px;
  font-family: var(--serif); font-size: 56px; line-height: 1.1;
  color: rgba(139,92,255,0.18);
  font-weight: 400;
}
.rev-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--grad-1);
}
.rev-card .qno {
  font-family: var(--mono); font-size: 12px; color: var(--purple-bright);
  letter-spacing: 0.12em; margin-bottom: 12px;
}
.rev-card .row {
  display: flex; gap: 12px; align-items: center; margin: 6px 0;
  font-family: var(--mono); font-size: 12px;
}
.rev-card .row .l { color: var(--ink-3); width: 60px; }
.rev-card .row .v { color: var(--ink-0); }
.rev-card .row .v.warn { color: var(--warn); }
.rev-card .row .v.good { color: var(--good); }
.rev-card .arrow {
  margin: 8px 0; color: var(--ink-3); font-family: var(--mono); font-size: 11px;
}
.rev-card .note {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line);
  color: var(--ink-1); font-size: 13px; line-height: 1.55;
}

/* ANSWER GRID */
.answer-grid {
  display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px;
}
.answer-cell {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--mono);
  background: rgba(255,255,255,0.02);
  text-decoration: none;
  color: var(--ink-1);
  transition: 0.2s;
  position: relative;
  overflow: hidden;
}
.answer-cell.revised { border-color: rgba(255,154,61,0.35); background: rgba(255,154,61,0.04); }
.answer-cell:hover {
  border-color: var(--purple-bright);
  background: rgba(139,92,255,0.08);
  transform: translateY(-2px);
}
.answer-cell .qn {
  font-size: 10px; letter-spacing: 0.1em; color: var(--ink-3);
}
.answer-cell .ans {
  font-size: 22px; color: var(--ink-0); margin-top: 2px;
  font-weight: 600;
}
.answer-cell .star {
  position: absolute; top: 4px; right: 6px;
  font-size: 10px; color: var(--warn);
}

/* SYSTEM CHIPS */
.systems {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.systems .row {
  display: grid; grid-template-columns: 220px 1fr;
  background: rgba(15,18,40,0.7);
  padding: 18px 22px;
  gap: 20px;
  align-items: start;
}
.systems .row .name {
  font-family: var(--sans); font-size: 13px; color: var(--ink-0);
  font-weight: 500;
}
.systems .row .name .n {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  letter-spacing: 0.2em; display: block; margin-bottom: 4px;
}
.systems .qs {
  display: flex; flex-wrap: wrap; gap: 5px;
}
.systems .qs a {
  font-family: var(--mono); font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink-1);
  text-decoration: none;
  transition: 0.15s;
}
.systems .qs a:hover {
  background: var(--grad-1);
  color: white; border-color: transparent;
}

/* FILTER BAR (sticky) */
.filter-bar {
  position: sticky; top: 64px; z-index: 30;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: linear-gradient(180deg, rgba(5,6,13,0.92), rgba(5,6,13,0.78));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 14px 32px;
  margin: 0 -32px 32px;
}
.filter-inner {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.filter-search {
  flex: 1; min-width: 240px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 14px;
}
.filter-search input {
  flex: 1;
  background: transparent; border: 0; outline: 0;
  color: var(--ink-0);
  font-family: var(--sans); font-size: 14px;
}
.filter-search input::placeholder { color: var(--ink-3); }
.filter-search .clear {
  background: transparent; border: 0; color: var(--ink-3); cursor: pointer;
  font-size: 14px; padding: 4px 6px;
}
.filter-search .clear:hover { color: var(--ink-0); }
.filter-status .num { color: var(--ink-0); font-weight: 600; }
.no-results { padding: 60px; text-align: center; color: var(--ink-3); font-family: var(--mono); }
.opt-text { flex: 1; padding-right: 90px; }
.qopt:not(.correct) .opt-text { padding-right: 0; }

/* loading */
.loading {
  min-height: 100vh; display: grid; place-items: center;
  color: var(--ink-2); font-family: var(--mono);
}
.loading .logo-pulse { width: 80px; height: 80px; margin: 0 auto 20px; animation: float 2s ease-in-out infinite; }
.loading .logo-pulse img { width: 100%; height: 100%; object-fit: contain; }
.loading-text { font-size: 14px; letter-spacing: 0.4em; color: var(--ink-0); margin-bottom: 6px; text-align: center; }
.loading-sub { font-size: 11px; letter-spacing: 0.2em; text-align: center; }
.footer-blurb { color: var(--ink-2); margin-top: 18px; font-size: 13.5px; max-width: 420px; line-height: 1.65; }
.filter-search .ico {
  color: var(--ink-3); font-family: var(--mono); font-size: 12px;
}
.filter-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.filter-chips .chip {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: 0.15s;
}
.filter-chips .chip:hover { color: var(--ink-0); border-color: var(--line-strong); }
.filter-chips .chip.active {
  background: var(--grad-1);
  color: white; border-color: transparent;
}
.filter-status {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  margin-left: auto; letter-spacing: 0.1em;
}

/* QUESTION CARDS */
.questions {
  display: flex; flex-direction: column; gap: 24px;
}
.qcard {
  background: linear-gradient(180deg, rgba(20,24,52,0.55), rgba(10,12,24,0.7));
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  scroll-margin-top: 140px;
  transition: 0.2s;
}
.qcard:hover { border-color: var(--line-strong); }
.qcard.revised { border-color: rgba(255,154,61,0.3); }
.qcard.revised::after { content: ''; }

.qcard-head {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.qcard-head .qmeta {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 11px;
  margin-bottom: 14px;
}
.qcard-head .qmeta .qno {
  background: var(--grad-1);
  color: white; padding: 4px 10px; border-radius: 5px;
  letter-spacing: 0.1em;
  font-weight: 600;
}
.qcard-head .qmeta .system {
  color: var(--purple-bright); letter-spacing: 0.18em; text-transform: uppercase;
}
.qcard-head .qmeta .badge-revised {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255,154,61,0.12);
  color: var(--warn);
  font-size: 10px; letter-spacing: 0.2em;
  border: 1px solid rgba(255,154,61,0.3);
}
.qcard-head .qtitle {
  font-family: var(--serif);
  font-size: 28px; line-height: 1.35;
  color: var(--ink-0);
  font-weight: 400;
  letter-spacing: -0.005em;
}

.qcard-body {
  padding: 24px 32px 28px;
}
.qstem {
  font-size: 18px;
  color: #ffffff;
  margin-bottom: 24px;
  line-height: 1.75;
  padding: 22px 26px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(140,150,240,0.28);
  border-left: 3px solid var(--blue-bright);
  border-radius: 4px 12px 12px 4px;
  font-weight: 500;
}
.qstem i, .qstem em { font-style: normal; color: #fff; }
.qoptions { display: grid; gap: 10px; margin-bottom: 24px; }
.qopt {
  display: flex; gap: 16px;
  padding: 16px 22px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(140,150,240,0.22);
  border-radius: 10px;
  font-size: 15.5px;
  line-height: 1.6;
  cursor: default;
  transition: 0.18s;
  color: #f0f2ff;
  align-items: flex-start;
  font-weight: 400;
}
.qopt b, .qopt strong { color: #fff; font-weight: 600; }
.qopt:hover { border-color: var(--line-strong); background: rgba(255,255,255,0.07); }
.qopt .letter {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--ink-1);
}
.qopt.selected { border-color: var(--blue-bright); background: rgba(58,108,255,0.08); }
.qopt.selected .letter { background: var(--blue); color: white; border-color: var(--blue); }
.qopt.correct { border-color: rgba(43,217,164,0.5); background: rgba(43,217,164,0.06); position: relative; }
.qopt.correct .letter { background: var(--good); color: var(--bg-0); border-color: var(--good); }
.qopt.correct::after {
  content: '✓ 正解'; position: absolute; top: 14px; right: 16px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; color: var(--good);
  background: rgba(43,217,164,0.12); padding: 3px 8px; border-radius: 4px;
}
.qopt.incorrect { border-color: rgba(255,93,122,0.5); background: rgba(255,93,122,0.06); }
.qopt.incorrect .letter { background: var(--bad); color: white; border-color: var(--bad); }

.answer-reveal {
  margin: 16px 0 0;
  padding: 18px 22px;
  background: linear-gradient(120deg, rgba(58,108,255,0.08), rgba(139,92,255,0.08));
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.answer-reveal::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--grad-1);
}
.answer-reveal .label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--purple-bright);
  margin-bottom: 8px;
}
.answer-reveal .value {
  font-family: var(--serif); font-size: 22px; color: var(--ink-0);
  margin-bottom: 8px;
}
.answer-reveal .value .ans {
  font-weight: 600; color: var(--good);
  background: rgba(43,217,164,0.14); padding: 2px 14px; border-radius: 6px;
  margin-right: 10px;
  font-family: var(--mono); font-size: 18px;
  border: 1px solid rgba(43,217,164,0.35);
}
.answer-reveal .value .rev-tag {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--warn);
  padding: 3px 9px; border-radius: 4px;
  background: rgba(255,154,61,0.1); border: 1px solid rgba(255,154,61,0.3);
}
.answer-reveal .note {
  font-size: 13.5px; color: var(--ink-1); line-height: 1.6;
}

.actions {
  display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap;
}
.btn {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.03);
  color: var(--ink-1);
  cursor: pointer;
  transition: 0.15s;
}
.btn:hover { background: rgba(255,255,255,0.06); color: var(--ink-0); }
.btn.primary { background: var(--grad-1); border-color: transparent; color: white; }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(139,92,255,0.5); }

.explain {
  margin-top: 22px;
  border-top: 1px dashed var(--line);
  padding-top: 24px;
  display: none;
}
.qcard.expanded .explain { display: block; animation: fadein 0.3s; }
@keyframes fadein { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.explain h4 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--purple-bright);
  margin: 22px 0 12px;
  display: flex; align-items: center; gap: 12px;
}
.explain h4::before {
  content: ''; width: 18px; height: 1px; background: var(--purple-bright);
}
.explain h4:first-child { margin-top: 0; }
.explain p { margin: 8px 0; font-size: 14.5px; line-height: 1.68; color: var(--ink-1); }
.explain p.keypoint {
  background: rgba(58,108,255,0.06);
  border-left: 2px solid var(--blue-bright);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
}
.explain p.pearl {
  background: linear-gradient(90deg, rgba(192,96,255,0.08), transparent);
  border-left: 2px solid var(--magenta);
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  margin: 10px 0;
}
.explain p.opt-a { color: var(--ink-1); padding-left: 0; }
.explain b { color: var(--ink-0); }
.explain i { color: var(--ink-1); }
.explain table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px;
  font-size: 13.5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.explain table th, .explain table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
}
.explain table th:last-child, .explain table td:last-child { border-right: 0; }
.explain table tr:last-child td { border-bottom: 0; }
.explain table thead th, .explain table tr:first-child td {
  background: rgba(58,108,255,0.08);
  color: var(--ink-0);
  font-weight: 600;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em;
  text-transform: uppercase;
}
.explain table tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.explain .extlearn {
  margin-top: 16px;
  background: linear-gradient(120deg, rgba(110,80,220,0.06), rgba(58,108,255,0.06));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
}
.explain .extlearn b { color: var(--purple-bright); }

/* FOOTER */
footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(20,24,52,0.4));
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 60px 32px 40px;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px;
}
.footer-inner .col h5 {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.28em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 14px;
}
.footer-inner .col a {
  display: block; color: var(--ink-1); text-decoration: none;
  font-size: 13.5px; padding: 4px 0;
}
.footer-inner .col a:hover { color: var(--ink-0); }
.footer-tag { font-family: var(--serif); font-size: 28px; line-height: 1.35; color: var(--ink-0); padding-bottom: 0.1em; }
.footer-tag em { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; font-style: italic; display: inline-block; padding-right: 0.22em; margin-right: -0.08em; }
.footer-bot {
  border-top: 1px solid var(--line);
  padding: 22px 32px;
  display: flex; justify-content: space-between;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.14em;
  max-width: 1440px; margin: 0 auto;
}

/* Responsive */
@media (max-width: 1080px) {
  .hero-character { width: 60vw; opacity: 0.55; right: -8vw; }
  .hero-character img { height: 75%; }
  .hero-meta { grid-template-columns: repeat(2, 1fr); }
  .rev-grid { grid-template-columns: 1fr; }
  .systems { grid-template-columns: 1fr; }
  .answer-grid { grid-template-columns: repeat(8, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 640px) {
  .topnav-inner, section.block, .footer-inner { padding-left: 18px; padding-right: 18px; }
  .qcard-head, .qcard-body { padding-left: 18px; padding-right: 18px; }
  .answer-grid { grid-template-columns: repeat(5, 1fr); }
  .systems .row { grid-template-columns: 1fr; }
}

/* preformat content from docx parts */
.docx-color-FF6600 { color: var(--warn); }
.docx-color-1F4E79 { color: var(--blue-bright); }
.docx-color-C00000 { color: var(--bad); }
.docx-color-548235 { color: var(--good); }

::selection { background: rgba(139,92,255,0.4); color: white; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: rgba(120,130,220,0.2); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120,130,220,0.4); }

/* ===== Sign-in gate (Google Identity Services) ===== */
.sign-in-gate {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(ellipse 65% 75% at 50% 38%, #4a236b 0%, #2a1248 32%, #140827 60%, #06030f 90%),
    #050208;
  isolation: isolate;
  overflow: hidden;
  z-index: 100;
}
.sign-in-gate .gate-stage {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.sign-in-gate .gate-aura {
  position: absolute; left: 50%; top: 38%;
  width: 1100px; height: 1100px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle, rgba(190,140,240,0.55) 0%, rgba(150,90,220,0.32) 28%, rgba(95,45,165,0.18) 50%, transparent 72%);
  filter: blur(50px);
  mix-blend-mode: screen;
  animation: aura-pulse 5s ease-in-out infinite alternate;
}
.sign-in-gate .gate-grain {
  position: absolute; inset: 0; opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.sign-in-gate .gate-card {
  position: relative; z-index: 1;
  width: min(520px, calc(100vw - 48px));
  padding: 44px 44px 36px;
  background: rgba(12,8,28,0.78);
  border: 1px solid rgba(168,80,255,0.32);
  border-radius: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 40px 80px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(168,80,255,0.08) inset;
  text-align: center;
}
.gate-brand {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 32px;
  text-align: left;
}
.gate-mark {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  overflow: hidden;
}
.gate-mark img { width: 100%; height: 100%; object-fit: contain; }
.gate-brand-text { display: flex; flex-direction: column; line-height: 1; }
.gate-brand-text .b1 {
  font-family: var(--sans); font-weight: 700; font-size: 17px;
  color: var(--ink-0); letter-spacing: 0.18em;
}
.gate-brand-text .b2 {
  font-family: var(--mono); font-size: 10px; color: var(--ink-2);
  letter-spacing: 0.32em; margin-top: 6px;
}
.gate-headline {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 60px);
  line-height: 1.05;
  font-weight: 400;
  margin: 0 0 16px;
  color: var(--ink-0);
  text-align: left;
}
.gate-headline span { display: block; }
.gate-headline .grad {
  background: var(--grad-1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
  display: inline-block;
  padding-right: 0.22em;
  margin-right: -0.08em;
}
.gate-lede {
  font-family: var(--tc), var(--sans);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-1);
  margin: 0 0 28px;
  text-align: left;
}
.gate-button-wrap {
  display: flex; justify-content: center;
  margin-bottom: 24px;
  min-height: 48px;
}
.gate-google-btn { display: inline-block; }
.gate-config-warning {
  width: 100%;
  padding: 16px 18px;
  border: 1px dashed rgba(255,180,80,0.45);
  border-radius: 10px;
  background: rgba(255,140,40,0.08);
  text-align: left;
  color: var(--ink-1);
  font-size: 13px; line-height: 1.6;
}
.gate-config-warning strong { color: rgb(255,180,80); display: block; margin-bottom: 6px; letter-spacing: 0.04em; }
.gate-config-warning a { color: var(--purple-bright); text-decoration: underline; }
.gate-config-warning code {
  font-family: var(--mono); font-size: 12px;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(255,255,255,0.06);
}
.gate-fineprint {
  font-family: var(--sans);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  text-align: left;
}

/* Stacked auth box: Google · OR · email field · email submit */
.gate-auth-box {
  width: 100%;
  padding: 18px;
  margin-bottom: 16px;
  background: rgba(8, 10, 24, 0.55);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  box-sizing: border-box;
}
.gate-auth-box .gate-google-btn {
  display: flex;
  justify-content: center;
}
.gate-google-fallback {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 14px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-1);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: not-allowed;
  opacity: 0.85;
}
.gate-or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.gate-or::before,
.gate-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.gate-or span { padding: 0 2px; }
.gate-email-input {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-0);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.gate-email-input::placeholder { color: var(--ink-3); }
.gate-email-input:focus {
  outline: none;
  border-color: var(--purple-bright);
  box-shadow: 0 0 0 3px rgba(168, 134, 255, 0.18);
}
.gate-form-error {
  padding: 9px 12px;
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.5;
  color: #ffd4dc;
  background: rgba(255, 93, 122, 0.10);
  border: 1px solid rgba(255, 93, 122, 0.40);
  border-radius: 8px;
}
.gate-email-submit {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: #1a1816;
  background: #f5f1ea;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.gate-email-submit:hover { background: #fff; }
.gate-email-submit:active { transform: translateY(1px); }
.gate-auth-box .gate-fineprint {
  margin-top: 16px;
  text-align: center;
}
.gate-auth-box .gate-fineprint a {
  color: var(--ink-1);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Multi-step register/sign-in/recover forms */
.gate-step-form { display: flex; flex-direction: column; gap: 12px; }
.gate-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.gate-back {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink-1);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.gate-back:hover { color: var(--ink-0); border-color: var(--line-strong); }
.gate-step-title {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-0);
  letter-spacing: 0.01em;
}
.gate-step-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  word-break: break-all;
}

.gate-pw-wrap { position: relative; display: flex; align-items: center; }
.gate-pw-wrap input { padding-right: 60px; }
.gate-pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 10px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  background: rgba(168,134,255,0.10);
  border: 1px solid rgba(168,134,255,0.25);
  border-radius: 6px;
  cursor: pointer;
}
.gate-pw-toggle:hover { color: var(--ink-0); background: rgba(168,134,255,0.20); }

.gate-link-btn {
  align-self: center;
  padding: 4px 6px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.gate-link-btn:hover { color: var(--ink-0); }
.gate-link-btn.danger { color: rgba(255, 154, 61, 0.85); }
.gate-link-btn.danger:hover { color: rgb(255, 184, 95); }

.gate-note {
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-1);
  background: rgba(168, 134, 255, 0.08);
  border: 1px solid rgba(168, 134, 255, 0.22);
  border-radius: 8px;
}
.gate-note.warn {
  color: #ffe2c0;
  background: rgba(255, 154, 61, 0.10);
  border-color: rgba(255, 154, 61, 0.35);
}

.gate-mono {
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gate-recovery-code {
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-align: center;
  color: var(--ink-0);
  background: rgba(5, 6, 13, 0.85);
  border: 1px dashed rgba(168, 134, 255, 0.45);
  border-radius: 10px;
  word-break: break-all;
  user-select: all;
}
.gate-recovery-actions {
  display: flex;
  justify-content: center;
}
.gate-ack {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 4px 2px;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-1);
  cursor: pointer;
}
.gate-ack input {
  margin-top: 2px;
  accent-color: var(--purple-bright);
}

.gate-wipe {
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.55;
  color: #ffd4dc;
  background: rgba(255, 93, 122, 0.08);
  border: 1px solid rgba(255, 93, 122, 0.32);
  border-radius: 8px;
}
.gate-wipe p { margin: 0 0 8px; }
.gate-wipe-btn {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: #ffd4dc;
  background: rgba(255, 93, 122, 0.14);
  border: 1px solid rgba(255, 93, 122, 0.45);
  border-radius: 8px;
  cursor: pointer;
}
.gate-wipe-btn:hover { background: rgba(255, 93, 122, 0.22); }

/* ===== Top-nav user chip ===== */
.user-chip {
  position: relative;
  margin-left: 12px;
}
.user-chip-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(168,80,255,0.4);
  padding: 0;
  background: rgba(168,80,255,0.10);
  cursor: pointer;
  overflow: hidden;
  display: grid; place-items: center;
  transition: border-color 0.2s, transform 0.15s;
}
.user-chip-btn:hover { border-color: rgba(190,140,240,0.85); transform: scale(1.04); }
.user-chip-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-chip-btn .user-fallback {
  font-family: var(--serif); font-style: italic; font-size: 16px;
  color: var(--ink-0);
}
.user-chip-menu {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 240px;
  background: rgba(12,8,28,0.96);
  border: 1px solid rgba(168,80,255,0.32);
  border-radius: 12px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.7);
  padding: 8px;
  z-index: 60;
}
.user-info {
  padding: 10px 12px 12px;
  border-bottom: 1px solid rgba(168,80,255,0.16);
  margin-bottom: 6px;
  text-align: left;
}
.user-info .user-name {
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--ink-0);
}
.user-info .user-email {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  margin-top: 2px;
  word-break: break-all;
}
.user-signout {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--ink-1);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.user-signout:hover { background: rgba(168,80,255,0.10); color: var(--ink-0); }

/* ===== Per-question social: notes + comments ===== */
.qcard-social {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px dashed rgba(168, 134, 255, 0.20);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Note editor */
.note-editor { display: flex; flex-direction: column; gap: 8px; }
.note-head {
  display: flex; align-items: baseline; justify-content: space-between;
}
.note-head h4 {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-1);
  margin: 0;
}
.note-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}
.note-status.saving { color: var(--ink-2); }
.note-status.saved  { color: var(--good); }
.note-status.error  { color: var(--bad); }
.note-textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-0);
  background: rgba(5, 6, 13, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
  min-height: 84px;
  box-sizing: border-box;
}
.note-textarea::placeholder { color: var(--ink-3); white-space: pre-line; }
.note-textarea:focus {
  outline: none;
  border-color: var(--purple-bright);
  box-shadow: 0 0 0 3px rgba(168, 134, 255, 0.15);
}

/* Comment thread */
.comment-thread { display: flex; flex-direction: column; gap: 10px; }
.comments-head {
  display: flex; align-items: center; gap: 10px;
}
.comments-head h4 {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-1);
  margin: 0;
}
.comments-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  padding: 2px 8px;
  background: rgba(168, 134, 255, 0.10);
  border-radius: 999px;
}
.comments-loading,
.comments-empty {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-3);
  padding: 8px 0;
}

.comment {
  padding: 10px 0;
  border-top: 1px solid rgba(120, 130, 220, 0.10);
}
.comment.deleted .comment-body { color: var(--ink-3); font-style: italic; }
.comment-meta {
  display: flex; align-items: baseline; gap: 8px;
  margin-bottom: 4px;
}
.comment-author {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-1);
}
.comment-admin {
  color: var(--purple-bright);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.comment-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.comment-body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-1);
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-actions {
  display: flex; gap: 12px;
  margin-top: 4px;
}
.comment-action {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  padding: 2px 0;
  cursor: pointer;
}
.comment-action:hover { color: var(--ink-0); }
.comment-action.danger { color: rgba(255, 154, 61, 0.85); }
.comment-action.danger:hover { color: rgb(255, 184, 95); }

.comment-form { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.reply-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-2);
  background: rgba(168, 134, 255, 0.08);
  border: 1px solid rgba(168, 134, 255, 0.20);
  border-radius: 6px;
}
.reply-cancel {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
}
.reply-cancel:hover { color: var(--ink-0); }
.comment-textarea {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-0);
  background: rgba(5, 6, 13, 0.55);
  border: 1px solid var(--line);
  border-radius: 8px;
  resize: vertical;
  min-height: 70px;
  box-sizing: border-box;
}
.comment-textarea:focus {
  outline: none;
  border-color: var(--purple-bright);
  box-shadow: 0 0 0 3px rgba(168, 134, 255, 0.15);
}
.comment-textarea:disabled { opacity: 0.6; cursor: not-allowed; }
.comment-form-foot {
  display: flex; align-items: center; justify-content: space-between;
}
.comment-counter {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
}
.comment-submit {
  padding: 8px 16px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #1a1816;
  background: #f5f1ea;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.comment-submit:hover:not(:disabled) { background: #fff; }
.comment-submit:active:not(:disabled) { transform: translateY(1px); }
.comment-submit:disabled { opacity: 0.45; cursor: not-allowed; }
.comment-error {
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 12.5px;
  color: #ffd4dc;
  background: rgba(255, 93, 122, 0.10);
  border: 1px solid rgba(255, 93, 122, 0.40);
  border-radius: 6px;
}
