/* ==========================================================================
   Alexander Rothe – Portfolio
   Gemeinsames Stylesheet für Startseite, AI Lab und Legal-Seiten (ohne Bootstrap).
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  --bg: #f6f7fb;
  --bg-alt: #eef1f7;
  --surface: #ffffff;
  --surface-2: #f3f5fa;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --text-muted: #526075;
  --accent: #0369a1;
  --accent-strong: #075985;
  --accent-soft: rgba(3, 105, 161, 0.09);
  --accent-contrast: #ffffff;
  --cyan: #0e7490;
  --green: #047857;
  --amber: #b45309;
  --grid-line: rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --glow: 0 0 0 transparent;

  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --radius: 14px;
  --radius-lg: 20px;
  --nav-h: 64px;
  --container: 1120px;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --bg-alt: #0e1427;
  --surface: #121a2e;
  --surface-2: #172036;
  --border: rgba(148, 163, 184, 0.13);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #e6ebf5;
  --text-muted: #9aa8bf;
  --accent: #38bdf8;
  --accent-strong: #7dd3fc;
  --accent-soft: rgba(56, 189, 248, 0.1);
  --accent-contrast: #04111f;
  --cyan: #22d3ee;
  --green: #34d399;
  --amber: #fbbf24;
  --grid-line: rgba(56, 189, 248, 0.06);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 16px 40px -18px rgba(0, 0, 0, 0.7);
  --glow: 0 0 40px -10px rgba(56, 189, 248, 0.45);

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
strong { font-weight: 600; color: var(--text); }

.mono { font-family: var(--font-mono); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 8px;
}
.skip-link:focus { top: 12px; color: var(--accent-contrast); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7em 1.2em;
  border-radius: 10px;
  border: 1px solid transparent;
  font: 500 0.95rem/1 var(--font-body);
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--glow);
}
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-contrast); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Theme-Icon: zeigt die Aktion, die ein Klick auslöst */
.icon-light { display: none; }
:root[data-theme="dark"] .icon-light { display: inline; }
:root[data-theme="dark"] .icon-dark { display: none; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font: 600 1rem var(--font-head);
}
.brand:hover { color: var(--text); }

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-contrast);
  font: 700 0.8rem var(--font-mono);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease, background-color 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); background: var(--accent-soft); }
.nav-links .nav-lab { color: var(--accent); }

.nav-actions { display: flex; gap: 8px; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 88px 0 56px;
  overflow: hidden;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 70% 40%, #000 30%, transparent 75%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 56px;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.5rem, 5.5vw, 4rem);
  font-weight: 700;
  margin-bottom: 8px;
}

.hero-role {
  font: 500 clamp(1.15rem, 2.2vw, 1.45rem) var(--font-head);
  color: var(--text-muted);
  margin-bottom: 24px;
}

.hero-lead {
  max-width: 58ch;
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }

.hero-tags,
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-tags li,
.tags li {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: 500 0.78rem var(--font-mono);
}

.hero-visual { display: flex; flex-direction: column; align-items: center; gap: 16px; }

.portrait {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  box-shadow: var(--shadow), var(--glow);
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* Bildwechsel rein über CSS */
.portrait-dark { display: none; }
:root[data-theme="dark"] .portrait-light { display: none; }
:root[data-theme="dark"] .portrait-dark { display: block; }

.portrait-caption {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
}
.portrait-caption .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 var(--green);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- Sections ---------- */
.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--border); }

.section-head { margin-bottom: 40px; max-width: 720px; }
.section-head h2,
.contact-grid h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); }
.section-lead { color: var(--text-muted); font-size: 1.05rem; }

.sub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 56px 0 20px;
  font-size: 1.2rem;
}
.sub-head i { color: var(--accent); }

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text > p { color: var(--text-muted); font-size: 1.07rem; }

.focus-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.focus-card {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.focus-card i { font-size: 1.4rem; color: var(--accent); }
.focus-card h3 { font-size: 1.02rem; margin: 10px 0 6px; }
.focus-card p { font-size: 0.9rem; color: var(--text-muted); margin: 0; }

.about-side {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  margin-bottom: 20px;
}
.side-title i { color: var(--accent); }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}
.timeline li {
  position: relative;
  padding: 0 0 22px 24px;
  border-left: 2px solid var(--border-strong);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.timeline li:first-child::before { background: var(--accent); }
.timeline-date { font-size: 0.78rem; color: var(--accent); }
.timeline h4 { font-size: 0.98rem; margin: 2px 0 4px; }
.timeline p { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

.badge-box { margin-top: 24px; display: flex; justify-content: center; }
.badge-box:empty { display: none; }

/* ---------- Terminal ---------- */
.terminal {
  margin: 0 auto;
  max-width: 760px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0f1c;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow);
}
.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #111827;
}
.terminal-bar span { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.terminal-bar span:nth-child(2) { background: #f59e0b; }
.terminal-bar span:nth-child(3) { background: #10b981; }
.terminal-body {
  margin: 0;
  padding: 20px 22px 6px;
  color: #e2e8f0;
  font-size: 0.92rem;
}
.terminal-prompt { color: #38bdf8; margin-right: 8px; }
.terminal-cite {
  padding: 0 22px 18px;
  color: #64748b;
  font-size: 0.8rem;
}

/* ---------- Projects ---------- */
.project-grid { display: grid; gap: 20px; }
.project-grid.featured { grid-template-columns: repeat(3, 1fr); }
.project-grid.two { grid-template-columns: repeat(2, 1fr); }
.project-grid.four { grid-template-columns: repeat(4, 1fr); }

.project-card {
  --card-accent: var(--accent);
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 26px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--card-accent) 45%, transparent);
  box-shadow: var(--shadow);
}
.project-card.accent-blue  { --card-accent: var(--accent); }
.project-card.accent-cyan  { --card-accent: var(--cyan); }
.project-card.accent-green { --card-accent: var(--green); }

.project-grid.featured .project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--card-accent);
}

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.project-icon { font-size: 1.8rem; color: var(--card-accent); }
.project-card h3 { font-size: 1.3rem; }
.project-card h4 { font-size: 1.05rem; margin: 0; }
.project-card p { color: var(--text-muted); font-size: 0.95rem; }

.checks {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.checks li { position: relative; padding-left: 22px; margin-bottom: 6px; }
.checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--card-accent);
}

.project-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--card-accent, var(--accent));
}
.link-arrow i { transition: transform 0.2s ease; }
.link-arrow:hover i,
a:hover .link-arrow i { transform: translateX(3px); }

.project-card.compact { padding: 22px; }
.project-card.compact p { margin: 10px 0 16px; font-size: 0.9rem; }
.project-card.compact .tags { margin-top: auto; }
.project-card.is-link:hover { color: var(--text); }

.compact-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font: 500 0.72rem var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--card-accent, var(--accent));
  background: color-mix(in srgb, var(--card-accent, var(--accent)) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--accent)) 30%, transparent);
  white-space: nowrap;
}
.pill-wip  { --card-accent: var(--amber); }
.pill-live { --card-accent: var(--green); }
.pill-new  { --card-accent: var(--accent); }

.lab-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 24px;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}
.lab-banner h3 { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; margin-bottom: 4px; }
.lab-banner h3 i { color: var(--accent); }
.lab-banner p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

/* ---------- Credentials ---------- */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.doc-card {
  display: flex;
  gap: 16px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.doc-card:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.doc-card > i {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.3rem;
}
.doc-card h3 { font-size: 1rem; margin-bottom: 6px; }
.doc-card p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 10px; }

.cert-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.cert-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 10px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.cert-card:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }
.cert-card img {
  aspect-ratio: 1.42;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
}
.cert-card .pill { position: absolute; top: 16px; right: 16px; background: var(--surface); }
.cert-title { font-size: 0.85rem; font-weight: 500; text-align: center; }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: start;
}

.contact-links { list-style: none; margin: 24px 0 0; padding: 0; }
.contact-links li { margin-bottom: 10px; }
.contact-links a { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; }
.contact-links a:hover { color: var(--accent); }
.contact-links i { color: var(--accent); font-size: 1.15rem; }

.contact-form {
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 6px; font-size: 0.88rem; font-weight: 500; }
.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.97rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); opacity: 0.7; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-inner p { margin: 0; }
.footer-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-links i { font-size: 1.1rem; }
.easter-egg { margin-top: 16px; margin-bottom: 0; font-size: 0.75rem; opacity: 0.55; }

/* ---------- Scroll-Top ---------- */
.scroll-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, color 0.2s ease, border-color 0.2s ease;
}
.scroll-top.visible { opacity: 1; visibility: visible; transform: none; }
.scroll-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.in-view { opacity: 1; transform: none; }

/* ---------- Legal-Seiten ---------- */
.legal-main { padding: 64px 0 88px; }
.legal-main .container { max-width: 820px; }
.legal-main h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.legal-card {
  margin-top: 32px;
  padding: 36px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.legal-card h2 { font-size: 1.2rem; margin-top: 28px; }
.legal-card h2:first-child { margin-top: 0; }
.legal-card p,
.legal-card li { color: var(--text-muted); }
.legal-card a { text-decoration: underline; text-underline-offset: 3px; }
.legal-card hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.legal-card .small { font-size: 0.88rem; }
.legal-back { margin-top: 32px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner,
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 72px; }
  .hero-visual { order: -1; }
  .portrait { width: min(70%, 260px); }
  .project-grid.featured { grid-template-columns: 1fr; }
  .project-grid.four { grid-template-columns: repeat(2, 1fr); }
  .doc-grid { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-grid; }
  .nav-links {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .nav-actions { margin-left: auto; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .section { padding: 64px 0; }
  .focus-grid,
  .project-grid.two,
  .project-grid.four { grid-template-columns: 1fr; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .lab-banner { flex-direction: column; align-items: flex-start; }
  .about-side,
  .contact-form,
  .legal-card { padding: 22px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .brand-name { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
