/* HS News Systems — industrial precision
   All colours and fonts live here. Tailwind maps to these tokens. */
:root {
  --color-bg: #F2F1EE;
  --color-surface: #FFFFFF;
  --color-text: #15181B;
  --color-text-muted: #56616A;
  --color-accent: #D3182A;
  --color-accent-muted: #F6DADC;
  --color-accent-hover: #A81021;
  --color-accent-on-dark: #FF4A57;
  --color-slate: #5C707C;
  --color-ink: #15181B;
  --color-ink-2: #1D2125;
  --color-rule: #D5D2CB;
  --color-rule-dark: #30363B;
  --color-on-dark: #F2F1EE;
  --color-on-dark-muted: #9BA5AD;
  --color-cardboard: #C89B62;
  --color-cardboard-dark: #A67A45;
  --color-label: #FFFFFF;
  --color-focus: #D3182A;
  --color-shadow: rgba(21, 24, 27, 0.18);
  --font-display: 'Archivo', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Type ---------- */
.font-display { font-family: var(--font-display); }
.display-xl,
.display-l,
.display-m {
  font-family: var(--font-display);
  font-stretch: 118%;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 0.98;
}
.display-xl { font-size: clamp(2.75rem, 7.6vw, 6.6rem); }
.display-l  { font-size: clamp(1.9rem, 4.3vw, 3.85rem); line-height: 1.02; }
.display-m  { font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.06; }

.label {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.3;
}
.label-sm { font-size: 0.72rem; }
.num {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 0.9;
}
.lede { font-size: clamp(1.1rem, 1.6vw, 1.35rem); line-height: 1.6; }

/* ---------- Links & focus ---------- */
a { color: inherit; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--color-accent-on-dark); }

.link-u {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
.link-u:hover { color: var(--color-accent); text-decoration-thickness: 2px; }
.on-dark .link-u:hover { color: var(--color-accent-on-dark); }

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--color-ink); color: var(--color-on-dark);
  padding: 0.75rem 1rem; transition: top 0.2s ease;
}
.skip-link:focus { top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  font-family: var(--font-display); font-stretch: 100%; font-weight: 700;
  font-size: 1rem; letter-spacing: 0.01em;
  padding: 0.95rem 1.4rem; min-height: 48px;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  cursor: pointer; text-decoration: none;
}
.btn svg { width: 1.1em; height: 1.1em; transition: transform 0.2s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--color-accent); color: var(--color-label); }
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }
.on-dark .btn-ghost:hover { background: var(--color-on-dark); color: var(--color-ink); border-color: var(--color-on-dark); }

/* ---------- Header ---------- */
.site-header {
  background: color-mix(in srgb, var(--color-bg) 92%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--color-rule);
}
.nav-link {
  position: relative; padding: 0.4rem 0; text-decoration: none;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--color-accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link:hover { color: var(--color-accent); }

.mobile-nav[hidden] { display: none; }

/* Sticky mobile action bar */
.action-bar {
  background: var(--color-ink);
  border-top: 1px solid var(--color-rule-dark);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- Rules & grid texture ---------- */
.rule-t { border-top: 1px solid var(--color-rule); }
.rule-b { border-bottom: 1px solid var(--color-rule); }
.on-dark .rule-t, .on-dark.rule-t { border-top-color: var(--color-rule-dark); }
.on-dark .rule-b { border-bottom-color: var(--color-rule-dark); }
.blueprint {
  background-image:
    linear-gradient(var(--color-rule-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-rule-dark) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

/* ---------- Hero: the bounding box around "box" ---------- */
.bbox {
  position: relative; display: inline-block;
  padding: 0 0.12em;
  outline: 2px solid var(--color-accent);
  outline-offset: 0.02em;
}
.bbox::before,
.bbox::after {
  content: ""; position: absolute; width: 0.18em; height: 0.18em;
  background: var(--color-bg); border: 2px solid var(--color-accent);
}
.bbox::before { left: -0.1em; top: -0.1em; }
.bbox::after { right: -0.1em; bottom: -0.1em; }
.bbox-dim {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.16em);
  display: flex; align-items: center; gap: 0.4em;
  color: var(--color-accent);
  font-family: var(--font-display); font-stretch: 75%; font-weight: 600;
  font-size: max(0.7rem, 0.11em); letter-spacing: 0.12em; line-height: 1;
}
.bbox-dim::before, .bbox-dim::after { content: ""; flex: 1; height: 1px; background: var(--color-accent); }

/* Figure annotations */
.fig { position: relative; }
.fig-cap {
  font-family: var(--font-display); font-stretch: 75%; font-weight: 600;
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-text-muted);
}
.callout {
  position: absolute; display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-stretch: 75%; font-weight: 600;
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-label); background: var(--color-ink);
  padding: 0.35rem 0.55rem;
}
.callout-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* ---------- Page-load stagger ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.load-in { animation: rise 0.4s cubic-bezier(.2,.7,.2,1) both; }
.d1 { animation-delay: 0.05s; } .d2 { animation-delay: 0.12s; } .d3 { animation-delay: 0.19s; }
.d4 { animation-delay: 0.26s; } .d5 { animation-delay: 0.33s; }

/* Scroll reveal — only class the editor recognises */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.4s ease, transform 0.4s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .load-in { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .img-zoom:hover img { transform: none; }
}

/* ---------- THE LINE (signature) ---------- */
.line-scroller { overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.line-track { position: relative; min-width: 760px; padding-top: 7.5rem; }
.line-belt {
  position: absolute; left: 0; right: 0; top: 5.25rem; height: 22px;
  border-top: 2px solid var(--color-on-dark-muted);
  border-bottom: 2px solid var(--color-on-dark-muted);
  background: repeating-linear-gradient(90deg, var(--color-rule-dark) 0 2px, transparent 2px 16px);
}
.line-belt.is-running { animation: belt 0.4s linear infinite; }
@keyframes belt { to { background-position: 16px 0; } }
.line-progress {
  position: absolute; left: 0; top: 5.25rem; height: 2px;
  background: var(--color-accent-on-dark);
  width: var(--progress, 6.25%);
  transition: width 0.4s ease;
}

/* The box */
.line-box {
  position: absolute; top: 1.9rem; width: 76px; height: 58px;
  left: calc(var(--pos, 6.25%) - 38px);
  transition: left 0.4s cubic-bezier(.5,0,.3,1);
}
.box-body {
  position: absolute; inset: 14px 0 0 0;
  background: var(--color-cardboard);
  box-shadow: inset 0 -6px 0 var(--color-cardboard-dark);
}
.box-flap {
  position: absolute; top: 0; width: 50%; height: 16px; background: var(--color-cardboard-dark);
  transition: transform 0.3s ease;
}
.box-flap.l { left: 0; transform-origin: bottom left; transform: rotate(-24deg); }
.box-flap.r { right: 0; transform-origin: bottom right; transform: rotate(24deg); }
.box-tape {
  position: absolute; left: 50%; top: 14px; bottom: 0; width: 8px; margin-left: -4px;
  background: var(--color-slate); opacity: 0; transition: opacity 0.3s ease;
}
.box-label {
  position: absolute; left: 10px; bottom: 12px; width: 26px; height: 18px;
  background: var(--color-label); opacity: 0; transform: scale(0.6);
  transition: opacity 0.3s ease, transform 0.3s ease;
  background-image: repeating-linear-gradient(90deg, var(--color-ink) 0 1px, transparent 1px 3px);
  background-size: 18px 8px; background-repeat: no-repeat; background-position: 4px 5px;
}
.box-item {
  position: absolute; left: 50%; top: -22px; width: 18px; height: 14px; margin-left: -9px;
  background: var(--color-accent-on-dark); opacity: 0; transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.line-box[data-stage="5"] .box-item { opacity: 1; transform: translateY(18px); }
.line-box[data-stage="6"] .box-item,
.line-box[data-stage="7"] .box-item,
.line-box[data-stage="8"] .box-item { opacity: 0; }
.line-box[data-stage="1"] .box-flap,
.line-box[data-stage="7"] .box-flap,
.line-box[data-stage="8"] .box-flap { transform: rotate(0deg); }
.line-box[data-stage="7"] .box-tape,
.line-box[data-stage="8"] .box-tape { opacity: 1; }
.line-box[data-stage="7"] .box-label,
.line-box[data-stage="8"] .box-label { opacity: 1; transform: none; }

.station {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 0.25rem 0.25rem 0.75rem; width: 100%;
  background: transparent; border: 0; color: var(--color-on-dark-muted); cursor: pointer;
  transition: color 0.2s ease;
}
.station-node {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--color-on-dark-muted); background: var(--color-ink);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.station:hover { color: var(--color-on-dark); }
.station:hover .station-node { border-color: var(--color-on-dark); transform: scale(1.15); }
.station[aria-selected="true"] { color: var(--color-on-dark); }
.station[aria-selected="true"] .station-node { background: var(--color-accent-on-dark); border-color: var(--color-accent-on-dark); }
.station.is-done .station-node { background: var(--color-on-dark-muted); }
.station-num { font-family: var(--font-display); font-stretch: 100%; font-weight: 800; font-size: 0.8rem; letter-spacing: 0.08em; }
.station-name { font-family: var(--font-display); font-stretch: 80%; font-weight: 600; font-size: 0.875rem; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; line-height: 1.2; }

.line-panel[hidden] { display: none; }
.line-panel { animation: rise 0.35s ease both; }
@media (prefers-reduced-motion: reduce) {
  .line-box, .line-progress { transition: none; }
  .line-belt.is-running { animation: none; }
  .line-panel { animation: none; }
}

.chip {
  display: inline-flex; align-items: center;
  border: 1px solid currentColor; padding: 0.3rem 0.6rem;
  font-family: var(--font-display); font-stretch: 85%; font-weight: 600;
  font-size: 0.875rem; letter-spacing: 0.04em;
}

/* ---------- Sector index rows ---------- */
.sector-row { transition: background-color 0.25s ease; }
.sector-row:hover { background: var(--color-surface); }
.sector-row .sector-arrow { transition: transform 0.25s ease, color 0.25s ease; }
.sector-row:hover .sector-arrow { transform: translateX(6px); color: var(--color-accent); }

/* ---------- Images ---------- */
.img-cover { width: 100%; height: 100%; object-fit: cover; }
.img-zoom { overflow: hidden; }
.img-zoom img { transition: transform 0.4s ease; }
.img-zoom:hover img { transform: scale(1.03); }
.logo-strip img { filter: none; opacity: 0.78; transition: opacity 0.2s ease; }
.logo-strip img:hover { opacity: 1; }

.placeholder {
  display: flex; flex-direction: column; justify-content: center; gap: 0.5rem;
  border: 2px dashed var(--color-slate); color: var(--color-text-muted);
  background: repeating-linear-gradient(135deg, transparent 0 14px, var(--color-accent-muted) 14px 15px);
  padding: 1.5rem;
}

/* ---------- Forms ---------- */
.field label { display: block; margin-bottom: 0.4rem; }
.input {
  width: 100%; min-height: 48px; padding: 0.75rem 0.9rem;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-text-muted); border-radius: 0;
  font: inherit; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input:hover { border-color: var(--color-text); }
.input:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-muted); }
.input:user-invalid { border-color: var(--color-accent); }
textarea.input { min-height: 150px; resize: vertical; }
select.input {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-text) 50%), linear-gradient(135deg, var(--color-text) 50%, transparent 50%);
  background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 2.5rem;
}
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: flex; align-items: center; min-height: 48px; padding: 0.7rem 1rem;
  border: 1px solid var(--color-text-muted); background: var(--color-surface);
  cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.choice span:hover { border-color: var(--color-text); }
.choice input:checked + span { background: var(--color-ink); color: var(--color-on-dark); border-color: var(--color-ink); }
.choice input:focus-visible + span { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.success-message {
  font-family: var(--font-display); font-stretch: 110%; font-weight: 800;
  font-size: 1.6rem; line-height: 1.2; padding: 2rem 0;
  border-top: 4px solid var(--color-accent);
}

/* ---------- FAQ ---------- */
.faq summary { list-style: none; cursor: pointer; transition: color 0.2s ease; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--color-accent); }
.faq .faq-icon { transition: transform 0.25s ease; }
.faq details[open] .faq-icon { transform: rotate(45deg); }

/* ---------- Filters (module catalogue) ---------- */
.filter-btn {
  padding: 0.55rem 0.9rem; min-height: 44px; border: 1px solid var(--color-text-muted);
  background: transparent; color: var(--color-text); cursor: pointer;
  font-family: var(--font-display); font-stretch: 85%; font-weight: 600; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-btn:hover { border-color: var(--color-text); background: var(--color-surface); }
.filter-btn[aria-pressed="true"] { background: var(--color-ink); color: var(--color-on-dark); border-color: var(--color-ink); }
.module[hidden] { display: none; }

/* Team portraits */
.portrait img { filter: grayscale(100%) contrast(1.05); transition: filter 0.3s ease; }
.portrait:hover img { filter: grayscale(0%); }

/* Timeline */
.tl-item { position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: 0; top: 0.55rem; width: 12px; height: 12px;
  background: var(--color-accent);
}

/* Utility for print of legal footnote */
.tabular { font-variant-numeric: tabular-nums; }
.btn-sm { padding: 0.7rem 1.1rem; min-height: 44px; }
.ph-inline { background: var(--color-accent-muted); color: var(--color-text); padding: 0.1em 0.35em; font-weight: 600; }

/* =========================================================
   MOBILE SYSTEM
   ========================================================= */
.section-y { padding-block: clamp(2.5rem, 7vw, 7rem); }
.section-y-sm { padding-block: clamp(2.25rem, 6vw, 6rem); }
.tap { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }

/* Sticky action bar: shown after the hero, hidden near form/footer */
.action-bar { transform: translateY(110%); transition: transform 0.3s ease; }
.action-bar.is-visible { transform: none; }
@media (prefers-reduced-motion: reduce) { .action-bar { transition: none; } }

/* Horizontal carousels (mobile only) */
@media (max-width: 767.98px) {
  .m-carousel {
    display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory; scroll-padding-inline: 16px;
    margin-inline: -16px; padding-inline: 16px; padding-bottom: 4px;
    scrollbar-width: none;
  }
  .m-carousel::-webkit-scrollbar { display: none; }
  .m-carousel > * { flex: 0 0 82%; scroll-snap-align: start; min-width: 0; }
  .m-carousel > *:focus-visible { outline-offset: -3px; }
  .m-card { background: var(--color-surface); border: 1px solid var(--color-rule); padding: 1.25rem; }
  .on-dark .m-card { background: var(--color-ink-2); border-color: var(--color-rule-dark); }
}
.carousel-status { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }
.carousel-dots { display: flex; gap: 6px; }
.carousel-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--color-rule); transition: background-color 0.2s ease, width 0.2s ease; }
.carousel-dots span.is-active { width: 18px; border-radius: 3px; background: var(--color-accent); }
.on-dark .carousel-dots span { background: var(--color-rule-dark); }
.on-dark .carousel-dots span.is-active { background: var(--color-accent-on-dark); }
@media (min-width: 768px) { .carousel-status { display: none; } }

/* Progressive disclosure: collapsed on mobile, always open on desktop */
.m-more > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 44px; font-family: var(--font-display); font-weight: 700; font-stretch: 100%;
  text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px;
}
.m-more > summary::-webkit-details-marker { display: none; }
.m-more > summary::after { content: "+"; color: var(--color-accent); font-size: 1.25em; line-height: 1; }
.on-dark .m-more > summary::after { color: var(--color-accent-on-dark); }
.m-more[open] > summary::after { content: "−"; }
.m-more[open] > summary { margin-bottom: 0.75rem; }
@media (min-width: 1024px) { .m-more > summary { display: none; } }

/* Takeovers: menu, enquiry form, filters */
.takeover-bar { display: none; }
@media (max-width: 1023.98px) {
  .takeover { display: none; }
  .takeover.is-open {
    display: flex; flex-direction: column;
    position: fixed; inset: 0; z-index: 80;
    height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
    background: var(--color-bg);
    animation: takeover-in 0.25s cubic-bezier(.2,.7,.2,1) both;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .takeover-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    position: sticky; top: 0; z-index: 2;
    min-height: 64px; padding: 0.5rem 1rem;
    background: var(--color-bg); border-bottom: 1px solid var(--color-rule);
  }
  .takeover [data-step]:not(.is-active) { display: none; }
  .takeover-form { border-top: 0; padding: 1.25rem 1rem 2rem; flex: 1; }
}
@keyframes takeover-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .takeover.is-open { animation: none; } }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 1px solid var(--color-text); background: transparent; color: inherit;
  cursor: pointer; transition: background-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { background: var(--color-text); color: var(--color-bg); }
.on-dark .icon-btn { border-color: var(--color-on-dark-muted); }
.on-dark .icon-btn:hover { background: var(--color-on-dark); color: var(--color-ink); }
.icon-btn[disabled] { opacity: 0.35; cursor: default; }
body.is-locked { overflow: hidden; }
.step-progress { height: 3px; background: var(--color-rule); }
.step-progress span { display: block; height: 100%; width: 50%; background: var(--color-accent); transition: width 0.3s ease; }

/* Field-level errors */
.field-error { display: none; margin-top: 0.4rem; color: var(--color-accent); font-size: 0.9rem; font-weight: 600; }
.field.has-error .field-error { display: block; }
.field.has-error .input { border-color: var(--color-accent); }

/* Portraits: colour on touch devices (no hover) */
@media (hover: none) { .portrait img { filter: none; } }
@media (max-width: 1023.98px) {
  .filter-group .filter-btn { min-height: 56px; text-align: left; padding-inline: 1rem; font-size: 1rem; }
}
@media (max-width: 767.98px) {
  .m-carousel-narrow > * { flex-basis: 62%; }
  .m-carousel > .tl-item::before { left: 1.25rem; top: 1.6rem; }
  .m-carousel > .tl-item { padding-left: 2.75rem; }
}

/* Robust at 200 % text zoom: grid items may shrink, long words wrap */
.grid > * { min-width: 0; }
body { overflow-wrap: break-word; }
h1, h2, h3 { hyphens: manual; }
@media (max-width: 767.98px) { h1, h2, h3, .display-m { hyphens: auto; } }
.flex > span, .flex > p, .flex > a { min-width: 0; }
