:root {
      --ink: #17212b;
      --muted: #60707f;
      --paper: #f4f1ea;
      --surface: #fffdf8;
      --line: #d8d3c8;
      --navy: #12324a;
      --blue: #176b87;
      --cyan: #39a8b5;
      --orange: #d66a2c;
      --gold: #dda83a;
      --green: #3f7e66;
      --red: #b4453f;
      --shadow: 0 18px 55px rgba(20, 35, 45, .13);
      --radius: 20px;
    }

    * { box-sizing: border-box; }
    [hidden] { display: none !important; }
    html { scroll-behavior: smooth; scroll-snap-type: y mandatory; }
    body {
      margin: 0;
      color: var(--ink);
      background: var(--paper);
      font-family: Inter, "Segoe UI", Arial, sans-serif;
      line-height: 1.45;
    }
    button, a { font: inherit; }
    a { color: inherit; }
    .skip-link {
      position: fixed; left: 1rem; top: -4rem; z-index: 100;
      padding: .7rem 1rem; color: white; background: var(--navy); border-radius: 8px;
    }
    .skip-link:focus { top: 1rem; }

    .topbar {
      position: fixed; inset: 0 0 auto 0; z-index: 30;
      display: flex; align-items: center; justify-content: space-between; gap: 1rem;
      min-height: 58px; padding: .6rem 1rem .6rem 1.25rem;
      color: white; background: rgba(18, 50, 74, .96); backdrop-filter: blur(10px);
      border-bottom: 1px solid rgba(255,255,255,.15);
    }
    .brand { display: flex; align-items: center; gap: .75rem; min-width: 0; }
    .brand-mark {
      display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 auto;
      border: 1px solid rgba(255,255,255,.5); border-radius: 50%; font-weight: 800;
    }
    .brand strong { display: block; font-size: .88rem; letter-spacing: .04em; text-transform: uppercase; }
    .brand span { display: block; color: #b9d4df; font-size: .72rem; }
    .top-actions { display: flex; align-items: center; gap: .5rem; }
    .top-actions a, .control {
      display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
      min-height: 36px; padding: .4rem .72rem; color: white; text-decoration: none;
      background: transparent; border: 1px solid rgba(255,255,255,.28); border-radius: 9px; cursor: pointer;
    }
    .top-actions a:hover, .control:hover, .control:focus-visible { background: rgba(255,255,255,.12); }
    .slide-counter { min-width: 4.5rem; color: #d6e6ec; text-align: center; font-variant-numeric: tabular-nums; }

    .progress { position: fixed; z-index: 35; inset: 58px 0 auto; height: 4px; background: rgba(18,50,74,.12); }
    .progress span { display: block; width: 5%; height: 100%; background: linear-gradient(90deg, var(--orange), var(--gold)); transition: width .25s ease; }

    .deck { padding-top: 58px; }
    .slide {
      position: relative; min-height: calc(100vh - 58px); padding: clamp(2.1rem, 5vw, 4.8rem) clamp(1.2rem, 7vw, 7rem) 4.5rem;
      display: grid; align-content: center; scroll-snap-align: start; overflow: hidden;
    }
    .slide:nth-child(even) { background: var(--surface); }
    .slide::after {
      content: attr(data-number); position: absolute; right: clamp(1.2rem, 4vw, 3.5rem); bottom: 1.1rem;
      color: rgba(18,50,74,.28); font-size: .78rem; font-weight: 800; letter-spacing: .15em;
    }
    .slide-inner { width: min(1180px, 100%); margin: 0 auto; }
    .eyebrow {
      display: inline-flex; align-items: center; gap: .55rem; margin-bottom: .7rem;
      color: var(--orange); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
    }
    .eyebrow::before { content: ""; width: 28px; height: 3px; background: currentColor; }
    h1, h2, h3, p { margin-top: 0; }
    h1, h2 { color: var(--navy); line-height: 1.05; letter-spacing: -.035em; }
    h1 { max-width: 920px; margin-bottom: 1rem; font-size: clamp(2.5rem, 6.4vw, 6.2rem); }
    h2 { max-width: 960px; margin-bottom: 1.4rem; font-size: clamp(2rem, 4.1vw, 4rem); }
    h3 { margin-bottom: .55rem; color: var(--navy); font-size: 1rem; }
    .lead { max-width: 880px; color: var(--muted); font-size: clamp(1.05rem, 1.8vw, 1.42rem); }
    .accent { color: var(--orange); }
    .big-statement { max-width: 1000px; color: var(--navy); font-size: clamp(1.55rem, 3.1vw, 3rem); line-height: 1.2; font-weight: 720; }

    .cover { color: white; background: var(--navy) !important; }
    .cover::before {
      content: ""; position: absolute; width: 52vw; height: 52vw; right: -18vw; top: -18vw;
      border: 1px solid rgba(255,255,255,.12); border-radius: 50%; box-shadow: 0 0 0 8vw rgba(255,255,255,.025), 0 0 0 16vw rgba(255,255,255,.018);
    }
    .cover h1 { color: white; }
    .cover .lead { color: #c4d8e1; }
    .cover .eyebrow { color: #f3b45e; }
    .cover-meta { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 2rem; }
    .pill { display: inline-flex; align-items: center; padding: .36rem .7rem; border-radius: 999px; background: #e9f2f3; color: var(--blue); font-size: .78rem; font-weight: 750; }
    .cover .pill { color: white; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); }

    .grid-2, .grid-3, .grid-4 { display: grid; gap: 1rem; }
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .card {
      padding: 1.15rem; background: rgba(255,255,255,.76); border: 1px solid var(--line);
      border-radius: var(--radius); box-shadow: 0 7px 24px rgba(20,35,45,.055);
    }
    .slide:nth-child(even) .card { background: #f8f5ee; }
    .card p, .card li { color: var(--muted); font-size: .91rem; }
    .card p:last-child, .card ul:last-child { margin-bottom: 0; }
    .card .num { display: block; margin-bottom: .5rem; color: var(--orange); font-size: 1.6rem; font-weight: 850; }
    .callout { padding: 1rem 1.2rem; border-left: 5px solid var(--orange); background: #fff5e9; border-radius: 0 14px 14px 0; }
    .callout strong { color: var(--navy); }
    .note { color: var(--muted); font-size: .82rem; }

    .flow { display: flex; align-items: stretch; gap: .6rem; margin: 1.5rem 0; }
    .flow-step {
      position: relative; flex: 1; min-width: 0; padding: 1rem .8rem; text-align: center;
      background: white; border: 1px solid var(--line); border-radius: 14px;
    }
    .flow-step:not(:last-child)::after { content: "›"; position: absolute; z-index: 2; right: -.48rem; top: 50%; transform: translate(50%,-50%); color: var(--orange); font-size: 1.8rem; font-weight: 800; }
    .flow-step b { display: block; color: var(--navy); font-size: .88rem; }
    .flow-step small { display: block; margin-top: .3rem; color: var(--muted); font-size: .72rem; }
    .phase-card { position: relative; overflow: hidden; padding-top: 1.4rem; }
    .phase-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; background: var(--phase-color, var(--blue)); }
    .phase-card .tag { color: var(--phase-color, var(--blue)); font-weight: 850; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }

    .formula {
      margin: 1rem 0; padding: 1rem 1.2rem; overflow-x: auto; color: #eaf4f7; background: var(--navy);
      border-radius: 14px; font-family: "Cascadia Code", Consolas, monospace; font-size: clamp(.9rem, 1.5vw, 1.1rem); white-space: nowrap;
    }
    .formula em { color: #f4b65f; font-style: normal; }
    .decision { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: .7rem; }
    .decision .result { min-height: 150px; padding: 1.1rem; border-radius: 18px; border: 1px solid var(--line); background: white; }
    .decision .arrow { color: var(--orange); font-size: 1.8rem; font-weight: 900; }
    .status { display: inline-block; margin-bottom: .6rem; padding: .25rem .55rem; border-radius: 999px; color: white; font-size: .72rem; font-weight: 800; text-transform: uppercase; }
    .status.red { background: var(--red); } .status.gold { background: #a66f13; } .status.green { background: var(--green); }

    table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.7); border-radius: 14px; overflow: hidden; }
    th, td { padding: .72rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: .83rem; }
    th { color: white; background: var(--navy); font-size: .73rem; letter-spacing: .04em; text-transform: uppercase; }
    td { color: var(--muted); }
    td strong { color: var(--ink); }
    tr:last-child td { border-bottom: 0; }
    .comparison td:first-child { width: 22%; color: var(--navy); font-weight: 800; }

    .stack { display: grid; gap: .7rem; }
    .stack-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: .8rem; }
    .stack-row b { color: var(--navy); font-size: .82rem; }
    .stack-bar { display: flex; height: 38px; overflow: hidden; border-radius: 10px; }
    .stack-bar span { display: grid; place-items: center; min-width: 12%; color: white; font-size: .72rem; font-weight: 800; }
    .stack-bar span:nth-child(1) { background: var(--red); }
    .stack-bar span:nth-child(2) { background: var(--blue); }
    .stack-bar span:nth-child(3) { background: var(--green); }

    .timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; counter-reset: step; }
    .timeline article { position: relative; padding: 1rem; border-top: 4px solid var(--cyan); background: white; border-radius: 0 0 14px 14px; }
    .timeline article::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: .65rem; color: white; background: var(--navy); border-radius: 50%; font-size: .8rem; font-weight: 800; }
    .timeline p { margin-bottom: 0; color: var(--muted); font-size: .78rem; }

    .legend { display: flex; flex-wrap: wrap; gap: .6rem; margin: .8rem 0 1.2rem; }
    .legend span { padding: .32rem .65rem; border-radius: 999px; font-size: .73rem; font-weight: 800; }
    .implemented { color: #225c48; background: #dfeee7; }
    .target { color: #7b5414; background: #f7e9c8; }
    .bridge { color: #17566c; background: #dceef2; }
    .done { color: #17603a; background: #dff3e8; }
    .state-machine { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
    .state-machine span { padding: .55rem .75rem; color: var(--navy); background: white; border: 1px solid var(--line); border-radius: 10px; font-size: .82rem; font-weight: 750; }
    .state-machine i { color: var(--orange); font-style: normal; font-weight: 900; }

    .sources { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem 1.4rem; margin-top: 1rem; }
    .sources a { color: var(--blue); font-size: .82rem; text-decoration-thickness: 1px; text-underline-offset: 3px; }
    .kbd-hint { position: absolute; left: 50%; bottom: 1.1rem; transform: translateX(-50%); color: rgba(255,255,255,.58); font-size: .74rem; }
    kbd { padding: .1rem .35rem; color: inherit; background: rgba(255,255,255,.1); border: 1px solid currentColor; border-radius: 5px; font-family: inherit; }

    .dots { position: fixed; z-index: 25; right: .7rem; top: 50%; display: grid; gap: .38rem; transform: translateY(-50%); }
    .dots button { width: 9px; height: 9px; padding: 0; background: rgba(18,50,74,.25); border: 0; border-radius: 50%; cursor: pointer; }
    .dots button.active { background: var(--orange); transform: scale(1.45); }

    @media (max-width: 900px) {
      html { scroll-snap-type: none; }
      .slide { min-height: auto; padding-top: 3.2rem; padding-bottom: 4rem; }
      .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
      .timeline { grid-template-columns: 1fr 1fr; }
      .flow { display: grid; grid-template-columns: 1fr 1fr; }
      .flow-step::after { display: none; }
      .decision { grid-template-columns: 1fr; }
      .decision .arrow { transform: rotate(90deg); text-align: center; }
      .dots { display: none; }
    }
    @media (max-width: 620px) {
      .brand span, .top-actions a { display: none; }
      .topbar { padding-inline: .65rem; }
      .grid-2, .grid-3, .grid-4, .timeline, .sources { grid-template-columns: 1fr; }
      .stack-row { grid-template-columns: 1fr; gap: .3rem; }
      h1 { font-size: 2.55rem; }
      h2 { font-size: 2rem; }
      th, td { padding: .55rem; font-size: .74rem; }
    }
    @media print {
      html, body { background: white; scroll-snap-type: none; }
      .topbar, .progress, .dots, .kbd-hint { display: none !important; }
      .deck { padding: 0; }
      .slide { min-height: 100vh; page-break-after: always; break-after: page; padding: 1.4cm; overflow: visible; }
      .slide:last-child { page-break-after: auto; }
      .card, .flow-step, .timeline article { box-shadow: none; }
    }
    @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
