/* ============================================================
   Vivaldi-Antenne Studienprojekt — Showcase Website
   ============================================================ */

:root {
  --bg-deep: #05070d;
  --bg-deep-2: #0a1424;
  --bg-deep-3: #0d1c33;
  --bg-graphite: #0b0f1a;
  --surface: #ffffff;
  --surface-alt: #f3f6fb;
  --surface-card: #0f1f3d;
  --surface-glass: rgba(18, 30, 54, 0.55);
  --border-soft: rgba(148, 178, 224, 0.14);
  --border-glass: rgba(255, 255, 255, 0.09);
  --accent-cyan: #4fd2fb;
  --accent-cyan-soft: rgba(79, 210, 251, 0.14);
  --accent-blue: #4a8bf7;
  --accent-blue-deep: #2563eb;
  --accent-warm: #f0a63e;
  --accent-green: #34d399;
  --text-on-dark: #edf2fa;
  --text-on-dark-muted: #92a3c2;
  --text-dark: #101827;
  --text-dark-muted: #57647c;
  --radius-lg: 22px;
  --radius-md: 15px;
  --radius-sm: 10px;
  --radius-pill: 100px;
  --shadow-soft: 0 24px 60px -24px rgba(2, 6, 16, 0.65);
  --shadow-card: 0 14px 34px -16px rgba(8, 15, 35, 0.4), 0 2px 8px -2px rgba(8, 15, 35, 0.12);
  --shadow-card-hover: 0 26px 52px -18px rgba(6, 12, 28, 0.5), 0 4px 14px -4px rgba(8, 15, 35, 0.18);
  --shadow-glow-cyan: 0 0 0 1px rgba(79, 210, 251, 0.18), 0 18px 40px -16px rgba(79, 210, 251, 0.28);
  --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  background-image: linear-gradient(180deg, var(--bg-graphite) 0%, var(--bg-deep) 40%, var(--bg-deep-2) 100%);
  background-attachment: fixed;
  color: var(--text-on-dark);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Background technical grid / EM-wave decoration ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
}

.bg-glow {
  position: fixed;
  inset: -10% -10% -10% -10%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 420px at 15% 8%, rgba(79, 210, 251, 0.15), transparent 60%),
    radial-gradient(600px 500px at 90% 22%, rgba(74, 139, 247, 0.13), transparent 60%),
    radial-gradient(900px 700px at 50% 100%, rgba(15, 40, 90, 0.32), transparent 70%);
  will-change: transform;
}

/* Subtle animated electromagnetic field rings behind the hero — decorative,
   flat color washes only (no motion blur/glow filters), paused entirely
   under reduced-motion via the global rule above. */
.field-rings {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.field-rings span {
  position: absolute;
  top: 18%;
  right: 6%;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  border: 1px solid rgba(79, 210, 251, 0.14);
  transform: translate(20%, -10%) scale(0.4);
  opacity: 0;
  animation: fieldPulse 6s ease-out infinite;
}
.field-rings span:nth-child(2) { animation-delay: 2s; }
.field-rings span:nth-child(3) { animation-delay: 4s; }
@keyframes fieldPulse {
  0% { transform: translate(20%, -10%) scale(0.4); opacity: 0; }
  15% { opacity: 0.5; }
  100% { transform: translate(20%, -10%) scale(1); opacity: 0; }
}

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

/* ---------- Page loader ----------
   Guaranteed to self-remove via pure CSS animation (no JS dependency) so it
   can NEVER get stuck covering the page — JS may hide it sooner, but the
   CSS keyframe is the hard safety net. pointer-events is off from frame 1
   so nothing is ever blocked underneath it. */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg-graphite);
  pointer-events: none;
  animation: loaderOut 0.5s ease 950ms forwards;
}
.page-loader img { height: 46px; width: auto; background: #fff; border-radius: 8px; padding: 6px; opacity: 0.95; }
.page-loader-bar { width: 140px; height: 2px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.page-loader-bar span { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)); animation: loaderSweep 0.9s ease-in-out infinite; }
@keyframes loaderSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@keyframes loaderOut {
  to { opacity: 0; visibility: hidden; }
}
.page-loader.js-done { animation-duration: 0.35s; animation-delay: 0s; }

/* ---------- Background particle field (canvas) ----------
   Subtle drifting dots suggesting field lines — purely decorative,
   drawn by JS; if canvas 2D context is unavailable or reduced-motion is
   set, the canvas simply stays empty/transparent (never blocks content,
   sits behind everything at z-index 0). */
.bg-particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  width: 100%;
  height: 100%;
  opacity: 0.55;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent-cyan);
  color: #04101f;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  z-index: 999;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(7, 12, 24, 0.6);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--border-glass);
  transition: background 0.35s var(--ease-premium), box-shadow 0.35s var(--ease-premium), border-color 0.35s ease;
}
.navbar.is-scrolled { background: rgba(6, 10, 20, 0.82); box-shadow: 0 16px 40px -20px rgba(0,0,0,0.6); border-bottom-color: var(--border-soft); }

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nav-brand img { height: 30px; width: auto; border-radius: 4px; background: #fff; padding: 2px; }
.nav-brand-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-on-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-brand-text span { display: block; font-weight: 400; font-size: 11px; color: var(--text-on-dark-muted); }

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-on-dark-muted);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text-on-dark); background: rgba(255,255,255,0.06); }
.nav-links a.active { color: var(--accent-cyan); background: rgba(56, 189, 248, 0.12); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  color: var(--text-on-dark);
}

.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: rgba(8, 17, 36, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
  z-index: 99;
  padding: 10px 20px 20px;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block;
  padding: 13px 6px;
  font-size: 15px;
  color: var(--text-on-dark-muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mobile-menu a.active { color: var(--accent-cyan); }

@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 90px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero { padding-top: 110px; }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 7px 14px;
  border-radius: 100px;
  margin-bottom: 22px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 0 4px rgba(56,189,248,0.18);
}

.hero h1 {
  font-size: clamp(28px, 4.2vw, 46px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: #fff;
  margin-bottom: 18px;
}
.hero h1 .accent {
  background: linear-gradient(100deg, var(--accent-cyan), var(--accent-blue) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--text-on-dark-muted);
  font-weight: 500;
  margin-bottom: 28px;
  letter-spacing: 0.01em;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px 24px;
  background: rgba(255,255,255,0.035);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 32px;
  backdrop-filter: blur(6px);
}
.hero-meta div { font-size: 13px; color: var(--text-on-dark-muted); }
.hero-meta strong { display: block; color: var(--text-on-dark); font-weight: 600; font-size: 13.5px; margin-bottom: 1px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  border: 1px solid transparent;
  overflow: hidden;
  transition: transform 0.2s var(--ease-premium), box-shadow 0.2s var(--ease-premium), background 0.2s ease, border-color 0.2s ease;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.28) 45%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s var(--ease-premium);
  pointer-events: none;
}
.btn:hover::before { transform: translateX(120%); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary {
  background: linear-gradient(100deg, var(--accent-blue-deep), var(--accent-cyan));
  color: #04101f;
  box-shadow: 0 10px 25px -8px rgba(79, 210, 251, 0.5);
}
.btn-primary:hover { box-shadow: 0 16px 36px -10px rgba(79, 210, 251, 0.65); transform: translateY(-2px); }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--text-on-dark);
  border-color: var(--border-glass);
}
.btn-ghost:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.3); transform: translateY(-2px); }
.btn-sm { padding: 9px 16px; font-size: 13px; border-radius: 9px; }
.btn:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }

.hero-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  background: linear-gradient(160deg, #0d1e3d, #060e1e);
  box-shadow: var(--shadow-soft);
}
.hero-visual img {
  width: 100%;
  height: auto;
  display: block;
  mix-blend-mode: normal;
  opacity: 0;
  transition: opacity 0.9s var(--ease-premium);
}
html.js-anim .hero-visual img.photo-in { opacity: 1; }
html:not(.js-anim) .hero-visual img { opacity: 1; }
.hero-visual-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 14px 18px;
  background: linear-gradient(0deg, rgba(4,10,22,0.92), transparent);
  font-size: 12px;
  color: var(--text-on-dark-muted);
}

/* Antenna line-draw overlay: real taper geometry traced from the report's
   own formula (Kap. 3.2/6.4), drawn in via stroke-dashoffset before the
   photographic geometry render crossfades in underneath. */
.antenna-draw {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  padding: 10%;
}
.antenna-draw path {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  opacity: 0.9;
}
.antenna-draw .board-outline {
  stroke: rgba(146, 163, 194, 0.55);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
html.js-anim .antenna-draw { transition: opacity 0.6s var(--ease-premium) 0.3s; }
html.js-anim .antenna-draw.draw-done { opacity: 0; }

/* ---------- Sections ---------- */
section { padding: 100px 0; position: relative; }
section.alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015) 10%, rgba(255,255,255,0.015) 90%, transparent); }

.section-head { max-width: 760px; margin: 0 auto 52px; text-align: center; }
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--text-on-dark-muted); font-size: 15.5px; }

/* ---------- Reveal-on-scroll ----------
   Progressive enhancement: content is visible by default (no JS required).
   Only once JS has actually run (html gets the .js-anim class, added at the
   very top of js/main.js) does CSS switch to the "hidden until animated"
   state. This guarantees that if JS is blocked, disabled, or throws an
   error, every section still renders immediately. */
.reveal {
  opacity: 1;
  transform: none;
  transition: opacity 0.85s var(--ease-premium, cubic-bezier(0.16,1,0.3,1)),
              transform 0.85s var(--ease-premium, cubic-bezier(0.16,1,0.3,1));
  will-change: transform, opacity;
}
/* Default entrance (no data-anim): a clearly visible rise from below. */
html.js-anim .reveal { opacity: 0; transform: translateY(70px); }
html.js-anim .reveal.in-view { opacity: 1; transform: translateY(0); }

/* Directional entrance variants — explicit, clearly-visible motion. */
html.js-anim .reveal[data-anim="left"] { opacity: 0; transform: translateX(-110px); }
html.js-anim .reveal[data-anim="left"].in-view { opacity: 1; transform: translateX(0); }

html.js-anim .reveal[data-anim="right"] { opacity: 0; transform: translateX(110px); }
html.js-anim .reveal[data-anim="right"].in-view { opacity: 1; transform: translateX(0); }

html.js-anim .reveal[data-anim="up"] { opacity: 0; transform: translateY(80px); }
html.js-anim .reveal[data-anim="up"].in-view { opacity: 1; transform: translateY(0); }

html.js-anim .reveal[data-anim="down"] { opacity: 0; transform: translateY(-70px); }
html.js-anim .reveal[data-anim="down"].in-view { opacity: 1; transform: translateY(0); }

html.js-anim .reveal[data-anim="scale"] { opacity: 0; transform: scale(0.93); }
html.js-anim .reveal[data-anim="scale"].in-view { opacity: 1; transform: scale(1); }

html.js-anim .reveal[data-anim="scale-left"] { opacity: 0; transform: scale(0.94) translateX(-90px); }
html.js-anim .reveal[data-anim="scale-left"].in-view { opacity: 1; transform: scale(1) translateX(0); }

html.js-anim .reveal[data-anim="scale-right"] { opacity: 0; transform: scale(0.94) translateX(90px); }
html.js-anim .reveal[data-anim="scale-right"].in-view { opacity: 1; transform: scale(1) translateX(0); }

.reveal-delay-1.in-view { transition-delay: 0.1s; }
.reveal-delay-2.in-view { transition-delay: 0.2s; }
.reveal-delay-3.in-view { transition-delay: 0.3s; }
.reveal-delay-4.in-view { transition-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
  html.js-anim .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- Overview / summary text card ---------- */
.overview-card {
  background: var(--surface);
  color: var(--text-dark);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-card);
  max-width: 920px;
  margin: 0 auto;
}
.overview-card h3 { font-size: 19px; margin-bottom: 12px; color: var(--text-dark); }
.overview-card p { color: var(--text-dark-muted); font-size: 15px; margin-bottom: 14px; }
.overview-card p:last-child { margin-bottom: 0; }
.overview-note {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff7e8;
  border: 1px solid #f3ddab;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  color: #7a5518;
}
.overview-note svg { flex-shrink: 0; margin-top: 2px; }

/* ---------- Key results / stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
  margin-top: 46px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -16px rgba(8,15,35,0.5); }
.stat-card .stat-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7690; margin-bottom: 10px; }
.stat-card .stat-value { font-size: 27px; font-weight: 800; color: var(--text-dark); letter-spacing: -0.01em; }
.stat-card .stat-value small { font-size: 15px; font-weight: 600; color: #6b7690; }
.stat-card .stat-sub { font-size: 12.5px; color: #7c879e; margin-top: 6px; }
.stat-card.accent-cyan { border-top: 3px solid var(--accent-cyan); }
.stat-card.accent-blue { border-top: 3px solid var(--accent-blue); }
.stat-card.accent-warm { border-top: 3px solid var(--accent-warm); }
.stat-card.accent-green { border-top: 3px solid var(--accent-green); }

.honesty-banner {
  margin-top: 28px;
  background: rgba(240, 166, 62, 0.09);
  border: 1px solid rgba(240, 166, 62, 0.32);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  font-size: 13.8px;
  color: #f0d9ae;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.honesty-banner strong { color: #fff; }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue) 60%, transparent);
}
@media (min-width: 720px) {
  .timeline::before { left: 50%; transform: translateX(-1px); }
}

.tl-item {
  position: relative;
  padding: 0 0 34px 52px;
}
@media (min-width: 720px) {
  .tl-item { width: 50%; padding: 0 0 34px 0; }
  .tl-item:nth-child(odd) { padding-right: 44px; text-align: right; }
  .tl-item:nth-child(even) { padding-left: 44px; margin-left: 50%; }
}
.tl-dot {
  position: absolute;
  left: 12px; top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 0 5px rgba(56,189,248,0.12);
}
@media (min-width: 720px) {
  .tl-item:nth-child(odd) .tl-dot { left: auto; right: -9px; }
  .tl-item:nth-child(even) .tl-dot { left: -9px; }
}
.tl-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.tl-card .tl-phase { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-blue-deep); margin-bottom: 4px; }
.tl-card .tl-date { font-size: 12px; color: #7c879e; margin-bottom: 8px; }
.tl-card h4 { font-size: 15.5px; color: var(--text-dark); margin-bottom: 4px; }
.tl-card p { font-size: 13.5px; color: var(--text-dark-muted); max-height: 0; overflow: hidden; transition: max-height 0.35s ease, margin-top 0.35s ease; margin-top: 0; }
.tl-card.expanded p { max-height: 200px; margin-top: 8px; }
.tl-card .tl-toggle { font-size: 12px; color: var(--accent-blue-deep); font-weight: 600; margin-top: 8px; display: inline-block; }

/* ---------- Design section ---------- */
.design-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 860px) { .design-layout { grid-template-columns: 1fr; } }

.design-figure {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.design-figure img { border-radius: 10px; cursor: zoom-in; }
.design-figure figcaption { font-size: 12.5px; color: #7c879e; margin-top: 10px; text-align: center; }

.param-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  font-size: 13.8px;
}
.param-table th, .param-table td { padding: 11px 16px; text-align: left; }
.param-table thead th { background: #0e2244; color: #cfe0f7; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.param-table tbody tr { border-bottom: 1px solid #edf0f5; color: var(--text-dark); }
.param-table tbody tr:last-child { border-bottom: none; }
.param-table tbody tr:nth-child(even) { background: #f8fafd; }
.param-table td:first-child { color: #57647c; font-family: var(--font-mono); font-size: 12.5px; }

.subblock-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent-cyan); margin: 46px 0 18px; text-align: center; }

/* Challenges / debugging accordion */
.challenge-list { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.challenge {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.challenge-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: none;
  border: none;
  text-align: left;
}
.challenge-num {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-blue-deep), var(--accent-cyan));
  color: #04101f;
  font-weight: 800;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.challenge-head h4 { font-size: 15.5px; color: var(--text-dark); flex: 1; }
.challenge-head .chev { transition: transform 0.25s ease; color: #9aa7bd; flex-shrink: 0; }
.challenge.open .chev { transform: rotate(180deg); }
.challenge-body { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.challenge.open .challenge-body { max-height: 600px; }
.challenge-body-inner { padding: 0 22px 22px 70px; }
.challenge-body-inner .cb-row { margin-bottom: 12px; }
.challenge-body-inner .cb-row:last-child { margin-bottom: 0; }
.challenge-body-inner .cb-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.challenge-body-inner .cb-label.problem { color: #d64545; }
.challenge-body-inner .cb-label.diagnosis { color: #b98008; }
.challenge-body-inner .cb-label.solution { color: #1a9c6e; }
.challenge-body-inner p { font-size: 13.8px; color: var(--text-dark-muted); }

/* ---------- Optimization ---------- */
.opt-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto 40px;
}
@media (max-width: 760px) { .opt-steps { grid-template-columns: 1fr; } }
.opt-step {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-card);
  position: relative;
}
.opt-step .opt-index { font-size: 26px; font-weight: 800; color: var(--accent-blue-deep); opacity: 0.28; position: absolute; top: 12px; right: 16px; }
.opt-step h4 { font-size: 14.5px; color: var(--text-dark); margin-bottom: 6px; }
.opt-step p { font-size: 13.2px; color: var(--text-dark-muted); }

.sweep-table-wrap { max-width: 1000px; margin: 0 auto; overflow-x: auto; }
.sweep-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-card); font-size: 13.5px; min-width: 560px; }
.sweep-table th, .sweep-table td { padding: 11px 14px; text-align: center; }
.sweep-table thead th { background: #0e2244; color: #cfe0f7; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.sweep-table tbody tr { border-bottom: 1px solid #edf0f5; color: var(--text-dark); }
.sweep-table tbody tr:last-child { border-bottom: none; }
.sweep-table tbody tr.winner { background: rgba(52, 211, 153, 0.12); font-weight: 700; }
.sweep-table tbody tr.winner td:first-child::before { content: "\2605  "; color: #1a9c6e; }
.sweep-note { text-align: center; font-size: 13px; color: var(--text-on-dark-muted); max-width: 720px; margin: 18px auto 0; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.gallery-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.gallery-item:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -18px rgba(8,15,35,0.55); }
.gallery-thumb { aspect-ratio: 4/3; overflow: hidden; background: #eef2f8; display: flex; align-items: center; justify-content: center; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-caption { padding: 14px 16px; }
.gallery-caption .gc-num { font-size: 11px; font-weight: 700; color: var(--accent-blue-deep); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }
.gallery-caption h4 { font-size: 14px; color: var(--text-dark); font-weight: 600; line-height: 1.35; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3, 8, 18, 0.94);
  display: none;
  align-items: center; justify-content: center;
  padding: 40px 20px;
}
.lightbox.open { display: flex; }
.lightbox-inner { max-width: 1000px; width: 100%; text-align: center; }
.lightbox-inner img { max-height: 76vh; margin: 0 auto; border-radius: 10px; background: #fff; }
.lightbox-caption { color: var(--text-on-dark); font-size: 14px; margin-top: 16px; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: fixed;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 201;
}
.lightbox-close { top: 24px; right: 24px; }
.lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.18); }
@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { width: 38px; height: 38px; }
}

/* ---------- KiCad section ---------- */
.kicad-layout { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: center; max-width: 1080px; margin: 0 auto; }
@media (max-width: 860px) { .kicad-layout { grid-template-columns: 1fr; } }
.kicad-check-list { display: flex; flex-direction: column; gap: 14px; }
.kicad-check {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: flex; gap: 12px; align-items: flex-start;
}
.kicad-check .ck-icon { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(52,211,153,0.15); color: #1a9c6e; display: flex; align-items: center; justify-content: center; }
.kicad-check h4 { font-size: 14px; color: var(--text-dark); margin-bottom: 3px; }
.kicad-check p { font-size: 12.8px; color: var(--text-dark-muted); }

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(240,166,62,0.12); border: 1px solid rgba(240,166,62,0.35);
  color: #f0c98a; font-size: 12.5px; font-weight: 600;
  padding: 8px 14px; border-radius: 100px; margin-top: 18px;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-warm); }

/* ---------- Report viewer ---------- */
.report-wrap { max-width: 980px; margin: 0 auto; }

.report-preview-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (max-width: 720px) { .report-preview-grid { grid-template-columns: 1fr; } }

.report-page-main, .report-page-thumb {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: zoom-in;
}
.report-page-main img, .report-page-thumb img { width: 100%; display: block; }
.report-page-stack { display: flex; flex-direction: column; gap: 20px; }
.report-page-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(0deg, rgba(6,12,26,0.82), transparent);
}

.report-frame-details { margin-bottom: 22px; }
.report-frame-details summary {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent-cyan);
  padding: 10px 4px;
  list-style: none;
}
.report-frame-details summary::-webkit-details-marker { display: none; }
.report-frame-details summary::before { content: "▸ "; }
.report-frame-details[open] summary::before { content: "▾ "; }

.report-frame-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
  margin-top: 10px;
}
.report-frame-card iframe { width: 100%; height: 640px; border: none; border-radius: 10px; background: #e9edf3; }
.report-fallback { display: none; padding: 40px 24px; text-align: center; color: var(--text-dark-muted); font-size: 13.5px; line-height: 1.7; }
.report-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.report-hint { text-align: center; font-size: 12.5px; color: var(--text-on-dark-muted); margin-top: 16px; }

/* ---------- Downloads ---------- */
.dl-categories { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.dl-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.dl-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.dl-card-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--accent-blue-deep), var(--accent-cyan)); color: #04101f; }
.dl-card-head h4 { font-size: 15px; color: var(--text-dark); }
.dl-card-head span { font-size: 11.5px; color: #8894a8; }
.dl-file-list { display: flex; flex-direction: column; gap: 6px; }
.dl-file {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dark-muted);
  transition: background 0.15s ease;
}
.dl-file:hover { background: #f2f5fa; color: var(--text-dark); }
.dl-file .dl-file-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dl-file .dl-file-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-file svg { flex-shrink: 0; color: var(--accent-blue-deep); }

.dl-package {
  margin-top: 30px;
  background: linear-gradient(120deg, #0e2244, #123166);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border: 1px solid rgba(56,189,248,0.25);
}
.dl-package h4 { color: #fff; font-size: 17px; margin-bottom: 4px; }
.dl-package p { color: var(--text-on-dark-muted); font-size: 13.5px; }

/* ---------- Academic responsibility note ---------- */
.responsibility-card {
  max-width: 900px; margin: 0 auto;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 34px 38px;
}
.responsibility-card p { color: var(--text-on-dark-muted); font-size: 14.5px; margin-bottom: 12px; }
.responsibility-card p:last-child { margin-bottom: 0; }
.responsibility-card strong { color: var(--text-on-dark); }

/* ---------- Footer ---------- */
footer { padding: 50px 0 34px; border-top: 1px solid var(--border-soft); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.footer-inner p { font-size: 12.8px; color: var(--text-on-dark-muted); }
.footer-inner .footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-inner .footer-brand img { height: 22px; background: #fff; border-radius: 3px; padding: 2px; }

/* ---------- Utility ---------- */
.center { text-align: center; }
.mt-32 { margin-top: 32px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; z-index: 101;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  width: 0%;
}

/* ============================================================
   Premium enhancement layer — hero choreography, 3D tilt, timeline
   progress fill, staggered reveals, card polish. Purely additive:
   nothing here can hide content (see progressive-enhancement rule
   above), it only refines motion and depth once JS confirms it ran.
   ============================================================ */

/* Hero entrance: staggered fade/slide-up, orchestrated by JS adding
   .hero-in to each child in sequence. Falls back to fully visible
   (via the .reveal default-visible rule) if JS never runs. */
html.js-anim .hero-stagger { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease-premium), transform 0.7s var(--ease-premium); }
html.js-anim .hero-stagger.hero-in { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  html.js-anim .hero-stagger { opacity: 1 !important; transform: none !important; }
}

/* Generic stagger: JS sets --stagger-i (0,1,2…) on children of
   [data-stagger] containers; CSS turns that into a transition-delay
   on top of the existing .reveal mechanism. */
[data-stagger] > .reveal { transition-delay: calc(var(--stagger-i, 0) * 110ms) !important; }

/* Timeline node pulse: briefly rings when its card enters the viewport. */
@keyframes dotPulse {
  0% { box-shadow: 0 0 0 0 rgba(79, 210, 251, 0.65); }
  70% { box-shadow: 0 0 0 16px rgba(79, 210, 251, 0); }
  100% { box-shadow: 0 0 0 0 rgba(79, 210, 251, 0); }
}
html.js-anim .tl-item.in-view .tl-dot { animation: dotPulse 0.9s ease-out; }

/* Package-ZIP card: a slightly delayed, slightly stronger final reveal. */
html.js-anim .dl-package.reveal { transition-delay: 0.15s; }
@keyframes packageGlow {
  0% { box-shadow: 0 0 0 0 rgba(79, 210, 251, 0.35); }
  100% { box-shadow: 0 0 0 22px rgba(79, 210, 251, 0); }
}
html.js-anim .dl-package.in-view { animation: packageGlow 1.1s ease-out 0.3s; }

/* 3D tilt-on-hover for premium cards. JS sets --tilt-x/--tilt-y (in
   degrees) on mousemove; without JS these default to 0 (flat, no
   tilt) so the card is always fully readable. */
.tilt-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateZ(0);
  transition: transform 0.35s var(--ease-premium), box-shadow 0.35s var(--ease-premium);
  will-change: transform;
}
.tilt-card:hover { box-shadow: var(--shadow-card-hover); }
@media (prefers-reduced-motion: reduce), (pointer: coarse) {
  .tilt-card { transform: none !important; }
}

/* Timeline animated progress fill: a second line layered on top of
   .timeline::before that grows with scroll position (JS sets
   --tl-progress 0..1 on .timeline). */
.timeline { --tl-progress: 0; }
.timeline::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 6px;
  width: 2px;
  height: calc(var(--tl-progress) * 100%);
  background: var(--accent-cyan);
  box-shadow: 0 0 12px 1px rgba(79, 210, 251, 0.5);
  transition: height 0.2s linear;
}
@media (min-width: 720px) {
  .timeline::after { left: 50%; transform: translateX(-1px); }
}
@media (prefers-reduced-motion: reduce) {
  .timeline::after { transition: none; }
}

/* Refined focus states across interactive cards (accessibility, not
   just decoration) */
.stat-card:focus-visible, .gallery-item:focus-visible, .tl-card:focus-visible,
.dl-file:focus-visible, .challenge-head:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* Card polish: consistent hover elevation using the shared shadow
   tokens (keeps every card family visually consistent) */
.stat-card, .gallery-item, .dl-card, .challenge, .opt-step, .kicad-check, .design-figure {
  transition: transform 0.3s var(--ease-premium), box-shadow 0.3s var(--ease-premium);
}
.dl-card:hover, .opt-step:hover, .kicad-check:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }

/* Download affordance micro-interaction: a brief check state applied
   by JS for ~1.2s after a download is actually triggered, so the
   click has visible, honest feedback instead of feeling inert. */
.dl-file.just-downloaded { background: rgba(52, 211, 153, 0.14); color: var(--text-dark); }
.dl-file.just-downloaded svg { color: #1a9c6e; }

/* Gallery lightbox open/close transition polish */
.lightbox { transition: opacity 0.25s ease; opacity: 0; }
.lightbox.open { opacity: 1; }
.lightbox-inner { transform: scale(0.96); transition: transform 0.3s var(--ease-premium); }
.lightbox.open .lightbox-inner { transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox-inner { transition: none; }
}
