@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --bg: #f5f5f7;
  --bg-2: #fbfbfd;
  --bg-3: #ffffff;
  --bg-4: #ededf0;
  --border: rgba(0,0,0,0.1);
  --border-light: rgba(0,0,0,0.15);
  --glass: rgba(255,255,255,0.68);
  --glass-border: rgba(255,255,255,0.88);
  --glass-hover: rgba(255,255,255,0.84);
  --shadow-glass: 0 2px 20px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.9);
  --shadow-glass-hover: 0 6px 32px rgba(0,0,0,0.09), 0 2px 8px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.95);
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --accent: #0071e3;
  --accent-light: #0071e3;
  --success: #1a7a38;
  --danger: #c42b2b;
  --warning: #8a5700;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --max-w: 980px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --blur: blur(20px) saturate(180%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: #eef3ff;
  color: var(--text-primary);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 12% 8%,  rgba(100,170,255,0.22) 0%, transparent 44%),
    radial-gradient(ellipse at 88% 14%, rgba(70,200,215,0.16) 0%, transparent 42%),
    radial-gradient(ellipse at 55% 88%, rgba(130,160,255,0.14) 0%, transparent 48%),
    radial-gradient(ellipse at 28% 72%, rgba(90,190,255,0.10) 0%, transparent 38%);
  z-index: -1;
  pointer-events: none;
}

/* ─── NAV ─────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  height: 52px;
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  letter-spacing: 0.01em;
}

.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--text-primary); font-weight: 500; }

/* ─── TYPOGRAPHY ──────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: 600; letter-spacing: -0.02em; color: var(--text-primary); }

.display {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 400;
}

.display em {
  font-style: italic;
  color: var(--text-secondary);
}

p { color: var(--text-secondary); line-height: 1.75; }

/* ─── SECTIONS ────────────────────────────────────────── */
.section { padding: 120px 24px; max-width: var(--max-w); margin: 0 auto; }
.section-sm { padding: 80px 24px; max-width: var(--max-w); margin: 0 auto; }

/* ─── DIVIDER ─────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ─── GLASS CARD ──────────────────────────────────────── */
.card {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
  padding: 40px;
  transition: var(--transition);
}

.card:hover {
  background: var(--glass-hover);
  box-shadow: var(--shadow-glass-hover);
}

/* ─── BADGE/TAG ───────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

/* ─── BUTTONS ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 980px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: #0077ed; }

.btn-ghost {
  background: transparent;
  color: var(--accent-light);
  padding: 12px 0;
}
.btn-ghost:hover { color: var(--text-primary); }
.btn-ghost::after { content: ' →'; }

/* ─── TABLES ──────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.5rem 0; }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.4);
}
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  color: var(--text-secondary);
  font-size: 15px;
}
tr:last-child td { border-bottom: none; }

.row-success td { color: var(--success); }
.row-danger td  { color: var(--danger); }
.row-warn td    { color: var(--warning); }

/* ─── SIM BOX ─────────────────────────────────────────── */
.sim-box {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glass);
  overflow: hidden;
  margin: 2rem 0;
}
.sim-header {
  background: rgba(255,255,255,0.5);
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
  border-bottom: 1px solid rgba(0,0,0,0.07);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sim-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ─── CALLOUT BOXES ───────────────────────────────────── */
.callout {
  background: rgba(0,113,227,0.06);
  border: 1px solid rgba(0,113,227,0.18);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 2rem 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.warning-box {
  background: rgba(138,87,0,0.05);
  border: 1px solid rgba(138,87,0,0.2);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 2rem 0;
  font-size: 15px;
  color: var(--warning);
  line-height: 1.7;
}

.danger-box {
  background: rgba(196,43,43,0.05);
  border: 1px solid rgba(196,43,43,0.18);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 2rem 0;
  font-size: 15px;
  color: var(--danger);
  line-height: 1.7;
}

/* ─── FORMULA BOX ─────────────────────────────────────── */
.formula-box {
  background: var(--glass);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glass);
  padding: 24px;
  margin: 1.5rem 0;
}
.formula-main {
  font-size: 20px;
  font-weight: 300;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  font-family: 'DM Serif Display', serif;
}
.formula-sub { font-size: 13px; color: var(--text-tertiary); line-height: 1.6; }

/* ─── ARTICLE HEADINGS ────────────────────────────────── */
.article-h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 3.5rem 0 1rem;
  letter-spacing: -0.02em;
}

.article-h3 {
  font-size: 19px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 2rem 0 0.6rem;
  letter-spacing: -0.01em;
}

/* ─── BADGES ──────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 980px;
  font-size: 12px;
  font-weight: 500;
}
.badge-success { background: rgba(26,122,56,0.10);  color: var(--success); }
.badge-danger  { background: rgba(196,43,43,0.10);  color: var(--danger);  }
.badge-warning { background: rgba(138,87,0,0.10);   color: var(--warning); }
.badge-info    { background: rgba(0,113,227,0.10);  color: var(--accent);  }

/* ─── CHART ───────────────────────────────────────────── */
.chart-wrap { margin: 2rem 0; }
.chart-note { font-size: 13px; color: var(--text-tertiary); text-align: center; margin-top: 10px; font-style: italic; }

/* ─── FOOTER ──────────────────────────────────────────── */
footer {
  border-top: 1px solid rgba(0,0,0,0.07);
  padding: 48px 24px;
  text-align: center;
  background: rgba(255,255,255,0.5);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
footer p { font-size: 13px; color: var(--text-tertiary); }
footer a { color: var(--text-tertiary); text-decoration: none; transition: var(--transition); }
footer a:hover { color: var(--text-primary); }

/* ─── ANIMATIONS ──────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up   { animation: fadeUp 0.7s cubic-bezier(0.4,0,0.2,1) both; }
.fade-up-2 { animation: fadeUp 0.7s 0.1s cubic-bezier(0.4,0,0.2,1) both; }
.fade-up-3 { animation: fadeUp 0.7s 0.2s cubic-bezier(0.4,0,0.2,1) both; }
.fade-up-4 { animation: fadeUp 0.7s 0.3s cubic-bezier(0.4,0,0.2,1) both; }

/* ─── STEP NUM ────────────────────────────────────────── */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,113,227,0.08);
  border: 1px solid rgba(0,113,227,0.2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ─── TAGS ────────────────────────────────────────────── */
.tags { font-size: 13px; color: var(--text-tertiary); margin-top: 3rem; line-height: 2.4; }

/* ─── HAMBURGER ───────────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    flex-direction: column;
    padding: 8px 24px 20px;
    gap: 0;
    list-style: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    display: block;
    padding: 14px 0;
    font-size: 17px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .nav-links li:last-child a { border-bottom: none; }

  .section { padding: 60px 20px; }
  .section-sm { padding: 48px 20px; }
  .card { padding: 24px; }
  .display { font-size: clamp(32px, 8vw, 48px); }
  .two-col { grid-template-columns: 1fr !important; gap: 40px !important; }
  .col-label { position: static !important; }
  table { font-size: 13px; }
  th, td { padding: 10px 10px; }
}

@media (max-width: 480px) {
  .nav-inner { padding: 0 16px; }
  .section { padding: 48px 16px; }
  .section-sm { padding: 36px 16px; }
}
