/* ==========================================================================
   Valure Help Centre — styles
   Light mode only. Brand colour is used for links, buttons and highlights;
   everything else is white and soft greys.
   ========================================================================== */

/* ---------- Fonts: Rethink Sans, bundled ---------- */
@font-face { font-family: "Rethink Sans"; src: url("../assets/fonts/RethinkSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Rethink Sans"; src: url("../assets/fonts/RethinkSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Rethink Sans"; src: url("../assets/fonts/RethinkSans-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Rethink Sans"; src: url("../assets/fonts/RethinkSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Rethink Sans"; src: url("../assets/fonts/RethinkSans-ExtraBold.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

/* ---------- Design tokens ---------- */
:root {
  --brand: #0207ff;
  --brand-hover: #0005d1;
  --brand-soft: #eef0ff;           /* tinted backgrounds (icons, <mark>) */
  --brand-ring: rgba(2, 7, 255, 0.16);

  --ink: #0a0b12;                  /* headings, primary text */
  --ink-2: #2f3340;                /* body copy */
  --muted: #646a78;                /* secondary text */
  --line: #e6e8ee;                 /* hairlines */
  --line-strong: #d3d6de;          /* decorative dividers */
  --control-border: #8a8f9c;       /* input and button edges, 3.2:1 on white */
  --surface: #f6f7f9;              /* soft grey panels */
  --page-grey: #f4f4f5;            /* homepage background below the hero */
  --card-border: #e6e6e6;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --tint: #dfe3ff;                 /* light blue card */
  --white: #fff;

  --radius: 14px;
  --radius-sm: 10px;

  --font-body: "Rethink Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: var(--font-body);

  --container: 1120px;
  --header-height: 64px;           /* the search band on inner pages sticks just below it */
  --gutter: clamp(16px, 4vw, 32px);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; outline: none; }

img, svg { display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Visible focus for keyboard users everywhere */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Headings receive focus after navigation (for screen readers); no ring needed */
h1:focus { outline: none; }

kbd {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 8px;
}

mark {
  background: var(--brand-soft);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--brand);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* Line icons (inline SVG) */
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: var(--white);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); text-decoration: none; }

.btn--ghost {
  background: var(--white);
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover { background: var(--white); border-color: var(--brand); color: var(--brand); }

/* ---------- Header ---------- */
/* Like Apple's global nav: a light translucent bar that stays at the top,
   with just the logo and "Back to store" */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
}
/* Solid when the browser can't blur, or the visitor asked for less transparency */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--white); }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--white); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

.site-header__inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }

.brand__logo { height: 26px; width: auto; }

.brand__label {
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink-2);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s;
}
.back-link:hover { color: var(--brand); text-decoration: none; }

@media (max-width: 360px) {
  .brand__label { display: none; }
}

/* ---------- Hero (homepage), like Apple Support: big V circle, big title, short line ---------- */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px var(--gutter) 72px;
  background: var(--white);
  text-align: center;
}

.hero__logo { width: 124px; height: 124px; }

.hero__title {
  margin: 48px 0 0;
  font-size: 4rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.hero__lead {
  margin: 28px 0 0;
  font-size: 1.75rem;
  line-height: 1.15;
}

@media (max-width: 720px) {
  .hero { padding: 48px var(--gutter) 44px; }
  .hero__logo { width: 88px; height: 88px; }
  .hero__title { margin-top: 32px; font-size: 2.75rem; }
  .hero__lead { margin-top: 16px; font-size: 1.3125rem; }
}

/* ---------- Homepage body ---------- */
/* The search stays on white with the hero; the grey starts at the topics */
.home-body { background: var(--white); }

.home-section { padding-top: 56px; }
.home-section:last-child { padding-bottom: 56px; }
.home-section--topics { background: var(--page-grey); }

.home-title {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.43;
}
.home-lead { margin: 0 0 24px; font-size: 1.125rem; line-height: 1.45; }
.home-lead--narrow { max-width: 600px; }

.ask__card {
  padding: 32px 32px 24px;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
}
@media (max-width: 560px) { .ask__card { padding: 20px 16px 16px; } }

.home-section--ask { padding-top: 0; padding-bottom: 64px; }

.ask__subtitle { margin: 28px 0 12px; font-size: 1.125rem; font-weight: 700; }


/* Popular questions as chips */
.question-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.question-chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.question-chip:hover { color: var(--brand); border-color: var(--brand); text-decoration: none; }

/* Cards: topics and "More ways to get help" */
.service-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .service-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .service-grid { grid-template-columns: 1fr; } }

.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s;
}
.service-card:hover { border-color: var(--brand); }

.service-card__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--ink);
  background: var(--page-grey);
  border-radius: 50%;
}
.service-card__icon .icon { width: 22px; height: 22px; }

.service-card__title { margin: 0 0 8px; font-size: 1.125rem; font-weight: 700; line-height: 1.45; }
/* The whole card is clickable through the title link */
.service-card__title a { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.service-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.service-card__title a:hover { text-decoration: none; }
.service-card__title .icon { width: 18px; height: 18px; stroke-width: 2; transition: transform 0.15s; }
.service-card:hover .service-card__title .icon { transform: translateX(3px); }
.service-card__text { margin: 0; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.5; }

/* ---------- Answers under the homepage search ---------- */
.ask__note { margin: 20px 0 0; color: var(--muted); font-size: 0.875rem; }

/* Short answer, inside the search card under a divider */
.answer { margin-top: 24px; padding-top: 28px; border-top: 1px solid var(--card-border); }

/* Whole answer, in its own card below */
.answer-card {
  margin-top: 24px;
  padding: 32px;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--card-shadow);
  scroll-margin-top: calc(var(--header-height) + 16px);
}
@media (max-width: 560px) { .answer-card { padding: 24px 16px; } }

.answer__badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 8px;
  color: var(--ink);
  font-size: 0.875rem;
  background: var(--tint);
  border-radius: 6px;
}

.answer__title {
  max-width: 760px;
  margin: 0 0 10px;
  font-size: clamp(1.375rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.3;
}
.answer__title:focus { outline: none; }

.answer__text { max-width: 760px; margin: 0 0 20px; font-size: 1.0625rem; line-height: 1.6; }

.answer__expand { height: 44px; padding: 0 20px; border-radius: 999px; }
.answer__expand .icon { width: 18px; height: 18px; stroke-width: 2; }

.answer__body { max-width: 760px; }
.answer__body h3 { margin-top: 1.4em; }

.answer__subtitle { margin: 28px 0 10px; font-size: 1.125rem; font-weight: 700; }

.answer__sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 520px; }
.answer__source {
  color: var(--ink);
  font-size: 1.0625rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.answer__source:hover { color: var(--brand); }
.answer__source-text { margin: 4px 0 0; color: var(--muted); font-size: 0.9375rem; line-height: 1.5; }

.answer__feedback { margin-top: 28px; border-top: 1px solid var(--card-border); }
.answer__votes { display: flex; flex-wrap: wrap; gap: 12px; }
.vote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  background: var(--white);
  border: 1px solid var(--control-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.vote:hover { color: var(--brand); border-color: var(--brand); }
.vote[aria-pressed="true"] { color: var(--white); background: var(--brand); border-color: var(--brand); }
.answer__thanks { margin: 10px 0 0; color: var(--muted); font-size: 0.9375rem; }
.answer__thanks:empty { display: none; }

.answer__more-help {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 12px;
  padding: 0;
  color: var(--brand);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 700;
  background: none;
  border: 0;
  cursor: pointer;
}
.answer__more-help:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Skeleton while the answer loads */
.answer__skeleton { display: grid; gap: 14px; justify-items: start; }
.skel {
  display: block;
  height: 16px;
  width: 100%;
  max-width: 760px;
  border-radius: 6px;
  background: #e2e3e8;
  animation: skeleton 1.2s ease-in-out infinite alternate;
}
.skel--badge { width: 150px; height: 26px; }
.skel--title { width: 55%; height: 30px; margin-bottom: 4px; }
.skel--short { width: 70%; }
.skel--button { width: 190px; height: 44px; margin-top: 8px; border-radius: 999px; }
@keyframes skeleton { from { opacity: 1; } to { opacity: 0.55; } }

/* ---------- "Need more help?" pop-up ---------- */
html.modal-open { overflow: hidden; }

/* The dialog fills the window as the dimmed backdrop; the panel sits inside */
.modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 24px 16px;
  display: grid;
  place-items: center;
  overflow-y: auto;
  border: 0;
  background: rgba(10, 11, 18, 0.5);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal:not([open]) { display: none; }
.modal::backdrop { background: transparent; }
.modal.is-open { opacity: 1; }

.modal__panel {
  width: min(100%, 960px);
  padding: 32px;
  background: var(--white);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(10, 11, 18, 0.24);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.2s ease;
}
.modal.is-open .modal__panel { transform: none; }
@media (max-width: 560px) { .modal__panel { padding: 24px 16px; } }

.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal__title { margin: 0; font-size: clamp(1.375rem, 2.4vw, 1.75rem); font-weight: 700; line-height: 1.3; }
.modal__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin: -8px -8px 0 0;
  color: var(--brand);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.modal__close:hover { background: var(--brand-soft); }
.modal__close .icon { width: 24px; height: 24px; stroke-width: 2; }

.modal__lead { margin: 16px 0 24px; font-size: 1.0625rem; }
.modal__lead a { text-decoration: underline; text-underline-offset: 3px; }

.modal__options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .modal__options { grid-template-columns: 1fr; } }

.option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 24px;
  border-radius: 24px;
}
.option--brand { color: var(--white); background: var(--brand); }
.option--tint { color: var(--ink); background: var(--tint); }

.option__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  color: var(--ink);
  background: var(--white);
  border-radius: 50%;
}
.option__icon .icon { width: 28px; height: 28px; }

.option__title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 700; }
.option__text { margin: 0 0 24px; font-size: 1.0625rem; line-height: 1.55; }
.option__text strong { display: block; }

.option__button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: auto;
  padding: 0 22px;
  font-weight: 700;
  border: 2px solid currentColor;
  border-radius: 999px;
  transition: background-color 0.15s, color 0.15s;
}
.option--brand .option__button { color: var(--white); }
.option--brand .option__button:hover { color: var(--brand); background: var(--white); text-decoration: none; }
.option--tint .option__button { color: var(--brand); background: var(--white); border-color: var(--brand); }
.option--tint .option__button:hover { color: var(--white); background: var(--brand); text-decoration: none; }
.option--brand :focus-visible { outline-color: var(--white); }

/* ---------- Search: a pill field with the Search button inside ---------- */
.search { position: relative; width: 100%; }
.search--sm { max-width: 560px; }

.search__field { position: relative; display: flex; align-items: center; }

.search__input {
  width: 100%;
  height: 68px;
  padding: 0 156px 0 24px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid #666a73;
  border-radius: 999px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search__input::placeholder { color: #6b7180; }  /* 4.9:1 on white */
.search__input:hover { border-color: var(--ink-2); }
.search__input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search__submit {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 32px;
  color: var(--white);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  background: var(--brand);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s;
}
.search__submit:hover { background: var(--brand-hover); }
.search__submit:focus-visible { outline-offset: 2px; }
.search__submit .icon { width: 20px; height: 20px; stroke-width: 2; }

/* The thin version in the band on inner pages */
.search--sm .search__input {
  height: 40px;
  padding: 0 104px 0 18px;
  font-size: 0.9375rem;
}
.search--sm .search__submit {
  right: 4px;
  top: 4px;
  bottom: 4px;
  gap: 6px;
  padding: 0 14px;
  font-size: 0.875rem;
}
.search--sm .search__submit .icon { width: 16px; height: 16px; }

/* Phones: the button shows only its icon (the label stays for screen readers) */
@media (max-width: 560px) {
  .search__input { padding-right: 72px; }
  .search--sm .search__input { padding-right: 52px; }
  .search__submit { padding: 0 18px; }
  .search--sm .search__submit { padding: 0 12px; }
  .search__submit-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ---------- Homepage sections ---------- */
.section { padding: clamp(40px, 6vw, 72px) 0; }

.section__title {
  margin: 0 0 28px;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 1.875rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* ---------- Inner pages ---------- */
/* Search band on inner pages: sticks right under the header */
.page-search {
  position: sticky;
  top: calc(var(--header-height) + 1px);   /* + the header's bottom border */
  z-index: 40;
  padding: 10px 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  will-change: transform;          /* moved with the scroll from js/app.js */
}

.page { padding-block: clamp(32px, 5vw, 56px) clamp(56px, 8vw, 96px); }
.page--narrow { max-width: calc(760px + 2 * var(--gutter)); }

.breadcrumb {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb [aria-current] { color: var(--ink-2); }

.page-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
}

.page-lead { margin: 0; color: var(--muted); font-size: 1.125rem; }
.meta { margin: 0; color: var(--muted); font-size: 0.875rem; }

/* ---------- Topic pages (like SAS's travel info centre) ---------- */
.topics-intro { padding-block: 24px 48px; }
.topics-intro .breadcrumb { margin-bottom: 20px; }

.topics-intro__title {
  margin: 0 0 12px;
  font-size: clamp(1.875rem, 3.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
}
.topics-intro__lead { margin: 0 0 40px; font-size: 1rem; }

/* Stage cards: filter the topics below */
.stage-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .stage-cards { grid-template-columns: repeat(2, 1fr); gap: 16px; } }

.stage-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  height: 100%;
  padding: 24px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.stage-card:hover { border-color: var(--brand); }
.stage-card[aria-pressed="true"] { color: var(--white); background: var(--brand); border-color: var(--brand); }
.stage-card[aria-pressed="true"]:focus-visible { outline-color: var(--ink); }

.stage-card__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: var(--white);
  background: var(--brand);
  border-radius: 50%;
}
.stage-card[aria-pressed="true"] .stage-card__icon { color: var(--brand); background: var(--white); }
.stage-card__icon .icon { width: 28px; height: 28px; stroke-width: 2; }

.stage-card__label { display: inline-flex; align-items: center; gap: 4px; font-size: 1.125rem; font-weight: 700; line-height: 1.4; }
.stage-card__label .icon { width: 18px; height: 18px; stroke-width: 2; }

@media (max-width: 560px) {
  .stage-card { gap: 16px; padding: 16px; }
  .stage-card__icon { width: 48px; height: 48px; }
  .stage-card__icon .icon { width: 22px; height: 22px; }
  .stage-card__label { font-size: 1rem; }
}

/* Grey part: the topic grid, then the chosen topic and its articles */
.topics-body { padding-block: 48px 64px; background: var(--page-grey); }

.topic-buttons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .topic-buttons { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 560px) { .topic-buttons { grid-template-columns: 1fr; gap: 12px; } }

.topic-button {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 68px;
  padding: 12px 24px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.35;
  background: var(--white);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.topic-button:hover { border-color: var(--brand); text-decoration: none; }
.topic-button[aria-current="page"] { color: var(--white); background: var(--brand); border-color: var(--brand); }
.topic-button[aria-current="page"]:focus-visible { outline-color: var(--ink); }

.topic-detail { margin-top: 56px; scroll-margin-top: calc(var(--header-height) + 24px); transition: opacity 0.15s ease-in; }
.topic-detail.is-switching { opacity: 0; }
.topic-detail__title { margin: 0 0 12px; font-size: clamp(1.5rem, 2.4vw, 1.75rem); font-weight: 700; line-height: 1.43; }
.topic-detail__lead { max-width: 560px; margin: 0 0 24px; }

/* ---------- Article, opened on its topic's page (white, under the grey part) ---------- */
.topic-article { padding-block: 48px 64px; background: var(--white); scroll-margin-top: var(--header-height); transition: opacity 0.15s ease-in; }
.topic-article.is-switching { opacity: 0; }
.topic-article__inner { max-width: 760px; }
.topic-article__title {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 2.4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.43;
}
.topic-article__title:focus { outline: none; }
.topic-article__feedback { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--card-border); }

/* Readable body: ~70 characters per line */
.prose {
  max-width: 68ch;
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.75;
}
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.15em; }

.prose h2 {
  margin: 2.2em 0 0.6em;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.prose h3 { margin: 1.8em 0 0.5em; color: var(--ink); font-size: 1.125rem; font-weight: 600; }

.prose ul,
.prose ol { margin: 0 0 1.15em; padding-left: 1.4em; }
.prose li { margin: 0.35em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--muted); }

.prose strong { color: var(--ink); font-weight: 600; }

.prose a {
  text-decoration: underline;
  text-decoration-color: rgba(2, 7, 255, 0.35);
  text-underline-offset: 3px;
}
.prose a:hover { text-decoration-color: var(--brand); }

.prose code {
  padding: 0.1em 0.4em;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

/* "> " lines in article bodies become callouts */
.callout {
  margin: 1.5em 0;
  padding: 14px 18px;
  font-size: 1rem;
  background: var(--surface);
  border-left: 3px solid var(--brand);
  border-radius: 0 10px 10px 0;
}

/* ---------- Search results page ---------- */
.results { list-style: none; margin: 32px 0 0; padding: 0; border-top: 1px solid var(--line); }
.result { padding: 24px 0; border-bottom: 1px solid var(--line); }
.result__title { font-size: 1.125rem; font-weight: 600; }
.result__meta { margin: 2px 0 8px; color: var(--muted); font-size: 0.8125rem; }
.result__snippet { margin: 0; color: var(--ink-2); font-size: 0.9375rem; }

/* Friendly empty / not-found states */
.empty {
  margin-top: 32px;
  padding: clamp(24px, 4vw, 40px);
  background: var(--surface);
  border-radius: var(--radius);
}
.empty__title { margin: 0 0 6px; font-size: 1.125rem; font-weight: 600; }
.empty p { margin: 0 0 20px; color: var(--muted); }
.empty .btn { margin-top: 4px; }

/* ---------- Footer ---------- */
.footer-band {
  position: relative;
  height: 240px;
  overflow: hidden;
  background: var(--brand);
}
/* The V mark, very large and cropped by the band */
.footer-band__mark {
  position: absolute;
  right: 4%;
  top: -12%;
  width: min(560px, 62vw);
  aspect-ratio: 129 / 108;
  background: var(--white);
  -webkit-mask: url("../assets/mark.svg") center / contain no-repeat;
  mask: url("../assets/mark.svg") center / contain no-repeat;
}
@media (max-width: 560px) { .footer-band { height: 160px; } }

.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  padding-block: 40px 32px;
  border-bottom: 1px solid var(--line);
}
@media (max-width: 720px) { .footer-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .footer-cols { grid-template-columns: 1fr; } }

.footer-cols__title { margin: 0 0 12px; font-size: 1.125rem; font-weight: 700; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-cols a { color: var(--ink); font-size: 0.9375rem; }
.footer-cols a:hover { color: var(--brand); }

.footer-legal { margin: 0; padding-block: 24px 32px; color: var(--muted); font-size: 0.8125rem; }

/* ---------- Tap targets ----------
   Small text links get a 44px-tall hit area; the negative margin keeps
   the visual layout unchanged. */
.breadcrumb a,
.footer-cols a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -12px;
}
.breadcrumb { row-gap: 14px; }

/* ---------- Motion: page changes and reveals ---------- */
/* The old page fades out quickly while the loading bar runs */
#app { transition: opacity 0.2s ease-in, transform 0.2s ease-in; }
#app.is-leaving { opacity: 0; transform: translateY(6px); }

/* New content fades and rises in */
.reveal { animation: reveal 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(14px); } }

/* Thin loading bar at the very top while a page loads */
.route-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 3px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: 0 50%;
  opacity: 0;
  pointer-events: none;
}
.route-progress.is-loading {
  opacity: 1;
  animation: progress-load 0.55s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}
.route-progress.is-done {
  opacity: 0;
  transform: scaleX(1);
  transition: transform 0.2s ease-out, opacity 0.3s ease 0.2s;
}
@keyframes progress-load { from { transform: scaleX(0); } to { transform: scaleX(0.8); } }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .skel,
  .reveal { animation: none; }
  .route-progress { display: none; }
}
