/* Runo — landing and pricing.
 *
 * These are the only pages a stranger sees before deciding anything, so they
 * get room to breathe: wider measure, larger type, more vertical space than
 * the app.
 *
 * The hero backdrop is CSS and SVG rather than a photograph. Not a
 * compromise — it is the better answer here: no third-party request (a CDN
 * is forbidden by the privacy posture and a self-hosted photo is megabytes
 * on a phone), it fits any viewport without art direction, it follows the
 * theme, and it can stop moving when asked. To swap in a real image later,
 * override `background` on `.hero-scene` and delete the three glows.
 */

@layer pages {
  .marketing .topbar-public { background: transparent; border-bottom: none; }
  .marketing #page { min-height: 60vh; }

  /* --- hero ------------------------------------------------------------ */
  .hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: min(46rem, 88svh);
    padding: var(--space-8) var(--space-4) var(--space-7);
    overflow: hidden;
    /* The topbar is transparent over the hero, so pull the scene up behind it. */
    margin-top: calc(-1 * var(--topbar-h));
    padding-top: calc(var(--topbar-h) + var(--space-8));
  }

  .hero-scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: var(--surface-sunken);
  }

  /* Three slow, overlapping ember pools. Different sizes, speeds and
     directions, and prime-ish durations so they do not visibly resynchronise
     — the tell that gives away a looping CSS background. */
  .hero-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.5;
    will-change: transform;
  }
  .hero-glow-1 {
    width: 46vmax; height: 46vmax;
    top: -14vmax; left: -10vmax;
    background: radial-gradient(circle, var(--ember-400), transparent 68%);
    animation: drift-1 31s var(--ease) infinite alternate;
  }
  .hero-glow-2 {
    width: 38vmax; height: 38vmax;
    bottom: -12vmax; right: -8vmax;
    background: radial-gradient(circle, var(--ember-600), transparent 66%);
    opacity: 0.45;
    animation: drift-2 43s var(--ease) infinite alternate;
  }
  .hero-glow-3 {
    width: 30vmax; height: 30vmax;
    top: 28%; left: 42%;
    background: radial-gradient(circle, var(--ember-300), transparent 70%);
    opacity: 0.22;
    animation: drift-3 37s var(--ease) infinite alternate;
  }

  @keyframes drift-1 {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(12vmax, 8vmax, 0) scale(1.18); }
  }
  @keyframes drift-2 {
    from { transform: translate3d(0, 0, 0) scale(1.1); }
    to   { transform: translate3d(-14vmax, -6vmax, 0) scale(0.92); }
  }
  @keyframes drift-3 {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(-9vmax, 11vmax, 0); }
  }

  /* Fractal noise over the gradients. Without it large soft gradients band
     visibly on 8-bit displays, which reads as cheap. Inline SVG data URI, so
     still no network request. */
  .hero-grain {
    position: absolute;
    inset: -50%;
    opacity: 0.22;
    mix-blend-mode: overlay;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  }

  /* Keeps the text legible over whatever the glows are doing underneath. */
  .hero-vignette {
    position: absolute;
    inset: 0;
    background:
      radial-gradient(120% 80% at 50% 40%, transparent 30%,
                      color-mix(in oklab, var(--bg) 82%, transparent) 100%),
      linear-gradient(to bottom, transparent 55%, var(--bg) 100%);
  }

  .hero-inner {
    position: relative;
    z-index: 1;
    max-width: 44rem;
    text-align: center;
  }

  .hero-eyebrow {
    margin-bottom: var(--space-4);
    color: var(--text-muted);
    font-size: var(--text-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .hero-eyebrow em { font-style: italic; text-transform: none; letter-spacing: 0; }

  .hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.25rem, 7vw, 4.25rem);
    font-weight: 600;
    line-height: 1.05;
    letter-spacing: -0.03em;
    text-wrap: balance;
  }

  .hero-lede {
    max-width: 36rem;
    margin: var(--space-5) auto 0;
    color: var(--text-muted);
    font-size: clamp(var(--text-md), 2.2vw, var(--text-lg));
    line-height: var(--leading-prose);
    text-wrap: pretty;
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
  }

  .btn-lg {
    min-height: 3rem;
    padding-inline: var(--space-5);
    font-size: var(--text-md);
  }

  .hero-note {
    margin-top: var(--space-4);
    color: var(--text-faint);
    font-size: var(--text-sm);
  }

  /* --- sections -------------------------------------------------------- */
  .section { padding: var(--space-8) var(--space-4); }
  .section-tight { padding-top: var(--space-6); }
  .section-alt { background: var(--surface); }
  .section-cta { padding-bottom: var(--space-8); text-align: center; }

  .section-inner { max-width: var(--content-max); margin-inline: auto; }
  .cta-inner { max-width: 40rem; }

  .section-eyebrow {
    color: var(--accent);
    font-size: var(--text-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
  }

  .section-title {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
  }

  .section-body {
    max-width: var(--prose-max);
    color: var(--text-muted);
    line-height: var(--leading-prose);
    margin-bottom: var(--space-3);
  }
  .section-cta .section-body,
  .cta-inner .section-body { margin-inline: auto; }

  /* --- steps ----------------------------------------------------------- */
  .steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--space-5);
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: step;
  }
  .step {
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }
  .step-num {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    margin-bottom: var(--space-3);
    background: var(--accent-subtle);
    color: var(--accent);
    border-radius: var(--radius-full);
    font-family: var(--font-serif);
    font-weight: 700;
  }
  .step-title { font-size: var(--text-md); margin-bottom: var(--space-2); }
  .step-body { color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-prose); }

  /* --- honest cards ---------------------------------------------------- */
  .honest-grid,
  .plan-notes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: var(--space-4);
  }
  .plan-notes { margin-top: var(--space-7); }
  .honest-card {
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }
  .honest-title { font-size: var(--text-md); margin-bottom: var(--space-2); }
  .honest-body { color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-prose); }

  /* --- plans ----------------------------------------------------------- */
  .plans-head { max-width: var(--prose-max); margin-bottom: var(--space-5); }

  .plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-5);
    align-items: start;
  }

  .plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }
  .plan-featured {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
  }
  .plan-chosen { border-color: var(--ok); }

  .plan-flag {
    position: absolute;
    top: 0;
    left: var(--space-5);
    transform: translateY(-50%);
    padding: 0.15rem var(--space-3);
    background: var(--accent);
    color: var(--accent-contrast);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 600;
    white-space: nowrap;
  }

  .plan-name { font-family: var(--font-serif); font-size: var(--text-lg); }
  .plan-price { display: flex; align-items: baseline; gap: 0.15rem; margin: 0; }
  .plan-amount {
    font-family: var(--font-serif);
    font-size: 2.5rem;
    line-height: 1;
    letter-spacing: -0.02em;
  }
  .plan-period { color: var(--text-muted); font-size: var(--text-sm); }
  .plan-hours { color: var(--accent); font-size: var(--text-sm); font-weight: 600; margin: 0; }
  .plan-blurb { color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-prose); margin: 0; }

  .plan-features {
    display: grid;
    gap: var(--space-2);
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: var(--text-sm);
  }
  .plan-features li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2);
    align-items: start;
    color: var(--text-muted);
  }
  .plan-features svg { color: var(--ok); margin-top: 0.2em; }

  .plan-action { margin-top: auto; padding-top: var(--space-2); }

  /* --- footer ---------------------------------------------------------- */
  .site-footer {
    padding: var(--space-6) var(--space-4);
    border-top: 1px solid var(--border);
  }
  .site-footer-inner {
    max-width: var(--content-max);
    margin-inline: auto;
    display: grid;
    gap: var(--space-2);
    text-align: center;
  }
  .footer-sep { color: var(--text-faint); }

  /* --- motion ----------------------------------------------------------
   * base.css already forces every duration to 1ms under reduced-motion,
   * which would leave the glows frozen mid-drift at their `from` position.
   * Park them somewhere composed instead — a still image, deliberately.
   */
  @media (prefers-reduced-motion: reduce) {
    .hero-glow-1 { transform: translate3d(6vmax, 4vmax, 0) scale(1.1); }
    .hero-glow-2 { transform: translate3d(-7vmax, -3vmax, 0); }
    .hero-glow-3 { transform: translate3d(-4vmax, 5vmax, 0); }
  }

  @media (max-width: 48rem) {
    .hero { min-height: min(38rem, 82svh); padding-inline: var(--space-3); }
    .section { padding: var(--space-7) var(--space-3); }
    .hero-actions .btn { width: 100%; }
    /* Blur radius is the expensive part of this effect on a phone GPU. */
    .hero-glow { filter: blur(48px); }
  }

  /* --- audio sample ----------------------------------------------------
   * Native <audio> deliberately: accessible, keyboard-operable, no
   * JavaScript, and no third-party player embedding a visitor tracker into
   * a page whose whole pitch is that we are the careful option. */
  .section-sample { text-align: center; }
  .sample-inner { max-width: 46rem; }
  /* Before ui.js swaps it: the native control, so a page without
     JavaScript still plays. Sized to match the themed shell that replaces
     it so nothing jumps. */
  .sample-audio { width: 100%; }

  .sample-shell {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-5);
    padding: var(--space-4) var(--space-5);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
  }
  .sample-ui {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    width: 100%;
  }

  /* The app player's round accent button, at the same size, so the sample
     is recognisably the same product rather than a lookalike. */
  .sample-play {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 3rem;
    height: 3rem;
    padding: 0;
    background: var(--accent);
    color: var(--accent-contrast);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease);
  }
  .sample-play:hover { background: var(--accent-hover); }

  /* accent-color rather than a rebuilt track: the app player does the same,
     and a native range keeps keyboard and screen-reader behaviour for free. */
  .sample-seek {
    flex: 1;
    min-width: 0;
    height: 1.1rem;
    accent-color: var(--accent);
    background: transparent;
    cursor: pointer;
  }
  .sample-time {
    flex: none;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-variant-numeric: tabular-nums;
  }

  @media (max-width: 30rem) {
    .sample-shell { padding: var(--space-3) var(--space-4); gap: var(--space-3); }
    .sample-ui { gap: var(--space-3); }
  }
  .sample-note {
    margin-top: var(--space-2);
    color: var(--text-muted);
    font-size: var(--text-xs);
  }

  /* --- steps: what you do vs what Runo does --------------------------- */
  .section-body-lead { max-width: 46rem; margin-bottom: var(--space-6); }
  .step-aside {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
  }
  .step-who { color: var(--accent); font-weight: 650; }

  /* --- supported formats ------------------------------------------------
     Replaced the explainer cards that named two source sites (KAN-80).
     A list rather than a grid of cards: these are one word each, and cards
     gave five words the visual weight of five paragraphs.

     `.is-live` is the only distinction, and it is doing real work — it is
     what keeps the planned formats from reading as available. Do not style
     the two the same to make the row look tidier. */
  .format-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin: var(--space-6) 0;
    padding: 0;
    list-style: none;
  }
  .format-item {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    /* Dimmed, because they are not here yet. */
    opacity: 0.62;
  }
  .format-item.is-live {
    opacity: 1;
    border-color: var(--accent);
    background: var(--surface);
  }
  .format-name { font-weight: 650; }
  .format-note {
    color: var(--text-muted);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }
  .format-item.is-live .format-note { color: var(--accent); }
}

@layer pages {
  /* --- the legal documents (/terms, /privacy) ---------------------------
     Set for reading rather than for scanning: a narrower measure than the
     marketing sections, generous leading, and headings that are clearly
     subordinate to the page title. Nobody enjoys reading these; the least we
     can do is not make them hard. */
  .legal-doc {
    max-width: 44rem;
  }
  .legal-doc h2 {
    margin: var(--space-6) 0 var(--space-2);
    font-size: var(--text-md);
    font-weight: 650;
  }
  .legal-doc p,
  .legal-doc li {
    color: var(--text-muted);
    line-height: 1.75;
  }
  .legal-doc ul { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
  .legal-doc li { margin-bottom: var(--space-2); }
  .legal-doc strong { color: var(--text); }

  /* The "this is a draft" admission. Marked out because burying it would be
     the dishonest choice, not because anything is wrong. */
  .legal-draft {
    padding: var(--space-4);
    border: 1px solid var(--border-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
  }

  .legal-table {
    width: 100%;
    margin: var(--space-3) 0 var(--space-4);
    border-collapse: collapse;
    font-size: var(--text-sm);
  }
  .legal-table th,
  .legal-table td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
  }
  .legal-table th { color: var(--text); font-weight: 650; }
  .legal-table td { color: var(--text-muted); }
  /* The sub-processor table is the one wide thing on these pages. It scrolls
     inside itself rather than making the document scroll sideways. */
  .legal-doc :where(.legal-table) { display: table; }
  @media (max-width: 34rem) {
    .legal-doc { overflow-x: auto; }
  }

  .legal-meta {
    margin-top: var(--space-7);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border);
    font-size: var(--text-xs);
  }
}
