/*
 * Nabors Marketing — styles
 * Concept "Story bar": the site reads like a phone story. The header is a row
 * of segmented progress ticks, one per section, that fill as you scroll; the
 * hero fans out three phone screens; the footer is the "all caught up" screen.
 * Palette: night sky over Aurora (deep navy, aurora green, violet) on warm paper.
 *
 * 1. Fonts  2. Tokens  3. Base  4. Components (buttons, header, labels)
 * 5. Home sections  6. Footer  7. Legal pages and 404  8. Consent
 * 9. Utilities  10. Motion  11. Print
 */

/* ---------- 1. Fonts (self-hosted, latin subset) ---------- */
@font-face {
  font-family: 'Lexend Zetta';
  src: url('../fonts/lexend-zetta-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Scada';
  src: url('../fonts/scada-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Scada';
  src: url('../fonts/scada-400-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Scada';
  src: url('../fonts/scada-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. Tokens ---------- */
:root {
  --night: #0f1529;
  --night-line: #2b3666;
  --ink: #151a2c;
  --ink-soft: #4a5068;
  --paper: #f6f4ef;
  --white: #ffffff;
  --lilac: #ece8fb;
  --line: #d9d6e6;
  --field-line: #7d839b;
  --on-night: #f6f4ef;
  --on-night-soft: #b9bfd8;

  --aurora: #4fe0a5;
  --aurora-hover: #84edc2;
  --violet: #6d5be6;
  --violet-ink: #4b39c9;
  --error: #b3261e;
  --success: #0d7350;

  /* Service colors: a tint for the calendar tag, a strong edge for the key. */
  --plan: #6d5be6;   --plan-tint: #e7e2fe;
  --video: #e8613f;  --video-tint: #ffe3da;
  --gbp: #1f9e6b;    --gbp-tint: #d6f5e7;
  --ads: #d99a1e;    --ads-tint: #fcefd2;
  --report: #2d8fd0; --report-tint: #dcf0fc;

  --font-display: 'Lexend Zetta', 'Trebuchet MS', sans-serif;
  --font-body: 'Scada', 'Segoe UI', system-ui, sans-serif;

  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  --step-1: clamp(1.12rem, 1.06rem + 0.3vw, 1.28rem);
  --step-2: clamp(1.2rem, 1.05rem + 0.8vw, 1.7rem);
  --step-3: clamp(1.45rem, 1.15rem + 1.5vw, 2.4rem);
  --step-4: clamp(1.9rem, 1.2rem + 3.4vw, 4.1rem);

  --space-3: 1.5rem;
  --space-4: clamp(2rem, 1.6rem + 2vw, 3rem);
  --space-5: clamp(3.5rem, 2.6rem + 4vw, 6.5rem);

  --wrap: 75rem;
  --gutter: clamp(1rem, 0.6rem + 2.4vw, 2.5rem);
  --radius-s: 10px;
  --radius-m: 18px;
  --radius-l: 28px;
  --shadow: 0 18px 40px -22px rgba(15, 21, 41, 0.45);
  --head-h: 5.75rem;
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--head-h) + 1rem); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
}
body.nav-open { overflow: hidden; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; }
h3 { font-weight: 700; font-size: var(--step-1); }
p, li, dd { text-wrap: pretty; }
p { margin: 0 0 1em; }
a { color: var(--violet-ink); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--violet-ink); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
section[id] { scroll-margin-top: calc(var(--head-h) + 0.5rem); }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  padding: 0.75rem 1rem; border-radius: var(--radius-s);
  background: var(--aurora); color: var(--night); font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* ---------- 4. Components ---------- */

/* Buttons: one height everywhere. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0 1.4rem;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 1rem/1 var(--font-body); text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-glow { background: var(--aurora); color: var(--night); }
.btn-glow:hover { background: var(--aurora-hover); color: var(--night); }
.btn-line { border-color: currentColor; color: var(--on-night); background: transparent; }
.btn-line:hover { background: var(--on-night); border-color: var(--on-night); color: var(--night); }

/* Header: the story bar. */
.story-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--night); color: var(--on-night);
  box-shadow: 0 1px 0 var(--night-line);
}
.head-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-areas: "nav nav nav nav" "brand . phone cta";
  align-items: center;
  column-gap: 1.25rem;
  max-width: var(--wrap); margin-inline: auto;
  padding: 0.35rem var(--gutter) 0.6rem;
}
.brand {
  grid-area: brand;
  display: inline-flex; align-items: center; gap: 0.65rem;
  min-height: 44px; color: var(--on-night); text-decoration: none;
}
.brand:hover { color: var(--on-night); }
.brand-mark { width: 2.5rem; height: 2.5rem; flex: none; }
.brand-name { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; }
.brand-word { font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.8rem; color: var(--on-night-soft); letter-spacing: 0.04em; }
.head-phone {
  grid-area: phone;
  color: var(--on-night); font-weight: 700; text-decoration: none; white-space: nowrap;
  min-height: 44px; display: inline-flex; align-items: center;
}
.head-phone:hover { color: var(--aurora); }
.head-cta { grid-area: cta; }
.cta-short { display: none; }

.segments { grid-area: nav; }
.segment-list {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.4rem;
  margin: 0; padding: 0; list-style: none;
}
.segment {
  display: flex; flex-direction: column; gap: 0.45rem;
  min-height: 44px; padding: 0.55rem 0 0.3rem;
  color: var(--on-night-soft); text-decoration: none;
  font-size: 0.86rem; font-weight: 700; white-space: nowrap;
}
.segment:hover, .segment[aria-current] { color: var(--on-night); }
.segment:hover .tick { background: rgba(246, 244, 239, 0.42); }
.segments-extra { display: none; }

/* A tick is a story progress segment; --fill (0–1) is set by main.js. */
.tick {
  display: block; height: 4px; border-radius: 2px; overflow: hidden;
  background: rgba(246, 244, 239, 0.24);
  transition: background-color 0.2s;
}
.tick::after {
  content: ""; display: block; height: 100%;
  background: var(--aurora);
  transform: scaleX(var(--fill, 0)); transform-origin: left center;
}
.tick-bar { display: none; }

.seg-toggle {
  display: none;
  align-items: center; gap: 0.5rem;
  min-height: 44px; min-width: 44px; padding: 0 0.9rem;
  border: 2px solid var(--night-line); border-radius: 999px;
  background: transparent; color: var(--on-night);
  font: 700 0.95rem/1 var(--font-body); cursor: pointer;
}
.seg-toggle:hover { border-color: var(--on-night-soft); }
.seg-toggle svg { width: 1.3rem; height: 1.3rem; }
.story-head :focus-visible { outline-color: var(--aurora); }

@media (max-width: 1099px) {
  .head-phone { display: none; }
}

@media (max-width: 959px) {
  :root { --head-h: 4.6rem; }
  .tick-bar {
    display: flex; gap: 4px;
    max-width: var(--wrap); margin-inline: auto;
    padding: 0.55rem var(--gutter) 0;
  }
  .tick-bar .tick { flex: 1; height: 3px; }
  .head-row {
    display: flex; align-items: center; gap: 0.6rem;
    padding-block: 0.45rem 0.55rem;
  }
  .brand { margin-right: auto; }
  .seg-toggle { display: inline-flex; }
  .js .segments {
    display: none;
    position: fixed; inset: var(--head-h) 0 0 0; z-index: 40;
    overflow-y: auto;
    padding: 1.25rem var(--gutter) 2rem;
    background: var(--night);
  }
  .js .segments.is-open { display: block; }
  .segment-list { grid-template-columns: 1fr; gap: 0.25rem; max-width: 34rem; margin-inline: auto; }
  .segment { flex-direction: column-reverse; font-size: 1.2rem; padding: 0.8rem 0; color: var(--on-night); }
  .segments-extra {
    display: block; max-width: 34rem; margin: 1.5rem auto 0;
    color: var(--on-night-soft);
  }
  .segments-extra a { color: var(--aurora); font-weight: 700; }
}

@media (max-width: 520px) {
  .cta-long { display: none; }
  .cta-short { display: inline; }
  .head-cta { padding-inline: 1rem; }
  .toggle-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .seg-toggle { padding: 0; width: 44px; justify-content: center; }
}
@media (max-width: 360px) {
  .brand-mark { width: 2.2rem; height: 2.2rem; }
  .brand-word { font-size: 0.86rem; }
}

/* Section label: the six ticks, with this section's tick lit. */
.seg-label {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 0 0 1rem; font-size: var(--step--1); font-weight: 700; color: var(--ink-soft);
}
.seg-ticks { display: inline-flex; gap: 3px; }
.seg-ticks span { width: 1.1rem; height: 4px; border-radius: 2px; background: var(--line); }
.seg-ticks .on { background: var(--violet); }
.sec-head { max-width: 46rem; margin-bottom: var(--space-4); }
.sec-head h2 { font-size: var(--step-3); margin-bottom: 0.9rem; }
.sec-head > p:last-child { color: var(--ink-soft); font-size: var(--step-1); margin: 0; }
.sec-head-dark .seg-label { color: var(--on-night-soft); }
.sec-head-dark .seg-ticks span { background: var(--night-line); }
.sec-head-dark .seg-ticks .on { background: var(--aurora); }
.sec-head-dark > p:last-child { color: var(--on-night-soft); }

/* ---------- 5. Home sections ---------- */

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 15% 0%, rgba(109, 91, 230, 0.35), transparent 70%),
    radial-gradient(50rem 28rem at 90% 10%, rgba(79, 224, 165, 0.18), transparent 70%),
    var(--night);
  color: var(--on-night);
  padding: var(--space-4) 0 0;
}
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-copy { max-width: 58rem; }
.hero-title { font-size: var(--step-4); font-weight: 700; margin-bottom: 1.25rem; }
.hero-title span { display: inline-block; }
.hero-lead { max-width: 44rem; margin: 0 auto 1.75rem; font-size: var(--step-1); color: var(--on-night-soft); }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.hero-fan { width: 100%; max-width: 46rem; margin: var(--space-3) 0 0; }
.fan { width: 100%; height: auto; }
.fan-captions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem;
  padding: 0.75rem 0 var(--space-4);
  font-size: var(--step--1); color: var(--on-night-soft);
}
.fan-cap b { display: block; color: var(--on-night); font-size: 1rem; }
@media (max-width: 560px) {
  .fan-captions { grid-template-columns: 1fr; gap: 0.5rem; }
  .fan-cap b { display: inline; }
}

/* The month: service key + calendar */
.month { padding: var(--space-5) 0; }
.key {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem;
  margin: 0 0 var(--space-4); padding: 0; list-style: none;
}
.key-item { border-top: 5px solid; padding-top: 0.9rem; }
.key-item p { margin: 0; font-size: 0.97rem; color: var(--ink-soft); }
.key-name { margin-bottom: 0.5rem; }
.key-plan { border-color: var(--plan); }
.key-video { border-color: var(--video); }
.key-gbp { border-color: var(--gbp); }
.key-ads { border-color: var(--ads); }
.key-report { border-color: var(--report); }
@media (max-width: 1099px) { .key { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .key { grid-template-columns: 1fr; } }

.cal { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.6rem; }
.cal-week { display: grid; grid-template-columns: 6rem 1fr; gap: 0.6rem; align-items: stretch; }
.cal-week-title {
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-s); background: var(--night); color: var(--on-night);
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 600;
}
.cal-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.cal-day {
  display: flex; flex-direction: column; gap: 0.4rem;
  min-height: 6.5rem; padding: 0.55rem;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--white);
}
.cal-day.is-quiet { background: transparent; border-style: dashed; }
.cal-dow { font-size: 0.78rem; font-weight: 700; color: var(--ink-soft); }
.ev {
  display: block; padding: 0.35rem 0.5rem;
  border-left: 4px solid; border-radius: 6px;
  font-size: 0.88rem; font-weight: 700; line-height: 1.3;
}
.ev-plan { background: var(--plan-tint); border-color: var(--plan); }
.ev-video { background: var(--video-tint); border-color: var(--video); }
.ev-gbp { background: var(--gbp-tint); border-color: var(--gbp); }
.ev-ads { background: var(--ads-tint); border-color: var(--ads); }
.ev-report { background: var(--report-tint); border-color: var(--report); }
.ev-none { font-size: 0.88rem; color: var(--ink-soft); }
.cal-note { margin: 1rem 0 0; font-size: var(--step--1); color: var(--ink-soft); }
@media (max-width: 899px) {
  .cal { gap: 1.25rem; }
  .cal-week { grid-template-columns: 1fr; }
  .cal-week-title { justify-content: flex-start; padding: 0.55rem 0.9rem; }
  .cal-days { grid-template-columns: 1fr; gap: 0.4rem; }
  .cal-day { flex-direction: row; align-items: center; min-height: 0; padding: 0.45rem 0.55rem; }
  .cal-dow { width: 2.4rem; flex: none; }
  .ev { flex: 1; }
  .cal-day.is-quiet { display: none; }
}

/* Plans */
.plans { padding: var(--space-5) 0; background: var(--lilac); }
.plan-list-wrap {
  margin: 0; padding: 0 1.75rem; list-style: none;
  background: var(--white); border-radius: var(--radius-l); box-shadow: var(--shadow);
}
.plan {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr) minmax(0, 1.5fr) 10rem;
  gap: 1.75rem; align-items: start;
  padding: 1.75rem 0;
}
.plan + .plan { border-top: 1px solid var(--line); }
.plan-meter { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 0.4rem; }
.plan-ticks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; }
.plan-ticks span { height: 7px; border-radius: 4px; background: var(--line); }
.plan-ticks .m-plan.is-on { background: var(--plan); }
.plan-ticks .m-video.is-on { background: var(--video); }
.plan-ticks .m-gbp.is-on { background: var(--gbp); }
.plan-ticks .m-ads.is-on { background: var(--ads); }
.plan-ticks .m-report.is-on { background: var(--report); }
.plan-covers { font-size: 0.82rem; line-height: 1.4; color: var(--ink-soft); }
.plan-name { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); margin-bottom: 0.5rem; }
.plan-best { margin: 0; color: var(--ink-soft); }
.plan-list { margin: 0; padding-left: 1.1rem; }
.plan-list li + li { margin-top: 0.35rem; }
.plan-list li::marker { color: var(--violet); }
.plan-price { display: flex; flex-direction: column; align-items: flex-end; margin: 0; text-align: right; }
.plan-from, .plan-per { font-size: var(--step--1); color: var(--ink-soft); }
.plan-amount { font-family: var(--font-display); font-weight: 700; font-size: var(--step-2); line-height: 1.2; }
@media (max-width: 1023px) {
  .plan { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "head price" "meter meter" "list list"; gap: 1rem 1.5rem; }
  .plan-head { grid-area: head; }
  .plan-price { grid-area: price; }
  .plan-meter { grid-area: meter; max-width: 22rem; padding: 0; }
  .plan-list { grid-area: list; }
}
@media (max-width: 520px) {
  .plan-list-wrap { padding: 0 1.1rem; }
  .plan { grid-template-columns: 1fr; grid-template-areas: "head" "price" "meter" "list"; }
  .plan-price { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.4rem; text-align: left; }
}

.extras { margin-top: var(--space-4); max-width: 52rem; }
.extras-title { margin-bottom: 0.75rem; }
.extras-list { margin: 0 0 1rem; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.extras-list li {
  display: flex; justify-content: space-between; gap: 1.5rem;
  padding: 0.85rem 0; border-bottom: 1px solid var(--line);
}
.extras-price { flex: none; font-weight: 700; }
.extras-note { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
@media (max-width: 600px) { .extras-list li { flex-direction: column; gap: 0.2rem; } }

/* First 30 days: lock-screen notifications */
.first30 {
  padding: var(--space-5) 0;
  background:
    radial-gradient(40rem 26rem at 85% 20%, rgba(109, 91, 230, 0.3), transparent 70%),
    var(--night);
  color: var(--on-night);
}
.first30-inner { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-4); align-items: start; }
.first30 .sec-head { position: sticky; top: calc(var(--head-h) + 2rem); }
.notes { display: grid; gap: 0.75rem; margin: 0; padding: 0; list-style: none; }
.note {
  display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.9rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(246, 244, 239, 0.12); border-radius: 22px;
  background: rgba(246, 244, 239, 0.07);
}
.note-icon { width: 2.4rem; height: 2.4rem; }
.note-meta { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 0.2rem; font-size: 0.82rem; color: var(--on-night-soft); }
.note-day { color: var(--aurora); font-weight: 700; }
.note-title { font-size: 1.08rem; margin-bottom: 0.25rem; }
.note-body p:last-child { margin: 0; color: var(--on-night-soft); font-size: 0.97rem; }
@media (max-width: 899px) {
  .first30-inner { grid-template-columns: 1fr; }
  .first30 .sec-head { position: static; margin-bottom: 0; }
}

/* Ground rules: a settings screen */
.rules { padding: var(--space-5) 0; }
.rules-inner { display: flex; flex-direction: column; align-items: center; }
.rules .sec-head { text-align: center; }
.rules .seg-label { justify-content: center; }
.settings {
  width: 100%; max-width: 54rem; margin: 0; padding: 0.5rem 1.75rem; list-style: none;
  background: var(--white); border-radius: var(--radius-l); box-shadow: var(--shadow);
}
.setting { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.15rem 0; }
.setting + .setting { border-top: 1px solid var(--line); }
.setting-name { font-size: 1.06rem; margin-bottom: 0.3rem; }
.setting-text p { margin: 0; color: var(--ink-soft); font-size: 0.97rem; }
.setting-state { display: flex; align-items: center; gap: 0.6rem; flex: none; margin: 0; font-weight: 700; }
.setting-word { width: 1.8rem; }
.switch {
  position: relative; width: 3rem; height: 1.75rem; border-radius: 999px;
  background: #9ba0b4;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: calc(1.75rem - 6px); height: calc(1.75rem - 6px); border-radius: 50%;
  background: var(--white); box-shadow: 0 1px 3px rgba(15, 21, 41, 0.3);
}
.setting.is-on .switch { background: var(--gbp); }
.setting.is-on .switch::after { left: auto; right: 3px; }
@media (max-width: 560px) {
  .settings { padding-inline: 1.1rem; }
  .setting { flex-direction: column; align-items: flex-start; gap: 0.7rem; }
}

/* About */
.about { padding: var(--space-5) 0; background: var(--white); }
.about-inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.about-copy h2 { font-size: var(--step-3); margin-bottom: 1.1rem; }
.about-copy p:last-child { margin: 0; }
.info { margin: 0; border-radius: var(--radius-m); background: var(--paper); padding: 0.4rem 1.5rem; }
.info div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem; padding: 0.85rem 0; }
.info div + div { border-top: 1px solid var(--line); }
.info dt { font-weight: 700; color: var(--ink-soft); font-size: 0.92rem; }
.info dd { margin: 0; }
@media (max-width: 899px) { .about-inner { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .info div { grid-template-columns: 1fr; gap: 0.15rem; } }

/* Questions: a message thread */
.questions { padding: var(--space-5) 0; background: var(--lilac); }
.questions-inner { display: flex; flex-direction: column; align-items: center; }
.questions .sec-head { text-align: center; }
.questions .seg-label { justify-content: center; }
.thread {
  width: 100%; max-width: 50rem;
  background: var(--white); border-radius: var(--radius-l); box-shadow: var(--shadow);
  overflow: hidden;
}
.thread-head {
  display: flex; align-items: center; gap: 0.8rem; margin: 0;
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--line);
}
.thread-icon { width: 2.5rem; height: 2.5rem; }
.thread-sub { display: block; font-size: 0.85rem; color: var(--ink-soft); }
.thread-list { display: grid; gap: 1.4rem; margin: 0; padding: 1.5rem; list-style: none; }
.msg-pair { display: flex; flex-direction: column; gap: 0.5rem; }
.bubble { max-width: min(36rem, 86%); padding: 0.8rem 1.1rem; border-radius: 22px; }
.bubble p { margin: 0; }
.bubble p + p { margin-top: 0.6rem; }
.bubble-them { align-self: flex-end; background: var(--violet-ink); color: var(--white); border-bottom-right-radius: 6px; }
.bubble-q { font-size: 1rem; line-height: 1.45; }
.bubble-us { align-self: flex-start; background: #f0eef8; border-bottom-left-radius: 6px; }
.bubble-from { display: block; margin-bottom: 0.2rem; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); }
@media (max-width: 480px) {
  .thread-list { padding: 1.1rem; }
  .bubble { max-width: 92%; }
}

/* Contact: a message composer */
.contact { padding: var(--space-5) 0; }
.contact-inner { display: flex; flex-direction: column; align-items: center; }
.contact-head { max-width: 44rem; text-align: center; margin-bottom: var(--space-4); }
.contact-head h2 { font-size: var(--step-3); margin-bottom: 0.9rem; }
.contact-head p { color: var(--ink-soft); font-size: var(--step-1); }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.quick-chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--ink); font-weight: 700; font-size: 0.95rem; text-decoration: none;
}
a.quick-chip:hover { border-color: var(--violet-ink); color: var(--violet-ink); }
.quick-plain { font-weight: 400; color: var(--ink-soft); }

.composer {
  width: 100%; max-width: 52rem;
  background: var(--white); border-radius: var(--radius-l); box-shadow: var(--shadow); overflow: hidden;
}
.composer-bar {
  display: flex; justify-content: space-between; gap: 1rem; margin: 0;
  padding: 0.9rem 1.5rem; background: var(--night); color: var(--on-night); font-weight: 700;
}
.composer-to { color: var(--on-night-soft); font-weight: 400; }
.composer-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0.25rem 1.25rem; padding: 1.5rem 1.5rem 0.5rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-wide { grid-column: 1 / -1; }
.field label { font-weight: 700; }
.req, .opt { font-weight: 400; color: var(--ink-soft); font-size: 0.9rem; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 3rem; padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--field-line); border-radius: var(--radius-s);
  background: var(--white); color: var(--ink); font: inherit;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; border-color: var(--violet-ink); }
.field [aria-invalid="true"] { border-color: var(--error); }
.field-hint { margin: 0; font-size: 0.88rem; color: var(--ink-soft); }
.field-error { min-height: 1.4em; margin: 0 0 0.4rem; font-size: 0.9rem; font-weight: 700; color: var(--error); }
.hp { position: absolute; left: -100vw; width: 1px; height: 1px; overflow: hidden; }
.composer-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 1.25rem;
  padding: 1rem 1.5rem 1.5rem; border-top: 1px solid var(--line);
}
.composer-note { margin: 0; font-size: 0.9rem; color: var(--ink-soft); max-width: 28rem; }
.form-status { margin: 0 1.5rem 1.5rem; }
.form-status:empty { display: none; }
.form-status.is-success, .form-status.is-error { padding: 0.9rem 1.1rem; border-radius: var(--radius-s); font-weight: 700; }
.form-status.is-success { background: var(--gbp-tint); color: var(--success); }
.form-status.is-error { background: #fde3e1; color: var(--error); }
@media (max-width: 700px) {
  .composer-body { grid-template-columns: 1fr; padding-inline: 1.1rem; }
  .composer-bar, .composer-foot { padding-inline: 1.1rem; }
  .composer-foot { flex-direction: column; align-items: stretch; }
  .composer-to { display: none; }
  .form-status { margin-inline: 1.1rem; }
}

/* ---------- 6. Footer: the "all caught up" screen ---------- */
.caught-up { background: var(--night); color: var(--on-night-soft); padding: var(--space-5) 0 var(--space-3); text-align: center; }
.caught-up a { color: var(--on-night); }
.caught-up a:hover { color: var(--aurora); }
.caught-up :focus-visible { outline-color: var(--aurora); }
.caught-mark svg { width: 4rem; height: 4rem; margin: 0 auto 1rem; }
.caught-title { margin: 0 0 0.4rem; font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); color: var(--on-night); }
.caught-sub { margin: 0 0 var(--space-4); }
.caught-details { border-top: 1px solid var(--night-line); padding-top: var(--space-3); font-size: 0.94rem; }
.caught-legal { margin: 0 0 0.4rem; }
.caught-legal strong { color: var(--on-night); }
.caught-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1.5rem; margin: 1rem 0; padding: 0; list-style: none; }
.caught-links a, .link-button { display: inline-flex; align-items: center; min-height: 44px; }
.link-button {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--on-night); font: inherit; text-decoration: underline; text-underline-offset: 0.18em;
}
.link-button:hover { color: var(--aurora); }
.caught-fine { margin: 0; font-size: 0.86rem; }

/* ---------- 7. Legal pages and 404 ---------- */
.doc-band { background: var(--night); color: var(--on-night); padding: var(--space-4) 0; }
.doc-band h1 { font-size: var(--step-3); margin-bottom: 0.8rem; }
.doc-lead { max-width: 44rem; margin: 0 0 0.6rem; font-size: var(--step-1); color: var(--on-night-soft); }
.doc-date { margin: 0; font-size: var(--step--1); color: var(--on-night-soft); }
.doc-body { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-4); padding-block: var(--space-4) var(--space-5); align-items: start; }
.doc-toc { position: sticky; top: calc(var(--head-h) + 1.5rem); padding: 1.1rem 1.25rem; border-radius: var(--radius-m); background: var(--white); }
.doc-toc-title { margin: 0 0 0.5rem; font-weight: 700; }
.doc-toc ol { margin: 0; padding-left: 1.2rem; font-size: 0.93rem; }
.doc-toc li + li { margin-top: 0.2rem; }
.doc-toc a { display: inline; padding-block: 0.15rem; line-height: 1.7; }
.prose { max-width: 46rem; }
.prose h2 { font-size: var(--step-2); margin: 2.4rem 0 0.8rem; scroll-margin-top: calc(var(--head-h) + 1rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; scroll-margin-top: calc(var(--head-h) + 1rem); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1em; }
.prose li + li { margin-top: 0.35rem; }
.prose address { font-style: normal; margin: 0 0 1em; padding: 1rem 1.25rem; border-left: 4px solid var(--violet); background: var(--white); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.callout { padding: 1rem 1.25rem; border-radius: var(--radius-s); background: var(--lilac); }
.table-wrap { margin: 1.25rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.93rem; background: var(--white); }
.prose caption { text-align: left; font-weight: 700; padding-bottom: 0.5rem; }
.prose th, .prose td { padding: 0.6rem 0.7rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--lilac); }
.prose code { font-size: 0.9em; overflow-wrap: anywhere; }
@media (max-width: 1023px) {
  .doc-body { grid-template-columns: 1fr; }
  .doc-toc { position: static; }
}
@media (max-width: 700px) {
  .prose table, .prose tbody, .prose tr, .prose td { display: block; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .prose tr { margin-bottom: 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-s); }
  .prose td { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.75rem; border: 0; border-bottom: 1px solid var(--line); }
  .prose tr td:last-child { border-bottom: 0; }
  .prose td::before { content: attr(data-label); font-weight: 700; }
}

.expired { padding: var(--space-5) 0; }
.expired-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.expired-screen {
  width: min(100%, 22rem); aspect-ratio: 9 / 15; margin-bottom: var(--space-4);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1rem;
  padding: 2rem 1.5rem; border-radius: 36px; border: 10px solid var(--night);
  background: linear-gradient(160deg, #2a2f7a, var(--violet) 60%, #3fcf98);
  color: var(--white);
}
.expired-code { font-family: var(--font-display); font-weight: 700; font-size: 3rem; line-height: 1; }
.expired-screen p { margin: 0; font-weight: 700; }
.expired h1 { font-size: var(--step-3); margin-bottom: 1rem; }
.expired-inner > p { max-width: 36rem; color: var(--ink-soft); }
.expired-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.expired-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }

/* ---------- 8. Consent banner and dialog ---------- */
.consent-banner {
  position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 60;
  max-width: 36rem; padding: 1.25rem 1.4rem;
  border: 1px solid var(--night-line); border-radius: var(--radius-m);
  background: var(--night); color: var(--on-night-soft); box-shadow: var(--shadow);
}
.consent-title { margin: 0 0 0.5rem; font-size: 1.1rem; color: var(--on-night); font-family: var(--font-body); }
.consent-text { margin: 0 0 1rem; font-size: 0.93rem; }
.consent-banner a { color: var(--aurora); }
.consent-banner :focus-visible { outline-color: var(--aurora); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.consent-btn {
  min-height: 44px; padding: 0 1.2rem; border-radius: 999px;
  border: 2px solid var(--on-night); background: var(--on-night); color: var(--night);
  font: 700 0.95rem/1 var(--font-body); cursor: pointer;
}
.consent-btn:hover { background: var(--aurora); border-color: var(--aurora); }
.consent-link {
  min-height: 44px; padding: 0 0.4rem; border: 0; background: none; cursor: pointer;
  color: var(--on-night); font: inherit; font-size: 0.95rem; text-decoration: underline; text-underline-offset: 0.18em;
}
.consent-link:hover { color: var(--aurora); }
.consent-dialog {
  width: min(36rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); padding: 0;
  border: 0; border-radius: var(--radius-l); background: var(--white); color: var(--ink);
  box-shadow: var(--shadow);
}
.consent-dialog::backdrop { background: rgba(15, 21, 41, 0.6); }
.consent-dialog-inner { padding: 1.5rem; }
.consent-dialog .consent-title { color: var(--ink); font-size: 1.25rem; }
.consent-dialog .consent-text { color: var(--ink-soft); }
.consent-categories { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.consent-category { padding: 0.9rem 0; border-top: 1px solid var(--line); }
.consent-category p { margin: 0.3rem 0 0; font-size: 0.92rem; color: var(--ink-soft); }
.consent-category-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.consent-category h3 { font-size: 1rem; }
.consent-always { font-size: 0.88rem; font-weight: 700; color: var(--success); }
.consent-switch { position: relative; display: inline-flex; width: 3.25rem; height: 44px; align-items: center; cursor: pointer; }
.consent-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.consent-switch-track { position: relative; width: 3rem; height: 1.75rem; border-radius: 999px; background: #9ba0b4; transition: background-color 0.2s; }
.consent-switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: calc(1.75rem - 6px); height: calc(1.75rem - 6px); border-radius: 50%; background: var(--white);
  transition: transform 0.2s;
}
.consent-switch input:checked + .consent-switch-track { background: var(--gbp); }
.consent-switch input:checked + .consent-switch-track::after { transform: translateX(1.25rem); }
.consent-switch input:focus-visible + .consent-switch-track { outline: 3px solid var(--violet-ink); outline-offset: 2px; }
.consent-dialog .consent-btn { border-color: var(--night); background: var(--white); color: var(--night); }
.consent-dialog .consent-btn:hover { background: var(--lilac); }
.consent-dialog .consent-btn-save { background: var(--night); color: var(--on-night); }
.consent-dialog .consent-btn-save:hover { background: var(--violet-ink); border-color: var(--violet-ink); }
.consent-dialog a { color: var(--violet-ink); }

/* ---------- 9. Utilities ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- 10. Motion ---------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.is-in { opacity: 1; transform: none; }
.fan { animation: fan-in 0.9s ease-out both; }
@keyframes fan-in {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- 11. Print ---------- */
@media print {
  .story-head, .consent-banner, .hero-fan, .caught-mark, .composer { display: none; }
  body { background: var(--white); }
  .hero, .first30, .doc-band, .caught-up { background: none; color: var(--ink); }
}
