/* Philipp Marenne — static personal site */

/* ─── Layer order ─────────────────────────────────────────────────────────── */
@layer reset, base, layout, components, utilities, animations, theme;

/* ─── Fonts (outside layers — always applied) ────────────────────────────── */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/outfit-variable-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/outfit-variable-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
@layer reset {

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

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

  a {
    color: var(--color-link);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
  }

  a:hover {
    color: var(--color-link-hover);
  }

}

/* ═══════════════════════════════════════════════════════════════════════════ */
@layer base {

  :root {
    /* Palette */
    --blue-950: #121a28;
    --blue-900: #1c2738;
    --blue-800: #3d4d62;
    --blue-600: #3a5f8f;
    --blue-500: #5a7d9e;
    --blue-400: #8aa9c4;
    --blue-100: #e8eef5;
    --blue-50:  #f2f5f9;
    --white:    #fdfcf9;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-200: #e5e7eb;

    /* Semantic tokens — light defaults */
    --color-bg:             var(--white);
    --color-text:           var(--blue-900);
    --color-text-muted:     var(--gray-500);
    --color-heading:        var(--blue-950);
    --color-link:           var(--blue-600);
    --color-link-hover:     var(--blue-500);
    --color-border:         var(--gray-200);
    --color-surface:        rgba(255, 255, 255, 0.6);
    --color-header-bg:      rgba(253, 252, 249, 0.78);
    --color-header-border:  rgba(18, 26, 40, 0.06);
    --color-footer-border:  var(--gray-200);

    /* Shadows */
    --shadow:    0 2px 16px rgba(18, 26, 40, 0.06);
    --shadow-lg: 0 24px 48px -24px rgba(18, 26, 40, 0.14);

    /* Misc */
    --radius:    10px;
    --radius-lg: 16px;
    --font-sans: "Outfit", system-ui, -apple-system, sans-serif;
    --max:       1080px;
    --prose-max: 700px;
  }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
    color-scheme: light dark;
  }

  body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.68;
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image:
      radial-gradient(ellipse 120% 80% at 0% -20%, rgba(232, 238, 245, 0.65) 0%, transparent 55%),
      radial-gradient(ellipse 80% 50% at 100% 0%, rgba(248, 246, 242, 0.9) 0%, transparent 45%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
  }

}

/* ═══════════════════════════════════════════════════════════════════════════ */
@layer layout {

  /* Header */

  .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-header-bg);
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--color-header-border);
  }

  .header-inner {
    max-width: var(--max);
    margin: 0 auto;
    padding: 1.1rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  /* Hero */

  .hero {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3.25rem 1.75rem 4.5rem;
    display: grid;
    gap: 2.75rem;
    align-items: center;
  }

  @media (min-width: 900px) {
    .hero {
      grid-template-columns: 1fr min(38%, 400px);
      padding-top: 4.5rem;
      padding-bottom: 5.5rem;
      gap: 3.5rem;
    }
  }

  .hero-text {
    order: 2;
  }

  @media (min-width: 900px) {
    .hero-text {
      order: 0;
    }
  }

  .hero-visual {
    order: 1;
    justify-self: center;
  }

  @media (min-width: 900px) {
    .hero-visual {
      justify-self: end;
    }
  }

  /* Sections */

  .section {
    max-width: var(--max);
    margin: 0 auto;
    padding: 4rem 1.75rem;
  }

  .logos-section {
    background: linear-gradient(165deg, #161e2e 0%, #1a2639 48%, #152032 100%);
    color: var(--blue-100);
    margin-top: 2.5rem;
    padding: 4rem 1.75rem;
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
  }

  .contact-section {
    padding-bottom: 4rem;
    content-visibility: auto;
    contain-intrinsic-size: 0 400px;
  }

  /* Inner pages */

  .page-hero {
    max-width: var(--max);
    margin: 0 auto;
    padding: 3rem 1.5rem 1.5rem;
  }

  .page-hero h1 {
    font-family: var(--font-sans);
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -0.03em;
    color: var(--color-heading);
    margin: 0 0 1rem;
  }

  .page-hero .lead {
    max-width: 48ch;
    margin: 0;
  }

  /* Footer */

  .site-footer {
    border-top: 1px solid var(--color-footer-border);
    padding: 1.5rem;
    font-size: 0.88rem;
    color: var(--color-text-muted);
  }

  .footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.65rem 1.25rem;
  }

  .footer-inner small {
    margin: 0;
  }

  .footer-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
  }

  .footer-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 500;
  }

  .footer-nav a:hover {
    color: var(--color-link);
  }

  .footer-sep {
    opacity: 0.45;
    user-select: none;
  }

  /* Prose (Impressum, Datenschutz) */

  .prose {
    max-width: var(--prose-max);
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
  }

  .prose > *:first-child {
    margin-top: 0;
  }

}

/* ═══════════════════════════════════════════════════════════════════════════ */
@layer components {

  /* Logo / nav */

  .logo {
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--color-heading);
    text-decoration: none;
    letter-spacing: -0.01em;
  }

  .logo:hover {
    color: var(--color-link);
  }

  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-links a {
    color: var(--blue-800);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
  }

  .nav-links a:hover,
  .nav-links a[aria-current="page"] {
    color: var(--color-link);
  }

  /* Theme toggle */

  .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid var(--color-header-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }

  .theme-toggle:hover {
    background: var(--color-bg);
    border-color: var(--color-link);
    color: var(--color-link);
  }

  .theme-toggle:focus-visible {
    outline: 2px solid var(--blue-400);
    outline-offset: 3px;
  }

  .theme-toggle svg {
    width: 1rem;
    height: 1rem;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Light mode: moon visible (switch to dark). Dark mode: sun visible (switch to light). */
  .icon-sun  { display: none; }
  .icon-moon { display: block; }
  [data-theme="dark"] .icon-sun  { display: block; }
  [data-theme="dark"] .icon-moon { display: none; }

  /* Reading progress bar */

  #progress {
    display: none;
  }

  /* Hero text */

  .eyebrow {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--color-link);
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(58, 95, 143, 0.22);
    max-width: 20rem;
  }

  .hero h1 {
    font-family: var(--font-sans);
    font-size: clamp(2.35rem, 5vw, 3.35rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.035em;
    color: var(--color-heading);
    margin: 0 0 1.25rem;
  }

  .lead {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--blue-800);
    max-width: 38ch;
    margin: 0 0 1.65rem;
    opacity: 0.92;
  }

  .facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
  }

  .facts li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
  }

  .facts li::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid var(--blue-500);
    background: transparent;
    flex-shrink: 0;
    opacity: 0.75;
  }

  .hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  /* Buttons */

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.88rem 1.45rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  }

  .btn:focus-visible {
    outline: 2px solid var(--blue-400);
    outline-offset: 3px;
  }

  .btn-primary {
    background: var(--blue-600);
    color: var(--white);
    box-shadow: 0 4px 20px rgba(58, 95, 143, 0.22);
  }

  .btn-primary:hover {
    color: var(--white);
    transform: translateY(-1px);
    background: #335580;
    box-shadow: 0 8px 28px rgba(58, 95, 143, 0.28);
  }

  .btn-ghost {
    background: var(--color-surface);
    color: var(--blue-800);
    border-color: rgba(18, 26, 40, 0.12);
  }

  .btn-ghost:hover {
    border-color: rgba(58, 95, 143, 0.35);
    color: var(--color-link);
    background: var(--color-bg);
  }

  /* Portrait */

  .portrait-frame {
    margin: 0;
    width: min(100%, 400px);
    max-width: 100%;
    background: none;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }

  .portrait-frame img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center center;
    filter: drop-shadow(0 28px 48px rgba(18, 26, 40, 0.12)) drop-shadow(0 10px 24px rgba(18, 26, 40, 0.07));
  }

  /* Section head */

  .section-head {
    max-width: 42ch;
    margin-bottom: 2.75rem;
  }

  .section-head h2 {
    font-family: var(--font-sans);
    font-size: clamp(1.65rem, 3.2vw, 2.15rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--color-heading);
    margin: 0 0 0.85rem;
  }

  .section-head p {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 1rem;
  }

  /* Agency note */

  .agency-note {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    max-width: 46ch;
  }

  .agency-note p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.65;
    color: var(--blue-800);
  }

  .agency-link {
    font-weight: 600;
  }

  /* Logos section */

  .logos-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 120% at 20% 0%, rgba(90, 125, 158, 0.12) 0%, transparent 50%);
    pointer-events: none;
  }

  .logos-inner {
    max-width: var(--max);
    margin: 0 auto;
    position: relative;
    z-index: 1;
  }

  .logos-section h2 {
    font-family: var(--font-sans);
    font-size: 1.35rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 2.25rem;
    color: rgba(253, 252, 249, 0.96);
    letter-spacing: -0.02em;
  }

  .logo-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .logo-slot {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .logo-slot a {
    display: flex;
    align-items: center;
  }

  .logo-slot img {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: opacity 0.2s ease;
  }

  .logo-slot a:hover img {
    opacity: 1;
  }

  /* Contact card */

  .contact-card {
    max-width: var(--max);
    margin: 0 auto;
    padding: 2.85rem 2rem;
    background: linear-gradient(145deg, #3d5d85 0%, var(--blue-600) 42%, #2e4a6e 100%);
    border-radius: var(--radius-lg);
    color: var(--white);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    position: relative;
    overflow: hidden;
  }

  .contact-card::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 55%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.09) 0%, transparent 65%);
    pointer-events: none;
  }

  .contact-card h2,
  .contact-card > p,
  .contact-card .contact-list {
    position: relative;
    z-index: 1;
  }

  .contact-card h2 {
    font-family: var(--font-sans);
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
  }

  .contact-card > p {
    margin: 0 0 1.5rem;
    opacity: 0.92;
    max-width: 40ch;
  }

  .contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .contact-list a {
    color: var(--white);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 5px;
  }

  .contact-list a:hover {
    opacity: 0.9;
  }

  /* Prose */

  .prose h2 {
    font-family: var(--font-sans);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--color-heading);
    margin: 2.25rem 0 0.75rem;
    letter-spacing: -0.02em;
  }

  .prose h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 1.5rem 0 0.5rem;
  }

  .prose h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--blue-800);
    margin: 1.25rem 0 0.35rem;
  }

  .prose p {
    margin: 0 0 1rem;
    color: var(--color-text-muted);
  }

  .prose ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    color: var(--color-text-muted);
  }

  .prose ul.plain-list {
    list-style: none;
    padding-left: 0;
  }

  .prose ul.plain-list li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.5rem;
  }

  .prose ul.plain-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid var(--blue-500);
    background: transparent;
    opacity: 0.75;
  }

  .prose a {
    font-weight: 600;
  }

  .prose .legal-block {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin: 1rem 0 1.5rem;
    box-shadow: var(--shadow);
    font-style: normal;
  }

  .prose .legal-block p {
    margin: 0 0 0.5rem;
  }

  .prose .legal-block p:last-child {
    margin-bottom: 0;
  }

}

/* ═══════════════════════════════════════════════════════════════════════════ */
@layer utilities {

  .skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    padding: 0.75rem 1rem;
    background: var(--blue-900);
    color: var(--white);
    z-index: 100;
  }

  .skip-link:focus {
    left: 1rem;
    top: 1rem;
  }

}

/* ═══════════════════════════════════════════════════════════════════════════ */
@layer animations {

  /* ── Reading progress bar ──────────────────────────────────────────────── */

  @supports (animation-timeline: scroll()) {
    #progress {
      display: block;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--blue-600);
      transform-origin: left;
      z-index: 200;
      animation: progress-grow linear both;
      animation-timeline: scroll(root block);
    }

    @keyframes progress-grow {
      from { transform: scaleX(0); }
      to   { transform: scaleX(1); }
    }
  }

  /* ── Hero entrance — @starting-style ──────────────────────────────────── */
  /* Graceful degradation: if unsupported, elements render immediately       */

  .hero-text {
    transition: opacity 0.55s ease, transform 0.55s ease;
  }

  .hero-visual {
    transition: opacity 0.55s ease 0.15s, transform 0.55s ease 0.15s;
  }

  @starting-style {
    .hero-text {
      opacity: 0;
      transform: translateY(22px);
    }

    .hero-visual {
      opacity: 0;
      transform: translateY(16px);
    }
  }

  /* ── Scroll-reveal: CSS-native path (Chrome/Edge 115+) ────────────────── */

  @supports (animation-timeline: view()) {
    @keyframes reveal-up {
      from {
        opacity: 0;
        transform: translateY(20px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .section-head {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }

    .logo-slot {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }

    .contact-card {
      animation: reveal-up linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }

  /* ── Scroll-reveal: JS-IntersectionObserver path (Safari / older) ─────── */
  /* .reveal class set in HTML; JS adds .is-visible when entering viewport   */

  @supports not (animation-timeline: view()) {
    .reveal {
      opacity: 0;
      transform: translateY(18px);
      transition: opacity 0.5s ease, transform 0.5s ease;
    }

    .reveal.is-visible {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* ── View Transitions ──────────────────────────────────────────────────── */

  @supports (view-transition-name: none) {
    ::view-transition-old(root) {
      animation: vt-fade-out 0.2s ease both;
    }

    ::view-transition-new(root) {
      animation: vt-fade-in 0.25s ease both;
    }

    @keyframes vt-fade-out {
      to { opacity: 0; transform: translateY(-6px); }
    }

    @keyframes vt-fade-in {
      from { opacity: 0; transform: translateY(6px); }
    }
  }

}

/* ═══════════════════════════════════════════════════════════════════════════ */
@layer theme {

  /* ── Dark mode — system preference ────────────────────────────────────── */

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      color-scheme: dark;
      --color-bg:             #121a28;
      --color-text:           var(--blue-100);
      --color-text-muted:     var(--blue-400);
      --color-heading:        #ecf1f8;
      --color-link:           var(--blue-400);
      --color-link-hover:     #aec5da;
      --color-border:         rgba(255, 255, 255, 0.08);
      --color-surface:        rgba(255, 255, 255, 0.05);
      --color-header-bg:      rgba(18, 26, 40, 0.85);
      --color-header-border:  rgba(255, 255, 255, 0.07);
      --color-footer-border:  rgba(255, 255, 255, 0.08);
      --shadow:    0 2px 16px rgba(0, 0, 0, 0.25);
      --shadow-lg: 0 24px 48px -24px rgba(0, 0, 0, 0.45);
    }
  }

  /* ── Dark mode — manual override ──────────────────────────────────────── */

  [data-theme="dark"] {
    color-scheme: dark;
    --color-bg:             #121a28;
    --color-text:           var(--blue-100);
    --color-text-muted:     var(--blue-400);
    --color-heading:        #ecf1f8;
    --color-link:           var(--blue-400);
    --color-link-hover:     #aec5da;
    --color-border:         rgba(255, 255, 255, 0.08);
    --color-surface:        rgba(255, 255, 255, 0.05);
    --color-header-bg:      rgba(18, 26, 40, 0.85);
    --color-header-border:  rgba(255, 255, 255, 0.07);
    --color-footer-border:  rgba(255, 255, 255, 0.08);
    --shadow:    0 2px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 48px -24px rgba(0, 0, 0, 0.45);
  }

  /* Dark: body background */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) body {
      background-image:
        radial-gradient(ellipse 120% 80% at 0% -20%, rgba(58, 95, 143, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(30, 45, 65, 0.6) 0%, transparent 45%);
    }
  }

  [data-theme="dark"] body {
    background-image:
      radial-gradient(ellipse 120% 80% at 0% -20%, rgba(58, 95, 143, 0.12) 0%, transparent 55%),
      radial-gradient(ellipse 80% 50% at 100% 0%, rgba(30, 45, 65, 0.6) 0%, transparent 45%);
  }

  /* Dark: portrait shadow more visible on dark bg */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .portrait-frame img {
      filter: drop-shadow(0 28px 60px rgba(0, 0, 0, 0.35)) drop-shadow(0 10px 28px rgba(0, 0, 0, 0.2));
    }
  }

  [data-theme="dark"] .portrait-frame img {
    filter: drop-shadow(0 28px 60px rgba(0, 0, 0, 0.35)) drop-shadow(0 10px 28px rgba(0, 0, 0, 0.2));
  }

  /* Dark: nav text */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .nav-links a {
      color: var(--blue-100);
    }
  }

  [data-theme="dark"] .nav-links a {
    color: var(--blue-100);
  }

  /* Dark: lead text */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .lead {
      color: var(--blue-100);
      opacity: 0.85;
    }
  }

  [data-theme="dark"] .lead {
    color: var(--blue-100);
    opacity: 0.85;
  }

  /* Dark: agency note text */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .agency-note p {
      color: var(--blue-100);
    }
  }

  [data-theme="dark"] .agency-note p {
    color: var(--blue-100);
  }

  /* Dark: btn-ghost */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn-ghost {
      background: rgba(255, 255, 255, 0.06);
      color: var(--blue-100);
      border-color: rgba(255, 255, 255, 0.12);
    }

    :root:not([data-theme="light"]) .btn-ghost:hover {
      background: rgba(255, 255, 255, 0.1);
      border-color: rgba(255, 255, 255, 0.22);
      color: var(--white);
    }
  }

  [data-theme="dark"] .btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--blue-100);
    border-color: rgba(255, 255, 255, 0.12);
  }

  [data-theme="dark"] .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--white);
  }

  /* Dark: eyebrow border */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .eyebrow {
      border-bottom-color: rgba(138, 169, 196, 0.25);
    }
  }

  [data-theme="dark"] .eyebrow {
    border-bottom-color: rgba(138, 169, 196, 0.25);
  }

  /* Dark: icon state for system preference (no data-theme set on first visit) */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun  { display: block; }
    :root:not([data-theme="light"]) .icon-moon { display: none; }
  }

  /* Dark: prose h4 — var(--blue-800) is near-invisible on dark bg */
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .prose h4 {
      color: var(--blue-400);
    }
  }

  [data-theme="dark"] .prose h4 {
    color: var(--blue-400);
  }

  /* Light force — manual override */

  [data-theme="light"] {
    color-scheme: light;
  }

}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Accessibility: respect reduced motion preference                           */

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

  #progress {
    display: none !important;
  }
}
