html[data-theme="day"] {
      --page: #f5f7fb;
      --card: #ffffff;
      --text: #0f172a;
      --muted: #64748b;
      --border: #e2e8f0;
      --accent: #0891b2;
      --nav-bg: rgba(11, 26, 46, 0.9);
      --footer: #0b1a2e;
      --logo-filter: brightness(0) invert(1);
      color-scheme: light;
    }
    html[data-theme="night"] {
      --page: #0a101c;
      --card: #121b2c;
      --text: #f1f5f9;
      --muted: #94a3b8;
      --border: rgba(255,255,255,0.1);
      --accent: #22d3ee;
      --nav-bg: rgba(7, 11, 20, 0.9);
      --footer: #070b14;
      --logo-filter: brightness(0) invert(1);
      color-scheme: dark;
    }

    *, *::before, *::after { box-sizing: border-box; }
    html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
    body {
      margin: 0;
      font-family: 'Inter', system-ui, sans-serif;
      background: var(--page);
      color: var(--text);
      line-height: 1.65;
      -webkit-font-smoothing: antialiased;
      transition: background 0.3s ease, color 0.3s ease;
    }
    a { color: var(--accent); text-decoration: none; }
    a:hover { text-decoration: underline; }

    .wrap { width: min(48rem, calc(100% - 2rem)); margin-inline: auto; }

    .nav {
      position: sticky; top: 0; z-index: 20;
      background: var(--nav-bg);
      backdrop-filter: blur(16px);
      border-bottom: 1px solid rgba(255,255,255,0.08);
      padding-top: env(safe-area-inset-top);
    }
    .nav-inner {
      height: 3.75rem;
      display: flex; align-items: center; justify-content: space-between; gap: 1rem;
      width: min(48rem, calc(100% - 2rem));
      margin-inline: auto;
    }
    .logo-img {
      height: 1.75rem; width: auto;
      filter: var(--logo-filter);
    }
    .nav-back {
      color: #e2e8f0; font-size: 0.9rem; font-weight: 500;
      display: inline-flex; align-items: center; gap: 0.4rem;
    }
    .nav-back:hover { color: #fff; text-decoration: none; }

    .theme-toggle {
      --tw: 3.25rem; --th: 1.8rem; --knob: 1.35rem;
      width: var(--tw); height: var(--th);
      border-radius: 999px;
      border: 1px solid rgba(255,255,255,0.16);
      background: #0f172a;
      position: relative; cursor: pointer; padding: 0;
    }
    html[data-theme="day"] .theme-toggle {
      background: #e2e8f0;
      border-color: rgba(15,23,42,0.12);
    }
    .theme-thumb {
      position: absolute; top: 50%; left: 3px;
      width: var(--knob); height: var(--knob);
      margin-top: calc(var(--knob) / -2);
      border-radius: 50%;
      display: grid; place-items: center;
      background: #1e293b; color: #e2e8f0;
      font-size: 0.58rem;
      transition: transform 0.28s ease, background 0.28s ease, color 0.28s ease;
    }
    html[data-theme="day"] .theme-thumb {
      transform: translateX(calc(var(--tw) - var(--knob) - 6px));
      background: #fff; color: #0f172a;
    }
    .theme-thumb .icon-sun { display: none; }
    html[data-theme="day"] .theme-thumb .icon-sun { display: inline; }
    html[data-theme="day"] .theme-thumb .icon-moon { display: none; }

    main { padding: 2.5rem 0 4rem; }
    h1 {
      font-family: 'Manrope', sans-serif;
      font-size: clamp(1.6rem, 4vw, 2rem);
      line-height: 1.2;
      margin: 0 0 0.75rem;
      letter-spacing: -0.02em;
    }
    .lead {
      color: var(--muted);
      font-size: 1.02rem;
      margin: 0 0 1.75rem;
    }
    .meta {
      display: flex; flex-wrap: wrap; gap: 0.5rem 1rem;
      font-size: 0.85rem; color: var(--muted);
      margin-bottom: 1.75rem;
      padding-bottom: 1.25rem;
      border-bottom: 1px solid var(--border);
    }

    .card {
      background: var(--card);
      border: 1px solid var(--border);
      border-radius: 1.25rem;
      padding: 1.35rem 1.4rem;
      margin-bottom: 1rem;
    }
    h2 {
      font-family: 'Manrope', sans-serif;
      font-size: 1.15rem;
      margin: 0 0 0.75rem;
    }
    p { margin: 0 0 0.75rem; color: var(--text); }
    p:last-child { margin-bottom: 0; }
    ul {
      margin: 0.4rem 0 0.75rem;
      padding-left: 1.2rem;
      color: var(--text);
    }
    li { margin-bottom: 0.35rem; }
    .muted { color: var(--muted); font-size: 0.92rem; }
    .highlight {
      border-left: 3px solid var(--accent);
      padding-left: 0.9rem;
    }

    .footer {
      background: var(--footer);
      color: #8ba3bc;
      padding: 1.75rem 0 calc(1.75rem + env(safe-area-inset-bottom));
      font-size: 0.875rem;
    }
    .footer a { color: #38bdf8; }
    .footer-inner {
      width: min(48rem, calc(100% - 2rem));
      margin-inline: auto;
      display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem;
    }
