/* PrepKit website styles. One file for every page: index, privacy and
 * api-keys were carrying byte-identical copies of this, which is three
 * places to edit and three chances to drift.
 */

  :root {
    color-scheme: light dark;
    --ink: #15181c;
    --muted: #5b6672;
    --ground: #fbfbfd;
    --panel: #ffffff;
    --line: rgba(0,0,0,.12);
    --accent: #0a5a72;
    --accent-ink: #ffffff;
    --beta: #b8507a;
    --beta-ink: #ffffff;
    /* One hue per feature, after the tinted cards they were modelled on.
       Darker here so the icons hold up on white. */
    --blue: #2563eb; --green: #15803d; --red: #dc2626;
    --purple: #7c3aed; --amber: #b45309; --teal: #0f766e;
    --pink: #be185d; --indigo: #4338ca;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --ink: #ededef; --muted: #9aa5b1; --ground: #121316; --panel: #1b1d21;
      --line: rgba(255,255,255,.14); --accent: #5dd8ff; --accent-ink: #0b1116;
      --beta: #d99ab4; --beta-ink: #ffffff;
      --blue: #60a5fa; --green: #4ade80; --red: #f87171;
      --purple: #a78bfa; --amber: #fbbf24; --teal: #2dd4bf;
      --pink: #f472b6; --indigo: #818cf8;
    }
  }
  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--ground); color: var(--ink);
    font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    padding: 0 20px;
  }
  main { max-width: 760px; margin: 0 auto; padding-block: 72px 96px; }
  h1 { font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 16px; }
  h2 { font-size: 1.25rem; margin: 56px 0 14px; letter-spacing: -.01em; }
  p { margin: 0 0 16px; }
  .lede { font-size: 1.15rem; color: var(--muted); max-width: 54ch; text-wrap: pretty; }
  /* The headline's second half in the accent, shading into violet. */
  .hero h1 { text-wrap: balance; }
  .hero h1 .glow {
    display: block;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  /* What to know before downloading, as a short list rather than three
     paragraphs of fine print. */
  .facts { list-style: none; padding: 0; margin: 18px 0 0; display: grid;
     grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px;
     color: var(--muted); font-size: .92rem; line-height: 1.45; }
  .facts li { position: relative; padding-left: 26px; margin: 0; }
  .facts li::before {
    content: "\2713"; position: absolute; left: 0; top: 1px;
    width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
    font-size: .7rem; font-weight: 700; color: var(--accent);
    background: color-mix(in srgb, var(--accent) 16%, transparent);
  }
  @media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }
  .cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 32px 0 10px; }
  .button {
    display: inline-block; padding: 12px 22px; border-radius: 10px;
    background: var(--accent); color: var(--accent-ink);
    text-decoration: none; font-weight: 600;
  }
  .button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
  /* Beside Download, the other way in should still read as a button: a
     tint and an outline in the accent, not a hairline on the ground. */
  .cta .button.secondary {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--accent) 75%, transparent);
    color: var(--accent);
  }
  .cta .button.secondary:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
  .fineprint { color: var(--muted); font-size: .9rem; }
  .button.small { padding: 6px 14px; border-radius: 8px; font-size: .9rem; }
  .topbar .links a.button.small { color: var(--accent-ink); }
  .works { font-size: .95rem; margin-top: 4px; }
  .intro { color: var(--muted); margin-top: -4px; }
  .steps { padding-left: 1.4rem; }
  .steps li { margin-bottom: 12px; }
  .steps a, .faq a { color: inherit; }
  /* Questions fold, so the answers do not push the footer a screen away. */
  .faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .faq summary { cursor: pointer; font-weight: 600; }
  .faq details p { margin: 10px 0 2px; color: var(--muted); }
  ul { padding-left: 1.1rem; }
  li { margin-bottom: 10px; }
  .plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 20px 0; }
  /* Tinted like the feature cards, each plan in its own hue. The button
     sits at the foot of the card whatever the list above it, so the two
     line up side by side. */
  .plan {
    --tone: var(--accent);
    display: flex; flex-direction: column;
    background: linear-gradient(165deg, color-mix(in srgb, var(--tone) 12%, var(--panel)), var(--panel) 70%);
    border: 1px solid color-mix(in srgb, var(--tone) 22%, var(--line));
    border-radius: 14px; padding: 24px;
  }
  /* The annual plan is the one to pick, so it is the one that looks picked. */
  .plan.featured {
    border-color: color-mix(in srgb, var(--tone) 55%, var(--line));
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent),
                0 12px 32px -12px color-mix(in srgb, var(--tone) 35%, transparent);
  }
  .plan h3 { margin: 0 0 8px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
  .tag {
    padding: 1px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase;
    color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent);
  }
  .price { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
  .price span { font-size: .95rem; font-weight: 400; color: var(--muted); }
  /* The discount, larger than an ordinary tag: it is the point of the card. */
  .tag.deal { font-size: .9rem; padding: 3px 11px; letter-spacing: .05em; }
  /* The regular price, slashed through in the card's colour beside the one
     charged, so the discount reads at a glance. The slash is drawn rather
     than a text decoration, which stays a thin line through the middle. */
  .price .was { position: relative; display: inline-block; text-decoration: none;
                font-size: 1.4rem; font-weight: 600; color: var(--muted);
                margin-right: 6px; padding: 0 2px; }
  .price .was::after { content: ""; position: absolute; left: -2px; right: -2px;
                       top: 50%; height: 3px; border-radius: 2px;
                       background: var(--tone); transform: rotate(-14deg); }
  .per { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
  .ticks { list-style: none; padding: 0; margin: 18px 0 22px; font-size: .95rem; flex: 1; }
  .ticks li { position: relative; padding-left: 26px; margin-bottom: 10px; }
  /* A tick drawn in the plan's hue, from a mask so the colour comes from
     the theme rather than being baked into an image. */
  .ticks li::before {
    content: ""; position: absolute; left: 0; top: .3em; width: 16px; height: 16px;
    background: var(--tone);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .plan .button { text-align: center; }
  .plan .button.soon { opacity: 0.6; cursor: default; pointer-events: none; }
  .plan.featured .button { background: var(--tone); border: 1px solid transparent; }
  table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .95rem; }
  th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
  th:not(:first-child), td:not(:first-child) { text-align: center; width: 6.5rem; }
  /* The hero sits on a ground of its own, so the page opens as something
     designed rather than as text starting at the top of a window. */
  .hero {
    background:
      radial-gradient(90% 120% at 15% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
      var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 44px 36px 36px;
    margin-bottom: 8px;
  }
  @media (max-width: 560px) { .hero { padding: 30px 22px 26px; border-radius: 14px; } }

  /* A tour of the app: one tab per screen, one screenshot at a time. The
     tabs carry the feature hues, and the active one fills with its colour
     as a timer before moving on. tour.js advances on that fill's
     animationend, so the CSS duration is the only place the pace is set. */
  .tour { margin: 28px 0 0; }
  .tour-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
  .tour-tabs button {
    position: relative; overflow: hidden;
    font: inherit; font-size: .9rem; font-weight: 600; line-height: 1;
    padding: 9px 14px; border-radius: 999px; cursor: pointer;
    color: var(--muted); background: transparent;
    border: 1px solid var(--line);
  }
  .tour-tabs button:hover { color: var(--ink); }
  .tour-tabs button[aria-selected="true"] {
    color: var(--tone, var(--accent)); border-color: var(--tone, var(--accent));
    background: color-mix(in srgb, var(--tone, var(--accent)) 12%, transparent);
  }
  .tour-tabs button:focus-visible { outline: 2px solid var(--tone, var(--accent)); outline-offset: 2px; }
  .tour-tabs button::after {
    content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
    background: var(--tone, var(--accent));
  }
  .tour.playing .tour-tabs button[aria-selected="true"]::after {
    animation: tour-fill 6s linear forwards;
  }
  .tour.playing:hover .tour-tabs button::after,
  .tour.playing:focus-within .tour-tabs button::after { animation-play-state: paused; }
  @keyframes tour-fill { to { width: 100%; } }

  /* Every slide sits in the same grid cell, so switching is a cross-fade
     and the box keeps the height of the tallest caption rather than
     jumping between them. */
  /* minmax(0, 1fr), not the default auto: a grid item is otherwise as
     wide as its widest content, and that is a 1600px screenshot. */
  .tour-slides { display: grid; grid-template-columns: minmax(0, 1fr); }
  .slide { grid-area: 1 / 1; min-width: 0; margin: 0; transition: opacity .35s ease, visibility .35s; }
  .slide.out { opacity: 0; visibility: hidden; }
  .slide img { width: 100%; height: auto; border-radius: 12px; display: block; }
  .slide figcaption { color: var(--muted); font-size: .95rem; margin-top: 12px; }
  @media (prefers-reduced-motion: reduce) { .slide { transition: none; } }

  /* Five long bullets read as a wall; the same words in cards give the eye
     somewhere to land and let each one carry its own heading. */
  .features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 20px 0 0; }
  .feature {
    --tone: var(--accent);
    /* The hue is strongest at the top corner and gone by two thirds of the
       way down, so it colours the card without competing with the words. */
    background: linear-gradient(165deg, color-mix(in srgb, var(--tone) 13%, var(--panel)), var(--panel) 70%);
    border: 1px solid color-mix(in srgb, var(--tone) 22%, var(--line));
    border-radius: 14px; padding: 22px 22px 20px;
  }
  .feature .icon {
    width: 30px; height: 30px; margin-bottom: 14px; display: block;
    fill: none; stroke: var(--tone); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  }
  .feature h3 { margin: 0 0 6px; font-size: 1.05rem; letter-spacing: -.01em; }
  .blue { --tone: var(--blue); }
  .green { --tone: var(--green); }
  .red { --tone: var(--red); }
  .purple { --tone: var(--purple); }
  .amber { --tone: var(--amber); }
  .teal { --tone: var(--teal); }
  .pink { --tone: var(--pink); }
  .indigo { --tone: var(--indigo); }
  .feature p { margin: 0; color: var(--muted); font-size: .95rem; }

  /* Privacy reads as promises rather than explanation. */
  .claims { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 18px 0 20px; }
  .claim { border-left: 3px solid var(--tone, var(--accent)); padding: 2px 0 2px 12px; font-size: .95rem; }
  .claim strong { display: block; }
  .claim span { color: var(--muted); }

  footer { max-width: 760px; margin: 0 auto; padding-block: 28px 56px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
  footer a { color: inherit; }
  code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

  /* The chooser table compares prose, not ticks, so it drops the narrow
     centred columns the pricing table wants. */
  table.wide th:not(:first-child), table.wide td:not(:first-child) {
     text-align: left; width: auto; }
  table.wide th:first-child, table.wide td:first-child { width: 9rem; }

  /* Each provider is a self-contained recipe. The panel says where one set
     of steps stops and the next begins, for somebody who only needs one. */
  .provider { background: var(--panel); border: 1px solid var(--line);
     border-radius: 12px; padding: 4px 24px 20px; margin: 20px 0; }
  .provider h2 { margin-top: 28px; }
  @media (max-width: 560px) { .provider { padding: 4px 18px 16px; } }

  ol { padding-left: 1.3rem; }
  ol li { margin-bottom: 10px; }

  /* The one thing people get wrong often enough to be worth interrupting
     them for. */
  .warn { border-left: 3px solid var(--accent); background: var(--panel);
     padding: 14px 16px; border-radius: 0 10px 10px 0; margin: 20px 0; }
  .warn p { margin: 0; }
  .warn p + p { margin-top: 10px; }

  /* The guide's sub-headings and its list of sections. */
  main > h3 { font-size: 1.05rem; margin: 32px 0 10px; }
  .toc { background: var(--panel); border: 1px solid var(--line);
     border-radius: 12px; padding: 14px 20px; margin: 28px 0 8px; }
  .toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
  .toc li { margin: 2px 0; break-inside: avoid; }
  .toc a { color: var(--accent); text-decoration: none; }
  .toc a:hover { text-decoration: underline; }
  @media (max-width: 560px) { .toc ol { columns: 1; } }
  /* Screenshots in the guide, each linking to the full-size image. */
  .shot { margin: 20px 0 28px; }
  .shot img { display: block; width: 100%; height: auto; border-radius: 10px;
     border: 1px solid var(--line); }
  .shot.narrow { max-width: 480px; }
  .shot figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }
  table.shortcuts th:first-child, table.shortcuts td:first-child { width: 11rem; }

  .key { background: var(--panel); border: 1px solid var(--line);
     border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

  /* The top bar. Every page had its links only in the footer, which on the
     home page meant scrolling past everything to find them. Sticky, because
     the API key page is long and the way out should not depend on where you
     are in it. */
  .topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; flex-wrap: wrap; gap: 8px 20px;
    align-items: baseline; justify-content: space-between;
    max-width: 760px; margin: 0 auto;
    padding: 14px 0 12px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    background: color-mix(in srgb, var(--ground) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { font-weight: 700; letter-spacing: -.01em; font-size: 1.05rem; }
  /* Says so up front: payments and email are not finished, and somebody
     who downloads today should know they are early. */
  .beta {
    display: inline-block; vertical-align: 2px; margin-left: 6px;
    padding: 1px 8px; border-radius: 999px;
    background: var(--beta); color: var(--beta-ink);
    font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  }
  .topbar a { color: var(--ink); text-decoration: none; }
  .topbar .links { display: flex; flex-wrap: wrap; gap: 18px; font-size: .95rem; }
  .topbar .links a { color: var(--muted); }
  .topbar .links a:hover { color: var(--ink); }
  /* The page you are on is named but not a link to itself. */
  .topbar .links [aria-current="page"] { color: var(--ink); font-weight: 600; }

  /* The bar already supplies the gap the page used to open with. */
  .topbar + main { padding-top: 40px; }
