    :root {
      --bg: oklch(98% 0.004 95);
      --surface: oklch(100% 0.002 95);
      --fg: oklch(20% 0.018 70);
      --muted: oklch(48% 0.012 70);
      --border: oklch(90% 0.006 95);
      --accent: oklch(52% 0.10 28);
      --accent-soft: oklch(70% 0.05 28);
      --font-display: 'Iowan Old Style', 'Charter', 'Georgia', 'Songti SC', serif;
      --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', system-ui, sans-serif;
      --font-mono: ui-monospace, 'SF Mono', 'Menlo', 'Consolas', monospace;
    }

    /* Skip link */
    .skip-link {
      position: absolute;
      left: -9999px;
      top: 0;
      z-index: 9999;
      padding: 12px 24px;
      background: var(--accent);
      color: var(--surface);
      font: 14px/1 var(--font-body);
      font-weight: 500;
      text-decoration: none;
      border-radius: 0 0 4px 0;
    }
    .skip-link:focus {
      left: 0;
    }
    /* Focus visible */
    *:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
    }
    /* Menu toggle (hamburger) */
    .menu-toggle {
      display: none;
      width: 44px;
      height: 44px;
      border: 1px solid var(--border);
      background: var(--surface);
      border-radius: 2px;
      cursor: pointer;
      position: relative;
      flex-shrink: 0;
    }
    .menu-toggle span,
    .menu-toggle span::before,
    .menu-toggle span::after {
      display: block;
      position: absolute;
      height: 2px;
      width: 20px;
      background: var(--fg);
      transition: all 0.2s;
    }
    .menu-toggle span {
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
    .menu-toggle span::before {
      content: '';
      top: -6px;
    }
    .menu-toggle span::after {
      content: '';
      top: 6px;
    }
    .menu-toggle[aria-expanded="true"] span {
      background: transparent;
    }
    .menu-toggle[aria-expanded="true"] span::before {
      top: 0;
      transform: rotate(45deg);
    }
    .menu-toggle[aria-expanded="true"] span::after {
      top: 0;
      transform: rotate(-45deg);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html, body {
      width: 100%;
      background: var(--bg);
      font: 16px/1.6 var(--font-body);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 24px;
    }
    /* Topbar */
    .topbar {
      border-bottom: 1px dotted var(--border);
      padding: 12px 0;
      font: 11px/1 var(--font-mono);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--muted);
    }
    .topbar-inner {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .topbar-tag {
      display: inline-flex;
      gap: 24px;
    }
    /* Header */
    .header {
      padding: 60px 0;
      position: sticky;
      top: 0;
      background: var(--bg);
      z-index: 100;
      transition: box-shadow 0.3s ease;
    }
    .header.scrolled {
      box-shadow: 0 1px 0 var(--border);
    }
    .header-inner {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .logo {
      font: 28px/1 var(--font-display);
      font-weight: 600;
      letter-spacing: -0.02em;
      text-decoration: none;
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .logo-mark {
      width: 40px;
      height: 40px;
      background: var(--fg);
      display: grid;
      place-items: center;
      font: 18px/1 var(--font-mono);
      color: var(--surface);
      border-radius: 2px;
    }
    .nav {
      display: flex;
      gap: 36px;
      font: 14px/1 var(--font-body);
    }
    .nav a {
      text-decoration: none;
      position: relative;
      padding: 6px 0;
    }
    .nav a::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 0;
      height: 1px;
      background: var(--accent);
      transition: width 0.2s ease;
    }
    .nav a:hover::after { width: 100%; }
    /* Hero */
    .hero {
      padding: 80px 0 120px;
    }
    .hero-kicker {
      font: 12px/1 var(--font-mono);
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 24px;
    }
    .hero-title {
      font: clamp(48px, 7vw, 84px)/1.05 var(--font-display);
      font-weight: 600;
      letter-spacing: -0.03em;
      max-width: 900px;
      text-wrap: pretty;
    }
    .hero-title em {
      font-style: italic;
      color: var(--accent);
    }
    .hero-lead {
      margin-top: 36px;
      font: 20px/1.7 var(--font-body);
      color: var(--muted);
      max-width: 640px;
    }
    .hero-meta {
      margin-top: 60px;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 40px;
      max-width: 900px;
    }
    .stat {
      padding-top: 24px;
      border-top: 1px dotted var(--border);
    }
    .stat-value {
      font: 44px/1 var(--font-display);
      font-weight: 600;
      color: var(--accent);
    }
    .stat-label {
      margin-top: 12px;
      font: 13px/1.4 var(--font-body);
      color: var(--muted);
    }
    /* Seismograph in hero */
    .seismograph {
      width: 100%;
      max-width: 700px;
      height: 90px;
      margin: 48px auto 0;
      opacity: 0.5;
    }
    /* Section */
    .section {
      padding: 100px 0;
      scroll-margin-top: 160px;
    }
    .section-header {
      margin-bottom: 60px;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      gap: 40px;
    }
    .section-kicker {
      font: 12px/1 var(--font-mono);
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 16px;
    }
    .section-title {
      font: clamp(32px, 4vw, 48px)/1.15 var(--font-display);
      font-weight: 600;
      letter-spacing: -0.02em;
      max-width: 560px;
    }
    .section-title em {
      font-style: italic;
      color: var(--accent);
    }
    .section-body {
      font: 16px/1.7 var(--font-body);
      color: var(--muted);
      max-width: 480px;
    }
    /* Profile cards — use cap-card style */
    .profile-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 1px;
      background: var(--border);
      border: 1px solid var(--border);
    }
    .profile-card {
      background: var(--surface);
      padding: 48px;
      position: relative;
      overflow: hidden;
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .profile-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    }
    .profile-card .icon {
      font: 28px/1 var(--font-display);
      margin-bottom: 20px;
    }
    .profile-card h3 {
      font: 24px/1.25 var(--font-display);
      font-weight: 600;
      margin-bottom: 12px;
    }
    .profile-card .value {
      font: 28px/1 var(--font-display);
      font-weight: 600;
      color: var(--accent);
      margin-bottom: 16px;
    }
    .profile-card p {
      font: 15px/1.7 var(--font-body);
      color: var(--muted);
    }
    /* Database badges */
    .badges {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 24px;
    }
    .badge-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      font: 12px/1 var(--font-mono);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      border: 1px solid var(--border);
      background: var(--surface);
      padding: 10px 16px;
      border-radius: 2px;
      cursor: pointer;
      transition: border-color 0.2s ease;
    }
    .badge-pill:hover { border-color: var(--accent-soft); }
    .badge-pill .dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: var(--accent);
    }
    .badge-pill.no .dot { background: var(--border); }
    .badge-pill.no { color: var(--muted); }
    /* Timeline */
    .timeline {
      border-left: 1px dotted var(--border);
      padding-left: 40px;
      margin-top: 0;
    }
    .timeline-item {
      position: relative;
      padding-bottom: 40px;
      cursor: pointer;
    }
    .timeline-item::before {
      content: '';
      position: absolute;
      left: -45px;
      top: 4px;
      width: 8px;
      height: 8px;
      background: var(--accent);
      border-radius: 50%;
    }
    .timeline-year {
      font: 14px/1 var(--font-mono);
      font-weight: 600;
      margin-bottom: 8px;
    }
    .timeline-title {
      font: 16px/1.4 var(--font-body);
      font-weight: 500;
      margin-bottom: 4px;
    }
    .tl-detail {
      font: 14px/1.6 var(--font-body);
      color: var(--muted);
      max-height: 0;
      opacity: 0;
      overflow: hidden;
      transition: all 0.4s;
    }
    .timeline-item:hover .tl-detail {
      max-height: 120px;
      opacity: 1;
      margin-top: 8px;
    }
    /* Earth section */
    .earth-section {
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 60px;
    }
    .earth-wrap {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 60px;
      align-items: center;
      margin-top: 40px;
    }
    .earth-diagram {
      position: relative;
      width: 100%;
      max-width: 400px;
      aspect-ratio: 1;
      margin: 0 auto;
    }
    .earth-diagram svg { width: 100%; height: 100%; }
    .layer-ring {
      cursor: pointer;
      transition: all 0.3s;
      transform-origin: center;
    }
    .layer-ring:hover { opacity: 0.8; }
    .layer-ring.active { filter: brightness(1.15) drop-shadow(0 0 6px currentColor); }
    .earth-info {
      background: var(--bg);
      padding: 32px;
      border: 1px dotted var(--border);
      min-height: 280px;
    }
    .earth-info h3 {
      font: 24px/1.25 var(--font-display);
      font-weight: 600;
      margin-bottom: 16px;
    }
    .stat-row {
      display: flex;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px dotted var(--border);
      font: 14px/1.6 var(--font-body);
    }
    .stat-row span:first-child {
      font: 11px/1 var(--font-mono);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--muted);
    }
    .stat-row span:last-child { font-weight: 500; }
    .earth-info p.desc {
      margin-top: 16px;
      font: 15px/1.7 var(--font-body);
      color: var(--muted);
    }
    

    .volcano-svg-wrap { width: 100%; max-width: 300px; }
    .volcano-heading {
      font-family: var(--font-display);
      font-weight: 600;
      margin-bottom: 16px;
    }
    .earth-legend {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      justify-content: center;
      margin-top: 16px;
    }
    .earth-legend .leg {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font: 11px/1 var(--font-mono);
      letter-spacing: 0.08em;
      text-transform: uppercase;
      border: 1px solid var(--border);
      background: var(--surface);
      padding: 8px 12px;
      border-radius: 2px;
      cursor: pointer;
      transition: all 0.2s;
      color: var(--muted);
    }
    .earth-legend .leg.active {
      color: var(--accent);
      border-color: var(--accent-soft);
      background: var(--bg);
    }
    .earth-legend .leg .sw {
      width: 10px;
      height: 10px;
      border-radius: 2px;
    }
    /* Fault tabs */
    .fault-tabs {
      display: flex;
      gap: 8px;
      margin-top: 24px;
      flex-wrap: wrap;
    }
    .fault-tab {
      font: 14px/1 var(--font-body);
      font-weight: 500;
      padding: 10px 20px;
      border: 1px solid var(--border);
      background: var(--surface);
      border-radius: 2px;
      cursor: pointer;
      transition: all 0.2s;
      color: var(--muted);
    }
    .fault-tab.active {
      background: var(--accent);
      border-color: var(--accent);
      color: var(--surface);
    }
    .fault-full-preview {
      margin: 32px 0 24px;
      text-align: center;
    }
    .fault-full-preview img {
      max-width: 100%;
      border: 1px solid var(--border);
    }
    .fault-display {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 40px;
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 32px;
      margin-top: 24px;
    }
    .fault-svg-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .fault-svg-wrap svg { width: 100%; max-width: 320px; }
    .fault-desc h3 {
      font: 24px/1.25 var(--font-display);
      font-weight: 600;
      margin-bottom: 12px;
    }
    .fault-desc .example {
      background: var(--bg);
      padding: 16px 20px;
      border-left: 2px solid var(--accent);
      margin-top: 16px;
      font: 14px/1.6 var(--font-body);
      color: var(--muted);
    }
    /* Wave demo */
    .wave-demo {
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 32px;
      margin-top: 24px;
    }
    .wave-controls {
      display: flex;
      gap: 8px;
      margin-bottom: 20px;
      flex-wrap: wrap;
    }
    .wave-btn {
      font: 13px/1 var(--font-mono);
      letter-spacing: 0.06em;
      padding: 10px 16px;
      border: 1px solid var(--border);
      background: var(--surface);
      border-radius: 2px;
      cursor: pointer;
      font-weight: 500;
      transition: all 0.2s;
    }
    .wave-btn:hover { border-color: var(--accent-soft); }
    .wave-btn.stop { color: var(--muted); }
    #waveCanvas {
      width: 100%;
      height: 200px;
      background: var(--fg);
      display: block;
    }
    .wave-legend {
      display: flex;
      gap: 20px;
      margin-top: 16px;
      flex-wrap: wrap;
      font: 12px/1.5 var(--font-mono);
      color: var(--muted);
    }
    .wave-legend span {
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }
    .wave-legend .swatch {
      width: 12px;
      height: 12px;
      border-radius: 2px;
    }
    /* Method cards */
    .method-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 1px;
      background: var(--border);
      border: 1px solid var(--border);
    }
    .method-card {
      background: var(--surface);
      padding: 48px;
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .method-card:hover {
      transform: translateY(-4px);
      box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    }
    .method-visual {
      font: 36px/1 var(--font-display);
      margin-bottom: 24px;
      color: var(--muted);
    }
    .method-card h3 {
      font: 24px/1.25 var(--font-display);
      font-weight: 600;
      margin-bottom: 16px;
    }
    .method-card p {
      font: 15px/1.7 var(--font-body);
      color: var(--muted);
      margin-bottom: 16px;
    }
    .method-card .tag {
      display: inline-block;
      font: 11px/1 var(--font-mono);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--accent);
      border: 1px dotted var(--accent-soft);
      padding: 6px 10px;
    }
    /* Case slider */
    .case-nav {
      display: flex;
      gap: 8px;
      margin-bottom: 32px;
      flex-wrap: wrap;
    }
    .case-btn {
      font: 14px/1 var(--font-body);
      font-weight: 500;
      padding: 10px 20px;
      border: 1px solid var(--border);
      background: var(--surface);
      border-radius: 2px;
      cursor: pointer;
      transition: all 0.2s;
      color: var(--muted);
    }
    .case-btn.active {
      background: var(--accent);
      border-color: var(--accent);
      color: var(--surface);
    }
    .case-panel {
      display: none;
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 48px;
    }
    .case-panel.active {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 60px;
      animation: fadeIn 0.4s;
    }
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    .case-visual {
      display: flex;
      flex-direction: column;
      gap: 16px;
      align-items: center;
      justify-content: center;
    }
    .magnitude-display {
      text-align: center;
      padding: 32px;
      border: 1px dotted var(--border);
    }
    .magnitude-display .mag-num {
      font: 72px/1 var(--font-display);
      font-weight: 600;
      color: var(--accent);
    }
    .magnitude-display .mag-label {
      font: 13px/1 var(--font-mono);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--muted);
      margin-top: 8px;
    }
    .case-info h3 {
      font: 28px/1.2 var(--font-display);
      font-weight: 600;
      margin-bottom: 8px;
    }
    .case-info .meta {
      font: 13px/1.5 var(--font-mono);
      color: var(--muted);
      margin-bottom: 24px;
    }
    .case-info ul {
      padding-left: 0;
      list-style: none;
    }
    .case-info ul li {
      font: 15px/1.7 var(--font-body);
      color: var(--muted);
      margin-bottom: 12px;
      padding-left: 20px;
      position: relative;
    }
    .case-info ul li::before {
      content: '—';
      position: absolute;
      left: 0;
      color: var(--accent-soft);
    }
    /* Flow steps */
    .flow-wrap {
      display: flex;
      flex-wrap: wrap;
      gap: 0;
      margin-top: 40px;
      justify-content: center;
    }
    .flow-step {
      flex: 1;
      min-width: 130px;
      max-width: 170px;
      text-align: center;
      padding: 24px 12px;
      position: relative;
    }
    .flow-step .circle {
      width: 56px;
      height: 56px;
      border: 1px solid var(--border);
      background: var(--surface);
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 16px;
      font: 20px/1 var(--font-display);
      transition: all 0.3s;
      cursor: pointer;
      position: relative;
      z-index: 2;
    }
    .flow-step:hover .circle {
      border-color: var(--accent);
      color: var(--accent);
      transform: scale(1.1);
    }
    .flow-step h4 {
      font: 14px/1.2 var(--font-body);
      font-weight: 500;
      margin-bottom: 4px;
    }
    .flow-step p {
      font: 12px/1.4 var(--font-mono);
      color: var(--muted);
    }
    .flow-step:not(:last-child)::after {
      content: '→';
      position: absolute;
      right: -12px;
      top: 38px;
      color: var(--border);
      font: 16px/1 var(--font-mono);
    }
    /* Quiz */
    .quiz-wrap {
      background: var(--surface);
      border: 1px solid var(--border);
      padding: 48px;
      margin-top: 40px;
    }
    .quiz-progress {
      height: 4px;
      background: var(--border);
      margin-bottom: 32px;
      overflow: hidden;
    }
    .quiz-progress-bar {
      height: 100%;
      background: var(--accent);
      width: 0%;
      transition: width 0.4s;
    }
    .quiz-q {
      font: 20px/1.5 var(--font-display);
      font-weight: 600;
      margin-bottom: 24px;
    }
    .quiz-options {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .quiz-option {
      padding: 16px 20px;
      border: 1px solid var(--border);
      cursor: pointer;
      transition: all 0.2s;
      background: var(--bg);
      font: 15px/1.5 var(--font-body);
      color: var(--fg);
      text-align: left;
    }
    .quiz-option:hover:not(.disabled) {
      border-color: var(--accent-soft);
    }
    .quiz-option.correct {
      border-color: var(--accent);
      background: color-mix(in oklch, var(--accent) 18%, transparent);
      color: var(--accent);
      font-weight: 500;
    }
    .quiz-option.wrong {
      border-color: var(--muted);
      background: color-mix(in oklch, var(--muted) 12%, transparent);
      color: var(--muted);
      text-decoration: line-through;
    }
    .quiz-option.disabled { cursor: not-allowed; }
    .quiz-feedback {
      margin-top: 20px;
      padding: 20px;
      font: 14px/1.6 var(--font-body);
      display: none;
    }
    .quiz-feedback.show { display: block; animation: fadeIn 0.3s; }
    .quiz-feedback.right { color: var(--accent); border-left: 2px solid var(--accent); }
    .quiz-feedback.wrong { color: var(--muted); border-left: 2px solid var(--border); }
    .quiz-next {
      margin-top: 20px;
      padding: 12px 24px;
      background: var(--fg);
      color: var(--surface);
      border: none;
      font: 14px/1 var(--font-body);
      font-weight: 500;
      cursor: pointer;
      display: none;
      transition: opacity 0.2s;
    }
    .quiz-next.show { display: inline-block; }
    .quiz-next:hover { opacity: 0.85; }
    .quiz-result {
      text-align: center;
      padding: 48px 0;
      display: none;
    }
    .quiz-result.show { display: block; }
    .quiz-result .score {
      font: 72px/1 var(--font-display);
      font-weight: 600;
      color: var(--accent);
    }
    .quiz-result p {
      font: 16px/1.7 var(--font-body);
      color: var(--muted);
      margin-top: 12px;
    }
    .quiz-result button {
      margin-top: 24px;
      padding: 12px 24px;
      background: var(--fg);
      color: var(--surface);
      border: none;
      font: 14px/1 var(--font-body);
      font-weight: 500;
      cursor: pointer;
      transition: opacity 0.2s;
    }
    .quiz-result button:hover { opacity: 0.85; }
    /* Sub-heading within sections */
    .sub-heading {
      font: 11px/1 var(--font-mono);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--muted);
      margin-top: 48px;
      margin-bottom: 16px;
    }
    .sub-title {
      font: 20px/1.4 var(--font-display);
      font-weight: 600;
      margin-bottom: 8px;
    }
    .sub-lead {
      font: 15px/1.7 var(--font-body);
      color: var(--muted);
      margin-bottom: 16px;
    }
    /* Small note style */
    .note {
      font: 12px/1.5 var(--font-mono);
      color: var(--muted);
      text-align: center;
      margin-top: 8px;
    }
    /* Footer */
    .footer {
      border-top: 1px dotted var(--border);
      padding: 80px 0 40px;
    }
    .footer-grid {
      display: grid;
      grid-template-columns: 1.5fr repeat(2, 1fr);
      gap: 60px;
      margin-bottom: 60px;
    }
    .footer-brand {
      font: 24px/1.2 var(--font-display);
      font-weight: 600;
      margin-bottom: 16px;
    }
    .footer-tagline {
      font: 15px/1.7 var(--font-body);
      color: var(--muted);
    }
    .footer-col-title {
      font: 11px/1 var(--font-mono);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 20px;
    }
    .footer-links {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }
    .footer-links a {
      text-decoration: none;
      font: 14px/1.4 var(--font-body);
    }
    .footer-links a:hover { color: var(--accent); }
    .footer-bottom {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 40px;
      border-top: 1px dotted var(--border);
      font: 12px/1 var(--font-mono);
      color: var(--muted);
    }
    .footer-mega {
      font: clamp(60px, 12vw, 140px)/1 var(--font-display);
      font-weight: 700;
      font-style: italic;
      letter-spacing: -0.04em;
      color: var(--border);
      text-align: right;
      margin-top: 40px;
    }
    /* Reveal */
    [data-reveal] {
      opacity: 0;
      transform: translateY(24px);
      transition: opacity 0.6s ease, transform 0.6s ease;
    }
    [data-reveal].revealed {
      opacity: 1;
      transform: translateY(0);
    }
    /* Responsive */
    @media (max-width: 960px) {
      .menu-toggle { display: flex; align-items: center; justify-content: center; }
      .nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 24px;
        background: var(--bg);
        border: 1px solid var(--border);
        padding: 16px;
        min-width: 200px;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
      }
      .nav.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
      }
      .nav a {
        padding: 12px 0;
        border-bottom: 1px dotted var(--border);
      }
      .nav a:last-child { border-bottom: none; }
      .section-header { flex-direction: column; align-items: flex-start; }
      .profile-grid, .method-grid { grid-template-columns: 1fr; }
      .earth-wrap, .case-panel.active, .fault-display { grid-template-columns: 1fr; gap: 32px; }
      .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
    }
    @media (max-width: 640px) {
      .header { padding: 32px 0; }
      .hero { padding: 40px 0 80px; }
      .section { padding: 60px 0; scroll-margin-top: 120px; }
      .earth-section { padding: 32px 24px; }
      .case-panel { padding: 32px 24px; }
      .quiz-wrap { padding: 32px 24px; }
      .footer-grid { grid-template-columns: 1fr; }
      .footer-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
      .flow-step:not(:last-child)::after { display: none; }
      .quiz-option { min-height: 44px; }
      .case-btn { min-height: 44px; }
      .wave-btn { min-height: 44px; }
      .badge-pill { min-height: 44px; }
      .quiz-next { min-height: 44px; }
      .quiz-result button { min-height: 44px; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
      }
      [data-reveal] {
        opacity: 1;
        transform: none;
      }
    }

/* Extracted inline style classes */
.stat-row-value { font-weight: 500; }
.desc-margin { margin-top: 16px; }
.note-center { text-align: center; }

/* Swatch color classes */
.sw-crust { background: oklch(52% 0.10 28); }
.sw-upper { background: oklch(55% 0.08 290); }
.sw-lower { background: oklch(45% 0.10 15); }
.sw-outer { background: oklch(60% 0.12 65); }
.sw-inner { background: oklch(75% 0.14 95); }
.sw-p { background: #e74c3c; }
.sw-s { background: #3498db; }
.sw-surface { background: #2ecc71; }
.sw-source { background: #ffd700; }
.sw-purple { background: #9b59b6; }
.sw-orange { background: #f39c12; }

/* Extracted inline style classes */
.case-note { text-align: center; }

/* W1: Theme system — dark mode + manual toggle */
:root[data-theme="dark"] {
  --bg: oklch(15% 0.005 70);
  --surface: oklch(20% 0.005 70);
  --fg: oklch(90% 0.005 70);
  --muted: oklch(65% 0.008 70);
  --border: oklch(30% 0.006 70);
  --accent: oklch(62% 0.12 28);
  --accent-soft: oklch(45% 0.06 28);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: oklch(15% 0.005 70);
    --surface: oklch(20% 0.005 70);
    --fg: oklch(90% 0.005 70);
    --muted: oklch(65% 0.008 70);
    --border: oklch(30% 0.006 70);
    --accent: oklch(62% 0.12 28);
    --accent-soft: oklch(45% 0.06 28);
  }
}

/* Theme toggle button */
.theme-toggle {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  margin-left: 12px;
}
.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
}

/* W3: Print styles */
@media print {
  .topbar, .header, .footer, .menu-toggle, .skip-link,
  .nav, .seismograph, canvas, .quiz-wrap,
  .reading-progress, .back-to-top {
    display: none !important;
  }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
  body {
    font-size: 12pt;
    color: black;
    background: white;
  }
  .section {
    padding: 20px 0;
    scroll-margin-top: 0;
    break-inside: avoid;
  }
  .section ~ .section .section-title {
    break-before: page;
  }
  img {
    max-width: 100%;
  }
}

/* W4: Reading progress bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 999;
  background: transparent;
}
.reading-progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.1s;
}

/* W4: Back to top button */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--surface);
  border: none;
  cursor: pointer;
  font: 20px/1 var(--font-body);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 999;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}
.back-to-top:hover {
  opacity: 0.85;
}
