/*
  ReFlow website styles. Colours are the brand tokens from docs/Roadmap.md section 8 (Electric Blue,
  Deep Navy, Cyan, Light Grey); change them here only. Dark mode follows the visitor's system setting.
  Layout: a navy title-block hero, the issue pipeline as the spine of the page, one drawing-sheet
  card per module, then plans and contact.
*/

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-variable.woff2") format("woff2-variations"), url("fonts/archivo-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("fonts/ibm-plex-sans-600.woff2") format("woff2"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --bg: #F3F6FA;          /* Light Grey: page */
  --surface: #FFFFFF;     /* cards */
  --ink: #10294A;         /* Deep Navy: text */
  --muted: #475B78;       /* navy-biased secondary text */
  --line: #D5DEEA;        /* hairlines */
  --blue: #0875E1;        /* Electric Blue: links, focus */
  --button: #0875E1;      /* Electric Blue: buttons (white label) */
  --button-hover: #0663BF;
  --cyan: #12B9E9;        /* Cyan: fills and icons only, never body text on light */
  --band: #10294A;        /* hero and closing bands */
  --band-ink: #FFFFFF;
  --band-muted: #A9BCD6;
  --panel: #0D2240;       /* the example window in the hero */
  --panel-line: #23406A;
  --chip: #E8EFF8;
  --red: #C8372D;
  --green: #1E8A4C;
  --f-display: "Archivo", "Segoe UI", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", Consolas, ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1628; --surface: #10233F; --ink: #E6EDF6; --muted: #9FB2CB; --line: #24395A;
    --blue: #5AA6F2; --cyan: #12B9E9; --band: #061020; --band-muted: #9FB2CB;
    --chip: #172E50; --red: #F0756B; --green: #4CC783;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.6; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; line-height: 1.1; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-stretch: 112%; font-weight: 750; letter-spacing: -0.01em; }
h3 { font-size: 1.35rem; font-stretch: 110%; font-weight: 700; }
p { margin: 0; }
a { color: var(--blue); }
.label { font-family: var(--f-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.mono { font-family: var(--f-mono); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 12px; z-index: 20; }
.skip:focus { left: max(16px, env(safe-area-inset-left, 0px)); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--band); color: var(--band-ink); border-bottom: 1px solid rgba(255, 255, 255, 0.08); padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; color: inherit; text-decoration: none; }
.brand b { font-family: var(--f-display); font-stretch: 125%; font-weight: 800; font-size: 1.2rem; letter-spacing: 0.02em; }
.brand span { font-size: 0.8rem; color: var(--band-muted); }
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.nav a { color: var(--band-ink); text-decoration: none; font-size: 0.88rem; font-weight: 500; }
.nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Hero */
.hero { background: var(--band); color: var(--band-ink); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; padding-block: 64px 72px; align-items: center; }
.hero .label { color: var(--band-muted); }
.hero h1 { margin-top: 14px; font-size: clamp(2.3rem, 5.6vw, 4.1rem); font-stretch: 118%; font-weight: 800; letter-spacing: -0.015em; }
.hero h1 em { font-style: normal; color: var(--cyan); }
.hero .lede { margin-top: 20px; font-size: 1.15rem; color: var(--band-muted); max-width: 34em; }
.hero .facts { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--f-mono); font-size: 0.82rem; color: var(--band-muted); }
.hero .facts li::before { content: "\25AA\00A0"; color: var(--cyan); }
.cta { display: inline-block; margin-top: 32px; background: var(--button); color: #FFFFFF; font-weight: 700; text-decoration: none; padding: 12px 22px; border-radius: 6px; font-size: 0.95rem; border: 0; cursor: pointer; font-family: inherit; }
.cta:hover { background: var(--button-hover); }

/* Hero illustration: ReDelta's change check */
.sheetlist { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 10px; font-family: var(--f-mono); font-size: 0.8rem; color: #DCE6F3; overflow: hidden; }
.sheetlist header { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--panel-line); color: #A9BCD6; flex-wrap: wrap; }
.sheetlist header b { color: #FFFFFF; font-weight: 500; }
.row { display: grid; grid-template-columns: 4.2em minmax(0, 1fr) auto; gap: 12px; padding: 9px 16px; border-bottom: 1px solid #1A345A; align-items: center; }
.row:last-of-type { border-bottom: 0; }
.row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #A9BCD6; }
.tag { font-size: 0.7rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tag.chg { background: rgba(18, 185, 233, 0.18); color: #7FDBF7; }
.tag.rev { background: rgba(240, 165, 60, 0.2); color: #F6C27A; }
.tag.new { background: rgba(255, 255, 255, 0.1); color: #DCE6F3; }
.tag.ok { color: #7F95B3; }
.sheetlist footer { padding: 12px 16px; border-top: 1px solid var(--panel-line); color: #A9BCD6; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sheetlist footer i { font-style: normal; background: #0875E1; color: #FFFFFF; padding: 4px 10px; border-radius: 4px; }
.caption { margin-top: 10px; font-size: 0.75rem; color: var(--band-muted); font-family: var(--f-mono); }

section { padding-block: 80px 0; scroll-margin-top: 56px; }
.intro { display: grid; gap: 14px; max-width: 46em; }
.intro p { color: var(--muted); font-size: 1.08rem; }

/* The issue pipeline: a real sequence, so the steps are numbered */
.pipe { margin: 40px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.step { position: relative; padding: 0 16px 0 0; }
.step .n { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 2px solid var(--blue); display: grid; place-items: center; font-family: var(--f-mono); font-weight: 500; color: var(--blue); background: var(--bg); position: relative; z-index: 1; }
.step::before { content: ""; position: absolute; top: 1.1rem; left: 2.2rem; right: 0; height: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step h3 { margin-top: 16px; font-size: 1.05rem; }
.step p { margin-top: 6px; font-size: 0.92rem; color: var(--muted); }
.mods { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.mod { font-family: var(--f-mono); font-size: 0.75rem; font-weight: 500; padding: 3px 8px; border-radius: 4px; background: var(--chip); color: var(--ink); text-decoration: none; }
.mod:hover { outline: 1px solid var(--blue); }
.around { margin-top: 36px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.around > div { border: 1px dashed var(--line); border-radius: 8px; padding: 16px 18px; }
.around p { margin-top: 6px; font-size: 0.92rem; color: var(--muted); }
.around b { font-family: var(--f-mono); font-weight: 500; }

/* Module cards: each a small drawing sheet with a title block along the bottom */
.grid { margin-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; display: flex; flex-direction: column; min-width: 0; scroll-margin-top: 72px; }
.card.lead { border-color: var(--blue); }
.card .body { padding: 22px 22px 18px; display: grid; gap: 12px; flex: 1; align-content: start; }
.card .what { font-size: 0.98rem; }
.card ul { margin: 0; padding-left: 1.1em; display: grid; gap: 5px; color: var(--muted); font-size: 0.9rem; }
.card ul li::marker { color: var(--cyan); }
.tb { display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--line); font-size: 0.78rem; }
.tb > div { padding: 9px 14px; min-width: 0; }
.tb > div + div { border-left: 1px solid var(--line); text-align: right; }
.tb .k { display: block; font-family: var(--f-mono); font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tb .v { font-weight: 600; }
.tb .with { display: flex; flex-wrap: wrap; gap: 0 8px; }
.tb .with a { font-family: var(--f-mono); font-weight: 500; font-size: 0.75rem; color: var(--blue); text-decoration: none; white-space: nowrap; }
.tb .with a:hover { text-decoration: underline; }

/* ReDiff's colours */
.legend { display: flex; gap: 14px; font-size: 0.82rem; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.legend .removed { background: var(--red); }
.legend .added { background: var(--green); }
.legend .same { background: var(--muted); }

/* What it will and won't do */
.trust { margin-top: 40px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.trust > div { padding: 18px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 9em minmax(0, 1fr); gap: 16px; }
.trust b { font-family: var(--f-mono); font-weight: 500; font-size: 0.85rem; }
.trust p { color: var(--muted); font-size: 0.95rem; }

/* Plans */
.plans { margin-top: 40px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.92rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
thead th { font-family: var(--f-mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
td:not(:first-child), th:not(:first-child) { text-align: center; }
tbody tr:last-child td { border-bottom: 0; }
td .yes { color: var(--blue); font-weight: 700; }
td .no { color: var(--muted); }
.note { margin-top: 12px; font-size: 0.85rem; color: var(--muted); }

/* Pricing page */
.hero-short .wrap { grid-template-columns: minmax(0, 1fr); padding-block: 56px 60px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.price-controls { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; }
.segmented { margin: 0; padding: 0; border: 0; min-width: 0; }
.segmented legend { padding: 0; margin-bottom: 8px; font-family: var(--f-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.segmented label { position: relative; display: inline-block; margin: 0 -1px 4px 0; padding: 8px 16px; border: 1px solid var(--line); background: var(--surface); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.segmented label:first-of-type { border-radius: 6px 0 0 6px; }
.segmented label:last-of-type { border-radius: 0 6px 6px 0; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--button); border-color: var(--button); color: #FFFFFF; z-index: 1; }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; z-index: 2; }
.price-status { margin-top: 20px; font-size: 0.88rem; color: var(--muted); min-height: 1.6em; }
.price-plans { margin-top: 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 24px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.price-card.featured { border: 2px solid var(--blue); padding: 23px; }
.price-card h3 { font-size: 1.5rem; }
.price { display: grid; gap: 2px; }
.price b { font-family: var(--f-display); font-size: 2rem; font-stretch: 112%; font-weight: 800; line-height: 1.15; }
.price b.quiet { font-size: 1.3rem; color: var(--muted); }
.price span { font-size: 0.82rem; color: var(--muted); }
.price-card .summary { color: var(--muted); font-size: 0.95rem; }
.included { margin: 4px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; display: grid; gap: 6px; font-size: 0.9rem; }
.included li::before { content: "\2713\00A0\00A0"; color: var(--blue); font-weight: 700; }
.price-extras { margin-top: 56px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.price-extras .plans { margin-top: 16px; }
.price-extras table { min-width: 480px; }
.discounts { margin: 16px 0 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.discounts li { padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.discounts li:last-child { border-bottom: 0; }

/* Closing band and contact */
.closing { margin-top: 80px; background: var(--band); color: var(--band-ink); scroll-margin-top: 56px; }
.closing .wrap { padding-block: 56px; display: flex; justify-content: space-between; align-items: center; gap: 24px 48px; flex-wrap: wrap; }
.closing .text { max-width: 36em; }
.closing p { color: var(--band-muted); margin-top: 8px; }
.closing .cta { margin-top: 0; }
.contact { display: grid; gap: 10px; min-width: 0; }
.contact .label { color: var(--band-muted); }
.address { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.address a { color: #FFFFFF; font-family: var(--f-mono); font-size: 1.05rem; word-break: break-all; }
.copy { font: inherit; font-size: 0.85rem; font-weight: 600; background: transparent; color: #FFFFFF; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.copy:hover { border-color: #FFFFFF; }
.status { font-size: 0.82rem; color: var(--band-muted); min-height: 1.3em; }

footer.foot .wrap { padding-block: 24px 40px; font-size: 0.8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Not found page */
.missing { padding-block: 96px; display: grid; gap: 16px; max-width: 40em; }
.missing p { color: var(--muted); }

@media (max-width: 920px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-block: 44px 52px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipe { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .step { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0 14px; padding: 0; }
  .step .n { grid-row: span 3; }
  .step h3 { margin-top: 4px; }
  .step::before { top: 2.2rem; bottom: -22px; left: 1.05rem; right: auto; width: 2px; height: auto; }
  .around, .trust, .price-extras { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .trust > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  section { padding-block: 56px 0; }
  .nav { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
