/* A page of screens. The shell holds the window's height; the head stands above, and the main is what scrolls,
   one whole screen at a time, each wholly paper or wholly ink, never half of each. No smooth scroll: a screen
   snaps into place. A screen taller than the window scrolls inside itself and snaps again at its edges. */
.la-shell.is-screened {
  display: flex;
  flex-direction: column;
  /* The window as the phone shows it now, its bars however they stand, so a screen fills the glass; a browser that
     knows not the dynamic height takes the small one. */
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
}

.la-shell.is-screened > .la-nav {
  flex: none;
}

.la-screens {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  scroll-behavior: auto;
}

.la-screen {
  display: grid;
  align-content: center;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  color: var(--la-color-fg-body);
  background: var(--la-color-bg);
}

.la-screen > * {
  min-width: 0;
}

/* An ink screen: the night's navy in both themes, the paper's sand as its ink; by night a step above the page's
   navy, so screens alternate in the dark as they do by day. */
.la-screen.is-ink {
  --la-color-bg: var(--la-color-role-screen-ink);
  --la-color-bg-raised: var(--la-color-role-emphasis-strong);
  --la-color-bg-raised-hover: var(--la-color-role-emphasis-strong);
  --la-color-bg-raised-strong: var(--la-color-role-emphasis-strong);
  --la-color-bg-sunken: var(--la-color-role-emphasis);
  --la-color-fg: var(--la-color-role-on-emphasis);
  --la-color-fg-body: var(--la-color-role-on-emphasis-muted);
  --la-color-fg-muted: var(--la-color-role-on-emphasis-muted);
  --la-color-fg-subtle: var(--la-color-role-on-emphasis-subtle);
  --la-color-border: var(--la-color-role-emphasis-border);
  --la-color-border-subtle: var(--la-color-role-emphasis-border);
  --la-color-accent: var(--la-color-role-emphasis-accent);
  --la-color-link: var(--la-color-role-emphasis-accent);
  --la-color-link-hover: var(--la-color-role-emphasis-accent);
  --la-color-accent-hover: var(--la-color-role-emphasis-accent);
  --la-color-accent-subtle: color-mix(
    in oklab,
    var(--la-color-role-emphasis-accent) 14%,
    var(--la-color-role-screen-ink)
  );
}

/* Within a screen a band paints no ground of its own: the screen's is the ground. */
.la-screen > .la-emphasis,
.la-screen > section {
  background: transparent;
}

/* A band within a screen keeps its room by the window's height, so a short window still holds it whole. */
.la-screens .la-band,
.la-screens .la-front,
.la-screens .la-install {
  padding-block: clamp(16px, 3svh, 56px);
}

/* The last screen: its part in the middle of the room left, the foot at its bottom, on the screen's own ground. */
.la-screen.is-last {
  grid-template-rows: 1fr auto;
  align-content: stretch;
}

.la-screen.is-last > :first-child {
  align-self: center;
}

.la-screen.is-last > .la-footer {
  background: transparent;
}

/* A phone holds one screen of each: each screen keeps its essence and leaves the rest to a wider room. */
@container la-page (max-width: 40rem) {
  .la-screens .la-count,
  .la-screens .la-persona-why,
  .la-screens .la-phone-time,
  .la-screens .la-phone-date,
  .la-screens .la-point-body,
  .la-screens .la-types ~ *,
  .la-screens .la-band-lede:has(+ .la-types) {
    display: none;
  }

  .la-screens .la-phone-screen {
    aspect-ratio: auto;
  }

  .la-screens .la-phone-stack {
    margin-block-start: 0;
  }

  .la-screens .la-types {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--la-space-2, 8px);
  }

  .la-screens .la-type {
    padding: var(--la-space-3, 12px);
  }

  .la-screens .la-type > :nth-child(n + 4) {
    display: none;
  }

  .la-screens .la-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .la-screens .la-plan-price {
    font-size: var(--la-text-3xl, 2rem);
  }

  .la-screens .la-plan-price small {
    display: block;
    margin-block-start: var(--la-space-1);
    margin-inline-start: 0;
    white-space: nowrap;
  }

  /* The two plans' names take two lines each, wrapped or not, so their figures stand on one line across the cards. */
  .la-screens .la-plan-name {
    min-block-size: 2lh;
  }
}

/* The one search. Touched in the hero, it grows into a screen of its own above the page: the field at the top,
   larger, the page dimmed away; left, it goes back to its place. No script: the field's own focus does it. */
.la-screen:has(.la-ss-hero:focus-within) {
  position: relative;
}

.la-screen:has(.la-ss-hero:focus-within) .la-front,
/* Its ancestors only, so the field's own room is the screen. */
.la-screen:has(.la-ss-hero:focus-within) .la-front *:has(.la-ss-hero) {
  position: static;
  transform: none;
  contain: none;
  container-type: normal;
}

.la-screens .la-ss-hero:focus-within {
  position: absolute;
  inset: 0;
  z-index: 40;
  width: auto;
  max-width: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  align-content: start;
  padding-block: clamp(24px, 12svh, 160px);
  padding-inline: var(--la-page-edge, 16px);
  background: var(--la-color-bg);
  animation: la-grow calc(240ms * var(--la-motion)) var(--la-ease-out) both;
}

.la-screens .la-ss-hero:focus-within .la-ss-input-wrap {
  width: min(100%, 48rem);
  margin-inline: auto;
}

.la-screens .la-ss-hero:focus-within .la-ss-input {
  font-size: var(--la-text-xl, 1.25rem);
}

@keyframes la-grow {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

/* A tablet with little height: the phone told without its clock, the changes by their names alone. A tall
   tablet keeps them whole. */
@container la-page (max-width: 64rem) {
  @media (max-height: 62rem) {
    .la-screens .la-phone-screen {
      aspect-ratio: auto;
    }

    .la-screens .la-phone-time,
    .la-screens .la-phone-date {
      display: none;
    }

    .la-screens .la-phone-stack {
      margin-block-start: 0;
    }

    .la-screens .la-type > :nth-child(n + 4) {
      display: none;
    }
  }
}

/* The hero's glow lies on its whole screen, never on the band its words fill. */
.la-screen:has(> .la-front) {
  background:
    radial-gradient(60rem 30rem at 50% 0, var(--la-color-role-glow-hero, transparent), transparent 70%),
    var(--la-color-bg);
}

.la-screen > .la-front {
  background: transparent;
}

.la-screen > .la-front::before {
  display: none;
}

/* A phone: the hero says what Procese does before anything else, the notice arriving above its words; the case
   behind it is the next screens' to show. */
@container la-page (max-width: 40rem) {
  .la-screens .la-front.is-scened .la-scene {
    display: block;
    order: -1;
  }

  .la-screens .la-scene-record {
    display: none;
  }

  /* The notice stands on the words' own edge, flush with them, and the whole stands in the middle of the screen,
     its spaces growing with the screen's height so a tall phone is filled and a short one still holds it all. */
  .la-screens .la-front.is-scened {
    gap: clamp(12px, 4.5svh, 48px);
  }

  .la-screens .la-front.is-scened .la-hero-lede {
    font-size: calc(clamp(1rem, 2.2svh, 1.25rem) * var(--access-text-size, 1));
  }

  .la-screens .la-front.is-scened .la-scene {
    padding: 0;
  }

  .la-screens .la-scene-toast {
    position: static;
    inset: auto;
    width: 100%;
    margin: 0;
    animation: la-arrive calc(700ms * var(--la-motion)) calc(400ms * var(--la-motion)) var(--la-ease-out) both;
  }

  .la-screens .la-hero-line {
    font-size: min(12cqi, calc(clamp(1.75rem, 5.6svh, 3rem) * var(--access-text-size, 1)));
  }
}

/* A notice arrives once and stays, as a phone's does. */
@keyframes la-arrive {
  from {
    opacity: 0;
    transform: translateY(-1.5rem) scale(0.96);
  }
}

/* A short room, a phone on its side: little height, much width. Each screen lays its pieces side by side, says its
   title smaller, and leaves its lede and its long lines to a taller room; a screen is never a column read sideways. */
@media (orientation: landscape) and (max-height: 32rem) {
  .la-shell.is-screened > .la-nav {
    padding-block: var(--la-space-1);
  }

  .la-screens .la-band,
  .la-screens .la-front,
  .la-screens .la-install {
    padding-block: var(--la-space-3);
  }

  .la-screens .la-hero-line,
  .la-screens .la-band-title {
    font-size: clamp(1.25rem, 7svh, 2.25rem);
  }

  /* A title runs the room's width, one line where it fits: the room has the width and lacks the height. */
  .la-screens .la-band-title {
    max-width: none;
  }

  .la-screens .la-band-lede,
  .la-screens .la-hero-lede,
  .la-screens .la-hero-trust,
  .la-screens .la-band-eyebrow,
  .la-screens .la-hero-eyebrow,
  .la-screens .la-scene-record,
  .la-screens .la-phone,
  .la-screens .la-point-body,
  .la-screens .la-persona-why,
  .la-screens .la-count,
  .la-screens .la-plan ul,
  .la-screens .la-contrast-note,
  .la-screens .la-app-body {
    display: none;
  }

  /* The hero: its words on the left, the notice arriving on the right. */
  .la-screens .la-front.is-scened {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: var(--la-space-5);
  }

  .la-screens .la-scene-toast {
    position: static;
    width: 100%;
    animation: la-arrive calc(700ms * var(--la-motion)) calc(400ms * var(--la-motion)) var(--la-ease-out) both;
  }

  .la-screens .la-moat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .la-screens .la-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--la-space-3);
  }

  .la-screens .la-types {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--la-space-2);
  }

  .la-screens .la-type {
    padding: var(--la-space-2);
  }

  .la-screens .la-type > :nth-child(n + 4) {
    display: none;
  }

  .la-screens .la-contrast {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }

  .la-screens .la-personas {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--la-space-2);
  }

  .la-screens .la-plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .la-screens .la-install {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--la-space-5);
    align-items: center;
  }
}

/* An opening laid as a screen reads as the other screens' bands: no rule beside it, its title theirs. */
.la-screens .la-opening {
  padding-inline-start: 0;
}

.la-screens .la-opening::before {
  display: none;
}

.la-screens .la-opening-line {
  font-size: var(--la-text-3xl);
}

@media (orientation: landscape) and (max-height: 32rem) {
  .la-screens .la-opening-line {
    font-size: clamp(1.25rem, 7svh, 2.25rem);
  }

  .la-screens .la-front.is-scened .la-scene {
    display: block;
  }

  /* The price's lede runs the room's width on one line, and its cards stand closer, so the screen keeps a breath at
     the head and at the foot. */
  .la-screens .la-band-lede:has(+ .la-plans) {
    display: block;
    max-width: none;
    margin-block-end: var(--la-space-3);
  }

  .la-screens .la-plan {
    padding-block: var(--la-space-4);
  }
}

/* The phone drawn on a screen is as tall as the screen allows, never taller: its width follows the room's height. */
.la-screens .la-phone {
  width: min(17.5rem, calc((100svh - 12rem) * 9 / 19.5));
}

/* The map of the counties as a screen of the home: the whole country in the screen, its tiles as tall as the room
   lets eight rows stand, never taller than they are wide by much; at a desk and a tablet each county its name and its
   count, on a phone its code alone, its heat telling the rest. */
.la-screens .la-map-zone {
  display: grid;
  gap: clamp(8px, 2svh, 24px);
  /* A band that bleeds: its edge, the page's, holds its words to the one column. */
  width: 100%;
  margin: 0;
  padding: clamp(12px, 3svh, 48px) var(--la-page-edge);
  background: transparent;
  border: 0;
}

.la-screens .la-map-head {
  align-items: flex-end;
  margin: 0;
}

.la-screens .la-map-eyebrow {
  flex-basis: 100%;
  margin: 0;
}

.la-screens .la-map-head h2 {
  font-size: var(--la-text-3xl);
  line-height: var(--la-leading-display, 1.1);
}

.la-screens .la-map-grid {
  grid-auto-rows: min(
    5.25rem,
    max(1.75rem, calc((100svh - 20rem) / 8)),
    calc((100cqi - 2 * var(--la-page-edge)) / 9 * 1.15)
  );
  gap: clamp(3px, 0.7vmin, 8px);
}

.la-screens .la-judet {
  justify-content: space-between;
  min-width: 0;
}

.la-screens .la-judet .la-abbr {
  display: none;
}

.la-screens .la-judet .la-judet-name {
  overflow: hidden;
  font-size: var(--la-text-xs);
  overflow-wrap: anywhere;
}

.la-screens .la-judet .la-judet-count {
  position: static;
  align-self: flex-end;
  font-size: var(--la-text-xs);
  line-height: 1;
}

.la-map-go {
  display: flex;
}

@container la-page (min-width: 64rem) {
  .la-screens .la-judet .la-judet-name,
  .la-screens .la-judet .la-judet-count {
    font-size: var(--la-text-sm);
  }
}

/* A tablet held upright: tiles too narrow for a whole name, so each county its code and its count. */
@container la-page (min-width: 40rem) and (max-width: 64rem) {
  .la-screens .la-judet .la-abbr {
    display: block;
    margin: 0;
  }

  .la-screens .la-judet .la-judet-name {
    display: none;
  }
}

/* A phone: each county its code, centred in its tile. */
@container la-page (max-width: 40rem) {
  .la-screens .la-judet {
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: var(--la-radius-sm);
  }

  .la-screens .la-judet .la-abbr {
    display: block;
    margin: 0;
    font-size: 0.6875rem;
  }

  .la-screens .la-judet .la-judet-name,
  .la-screens .la-judet .la-judet-count {
    display: none;
  }

  .la-screens .la-map-head h2 {
    font-size: var(--la-text-2xl);
  }
}

/* A phone on its side: the head on one line, the map beneath filling the rest, each county its code and count. */
@media (orientation: landscape) and (max-height: 32rem) {
  .la-screens .la-map-eyebrow {
    display: none;
  }

  .la-screens .la-map-head h2 {
    font-size: clamp(1.125rem, 6svh, 1.5rem);
  }

  .la-screens .la-map-grid {
    grid-auto-rows: max(1.5rem, calc((100svh - 8.5rem) / 8));
  }

  .la-screens .la-judet {
    flex-direction: row;
    align-items: center;
    padding: 0 var(--la-space-1);
  }

  .la-screens .la-judet .la-abbr {
    display: block;
    margin: 0;
  }

  .la-screens .la-judet .la-judet-name {
    display: none;
  }

  .la-screens .la-map-go {
    display: none;
  }
}

/* ---- a phone: every screen whole ----------------------------------------------------------------------------------- */

/* The foot's own screen stands on a phone alone. */
.la-screen.is-foot {
  display: none;
}

/* A phone upright: every screen stands whole in the room its browser leaves it, so a swipe always shows a screen
   entire and never reads one through (Razvan's word of 16 November 2026). What a screen holds past its essence leaves,
   what stays is drawn tighter, and the foot, which with the questions fills more than a room, is a screen of its own. */
@container la-page (max-width: 40rem) {
  .la-screen.is-last {
    grid-template-rows: none;
    align-content: center;
  }

  .la-screen.is-last > .la-footer {
    display: none;
  }

  .la-screen.is-foot {
    display: grid;
    align-content: center;
  }

  .la-screen.is-foot > .la-footer {
    background: transparent;
  }

  /* Why a push: the phone's notices and the line that says it; the points are a wider room's. */
  .la-screens .la-points {
    display: none;
  }

  .la-screens .la-moat-lede {
    margin-block-end: 0;
  }

  /* The changes: each its glyph beside its name and what it says, two to a row. */
  .la-screens .la-type {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: var(--la-space-2);
    align-items: center;
    /* The two lines stand together, centred: a tile taller than its words (its row's neighbour wraps) never spreads
       the label from its name. */
    align-content: center;
    padding: var(--la-space-2);
  }

  .la-screens .la-type-glyph {
    grid-row: span 2;
    width: var(--la-icon-md, 1.25rem);
    height: var(--la-icon-md, 1.25rem);
    margin: 0;
    padding: 6px;
  }

  .la-screens .la-type-tag {
    font-size: var(--la-text-2xs);
  }

  .la-screens .la-type-was {
    margin-block-start: 2px;
    font-size: var(--la-text-xs);
  }
}

/* A phone with a shorter room: the phone's two first notices tell it. */
@container la-page (max-width: 40rem) {
  @media (max-height: 50rem) {
    .la-screens .la-phone-stack .la-notif:nth-child(n + 3) {
      display: none;
    }
  }
}

/* A phone tells the phone's notices across its width: its height is the notices' own, so a narrower phone would only
   wrap their words and stand taller. */
@container la-page (max-width: 40rem) {
  .la-screens .la-phone {
    width: min(17.5rem, 100%);
  }
}

/* A phone with a short room, a smaller or an older one: every screen still whole. The bands breathe less, the notes
   under the portal's table and ours leave to the lede that says them, the apps their names alone, the people it is
   for two to a row, the foot drawn closer. */
@container la-page (max-width: 40rem) {
  @media (max-height: 44rem) {
    .la-screens .la-band,
    .la-screens .la-front,
    .la-screens .la-install {
      padding-block: var(--la-space-3);
    }

    .la-screens .la-band-lede,
    .la-screens .la-opening {
      margin-block-end: var(--la-space-4);
    }

    .la-screens .la-contrast-note,
    .la-screens .la-app-body {
      display: none;
    }

    .la-screens .la-personas {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: var(--la-space-2);
    }

    .la-screen.is-foot > .la-footer {
      gap: var(--la-space-4);
      padding-block: var(--la-space-4) var(--la-space-5);
    }
  }
}
