/* Shared styles for every page. Brand tokens are at the top: swap them when the real brand is ready. */
  /* ---------- Brand tokens: swap these when the real brand is ready ---------- */
  :root {
    --paper: #F3EDE2;       /* page */
    --paper-deep: #E9E0CF;  /* alternate sections */
    --card: #FFFCF6;        /* card stock */
    --ink: #1D1B18;
    --ink-soft: #5A544B;
    --line: #D8CCB8;
    --red: #C2412A;         /* airmail red, postmark */
    --blue: #24418F;        /* airmail blue */
    --navy: #1A2C5E;        /* deep airmail blue, for large blue areas (the best-value plan card) */
    --olive: #5F6E3C;
    --sun: #E8A13A;
    --todo: #FFF1B8;       /* highlights placeholders still to fill in */

    --serif: "Fraunces", Georgia, serif;
    --sans: "Instrument Sans", system-ui, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, monospace;
    --hand: "Reenie Beanie", cursive;

    --airmail: repeating-linear-gradient(-45deg,
      var(--red) 0 14px, var(--card) 14px 22px, var(--blue) 22px 36px, var(--card) 36px 44px);
    color-scheme: light;
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; scroll-padding-top: 5rem; overflow-x: clip; }
  body {
    margin: 0; background: var(--paper); color: var(--ink); overflow-x: clip;
    font: 400 1.0625rem/1.65 var(--sans);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  }
  /* paper grain */
  body::before {
    content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .35; mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4  0 0 0 0 .35  0 0 0 0 .3  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  }
  a { color: inherit; }
  img, svg { display: block; }
  :focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
  .wrap { width: min(74rem, 100% - 2.5rem); margin-inline: auto; }
  @media (max-width: 40rem) { .wrap { width: calc(100% - 2rem); } }
  .visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; font-optical-sizing: auto; }
  h1 em, h2 em { font-style: italic; color: var(--red); font-weight: 350; }
  .kicker {
    font: 500 .75rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--red);
    margin: 0 0 1.1rem; display: flex; align-items: center; gap: .6rem;
  }

  /* ---------- Buttons ---------- */
  .btn {
    --bg: var(--ink); --fg: var(--card);
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    background: var(--bg); color: var(--fg); text-decoration: none; border: 1.5px solid var(--bg);
    font: 600 .975rem/1 var(--sans); padding: 1rem 1.4rem; border-radius: 999px; cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
  }
  .btn:hover { --bg: var(--red); transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(29,27,24,.6); }
  .btn svg { width: 1rem; height: 1rem; transition: transform .2s ease; }
  .btn:hover svg { transform: translateX(3px); }
  .btn-ghost { --bg: transparent; --fg: var(--ink); border-color: var(--ink); }
  .btn-ghost:hover { --bg: var(--ink); --fg: var(--card); }
  .btn-red { --bg: var(--red); }
  .btn-red:hover { --bg: var(--ink); }
  .btn-small { padding: .7rem 1.1rem; font-size: .9rem; white-space: nowrap; }

  /* ---------- Header ---------- */
  .airmail-rule { height: 8px; background: var(--airmail); }
  /* The airmail strip lives in the header, so it stays in view while scrolling */
  .site-header::before { content: ""; display: block; height: 8px; background: var(--airmail); }
  .site-header {
    position: sticky; top: 0; z-index: 50; transition: box-shadow .3s ease;
    background: rgba(243,237,226,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .site-header.scrolled { box-shadow: 0 1px 0 var(--line); }
  .nav { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1.1rem; }
  /* Wordmark: "Roaming" is the hero; THE and POSTMAN sit above and below like a postmark */
  .wordmark { display: inline-grid; justify-items: start; line-height: 1; text-decoration: none; color: var(--ink); flex: none; }
  .wm-the, .wm-post { font: 500 .6rem/1 var(--mono); letter-spacing: .34em; text-transform: uppercase; }
  .wm-roam { font: italic 420 2rem/.9 var(--serif); letter-spacing: -.025em; color: var(--red); margin: .12rem 0 .16rem -.04em; }
  .wm-post { justify-self: end; margin-right: -.34em; }
  .wordmark:hover .wm-roam { color: var(--ink); }
  .nav nav { display: flex; gap: clamp(1rem, 2.2vw, 2rem); margin-left: auto; }
  .nav nav a { font-weight: 500; font-size: .95rem; text-decoration: none; position: relative; white-space: nowrap; }
  .nav nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
  .nav nav a:hover::after { transform: scaleX(1); }
  .nav-checkin { color: var(--red); }
  .nav-short { display: none; }
  .nav nav a[aria-current="page"]::after { transform: scaleX(1); }
  @media (max-width: 52rem) {
    .nav { gap: .9rem; }
    .nav nav { gap: 0; }
    .nav nav a:not(.nav-checkin) { display: none; }
    .nav nav a.nav-checkin { font-size: .88rem; white-space: nowrap; }
    .nav-long { display: none; }
    .nav-short { display: inline; }
  }
  @media (max-width: 23.5rem) {
    .nav { gap: .6rem; }
    .wm-roam { font-size: 1.5rem; }
    .wm-the, .wm-post { font-size: .52rem; }
    .nav nav a.nav-checkin { font-size: .74rem; }
    .nav .btn-small { padding: .5rem .7rem; font-size: .76rem; }
  }

  /* Footer */
  .site-footer { background: var(--ink); color: var(--paper); position: relative; }
  .site-footer::before { content: ""; display: block; height: 10px; background: var(--airmail); }
  .foot-top { padding: clamp(4rem, 8vw, 6.5rem) 0 3rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; align-items: end; }
  .foot-top h2 { font-size: clamp(2.4rem, 5.5vw, 4.6rem); color: var(--card); }
  .foot-top h2 em { color: var(--sun); }
  .foot-cta .foot-fine { margin: .4rem 0 0; max-width: 28rem; font-size: .7rem; line-height: 1.55; color: rgba(243,237,226,.6); }
  .foot-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
  .foot-cta p { margin: 0; color: rgba(243,237,226,.7); }
  .foot-cta .btn { --bg: var(--card); --fg: var(--ink); }
  .foot-bottom { border-top: 1px solid rgba(243,237,226,.15); padding: 1.6rem 0 2.2rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; font-size: .9rem; color: rgba(243,237,226,.65); }
  .foot-bottom a { text-decoration: none; }
  .foot-bottom a:hover { color: var(--card); text-decoration: underline; }
  .foot-links { display: flex; flex-wrap: wrap; gap: 1.75rem; }
  @media (max-width: 52rem) { .foot-top { grid-template-columns: 1fr; } }


  [hidden] { display: none !important; }
  .btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

  /* ---------- Simple header and footer for inner pages ---------- */
  .mini-foot { border-top: 1px solid var(--line); padding: 1.5rem 0 2.5rem; display: flex; flex-wrap: wrap; gap: 1rem 1.75rem; font-size: .88rem; color: var(--ink-soft); }
  .mini-foot a { text-decoration: none; }
  .mini-foot a:hover { text-decoration: underline; color: var(--ink); }

  /* ---------- Legal pages (terms, privacy) ---------- */
  .legal-hero { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); border-bottom: 1px solid var(--line); }
  .legal-hero h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1; letter-spacing: -.025em; font-weight: 380; margin-bottom: 1rem; }
  .legal-hero h1 em { font-style: italic; color: var(--red); font-weight: 350; }
  .legal-hero .updated { font: 500 .75rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
  .legal-hero .intro { font: 400 clamp(1.15rem, 2vw, 1.35rem)/1.5 var(--serif); margin: 1.5rem 0 0; }
  .draft-note { display: inline-flex; gap: .55rem; align-items: center; margin-top: 1.5rem; font-size: .88rem; color: var(--ink-soft); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; }
  .draft-note i { width: .9rem; height: .9rem; border-radius: 3px; background: var(--todo); border: 1px solid #E6CF6A; flex: none; }

  .legal { display: grid; grid-template-columns: 15rem 1fr; gap: clamp(2rem, 6vw, 5rem); padding: clamp(2.5rem, 5vw, 4rem) 0 5rem; align-items: start; }
  .toc { position: sticky; top: 6rem; }
  .toc p { font: 500 .7rem/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 1rem; }
  .toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .1rem; border-left: 1px solid var(--line); }
  .toc a { display: block; text-decoration: none; font-size: .9rem; color: var(--ink-soft); padding: .35rem 0 .35rem 1rem; margin-left: -1px; border-left: 2px solid transparent; line-height: 1.35; }
  .toc a:hover { color: var(--ink); }
  .toc a.active { color: var(--red); border-left-color: var(--red); }
  .legal-body { max-width: 42rem; }
  .legal-body section { padding-bottom: 2rem; margin-bottom: 2rem; border-bottom: 1px dashed var(--line); scroll-margin-top: 6rem; }
  .legal-body section:last-child { border: 0; }
  .legal-body h2 { font-size: clamp(1.45rem, 2.4vw, 1.8rem); line-height: 1.2; letter-spacing: -.01em; font-weight: 420; margin-bottom: 1rem; display: flex; gap: .85rem; align-items: baseline; }
  .legal-body h2 .n { font: 500 .8rem/1 var(--mono); color: var(--red); letter-spacing: .08em; flex: none; }
  .legal-body p, .legal-body li { color: #3B3731; }
  .legal-body p { margin: 0 0 1rem; }
  .legal-body ul { padding-left: 0; list-style: none; margin: 0 0 1rem; display: grid; gap: .55rem; }
  .legal-body li { padding-left: 1.4rem; position: relative; }
  .legal-body li::before { content: ""; position: absolute; left: .2rem; top: .7em; width: .45rem; height: .45rem; border-radius: 50%; border: 1.5px solid var(--red); }
  .legal-body strong { color: var(--ink); font-weight: 600; }
  .legal-body .lead-in { font-weight: 600; color: var(--ink); margin: 1.4rem 0 .6rem; }
  .todo { background: var(--todo); padding: 0 .25em; border-radius: 2px; color: var(--ink); }
  @media (max-width: 56rem) { .legal { grid-template-columns: 1fr; } .toc { position: static; } .toc ol { grid-template-columns: 1fr 1fr; column-gap: 1rem; } }
  @media (max-width: 30rem) { .toc ol { grid-template-columns: 1fr; } }

/* Perforated stamp edge: the hero's mini stamp, the plan cards, the last-month stamp and the postmark album */
.perf {
  --r: 5px; --c: var(--card);
  padding: calc(var(--r) * 2);
  background:
    radial-gradient(var(--r), #0000 97%, var(--c)) round calc(var(--r) * -1.5) calc(var(--r) * -1.5) / calc(var(--r) * 3) calc(var(--r) * 3),
    linear-gradient(var(--c) 0 0) no-repeat 50% / calc(100% - var(--r) * 3) calc(100% - var(--r) * 3);
  filter: drop-shadow(0 1px 1px rgba(29,27,24,.12));
}
