/* MedLab — doctors landing page.
   Tokens below are copied from packages/ui/src/tokens.css. Nothing else in this
   file may carry a raw hex: every rule reads a var(). */

:root {
  /* Blue ramp */
  --b50: #f0f6fb;
  --b100: #dceaf6;
  --b300: #8dbbdf;
  --b600: #1b75bb;
  --b700: #1a629f;
  --b800: #22508c;
  --b900: #263d82;

  /* Magenta — a short ramp on purpose: never a surface, never a gradient.
     --m400 is the app's --nav-mark: the one magenta that clears 3:1 on navy. */
  --m400: #e56bae;
  --m600: #cb398d;
  --m700: #a82c73;

  /* Neutrals, blue-leaning by design */
  --n0: #ffffff;
  --n50: #f7f9fc;
  --n100: #eef2f7;
  --n200: #e0e6ef;
  --n300: #c8d2e0;
  --n500: #6a778c;
  --n600: #556072;
  --n900: #1c222c;

  /* Roles */
  --surface: var(--n0);
  --surface-raised: var(--n50);
  --surface-sunken: var(--n100);
  --ink: var(--n900);
  --ink-muted: var(--n600);
  --ink-faint: var(--n500);
  --line: var(--n200);
  --line-strong: var(--n300);
  --line-control: #828c9a; /* 3:1 on the darkest light surface — WCAG 1.4.11 */
  --brand: var(--b600);
  --brand-deep: var(--b900);
  --accent: var(--m600);
  --on-accent: #ffffff;
  --s-trk3: #dbeafe;
  --on-trk3: #1e40af;

  /* Shape */
  --r-card: 14px;
  --r-control: 8px;
  --r-pill: 999px;

  /* Layout constant, matching the app's content column in marketing/section.tsx */
  --container: 1120px;

  /* One heartbeat: the ECG sweep, the travelling pulse and the logo beat all
     share it, so the heart contracts exactly when the trace spikes. */
  --beat: 4s;

  /* Light only. The portraits carry a light studio background, so a dark
     surface would render four white rectangles. */
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Clears the sticky header when an anchor is jumped to */
  scroll-padding-block-start: 5rem;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Cairo, system-ui, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.35;
  text-wrap: balance;
  font-weight: 700;
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: var(--brand);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--r-control);
}

/* Focus rings on the navy band need the light ring, not the brand blue. */
.header :focus-visible,
.hero :focus-visible,
.footer :focus-visible {
  outline-color: var(--n0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -100%;
  z-index: 60;
  background: var(--n0);
  color: var(--brand-deep);
  padding: 0.75rem 1.25rem;
  border-radius: var(--r-control);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  inset-block-start: 1rem;
}

/* ── Layout ─────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: 3.25rem;
}

.section--sunken {
  background: var(--surface-sunken);
}

@media (min-width: 768px) {
  .section {
    padding-block: 5rem;
  }
}

/* Headings sit on the centre line — the page is read one column at a time. */
.section-head {
  max-width: 40rem;
  margin-inline: auto;
  margin-block-end: 2rem;
  text-align: center;
}

.section-head h2 {
  font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.1rem);
}

.section-head p {
  color: var(--ink-muted);
  margin-block-start: 0.55rem;
  font-size: 1.0625rem;
}

/* Numbered eyebrow above each heading — the small, deliberate magenta of the
   light sections. --m700 clears AA at this size on white and on the sunken field.
   Scoped under .section-head so it outranks the `.section-head p` rule above. */
.section-head .eyebrow {
  color: var(--m700);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-block: 0 0.5rem;
}

.accent {
  color: var(--brand);
}

@media (min-width: 768px) {
  .section-head {
    margin-block-end: 2.75rem;
  }
}

/* ── Buttons ────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding-inline: 1.5rem;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.btn svg {
  flex: none;
}

/* White on navy — the primary shape wherever the ground is --brand-deep. */
.btn--onbrand {
  background: var(--n0);
  color: var(--brand-deep);
}

.btn--onbrand:hover {
  background: var(--b50);
}

.btn--ghostbrand {
  background: transparent;
  border-color: var(--b300);
  color: var(--n0);
}

.btn--ghostbrand:hover {
  background: var(--b800);
}

/* The header pill — the same magenta booking pill the main site's navy header
   uses. Solid fill, white text at 4.66:1. */
.btn--accent {
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-pill);
}

.btn--accent:hover {
  background: var(--m700);
}

.btn--lg {
  min-height: 3.5rem;
  padding-inline: 1.85rem;
  font-size: 1.0625rem;
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}

/* ── Header — the navy band, pinned like the main site's ── */

.header {
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
  background: var(--brand-deep);
}

.header__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  text-decoration: none;
  color: var(--n0);
  flex: none;
}

.brand img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.brand__name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}

.brand__name span {
  display: block;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--b100);
}

.nav {
  display: none;
}

.nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.85rem;
  border-radius: var(--r-control);
  color: var(--b100);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--n0);
  background: var(--b800);
}

.header__cta {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cta-long {
  display: none;
}

@media (min-width: 480px) {
  .cta-long {
    display: inline;
  }

  .cta-short {
    display: none;
  }
}

.header__cta .btn {
  min-height: 2.75rem;
  padding-inline: 1.1rem;
  font-size: 0.925rem;
}

/* Mobile menu — native <details> so it opens before and without JS */
.menu {
  position: relative;
  flex: none;
}

.menu > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--b300);
  border-radius: var(--r-control);
  color: var(--n0);
  cursor: pointer;
  list-style: none;
}

.menu > summary::-webkit-details-marker {
  display: none;
}

.menu__panel {
  position: absolute;
  inset-inline-end: 0;
  inset-block-start: calc(100% + 0.5rem);
  min-width: 13rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 16px 40px -24px rgb(28 34 44 / 0.45);
  padding: 0.4rem;
}

.menu__panel a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  border-radius: var(--r-control);
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.menu__panel a:hover {
  background: var(--surface-sunken);
  color: var(--b700);
}

@media (min-width: 1024px) {
  .nav {
    display: block;
  }

  .menu {
    display: none;
  }
}

/* ── Hero — navy, the heart beating over a live trace ── */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--brand-deep);
  /* Two blue washes for depth. Neither is magenta: that ramp never gradients. */
  background-image:
    radial-gradient(70% 90% at 100% 0%, color-mix(in oklab, var(--n0) 14%, transparent), transparent),
    radial-gradient(60% 70% at 0% 100%, color-mix(in oklab, var(--brand) 55%, transparent), transparent);
  color: var(--n0);
  padding-block: 2.75rem 8rem;
  text-align: center;
}

/* The heart alone, at 1:1 on a 2× screen, so the beat has a clean edge. */
.hero__mark {
  width: 6rem;
  height: 6rem;
  margin-inline: auto;
  margin-block-end: 1.25rem;
  transform-origin: 50% 55%;
  animation: beat var(--beat) ease-in-out infinite;
}

.hero__kicker {
  color: var(--b100);
  font-size: 0.9375rem;
  font-weight: 600;
  margin-block-end: 0.5rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 1.4rem + 3.2vw, 3.6rem);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

/* --m400 on --brand-deep is 3.34:1 — enough for this size and weight, and the
   exact pair the main site pins for its active-section mark. */
.hero__em {
  color: var(--m400);
}

.hero__lead {
  max-width: 34rem;
  margin-inline: auto;
  margin-block-start: 1rem;
  color: var(--b100);
  font-size: 1.0625rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-block-start: 1.85rem;
}

/* Stacked buttons match each other's width; side by side they size to content. */
.hero__actions .btn,
.closing__actions .btn {
  width: 100%;
}

@media (min-width: 480px) {
  .hero__actions .btn,
  .closing__actions .btn {
    width: auto;
  }
}

/* The ECG band along the hero's lower edge. The viewBox scales uniformly
   (`slice`): on a phone the band is a fixed height and the trace is cropped at
   the sides, centred on the spike; from 900px up the band takes the trace's own
   aspect so nothing is cropped. Uniform scale is what lets the pulse be a real
   circle and the dash arithmetic stay in pathLength="1000" units. */
.hero__ecg {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 1.25rem;
  z-index: -1;
  width: 100%;
  height: 5.5rem;
  pointer-events: none;
}

.hero__ecg path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hero__trace {
  stroke: var(--b300);
  stroke-width: 3;
  opacity: 0.55;
}

/* A short bright dash trailing the pulse: dash 60, gap 1500, and an offset
   that runs from 1620 to 620 — off the path at the start, at its end when it ends. */
.hero__sweep {
  stroke: var(--n0);
  stroke-width: 3.5;
  stroke-dasharray: 60 1500;
  stroke-dashoffset: 1620;
  animation: sweep var(--beat) linear infinite;
}

/* The pulse travels the same geometry the trace is drawn with. */
.hero__pulse {
  fill: var(--m400);
  offset-path: path("M1200 62 H800 l-20 0 l-14 -14 l-12 28 l-16 -58 l-14 94 l-16 -64 l-12 14 l-18 0 q-20 -24 -40 0 H130");
  offset-rotate: 0deg;
  offset-distance: 0%;
  animation: travel var(--beat) linear infinite;
}

.hero__halo {
  opacity: 0.22;
}

@keyframes sweep {
  from {
    stroke-dashoffset: 1620;
  }

  to {
    stroke-dashoffset: 620;
  }
}

@keyframes travel {
  from {
    offset-distance: 0%;
  }

  to {
    offset-distance: 100%;
  }
}

/* The QRS spike sits at 41–49 % of the trace, so the heart contracts there:
   a strong beat on the R peak, a lighter one on the S return. */
@keyframes beat {
  0%,
  36%,
  55%,
  100% {
    transform: scale(1);
  }

  41% {
    transform: scale(1.09);
  }

  45% {
    transform: scale(1);
  }

  49% {
    transform: scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__mark,
  .hero__sweep,
  .hero__pulse {
    animation: none;
  }

  .hero__sweep {
    opacity: 0;
  }

  .hero__pulse {
    offset-distance: 100%;
  }
}

@media (min-width: 640px) {
  .hero {
    padding-block: 4.5rem 9rem;
  }

  .hero__mark {
    width: 7rem;
    height: 7rem;
  }

  .hero__lead {
    font-size: 1.125rem;
  }

  .hero__actions .btn {
    min-height: 3.5rem;
    padding-inline: 2rem;
    font-size: 1.0625rem;
  }

  .hero__ecg {
    height: 6.5rem;
  }
}

/* Wide enough for the whole trace: the band takes its natural aspect. */
@media (min-width: 900px) {
  .hero {
    padding-block: 4.5rem 10.5rem;
  }

  .hero__ecg {
    inset-block-end: 1rem;
    height: auto;
    aspect-ratio: 1200 / 124;
  }
}

/* ── Specialties ────────────────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

/* One row per tile on a phone — icon beside the words, one full-width tap. */
.tile {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: center;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.tile:hover {
  transform: translateY(-3px);
  border-color: var(--b300);
  box-shadow: 0 12px 28px -20px rgb(28 34 44 / 0.5);
}

.tile__icon {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-pill);
  background: var(--b50);
  color: var(--brand);
}

.tile h3 {
  font-size: 1rem;
  line-height: 1.4;
}

.tile p {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.55;
  margin-block-start: 0.15rem;
}

@media (min-width: 640px) {
  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  .tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 1.35rem 1.15rem;
  }

  .tile__icon {
    grid-row: auto;
    margin-block-end: 0.35rem;
  }

  .tile h3 {
    font-size: 1.0625rem;
  }

  .tile p {
    font-size: 0.875rem;
    line-height: 1.6;
    margin-block-start: 0;
  }
}

@media (min-width: 900px) {
  .tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile {
    transition: none;
  }

  .tile:hover {
    transform: none;
  }
}

/* ── Doctors ────────────────────────────────────────── */

.doctors {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

/* Phone: a horizontal card — portrait on the start side, the decision on the
   other — so four doctors fit in one screen of scrolling instead of three. */
.doc {
  display: grid;
  grid-template-columns: 8.25rem minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "photo head"
    "photo body"
    "photo foot";
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  scroll-margin-block-start: 5.5rem;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.doc:hover {
  transform: translateY(-3px);
  border-color: var(--b300);
  box-shadow: 0 16px 32px -24px rgb(28 34 44 / 0.55);
}

.doc__photo {
  grid-area: photo;
  min-height: 13rem;
  background: var(--surface-sunken);
}

.doc__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 12%;
}

.doc__head {
  grid-area: head;
  padding: 0.9rem 0.9rem 0;
}

.doc__name {
  font-size: 1rem;
  line-height: 1.45;
}

.doc__role {
  color: var(--brand);
  font-weight: 500;
  font-size: 0.8125rem;
  margin-block-start: 0.1rem;
}

.doc__body {
  grid-area: body;
  padding: 0.45rem 0.9rem 0;
}

.doc__exp {
  color: var(--ink-muted);
  font-size: 0.8125rem;
  line-height: 1.6;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-block-start: 0.55rem;
}

.chips li {
  background: var(--surface-sunken);
  color: var(--ink-muted);
  border-radius: var(--r-pill);
  padding: 0.15rem 0.55rem;
  font-size: 0.7rem;
  line-height: 1.6;
  font-weight: 500;
}

.doc__foot {
  grid-area: foot;
  margin-block-start: auto;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 0.9rem 0.9rem;
}

.docbtn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding-inline: 0.4rem;
  border-radius: var(--r-control);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background-color 0.2s, border-color 0.2s;
}

.docbtn svg {
  flex: none;
}

.docbtn--whatsapp {
  background: var(--brand);
  color: var(--n0);
}

.docbtn--whatsapp:hover {
  background: var(--b700);
}

.docbtn--call {
  border-color: var(--line-control);
  color: var(--ink);
}

.docbtn--call:hover {
  background: var(--surface-sunken);
}

@media (prefers-reduced-motion: reduce) {
  .doc,
  .docbtn {
    transition: none;
  }

  .doc:hover {
    transform: none;
  }
}

/* Tablet up: the tall card, two then four across. */
@media (min-width: 640px) {
  .doctors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  /* The column template must go too, or the subgrid upgrade below inherits the
     phone's two columns and lays the portrait beside the text again. */
  .doc {
    display: flex;
    flex-direction: column;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: none;
  }

  .doc__photo,
  .doc__head,
  .doc__body,
  .doc__foot {
    grid-area: auto;
  }

  .doc__photo {
    aspect-ratio: 4 / 5;
    min-height: 0;
  }

  .doc__head {
    padding: 1.15rem 1.15rem 0;
  }

  .doc__name {
    font-size: 1.0625rem;
    line-height: 1.5;
  }

  .doc__role {
    font-size: 0.875rem;
    margin-block-start: 0.15rem;
  }

  .doc__body {
    padding: 0.7rem 1.15rem 0;
  }

  .doc__exp {
    font-size: 0.875rem;
    line-height: 1.65;
  }

  .chips {
    gap: 0.375rem;
    margin-block-start: 0.75rem;
  }

  .chips li {
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
  }

  .doc__foot {
    gap: 0.5rem;
    padding: 1rem 1.15rem 1.15rem;
  }

  .docbtn {
    gap: 0.4rem;
    padding-inline: 0.5rem;
    font-size: 0.875rem;
  }
}

/* Rows line up across the row when the browser has subgrid; the flex fallback
   above still bottoms out the button row via margin-block-start:auto. */
@supports (grid-template-rows: subgrid) {
  @media (min-width: 640px) {
    .doc {
      display: grid;
      grid-row: span 4;
      grid-template-rows: subgrid;
    }
  }
}

@media (min-width: 1024px) {
  .doctors {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

/* ── Why MedLab ─────────────────────────────────────── */

.reasons {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.875rem;
}

.reason {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 0.9rem;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.1rem 1rem;
}

.reason__icon {
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: var(--r-pill);
  background: var(--s-trk3);
  color: var(--on-trk3);
}

.reason h3 {
  font-size: 1rem;
  line-height: 1.45;
}

.reason p {
  color: var(--ink-muted);
  font-size: 0.875rem;
  margin-block-start: 0.3rem;
}

@media (min-width: 768px) {
  .reasons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }

  .reason {
    display: block;
    padding: 1.5rem;
  }

  .reason__icon {
    margin-block-end: 0.9rem;
  }

  .reason h3 {
    font-size: 1.0625rem;
  }

  .reason p {
    font-size: 0.9375rem;
    margin-block-start: 0.4rem;
  }
}

/* ── Footer — one navy block: the closing ask, then the posters' footer row ── */

.footer {
  background-color: var(--brand-deep);
  background-image: radial-gradient(
    75% 90% at 100% 0%,
    color-mix(in oklab, var(--n0) 12%, transparent),
    transparent
  );
  color: var(--n0);
  padding-block: 3.25rem 1.5rem;
}

.closing {
  text-align: center;
  padding-block-end: 2.5rem;
  border-block-end: 1px solid var(--b800);
}

.closing__eyebrow {
  display: inline-block;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-pill);
  padding: 0.25rem 0.9rem;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-block-end: 1rem;
}

.closing h2 {
  font-size: clamp(1.6rem, 1.15rem + 2.1vw, 2.5rem);
}

.closing__em {
  color: var(--b300);
}

.closing__lead {
  color: var(--b100);
  margin-block-start: 0.8rem;
  max-width: 36rem;
  margin-inline: auto;
}

.closing__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-block-start: 1.75rem;
}

/* The posters' footer: CBAHI on one side, the practice in the middle, CAP on
   the other. On a phone the practice comes first and the two marks share a row. */
.footer__band {
  display: grid;
  grid-template-columns: repeat(2, auto);
  grid-auto-flow: row dense;
  justify-content: center;
  align-items: center;
  gap: 1.25rem 0.75rem;
  padding-block: 2rem;
  border-block-end: 1px solid var(--b800);
  text-align: center;
}

.footer__id {
  grid-column: 1 / -1;
  order: -1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logos keep their white plate on the navy band — the app's partner-strip rule. */
.accred-chip {
  display: inline-flex;
  align-items: center;
  background: var(--n0);
  border-radius: var(--r-card);
  padding: 0.55rem 0.9rem;
}

.accred-chip img {
  height: 2.25rem;
  width: auto;
  object-fit: contain;
}

.footer__line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  margin-block-start: 0.6rem;
  color: var(--b100);
  font-size: 0.9375rem;
}

.footer__line > * {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
}

.footer__line a {
  color: inherit;
  text-decoration: none;
  gap: 0.35rem;
}

.footer__line a:hover {
  color: var(--n0);
  text-decoration: underline;
}

.num {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.social {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-block-start: 0.85rem;
}

.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--b300);
  border-radius: var(--r-pill);
  color: var(--b100);
}

.social a:hover {
  background: var(--b800);
  border-color: var(--n0);
  color: var(--n0);
}

.footer__bottom {
  padding-block-start: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.5rem;
  text-align: center;
}

.footer__bottom p {
  color: var(--b300);
  font-size: 0.8125rem;
}

@media (min-width: 640px) {
  .footer__line {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 0.9rem;
  }

  .footer__line > * + *::before {
    content: "·";
    color: var(--b300);
    margin-inline-end: 0.9rem;
  }
}

@media (min-width: 768px) {
  .footer {
    padding-block: 5rem 1.75rem;
  }

  .closing {
    padding-block-end: 3.25rem;
  }

  .footer__band {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-auto-flow: row;
    gap: 2rem;
    padding-block: 2.5rem;
  }

  .footer__id {
    grid-column: auto;
    order: 0;
  }

  .accred-chip img {
    height: 2.75rem;
  }

  .footer__bottom {
    justify-content: space-between;
    text-align: start;
  }
}
