/* LogInject — USENIX Security 2026 paper companion site
   Inherits the talk's design system: IBM Plex, dark-on-light projection
   theme, dark terminal blocks for log legibility, red/teal/blue/amber/purple
   semantic palette. Adapted for scroll-based web layout.

   Visual layer:
   - Mesh-gradient hero with animated grid + glow orbs
   - Sticky reading-progress bar + section anchors with numbered indicators
   - Scroll-reveal (IntersectionObserver, no framework)
   - Card hover lift + focus rings
   - prefers-reduced-motion respected throughout */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-400.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-500.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-600.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("fonts/IBMPlexSans-700.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/IBMPlexMono-700.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --text: #0f172a;
  --muted: #475569;
  --faint: #94a3b8;
  --red: #dc2626;
  --red-dim: #991b1b;
  --teal: #0d9488;
  --blue: #2563eb;
  --amber: #b45309;
  --purple: #7c3aed;
  --green: #059669;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Monaco, "Cascadia Code", Consolas, monospace;
  --sans: "IBM Plex Sans", "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

/* ---------- reading progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--blue));
  z-index: 200;
  transition: width .08s linear;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.45);
}

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.16,.84,.44,1), transform .6s cubic-bezier(.16,.84,.44,1);
  will-change: opacity, transform;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }

/* ---------- section anchor with number ---------- */
section.page { position: relative; }
.section-num {
  position: absolute;
  top: 80px;
  left: -8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--faint);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  opacity: 0;
  transition: opacity .3s;
}
section.page:hover .section-num { opacity: 1; }
@media (max-width: 1100px) { .section-num { display: none; } }

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .progress-bar { transition: none; }
  .float-card, .hero-glow, .hero-grid { animation: none !important; }
}

/* ---------- sticky nav ---------- */
nav.top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 248, 251, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
nav.top .nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
nav.top .brand {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--text);
}
nav.top .brand .dot { color: var(--red); }
nav.top ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0 auto;
  flex-wrap: wrap;
}
nav.top ul a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 8px;
  letter-spacing: 0.01em;
  transition: color .15s, background .15s;
}
nav.top ul a:hover { color: var(--text); background: rgba(15,23,42,0.05); }
nav.top ul a.active { color: var(--red); background: rgba(220,38,38,0.08); }
nav.top .nav-cta { display: flex; gap: 8px; }
nav.top .nav-cta a {
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 8px;
  text-decoration: none;
}
nav.top .nav-cta a.paper { color: #fff; background: var(--red); }
nav.top .nav-cta a.paper:hover { background: var(--red-dim); }
nav.top .nav-cta a.artifacts { color: var(--text); border: 1px solid var(--border-2); }

/* ---------- layout ---------- */
section.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px 24px;
}
section.page.tight { padding: 56px 24px; }
section.page.narrow { max-width: 880px; }

.kicker {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 14px;
}
.kicker.red { color: var(--red); }
.kicker.teal { color: var(--teal); }
.kicker.amber { color: var(--amber); }
.kicker.center { text-align: center; }

h1.title {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 18px;
}
h1.title .accent { color: var(--red); }
h1.title .accent-blue { color: var(--blue); }
h1.title .accent-teal { color: var(--teal); }

h2.section-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 14px;
}
h2.section-title .accent { color: var(--red); }
h2.section-title .accent-teal { color: var(--teal); }

.lead {
  font-size: 20px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 920px;
}
.lead b, .lead strong { color: var(--text); }

p { font-size: 17px; color: var(--muted); line-height: 1.6; }
p b { color: var(--text); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 120px 24px 88px;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(37, 99, 235, 0.10), transparent 60%),
    radial-gradient(800px 440px at -10% 110%, rgba(220, 38, 38, 0.08), transparent 55%),
    radial-gradient(600px 300px at 50% 50%, rgba(124, 58, 237, 0.04), transparent 70%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
}
.hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15,23,42,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, #000 30%, transparent 90%);
  opacity: 0.7;
}
.hero-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  animation: floatGlow 14s ease-in-out infinite;
}
.hero-glow.red {
  background: var(--red);
  top: -120px;
  right: -80px;
}
.hero-glow.blue {
  background: var(--blue);
  bottom: -180px;
  left: -100px;
  animation-delay: -7s;
}
@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -30px) scale(1.1); }
}
.hero-inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
}
.hero .badge-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.hero .conf-badge {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #1e40af);
  box-shadow: 0 4px 14px rgba(37,99,235,0.25);
}
.hero .date-badge {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border-2);
}
.hero h1 {
  font-size: clamp(30px, 4.6vw, 50px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.018em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #334155 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero h1 .accent-grad {
  background: linear-gradient(135deg, var(--red), #b91c1c);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .subtitle {
  font-size: clamp(17px, 2vw, 22px);
  color: var(--muted);
  max-width: 540px;
  line-height: 1.42;
  margin-bottom: 32px;
}
.hero .subtitle b { color: var(--text); }

.hero .authors {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.7;
  margin-bottom: 6px;
}
.hero .authors sup { font-size: 10.5px; color: var(--faint); }
.hero .affil {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 24px;
}
.hero .affil sup { font-size: 9.5px; }
.hero .affil-logos { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 32px; }
.hero .logo-chip {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 18px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: transform .15s, box-shadow .15s;
}
.hero .logo-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,0.12); }
.hero .logo-chip img { height: 30px; width: auto; }
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .cta {
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .12s, box-shadow .15s, background .15s;
}
.hero .cta:hover { transform: translateY(-2px); }
.hero .cta.primary { color: #fff; background: linear-gradient(135deg, var(--red), #b91c1c); box-shadow: 0 6px 20px rgba(220,38,38,0.30); }
.hero .cta.primary:hover { box-shadow: 0 10px 26px rgba(220,38,38,0.40); }
.hero .cta.secondary { color: var(--text); background: var(--panel); border: 1px solid var(--border-2); box-shadow: 0 2px 8px rgba(15,23,42,0.06); }
.hero .cta.secondary:hover { border-color: var(--blue); color: var(--blue); }
.hero .cta.tertiary { color: var(--blue); background: rgba(37,99,235,0.08); border: 1px solid rgba(37,99,235,0.3); }
.hero .cta.tertiary:hover { background: rgba(37,99,235,0.14); }

/* ---------- hero floating terminal preview ---------- */
.hero-visual {
  position: relative;
  perspective: 1400px;
}
.float-card {
  position: relative;
  background: #0a0f1c;
  border: 1px solid #2b3b55;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(15,23,42,0.28),
    0 8px 24px rgba(15,23,42,0.16);
  transform: rotateY(-6deg) rotateX(4deg) rotate(1.5deg);
  animation: floatCard 9s ease-in-out infinite;
  transform-style: preserve-3d;
}
@keyframes floatCard {
  0%, 100% { transform: rotateY(-6deg) rotateX(4deg) rotate(1.5deg) translateY(0); }
  50% { transform: rotateY(-4deg) rotateX(2deg) rotate(1deg) translateY(-10px); }
}
.float-card .term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  background: #131c30;
  border-bottom: 1px solid #1e293b;
}
.float-card .term-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.float-card .term-bar .dot.r { background: #ff5f57; }
.float-card .term-bar .dot.y { background: #febc2e; }
.float-card .term-bar .dot.g { background: #28c840; }
.float-card .term-bar .term-title {
  margin-left: 10px;
  font-size: 12px;
  color: #64748b;
  font-family: var(--mono);
}
.float-card .term-body {
  padding: 18px 22px 22px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  color: #cbd5e1;
}
.float-card .term-body .dim { color: #64748b; }
.float-card .term-body .payload {
  color: #fecaca;
  background: rgba(248,113,113,0.16);
  border-bottom: 1px solid #f87171;
  padding: 0 2px;
  border-radius: 3px;
}
.float-card .term-body .ai { color: #60a5fa; }
.float-card .term-body .warn { color: #fbbf24; }

.hero-callouts {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hero-callouts .callout {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.05);
  transition: transform .15s, box-shadow .15s;
}
.hero-callouts .callout:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,0.10); }
.hero-callouts .callout .c-num { font-family: var(--mono); font-size: 22px; font-weight: 800; line-height: 1; }
.hero-callouts .callout .c-num.red { color: var(--red); }
.hero-callouts .callout .c-num.teal { color: var(--teal); }
.hero-callouts .callout .c-num.blue { color: var(--blue); }
.hero-callouts .callout .c-num.amber { color: var(--amber); }
.hero-callouts .callout .c-lbl { font-size: 12px; color: var(--muted); line-height: 1.35; }
@media (max-width: 920px) {
  .float-card { transform: none; animation: none; }
  .hero-callouts { grid-template-columns: 1fr 1fr; }
}

/* ---------- abstract / tldr ---------- */
.tldr {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: 14px;
  padding: 28px 32px;
  font-size: 18px;
  line-height: 1.65;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
}
.tldr .tldr-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 10px;
}

/* ---------- stat row ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; }
.stat {
  text-align: center;
  padding: 24px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
  transition: transform .18s, box-shadow .18s, border-color .18s;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--blue), transparent);
  opacity: 0;
  transition: opacity .18s;
}
.stat:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15,23,42,0.10);
  border-color: var(--border-2);
}
.stat:hover::before { opacity: 1; }
.stat .num {
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.stat .num.red { color: var(--red); }
.stat .num.teal { color: var(--teal); }
.stat .num.blue { color: var(--blue); }
.stat .num.amber { color: var(--amber); }
.stat .num.purple { color: var(--purple); }
.stat .num.green { color: var(--green); }
.stat .lbl { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.4; }

/* ---------- cards ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 26px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform .18s cubic-bezier(.16,.84,.44,1), box-shadow .18s, border-color .18s;
  position: relative;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}
.card.red { border-color: rgba(220, 38, 38, 0.4); background: rgba(220, 38, 38, 0.04); }
.card.red:hover { border-color: rgba(220, 38, 38, 0.6); box-shadow: 0 14px 32px rgba(220,38,38,0.12); }
.card.green { border-color: rgba(5, 150, 105, 0.4); background: rgba(5, 150, 105, 0.04); }
.card.green:hover { border-color: rgba(5, 150, 105, 0.6); }
.card.blue { border-color: rgba(37, 99, 235, 0.35); background: rgba(37, 99, 235, 0.04); }
.card.blue:hover { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 14px 32px rgba(37,99,235,0.10); }
.card.amber { border-color: rgba(180, 83, 9, 0.35); background: rgba(180, 83, 9, 0.04); }
.card.amber:hover { border-color: rgba(180, 83, 9, 0.55); }
.card.purple { border-color: rgba(124, 58, 237, 0.35); background: rgba(124, 58, 237, 0.04); }
.card.purple:hover { border-color: rgba(124, 58, 237, 0.55); box-shadow: 0 14px 32px rgba(124,58,237,0.10); }
.card.teal { border-color: rgba(13, 148, 136, 0.4); background: rgba(13, 148, 136, 0.04); }
.card.teal:hover { border-color: rgba(13, 148, 136, 0.6); }
.card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.card p, .card li { font-size: 16px; line-height: 1.55; color: var(--muted); }
.card p b, .card li b { color: var(--text); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.grid-2tight { display: grid; grid-template-columns: 1.15fr 1fr; gap: 28px; }
@media (max-width: 820px) {
  .grid-2, .grid-2tight { grid-template-columns: 1fr; }
}

/* ---------- terminal / logs (dark by design) ---------- */
.term {
  background: #0a0f1c;
  border: 1px solid #2b3b55;
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--mono);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18), 0 1px 3px rgba(15,23,42,0.10);
  transition: box-shadow .2s;
}
.term:hover { box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24), 0 2px 6px rgba(15,23,42,0.12); }
.term-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  background: #131c30;
  border-bottom: 1px solid #1e293b;
}
.term-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.term-bar .dot.r { background: #ff5f57; }
.term-bar .dot.y { background: #febc2e; }
.term-bar .dot.g { background: #28c840; }
.term-bar .term-title {
  margin-left: 10px;
  font-size: 12.5px;
  color: #64748b;
  font-family: var(--mono);
}
.term-body { padding: 16px 20px; font-size: 14.5px; line-height: 1.7; overflow-x: auto; }
.term-body .ln { color: #cbd5e1; white-space: pre-wrap; word-break: break-word; }
.term-body .dim { color: #64748b; }
.term-body .payload {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.16);
  border-bottom: 1px solid #f87171;
  padding: 0 2px;
  border-radius: 3px;
}
.term-body .ok { color: #34d399; }
.term-body .warn { color: #fbbf24; }
.term-body .ai { color: #60a5fa; }
.term-body .sys { color: #f0abfc; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 999px;
  text-transform: uppercase;
}
.badge.red { color: #b91c1c; background: rgba(220, 38, 38, 0.09); border: 1px solid rgba(220, 38, 38, 0.4); }
.badge.green { color: #047857; background: rgba(5, 150, 105, 0.09); border: 1px solid rgba(5, 150, 105, 0.4); }
.badge.blue { color: #1d4ed8; background: rgba(37, 99, 235, 0.09); border: 1px solid rgba(37, 99, 235, 0.4); }
.badge.amber { color: #b45309; background: rgba(180, 83, 9, 0.09); border: 1px solid rgba(180, 83, 9, 0.4); }
.badge.purple { color: #6d28d9; background: rgba(124, 58, 237, 0.09); border: 1px solid rgba(124, 58, 237, 0.4); }
.badge.teal { color: #0f766e; background: rgba(13, 148, 136, 0.09); border: 1px solid rgba(13, 148, 136, 0.4); }

.chip {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 6px;
  background: #eef2f7;
  border: 1px solid var(--border-2);
  color: var(--text);
}

/* ---------- flow diagram ---------- */
.flow-wrap { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.flow { display: flex; align-items: center; gap: 0; flex: 1; min-width: 0; }
.flow .node {
  background: var(--panel);
  border: 1.5px solid var(--border-2);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.flow .node small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 4px; }
.flow .node.red { border-color: var(--red); color: #b91c1c; background: rgba(220, 38, 38, 0.06); }
.flow .node.blue { border-color: var(--blue); }
.flow .node.teal { border-color: var(--teal); }
.flow .arrow {
  flex: 0 0 auto;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 24px;
  position: relative;
}
.flow .stepnum {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--amber);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zone {
  border: 1.5px dashed var(--border-2);
  border-radius: 16px;
  padding: 22px 20px 20px;
  position: relative;
  flex: 1;
  min-width: 0;
}
.zone .zone-label {
  position: absolute;
  top: -12px;
  left: 20px;
  background: var(--bg);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.zone.red { border-color: rgba(220, 38, 38, 0.5); }
.zone.red .zone-label { color: var(--red); }
.zone.teal { border-color: rgba(13, 148, 136, 0.45); }
.zone.teal .zone-label { color: var(--teal); }
@media (max-width: 820px) {
  .flow-wrap { flex-direction: column; gap: 16px; }
  .flow .arrow { width: 100%; height: 24px; }
  .flow .arrow::before { content: "↓"; }
  .flow .arrow span:not(.stepnum) { display: none; }
}

/* ---------- images ---------- */
.img-frame {
  border: 1px solid var(--border-2);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
}
.img-frame img { display: block; width: 100%; }
.img-cap {
  font-size: 13px;
  color: var(--faint);
  margin-top: 8px;
  line-height: 1.45;
}
.img-cap b { color: var(--muted); }

.chart-img {
  width: 100%;
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition: transform .2s, box-shadow .2s;
}
.chart-img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.10);
}

/* ---------- quote ---------- */
.bigquote {
  font-size: clamp(26px, 3.6vw, 42px);
  font-weight: 750;
  line-height: 1.28;
  letter-spacing: -0.015em;
  max-width: 980px;
  text-align: center;
  margin: 0 auto;
  position: relative;
  padding: 32px 0;
}
.bigquote::before, .bigquote::after {
  font-family: var(--mono);
  font-size: 72px;
  font-weight: 700;
  color: var(--red);
  opacity: 0.12;
  position: absolute;
  line-height: 1;
}
.bigquote::before { content: "\201C"; top: -10px; left: -28px; }
.bigquote::after  { content: "\201D"; bottom: -40px; right: -28px; }
.bigquote .accent { color: var(--red); background: linear-gradient(135deg, var(--red), #b91c1c); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
@media (max-width: 720px) {
  .bigquote::before, .bigquote::after { display: none; }
}

/* ---------- lists ---------- */
.clean { list-style: none; }
.clean li {
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  padding-left: 28px;
  position: relative;
  margin-bottom: 14px;
}
.clean li::before {
  content: "▸";
  position: absolute;
  left: 4px;
  color: var(--blue);
}
.clean li b { color: var(--text); }
.clean li.red-marker::before { color: var(--red); }
.clean li.teal-marker::before { color: var(--teal); }

/* ---------- tables ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15,23,42,0.05);
}
table.data th {
  text-align: left;
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 14px;
  border-bottom: 1.5px solid var(--border-2);
  background: var(--panel-2);
}
table.data td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
table.data td.num { font-family: var(--mono); }
table.data tr.hot td { background: rgba(220, 38, 38, 0.06); }
table.data tr:last-child td { border-bottom: none; }

/* ---------- takeaway strip ---------- */
.takeaway-strip {
  background: linear-gradient(90deg, rgba(220, 38, 38, 0.09), rgba(220, 38, 38, 0.03));
  border: 1px solid rgba(220, 38, 38, 0.4);
  border-radius: 12px;
  padding: 16px 22px;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 650;
  color: #b91c1c;
  margin-top: 28px;
}
.takeaway-strip.blue {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.09), rgba(37, 99, 235, 0.03));
  border-color: rgba(37, 99, 235, 0.4);
  color: #1d4ed8;
}
.takeaway-strip.teal {
  background: linear-gradient(90deg, rgba(13, 148, 136, 0.09), rgba(13, 148, 136, 0.03));
  border-color: rgba(13, 148, 136, 0.4);
  color: #0f766e;
}

/* ---------- level flow ---------- */
.level-flow { display: flex; gap: 20px; align-items: stretch; }
.level-card {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  position: relative;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  transition: transform .2s cubic-bezier(.16,.84,.44,1), box-shadow .2s, border-color .2s;
}
.level-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 14px 14px 0 0;
  opacity: 0.7;
}
.level-card:nth-child(1)::after { background: var(--red); }
.level-card:nth-child(3)::after { background: var(--amber); }
.level-card:nth-child(5)::after { background: var(--purple); }
.level-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}
.level-card .lvl {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.level-card h3 { font-size: 19px; margin-bottom: 10px; }
.level-card p { font-size: 14.5px; color: var(--muted); line-height: 1.5; }
.level-arrow {
  display: flex;
  align-items: center;
  color: var(--faint);
  font-size: 22px;
  transition: color .2s, transform .2s;
}
.level-card:hover ~ .level-arrow,
.level-arrow:hover { color: var(--red); transform: scale(1.15); }
@media (max-width: 820px) {
  .level-flow { flex-direction: column; }
  .level-arrow { transform: rotate(90deg); justify-content: center; height: 32px; }
}

/* ---------- interactive before/after case study ---------- */
.casestudy-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 18px;
}
.casestudy-toggle button {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--border-2);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  letter-spacing: 0.02em;
}
.casestudy-toggle button:hover { color: var(--text); border-color: var(--text); }
.casestudy-toggle button.active.green {
  color: #fff;
  background: linear-gradient(135deg, var(--green), #047857);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(5,150,105,0.30);
}
.casestudy-toggle button.active.red {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #b91c1c);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(220,38,38,0.30);
}
.casestudy-panel { display: none; }
.casestudy-panel.active { display: block; animation: fadeIn .35s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- chart lightbox ---------- */
.chart-img { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 32px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; animation: fadeIn .2s ease; }
.lightbox img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.divider-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-2) 20%, var(--border-2) 80%, transparent);
  margin: 0;
  position: relative;
}
.divider-rule::after {
  content: "§";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  font-weight: 700;
}

/* ---------- presentation & media showcase ---------- */
.media-showcase {
  margin-top: 24px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.media-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.media-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.media-tab-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: #f8fafc;
}

.media-tab-btn.active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.media-panel {
  display: none;
}

.media-panel.active {
  display: block;
}

.responsive-media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 380px;
  background: #090d16;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.12);
}

.responsive-media-frame iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.media-caption-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding: 0 4px;
  font-size: 14px;
  color: var(--muted);
}

.media-caption-bar a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
}

.media-caption-bar a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .media-showcase { padding: 12px; }
  .responsive-media-frame { min-height: 240px; }
  .media-caption-bar { flex-direction: column; align-items: flex-start; }
}

/* ---------- presentation embed ---------- */
.pdf-embed {
  width: 100%;
  height: 560px;
  border: 1px solid var(--border-2);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(15,23,42,0.08);
}
@media (max-width: 720px) { .pdf-embed { height: 380px; } }

/* ---------- QR blocks ---------- */
.qr-row { display: flex; gap: 28px; justify-content: center; align-items: stretch; flex-wrap: wrap; }
.qr-block {
  background: #fff;
  border: 1px solid var(--border-2);
  border-radius: 14px;
  padding: 18px 20px 16px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.08);
  min-width: 220px;
}
.qr-block img { display: block; width: 160px; height: 160px; margin: 0 auto; }
.qr-block .qr-label { margin-top: 12px; font-size: 15px; font-weight: 700; color: #0f172a; }
.qr-block .qr-url {
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #475569;
  word-break: break-all;
  max-width: 220px;
  line-height: 1.4;
  margin: 4px auto 0;
}

/* ---------- BibTeX ---------- */
.bibtex {
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  background: #0a0f1c;
  color: #cbd5e1;
  border: 1px solid #2b3b55;
  border-radius: 12px;
  padding: 18px 22px;
  overflow-x: auto;
  white-space: pre;
}
.bibtex .k { color: #60a5fa; }
.bibtex .s { color: #34d399; }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 48px 24px 36px;
}
footer.site .foot-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}
footer.site .foot-brand { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
footer.site .foot-brand .dot { color: var(--red); }
footer.site .foot-meta { font-size: 13px; color: var(--muted); line-height: 1.6; }
footer.site .foot-meta a { color: var(--blue); text-decoration: none; }
footer.site .foot-meta a:hover { text-decoration: underline; }
footer.site .foot-links { display: flex; gap: 24px; flex-wrap: wrap; }
footer.site .foot-links a {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
footer.site .foot-links a:hover { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  nav.top ul { display: none; }
  section.page { padding: 56px 18px; }
  .hero { padding: 64px 18px 56px; }
}

/* ---------- print ---------- */
@media print {
  nav.top, footer.site { display: none; }
  section.page { page-break-inside: avoid; padding: 28px 0; }
  .hero { padding: 28px 0; }
}
