:root {
  color-scheme: dark;
  --bg: #1a1a2e;
  --bg-2: #16213e;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-soft: rgba(255, 255, 255, 0.03);
  --text: #f8fafc;
  --muted: #aeb7c7;
  --line: rgba(255, 255, 255, 0.1);
  --red: #ff6b6b;
  --gold: #feca57;
  --blue: #48dbfb;
  --pink: #ff9ff3;
  --primary-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --dark-grad: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --glass: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--dark-grad);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: -1;
}

a {
  color: var(--blue);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--pink);
}

.hero {
  min-height: 80vh;
  position: relative;
  display: flex;
  flex-direction: column;
  background: 
    radial-gradient(circle at 20% 30%, rgba(102, 126, 234, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(118, 75, 162, 0.15) 0%, transparent 50%),
    var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  padding: 0.75rem max(2rem, calc((100% - 1180px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 26, 46, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--primary-grad);
  width: var(--scroll-percent, 0%);
  transition: width 0.1s;
}

.brand {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.hero-body {
  width: min(1180px, calc(100% - 3rem));
  margin: auto;
  padding: 3rem 0;
}

.label,
.notice-kicker {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

h1 {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.1;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.03em;
  background: linear-gradient(to bottom right, #fff, #aeb7c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.dek {
  max-width: 700px;
  font-size: clamp(1.1rem, 2vw, 1.2rem);
  color: var(--muted);
  margin: 1.5rem 0 2.5rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.button {
  padding: 0.7rem 1.75rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  border: none;
}

.button.primary {
  background: var(--primary-grad);
  color: white !important;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.button.secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text) !important;
  backdrop-filter: blur(8px);
}

.button.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.notice {
  background: rgba(254, 202, 87, 0.1);
  border: 1px solid rgba(254, 202, 87, 0.2);
  margin: 1.5rem auto;
  width: min(1180px, calc(100% - 3rem));
  border-radius: 16px;
  padding: 1.5rem;
}

.notice p {
  margin: 0;
  color: #feca57;
}

.section {
  width: min(1180px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 5rem 0;
}

.section-heading {
  max-width: 800px;
  margin-bottom: 2.5rem;
}

/* Specific Section Backgrounds */
#story { background: rgba(0,0,0,0.1); width: 100%; max-width: none; padding-left: max(1.5rem, calc((100% - 1180px) / 2)); padding-right: max(1.5rem, calc((100% - 1180px) / 2)); }
#protect { background: rgba(0,0,0,0.15); width: 100%; max-width: none; padding-left: max(1.5rem, calc((100% - 1180px) / 2)); padding-right: max(1.5rem, calc((100% - 1180px) / 2)); }

.personal-copy {
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
}

.prose p {
  color: var(--muted);
  max-width: 70ch;
  margin-bottom: 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 800px;
  margin: 2.5rem 0;
  padding-left: 2.5rem;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary-grad);
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.5rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.5rem;
  width: 14px;
  height: 14px;
  background: var(--primary-grad);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(102, 126, 234, 0.6);
}

.risk-grid, .steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .risk-grid, .steps {
    grid-template-columns: 1fr;
  }
}

.risk-grid article, .steps article {
  background: var(--glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.risk-grid article:hover, .steps article:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.risk-grid p, .steps p {
  color: var(--muted);
  margin: 0;
}

.step-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--pink);
  opacity: 0.4;
  margin-bottom: 0.75rem;
  display: block;
}

.evidence {
  background: rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: none;
  padding: 5rem max(1.5rem, calc((100% - 1180px) / 2));
}

.screenshots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

figure {
  margin: 0 auto;
  max-width: 900px;
  background: #252545;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

figure img {
  width: 100%;
  height: auto;
  display: block;
}

figcaption {
  padding: 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: rgba(0,0,0,0.2);
}

.closing {
  background: var(--primary-grad);
  border-radius: 32px;
  padding: 4rem 3rem;
  text-align: center;
  margin: 4rem auto;
  max-width: min(1180px, calc(100% - 3rem));
}

.closing h2, .closing p {
  color: white;
}

.closing p {
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.9;
  font-size: 1.1rem;
}

.footer {
  padding: 4rem 0;
  text-align: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.back-to-top {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 56px;
  height: 56px;
  background: var(--primary-grad);
  color: white !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

.back-to-top:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-visual svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.2));
}

.glitch {
  animation: glitch-pulse 4s infinite;
}

@keyframes glitch-pulse {
  0%, 100% { opacity: 1; transform: translate(0); }
  92% { opacity: 1; transform: translate(0); }
  94% { opacity: 0.5; transform: translate(5px, -2px); }
  96% { opacity: 1; transform: translate(-3px, 2px); }
  98% { opacity: 0.7; transform: translate(2px, 1px); }
}

/* Attack Diagram */
.attack-diagram {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
  margin: 2.5rem 0;
  padding: 2.5rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
}

.diagram-step {
  text-align: center;
}

.step-icon {
  width: 64px;
  height: 64px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border: 1px solid var(--glass-border);
}

.diagram-step p {
  font-size: 0.9rem;
  line-height: 1.4;
  margin: 0;
}

.diagram-arrow {
  opacity: 0.3;
}

.split-prose {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.side-svg {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  opacity: 0.9;
  filter: drop-shadow(0 0 15px rgba(102, 126, 234, 0.15));
}

@media (max-width: 992px) {
  .section { padding: 4rem 0; }
  .personal-copy { padding: 2.5rem 1.5rem; }
  
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .hero-visual {
    max-width: 250px;
    margin: 0 auto;
    order: -1;
  }
  
  .attack-diagram {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem;
  }
  
  .diagram-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hero-body { padding: 4rem 0; }
  .closing { padding: 3rem 1.5rem; }
  .back-to-top { bottom: 1.5rem; right: 1.5rem; width: 48px; height: 48px; }
}
