/* The public website (alamis.kz): the landing page, the news, the 404 page.
   «A quiet grid»: the rhythm of the ALAMIS calendar — 1 px lines, a faint grid of hours, 3 px
   marks in the doctors' colours. One accent colour (the brand blue), for actions and links only;
   real screens of the service. No JavaScript, no inline styles (CSP), no third-party resources. */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../site/fonts/onest-500.02e3d4e9aa57.woff2") format("woff2");
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../site/fonts/onest-600.fdd00af5d930.woff2") format("woff2");
}

/* Arial resized to Onest's proportions: headings keep their place while Onest loads. */
@font-face {
  font-family: "Onest Fallback";
  font-weight: 500;
  src: local("Arial"), local("ArialMT");
  size-adjust: 106.18%;
  ascent-override: 91.35%;
  descent-override: 28.72%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Onest Fallback";
  font-weight: 600;
  src: local("Arial Bold"), local("Arial-BoldMT");
  size-adjust: 98.26%;
  ascent-override: 98.72%;
  descent-override: 31.04%;
  line-gap-override: 0%;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;
  --brand: #0f6cbd;
  --brand-hover: #115ea3;
  --brand-pressed: #0c3b5e;
  --brand-ink: #0f548c;
  --brand-subtle: #ebf3fc;
  --brand-line: #cfe4fa;
  --tint: #f5f9fe;
  --grid: #e3ecf7;
  --ink: #242424;
  --text-2: #424242;
  --text-3: #616161;
  --line-1: #d1d1d1;
  --line-2: #e0e0e0;
  --line-3: #f0f0f0;
  --bg: #fff;
  --bg-alt: #fafafa;
  --hover: #f5f5f5;
  --pressed: #e0e0e0;
  --navy: #0a2e4a;
  --navy-2: #0c3b5e;
  --on-navy: #fff;
  --on-navy-2: #cfe4fa;
  --on-navy-link: #96c6fa;
  --on-navy-line: rgb(255 255 255 / 16%);
  --on-navy-frame: rgb(255 255 255 / 24%);
  --mark-1: #0f6cbd;
  --mark-2: #107c10;
  --mark-3: #5c2e91;
  --mark-4: #038387;

  --font-text: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Onest", "Onest Fallback", var(--font-text);

  --radius-s: 4px;
  --radius-m: 8px;
  --radius-pill: 999px;
  --shadow-8: 0 0 2px rgb(0 0 0 / 12%), 0 4px 8px rgb(0 0 0 / 14%);
  --shadow-28: 0 0 8px rgb(0 0 0 / 12%), 0 14px 28px rgb(0 0 0 / 14%);

  --container: 1200px;
  --gutter: 16px;
  --section: 56px;
  --header: 56px;
}

@media (min-width: 640px) {
  :root {
    --gutter: 24px;
    --section: 72px;
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: 32px;
    --section: 96px;
    --header: 64px;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

@media (min-width: 1024px) {
  html {
    scroll-padding-top: 80px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.625;
}

::selection {
  background: var(--brand-line);
  color: var(--ink);
}

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

img {
  height: auto;
}

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--brand-hover);
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.125rem, 1.5rem + 2.5vw, 3.5rem);
  font-weight: 500;
  line-height: calc(1em + 8px);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 1.25rem + 1.5vw, 2.25rem);
  font-weight: 600;
  line-height: calc(1em + 8px);
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.45;
}

@media (min-width: 1024px) {
  h3 {
    font-size: 1.25rem;
    line-height: 1.4;
  }
}

p {
  margin: 0;
  text-wrap: pretty;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  color: #fff;
  transform: none;
}

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

.container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.icon {
  flex: none;
}

/* The grid of hours behind the first screen, the news pages' heads and the 404 page. */
.hours {
  position: relative;
  isolation: isolate;
}

.hours::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(to bottom, var(--grid) 1px, transparent 1px) 0 0 / 100% 48px;
  content: "";
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, rgb(0 0 0 / 70%), transparent 75%);
  mask-image: linear-gradient(to bottom, rgb(0 0 0 / 70%), transparent 75%);
}

/* ---------- Text blocks ---------- */

.eyebrow {
  color: var(--brand-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 36em;
  font-size: 1.125rem;
  line-height: 1.55;
}

@media (min-width: 1024px) {
  .lead {
    font-size: 1.25rem;
    line-height: 1.5;
  }
}

.small {
  font-size: 0.875rem;
  line-height: 1.43;
}

.muted {
  color: var(--text-3);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-s);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.33;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
}

.button--primary {
  background: var(--brand);
  color: #fff;
}

.button--primary:hover {
  background: var(--brand-hover);
  color: #fff;
}

.button--primary:active {
  background: var(--brand-pressed);
}

.button--secondary {
  border-color: var(--line-1);
  background: var(--bg);
  color: var(--ink);
}

.button--secondary:hover {
  border-color: #c7c7c7;
  background: var(--hover);
  color: var(--ink);
}

.button--secondary:active {
  border-color: #b3b3b3;
  background: var(--pressed);
}

.button--large {
  min-height: 48px;
  padding: 0 24px;
  font-size: 1rem;
  line-height: 1.5;
}

.button .icon {
  width: 20px;
  height: 20px;
}

@media (prefers-reduced-motion: no-preference) {
  .button .icon--arrow {
    transition: transform 0.15s ease;
  }

  .button:hover .icon--arrow {
    transform: translateX(2px);
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* On a phone, buttons inside the page take the whole width. */
@media (max-width: 639px) {
  .actions {
    flex-direction: column;
  }

  .actions .button,
  .button--wide-phone {
    width: 100%;
  }
}

/* ---------- Header ---------- */

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--header);
  /* Room for the menu button, which stands in the header's corner. */
  padding-right: calc(var(--gutter) + 88px);
}

.brand {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  border-radius: var(--radius-s);
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand__mark {
  width: 24px;
  height: 24px;
}

.brand__word {
  width: auto;
  height: 11px;
}

.site-nav,
.site-header__login {
  display: none;
}

.site-header__apply {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.875rem;
}

/* The phone and tablet menu: details and summary, no JavaScript; it opens in the page's flow. */
.site-menu > summary {
  position: absolute;
  top: calc((var(--header) - 44px) / 2);
  right: var(--gutter);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: var(--radius-s);
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

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

.site-menu > summary:hover {
  background: var(--hover);
}

.site-menu > summary:active {
  background: var(--pressed);
}

.site-menu > summary .icon {
  width: 20px;
  height: 20px;
}

.site-menu:not([open]) .site-menu__close,
.site-menu[open] .site-menu__open {
  display: none;
}

.site-menu__panel {
  padding: 8px 0 16px;
  border-top: 1px solid var(--line-3);
  background: var(--bg);
}

.site-menu__login {
  width: 100%;
  margin: 8px 0;
}

.site-menu__panel nav {
  display: grid;
}

.site-menu__panel nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  border-bottom: 1px solid var(--line-3);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.site-menu__panel nav a:hover {
  background: var(--bg-alt);
}

.site-menu__panel nav a:focus-visible {
  outline-offset: -2px;
}

.site-menu__panel nav a[aria-current="page"] {
  color: var(--brand);
}

.site-menu__mail {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  font-size: 0.875rem;
}

.site-menu__mail .icon {
  width: 20px;
  height: 20px;
}

/* Below 360 px (320 px, or 640 px at 200% zoom): the mark alone, its name is in the label. */
@media (max-width: 359px) {
  .site-header .brand__word {
    display: none;
  }
}

@media (min-width: 640px) {
  .brand {
    gap: 10px;
  }

  .brand__mark {
    width: 28px;
    height: 28px;
  }

  .brand__word {
    height: 13px;
  }

  .site-header__login {
    display: inline-flex;
  }

  .site-header__apply {
    padding: 0 20px;
    font-size: 0.9375rem;
  }

  .site-menu__login {
    display: none;
  }
}

@media (min-width: 1024px) {
  .site-header {
    position: sticky;
    top: 0;
  }

  .site-header__bar {
    gap: 12px;
    padding-right: var(--gutter);
  }

  .site-nav {
    display: flex;
    gap: 16px;
    margin-right: 12px;
  }

  .site-nav a {
    padding: 8px 4px;
    border-radius: var(--radius-s);
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  .site-nav a:hover {
    color: var(--brand);
  }

  .site-nav a[aria-current="page"] {
    color: var(--ink);
    text-decoration: underline 2px var(--brand);
    text-underline-offset: 8px;
  }

  .site-menu {
    display: none;
  }
}

@media (min-width: 1280px) {
  .site-nav {
    gap: 28px;
  }

  .site-nav a {
    font-size: 0.9375rem;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: var(--section) 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__head {
  display: grid;
  gap: 12px;
  max-width: 792px;
  margin-bottom: 32px;
}

.section__head .lead {
  margin-top: 4px;
}

@media (min-width: 640px) {
  .section__head {
    margin-bottom: 48px;
  }
}

/* ---------- The first screen ---------- */

.hero {
  padding-top: 24px;
  background: var(--tint);
}

.hero__grid {
  display: grid;
  gap: 32px;
}

.hero__text {
  display: grid;
  align-content: start;
}

.hero__text h1 {
  margin: 12px 0 16px;
}

.hero__text .lead {
  margin-bottom: 24px;
}

.hero__login {
  margin: 16px 0 24px;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.facts {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.facts .icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--brand);
}

/* «МЦС» on the first screen: spelled out in its title, without the dotted line. */
.facts abbr[title] {
  text-decoration: none;
  cursor: help;
}

@media (min-width: 640px) {
  .hero {
    padding-top: 48px;
  }

  .hero__grid {
    gap: 48px;
  }

  .hero__text h1 {
    margin: 16px 0 24px;
  }

  .hero__text .lead {
    margin-bottom: 32px;
  }

  .hero__login {
    margin-bottom: 32px;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding-top: 64px;
  }

  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    column-gap: 24px;
  }

  .hero__text {
    grid-column: 1 / 8;
  }

  .hero__grid .news-rail {
    grid-column: 9 / 13;
  }
}

/* ---------- Screens of the service ---------- */

.shot {
  margin: 0;
}

.shot__frame {
  overflow: hidden;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-m);
  background: var(--bg);
  box-shadow: var(--shadow-8);
}

.shot__frame img {
  width: 100%;
}

.shot figcaption {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 0.875rem;
  line-height: 1.43;
}

.shot--main .shot__frame {
  box-shadow: var(--shadow-28);
}

/* A browser-like bar above the main screen, with the app's address. */
.shot__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-alt);
  color: var(--text-3);
  font-size: 0.75rem;
  line-height: 1.33;
}

.shot__bar .icon {
  width: 16px;
  height: 16px;
}

.shot--navy .shot__frame {
  border-color: var(--on-navy-frame);
  box-shadow: none;
}

.shot--navy figcaption {
  color: var(--on-navy-2);
}

/* ---------- The main screen and who it is for ---------- */

.product__band {
  padding-top: 32px;
  background: linear-gradient(to bottom, var(--tint) 50%, var(--bg) 50%);
}

/* Inside .container: vertical padding only, the gutters stay. */
.profiles {
  display: grid;
  gap: 16px;
  padding-top: 32px;
  padding-bottom: var(--section);
}

.profiles > p {
  color: var(--ink);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 5px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.43;
}

@media (min-width: 640px) {
  .product__band {
    padding-top: 48px;
  }
}

@media (min-width: 1024px) {
  .profiles {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    column-gap: 24px;
    padding-top: 48px;
  }

  .profiles > p {
    grid-column: 1 / 5;
  }

  .profiles .chips {
    grid-column: 5 / 13;
  }
}

/* ---------- Steps: how it works (.flow) and connecting (.steps) ---------- */

.flow,
.steps {
  display: grid;
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.flow > li,
.steps > li {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-content: start;
  column-gap: 16px;
  counter-increment: step;
}

/* A phone and a tablet: numbers in circles, joined by a vertical line. */
.flow > li::before,
.steps > li::before {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--brand-line);
  border-radius: 50%;
  background: var(--brand-subtle);
  color: var(--brand-ink);
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.43;
  content: counter(step, decimal-leading-zero);
}

.flow > li:not(:last-child)::after,
.steps > li:not(:last-child)::after {
  position: absolute;
  top: 40px;
  bottom: -24px;
  left: 16px;
  width: 1px;
  background: var(--line-1);
  content: "";
}

.flow h3,
.steps h3 {
  display: flex;
  align-items: center;
  min-height: 32px;
  font-size: 1.125rem;
  line-height: 1.45;
}

.flow p,
.steps p {
  grid-column: 2;
  margin-top: 8px;
}

/* A desktop: a big number over a line that runs along the whole row. */
@media (min-width: 1024px) {
  .flow,
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 48px 24px;
  }

  .flow > li,
  .steps > li {
    display: block;
  }

  .flow > li::before,
  .steps > li::before {
    display: block;
    width: auto;
    height: auto;
    padding-bottom: 12px;
    border: 0;
    border-bottom: 1px solid var(--line-1);
    border-radius: 0;
    background: none;
    color: var(--brand);
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.25;
  }

  /* The line goes on through the gap to the next step of the same row. */
  .flow > li::after,
  .steps > li::after {
    display: none;
  }

  .flow > li:not(:last-child)::after,
  .steps > li:not(:nth-child(3n), :last-child)::after {
    display: block;
    top: 52px;
    right: -24px;
    bottom: auto;
    left: auto;
    width: 24px;
    height: 1px;
  }

  .flow h3,
  .steps h3 {
    display: block;
    min-height: 0;
    margin-top: 16px;
    font-size: 1.25rem;
    line-height: 1.4;
  }
}

.steps-cta {
  margin-top: 48px;
}

@media (max-width: 639px) {
  .steps-cta .button {
    width: 100%;
  }
}

/* ---------- The МЦС panel ---------- */

.notice {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  margin-top: 48px;
  padding: 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-m);
  background: var(--bg);
}

.notice > .icon {
  width: 24px;
  height: 24px;
  color: var(--brand-ink);
}

.notice > div {
  display: grid;
  justify-items: start;
  max-width: 68ch;
}

.notice p {
  margin: 8px 0 12px;
}

@media (min-width: 640px) {
  .notice {
    gap: 16px;
    padding: 24px;
  }
}

@media (min-width: 1024px) {
  .notice {
    padding: 32px;
  }
}

/* ---------- Features ---------- */

.feature {
  display: grid;
  align-items: center;
  gap: 24px;
}

.feature + .feature {
  margin-top: 48px;
}

.feature__text {
  display: grid;
  align-content: start;
}

.feature__text .eyebrow {
  margin-bottom: 8px;
}

.feature__text > p:not(.eyebrow) {
  margin: 12px 0 16px;
}

@media (min-width: 640px) {
  .feature {
    gap: 32px;
  }

  .feature + .feature {
    margin-top: 64px;
  }
}

@media (min-width: 1024px) {
  .feature {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0 24px;
  }

  .feature + .feature {
    margin-top: 96px;
  }

  .feature .feature__text {
    grid-column: 1 / 6;
  }

  .feature .shot {
    grid-column: 6 / 13;
  }

  .feature--mirror .feature__text {
    grid-row: 1;
    grid-column: 8 / 13;
  }

  .feature--mirror .shot {
    grid-row: 1;
    grid-column: 1 / 8;
  }
}

.ticks {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticks li {
  position: relative;
  padding-left: 20px;
}

/* A 3 px mark like an appointment in the calendar, in the doctors' colours by turns. */
.ticks li::before {
  position: absolute;
  top: 0.35em;
  bottom: 0.35em;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--mark-1);
  content: "";
}

.ticks li:nth-child(4n + 2)::before {
  background: var(--mark-2);
}

.ticks li:nth-child(4n + 3)::before {
  background: var(--mark-3);
}

.ticks li:nth-child(4n + 4)::before {
  background: var(--mark-4);
}

.ticks--row {
  margin-top: 48px;
  color: var(--ink);
}

@media (min-width: 1024px) {
  .ticks--row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }
}

.cards {
  display: grid;
  gap: 16px;
  margin-top: 48px;
}

.cards--tight {
  margin-top: 0;
}

.card {
  display: grid;
  align-content: start;
  padding: 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-m);
  background: var(--bg);
}

.card h3 {
  margin: 16px 0 8px;
}

.tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-m);
  background: var(--brand-subtle);
  color: var(--brand);
}

.tile .icon {
  width: 24px;
  height: 24px;
}

@media (min-width: 640px) {
  .cards:not(.cards--tight) {
    margin-top: 64px;
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .cards:not(.cards--tight) {
    margin-top: 96px;
  }

  .card {
    padding: 32px;
  }
}

/* ---------- Analytics ---------- */

.metrics {
  display: grid;
  gap: 24px;
  margin: 48px 0 0;
}

.metrics > div {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line-1);
}

/* A 24 × 3 px mark on the line, a doctor's colour per group. */
.metrics > div::before {
  position: absolute;
  top: -2px;
  left: 0;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--mark-1);
  content: "";
}

.metrics > div:nth-child(2)::before {
  background: var(--mark-2);
}

.metrics > div:nth-child(3)::before {
  background: var(--mark-3);
}

.metrics > div:nth-child(4)::before {
  background: var(--mark-4);
}

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

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

.shots-pair {
  display: grid;
  gap: 32px;
  margin-top: 48px;
}

.shots-pair .shot--narrow {
  max-width: 560px;
}

@media (min-width: 1024px) {
  .shots-pair {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    gap: 24px;
  }

  .shots-pair .shot:first-child {
    grid-column: 1 / 8;
  }

  .shots-pair .shot--narrow {
    grid-column: 8 / 13;
    max-width: none;
  }
}

.excel {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 16px;
  margin-top: 32px;
  padding: 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-m);
  background: var(--bg);
}

.excel > div {
  display: grid;
  gap: 8px;
  max-width: 68ch;
}

@media (min-width: 1024px) {
  .excel {
    padding: 32px;
  }
}

/* A call to action in the middle of the page: a line of text and a button. */
.callout {
  display: grid;
  gap: 16px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--line-2);
}

.callout p {
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.55;
}

@media (max-width: 639px) {
  .callout .button {
    width: 100%;
  }
}

@media (min-width: 640px) {
  .callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Roles and their rights ---------- */

.rights {
  max-width: 792px;
  margin-top: 32px;
}

.rights > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: var(--radius-s);
  color: var(--brand);
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

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

.rights > summary:hover {
  text-decoration: underline;
}

.rights > summary .icon,
.faq summary .icon {
  width: 20px;
  height: 20px;
}

.rights[open] > summary .icon,
.faq details[open] summary .icon {
  transform: rotate(180deg);
}

@media (prefers-reduced-motion: no-preference) {
  .rights > summary .icon,
  .faq summary .icon {
    transition: transform 0.15s ease;
  }
}

.rights__table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
}

.rights__table .is-no {
  color: var(--text-3);
}

.rights__note {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 0.875rem;
}

/* From 640 px: a table in a rounded frame. */
@media (min-width: 640px) {
  .rights__frame {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-m);
  }

  .rights__table {
    margin-top: 0;
  }

  .rights__table th,
  .rights__table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--line-2);
    text-align: left;
    vertical-align: top;
  }

  .rights__table tbody tr:last-child > * {
    border-bottom: 0;
  }

  .rights__table thead th {
    border-bottom-color: var(--line-1);
    background: var(--bg-alt);
    color: var(--text-2);
    font-size: 0.875rem;
    font-weight: 600;
  }

  .rights__table thead th:first-child {
    width: 46%;
  }

  .rights__table tbody th {
    color: var(--ink);
    font-weight: 400;
  }
}

/* On a phone: one card per action, the role names written beside the values. */
@media (max-width: 639px) {
  .rights__table,
  .rights__table tbody,
  .rights__table tr,
  .rights__table th,
  .rights__table td {
    display: block;
  }

  .rights__table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .rights__table tbody tr {
    margin-bottom: 12px;
    padding: 12px 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-m);
  }

  .rights__table tbody th {
    margin-bottom: 8px;
    color: var(--ink);
    font-weight: 600;
    text-align: left;
  }

  .rights__table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 0;
    color: var(--ink);
    font-size: 0.875rem;
  }

  .rights__table td::before {
    color: var(--text-3);
    content: attr(data-label);
  }
}

/* ---------- Security: the one dark band ---------- */

.section--navy {
  background: var(--navy);
  color: var(--on-navy-2);
}

.section--navy h2,
.section--navy h3 {
  color: var(--on-navy);
}

.section--navy .eyebrow {
  color: var(--on-navy-2);
}

.section--navy a {
  color: var(--on-navy-link);
}

.section--navy a:hover {
  color: var(--on-navy-2);
}

.section--navy :focus-visible {
  outline-color: #fff;
}

.line {
  display: block;
}

.kpis {
  display: grid;
  gap: 8px;
  margin: 0;
}

.kpis > div {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 16px 20px;
  border-radius: var(--radius-m);
  background: var(--navy-2);
}

.kpis dt {
  color: var(--on-navy);
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1.22;
}

.kpis dd {
  max-width: 28ch;
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.47;
}

@media (min-width: 640px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border-radius: var(--radius-m);
    background: var(--on-navy-line);
  }

  .kpis > div {
    padding: 24px;
    border-radius: 0;
    background: var(--navy);
  }
}

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

@media (min-width: 1280px) {
  .kpis dt {
    font-size: 2.75rem;
    line-height: 1.18;
  }
}

.security {
  display: grid;
  gap: 48px;
  margin-top: 48px;
}

@media (min-width: 1024px) {
  .security {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    gap: 24px;
    margin-top: 64px;
  }

  .security .facts-list {
    grid-column: 1 / 6;
  }

  .security .shot {
    grid-column: 6 / 13;
  }
}

.facts-list {
  display: grid;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 4px 12px;
}

.facts-list .icon {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  color: var(--on-navy-link);
}

.facts-list h3 {
  font-size: 1.125rem;
  line-height: 1.45;
}

.facts-list p {
  grid-column: 2;
}

/* ---------- Questions ---------- */

.faq {
  display: grid;
  gap: 32px;
}

@media (min-width: 1024px) {
  .faq {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
  }

  .faq > h2 {
    position: sticky;
    top: 96px;
    grid-column: 1 / 5;
    align-self: start;
  }

  .faq__list {
    grid-column: 5 / 13;
  }
}

.faq__list {
  border-top: 1px solid var(--line-2);
}

.faq details {
  border-bottom: 1px solid var(--line-2);
}

.faq summary {
  position: relative;
  min-height: 64px;
  padding: 20px 48px 20px 0;
  border-radius: var(--radius-s);
  color: var(--ink);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.45;
  list-style: none;
  cursor: pointer;
}

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

.faq summary:hover {
  color: var(--brand);
}

.faq summary .icon {
  position: absolute;
  top: 23px;
  right: 8px;
  color: var(--text-3);
}

.faq__answer {
  display: grid;
  gap: 12px;
  max-width: 68ch;
  padding: 0 48px 24px 0;
}

/* ---------- The last call to action ---------- */

.final {
  position: relative;
  display: grid;
  justify-items: start;
  overflow: hidden;
  padding: 32px 24px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-m);
  background: var(--brand-subtle);
}

.final > * {
  position: relative;
  z-index: 1;
  max-width: 792px;
}

.final .lead {
  margin: 16px 0 32px;
}

.final__links {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

@media (max-width: 639px) {
  .final .button {
    width: 100%;
  }
}

@media (min-width: 640px) {
  .final {
    padding: 48px;
  }
}

@media (min-width: 1024px) {
  .final {
    padding: 64px;
  }

  /* The grid of hours in the panel's right part. */
  .final::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 45%;
    background: linear-gradient(to bottom, var(--brand-line) 1px, transparent 1px) 0 0 / 100% 48px;
    content: "";
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent, rgb(0 0 0 / 60%));
    mask-image: linear-gradient(to right, transparent, rgb(0 0 0 / 60%));
  }
}

/* ---------- News beside the first screen ---------- */

.news-rail__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.news-rail__head h2 {
  font-size: 1.125rem;
  line-height: 1.45;
}

.news-rail__all {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.43;
  text-decoration: none;
  white-space: nowrap;
}

.news-rail__all:hover {
  text-decoration: underline;
}

.news-rail__list,
.more-news__list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-card {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--line-3);
}

.news-card:first-child {
  padding-top: 0;
  border-top: 0;
}

.news-card:last-child {
  padding-bottom: 0;
}

.news-card__photo {
  display: none;
  width: 100%;
  aspect-ratio: 2 / 1;
  margin-bottom: 8px;
  border-radius: var(--radius-s);
  object-fit: cover;
}

.news-card__date {
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.25;
}

.news-card__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.375;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.news-card__title a {
  color: var(--ink);
  text-decoration: none;
}

/* The whole card opens the news item. */
.news-card__title a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.news-card:hover .news-card__title a {
  color: var(--brand);
  text-decoration: underline;
}

/* The focus ring goes round the whole card. */
.news-card:has(a:focus-visible) {
  border-radius: var(--radius-s);
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.news-card:has(a:focus-visible) a:focus-visible {
  outline: none;
}

.news-card__text {
  display: none;
}

.news-rail__empty {
  display: grid;
  font-size: 0.875rem;
  line-height: 1.43;
}

.news-rail__empty hr {
  width: 100%;
  margin: 16px 0;
  border: 0;
  border-top: 1px solid var(--line-3);
}

.news-rail__empty strong {
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 600;
}

.news-rail__empty .button {
  width: 100%;
  margin-bottom: 12px;
}

.news-rail__empty .muted {
  font-size: 0.8125rem;
  line-height: 1.54;
}

.news-rail__empty .with-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.news-rail__empty .with-icon .icon {
  width: 16px;
  height: 16px;
}

/* A phone: two news in a light panel, after the first screen's text. */
@media (max-width: 639px) {
  .news-rail {
    padding: 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-m);
    background: var(--bg);
  }

  .news-rail .news-card:nth-child(n + 3) {
    display: none;
  }

  .news-rail .news-card:nth-child(2) {
    padding-bottom: 0;
  }
}

/* A tablet: two cards side by side, without photos or text. */
@media (min-width: 640px) and (max-width: 1023px) {
  .news-rail__list {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
  }

  .news-rail .news-card,
  .news-rail .news-card:first-child,
  .news-rail .news-card:last-child {
    padding: 16px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-m);
    background: var(--bg);
  }

  .news-rail .news-card:nth-child(n + 3) {
    display: none;
  }

  .news-rail .news-card__title {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

/* Below 1024 px there is nothing to show without news. */
@media (max-width: 1023px) {
  .news-rail--empty {
    display: none;
  }
}

/* A desktop: a white panel in columns 9–12, the first news with its photo and text. */
@media (min-width: 1024px) {
  .news-rail {
    padding: 24px;
    border: 1px solid var(--line-2);
    border-radius: var(--radius-m);
    background: var(--bg);
  }

  .news-rail__head h2 {
    font-size: 1.25rem;
    line-height: 1.4;
  }

  .news-rail__arrow {
    display: none;
  }

  .news-rail .news-card:first-child .news-card__photo {
    display: block;
  }

  .news-rail .news-card:first-child .news-card__title {
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .news-rail .news-card:first-child .news-card__text {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 2px;
    font-size: 0.875rem;
    line-height: 1.43;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

/* ---------- News pages and the 404 page ---------- */

.page-head {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--line-2);
  background: var(--tint);
}

.page-head h1,
.article h1 {
  font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);
  line-height: calc(1em + 8px);
}

.page-head h1 {
  margin-top: 16px;
}

.page-head .lead {
  margin-top: 12px;
}

@media (min-width: 1024px) {
  .page-head {
    padding: 64px 0 48px;
  }
}

.page-head--404 {
  padding: 64px 0;
}

.page-head--404 h1 {
  margin-top: 0;
}

.page-head--404 .lead {
  margin: 12px 0 24px;
}

@media (min-width: 640px) {
  .page-head--404 {
    padding: 96px 0;
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.news-layout {
  display: grid;
  gap: 48px;
  padding-top: 48px;
  padding-bottom: var(--section);
}

@media (min-width: 1024px) {
  .news-layout {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
  }

  .news-layout > :first-child {
    grid-column: 1 / 9;
  }

  .news-layout > :last-child {
    grid-column: 10 / 13;
    align-self: start;
  }
}

.news-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-row {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-2);
}

.news-row:first-child {
  padding-top: 0;
}

.news-row__body {
  display: grid;
  align-content: start;
}

.news-row__date {
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.25;
}

.news-row h2 {
  margin: 4px 0 8px;
  font-size: 1.25rem;
  line-height: 1.4;
}

.news-row h2 a {
  color: var(--ink);
  text-decoration: none;
}

.news-row h2 a::after {
  position: absolute;
  inset: 0;
  content: "";
}

.news-row:hover h2 a {
  color: var(--brand);
  text-decoration: underline;
}

.news-row:has(a:focus-visible) {
  border-radius: var(--radius-s);
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.news-row:has(a:focus-visible) a:focus-visible {
  outline: none;
}

.news-row__text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.news-row__photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-s);
  object-fit: cover;
}

@media (min-width: 640px) {
  .news-row--photo {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 24px;
  }

  .news-row__photo {
    order: 2;
  }

  .news-row h2 {
    font-size: 1.375rem;
    line-height: 1.36;
  }
}

.pager {
  display: grid;
  grid-template-areas:
    "count count"
    "prev next";
  gap: 12px;
  margin-top: 32px;
}

.pager__prev {
  grid-area: prev;
  justify-self: start;
}

.pager__next {
  grid-area: next;
  justify-self: end;
}

.pager__count {
  grid-area: count;
  color: var(--text-3);
  font-size: 0.875rem;
  text-align: center;
}

@media (min-width: 640px) {
  .pager {
    grid-template-areas: "prev count next";
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }
}

.empty {
  display: grid;
  justify-items: start;
  gap: 16px;
}

.side-card {
  display: grid;
  padding: 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-m);
  background: var(--bg);
}

.side-card h2 {
  font-size: 1.25rem;
  line-height: 1.4;
}

.side-card > p {
  margin: 8px 0 16px;
}

.side-card .button {
  width: 100%;
}

.side-card__links {
  display: grid;
  justify-items: start;
  gap: 4px;
  margin-top: 12px;
  font-size: 0.875rem;
}

/* A news item, the other news beside it on a desktop. */
.article-layout {
  display: grid;
  gap: 48px;
  padding-top: 32px;
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
  }

  .article {
    grid-column: 1 / 9;
  }

  .more-news {
    grid-column: 10 / 13;
    align-self: start;
    margin-top: 64px;
  }
}

.article {
  display: grid;
  justify-items: start;
  max-width: 720px;
}

.article h1 {
  margin-top: 8px;
}

.article__date {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 0.875rem;
}

.article__photo {
  width: auto;
  max-height: 560px;
  margin-top: 32px;
  border-radius: var(--radius-m);
}

.article__body {
  margin-top: 32px;
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.65;
}

.article__body p + p {
  margin-top: 1em;
}

.article__body a {
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .article__body {
    font-size: 1.125rem;
    line-height: 1.67;
  }
}

.article__link {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 32px;
}

.more-news h2 {
  margin-bottom: 8px;
  font-size: 1.125rem;
  line-height: 1.45;
}

.more-news .news-card,
.more-news .news-card:first-child {
  padding: 12px 0;
  border-top: 1px solid var(--line-3);
}

.more-news .news-card__title {
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.more-news__all {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* The band at the end of a news item: what ALAMIS is, and the two ways in. */
.end-cta {
  display: grid;
  gap: 16px;
  margin: 64px 0 var(--section);
  padding: 24px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-m);
  background: var(--brand-subtle);
}

.end-cta > p {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .end-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px;
  }
}

/* ---------- Footer ---------- */

.site-footer {
  padding: 48px 0 32px;
  border-top: 1px solid var(--line-2);
  background: var(--bg-alt);
  font-size: 0.875rem;
  line-height: 1.43;
}

.site-footer__grid {
  display: grid;
  gap: 32px;
}

.site-footer__brand {
  display: grid;
  align-content: start;
  justify-items: start;
  max-width: 420px;
}

.site-footer__brand > p:first-of-type {
  margin-top: 16px;
}

.site-footer__brand > p + p {
  margin-top: 8px;
}

.site-footer__column h2 {
  margin-bottom: 12px;
  color: var(--text-3);
  font-family: var(--font-text);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer__column ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__column a {
  display: inline-block;
  min-height: 24px;
  color: var(--text-2);
  text-decoration: none;
}

.site-footer__column a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.site-footer__bottom {
  display: grid;
  gap: 8px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line-2);
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.54;
}

.site-footer__bottom ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .site-footer__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .site-footer {
    padding-top: 64px;
  }

  .site-footer__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
  }

  .site-footer__brand {
    grid-column: 1 / 6;
  }

  .site-footer__column:nth-child(2) {
    grid-column: 6 / 8;
  }

  .site-footer__column:nth-child(3) {
    grid-column: 8 / 10;
  }

  .site-footer__column:nth-child(4) {
    grid-column: 10 / 13;
  }
}
