/*
 * The site's look (work record landing_site, LS.2; frontend_visual_system.decisions.md §4): var()
 * only — HUB's scale (styles/scale.css, brought by the build) and the site's own
 * (styles/site-scale.css). The one literal is the breakpoint in @media, 768 px as in HUB.
 */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-family-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  color: var(--palette-black);
  background: var(--palette-white);
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

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

a {
  color: inherit;
}

img,
svg {
  display: block;
}

/* The page's column. */
.page {
  inline-size: 100%;
  max-inline-size: var(--site-width-page);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* ---------- Buttons: a pill, with or without an arrow in a circle ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-4);
  min-block-size: var(--control-height-lg);
  padding-block: var(--space-2);
  padding-inline: var(--space-7);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-round);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.button:has(.button-arrow) {
  padding-inline-end: var(--space-2);
}

.button-arrow {
  display: inline-grid;
  place-items: center;
  inline-size: var(--control-height-md);
  block-size: var(--control-height-md);
  border-radius: var(--radius-round);
}

.button-arrow svg,
.inline-arrow,
.round svg,
.pill-arrow svg {
  inline-size: var(--space-6);
  block-size: var(--space-6);
  fill: none;
  stroke: currentColor;
  stroke-width: var(--line-width-sm);
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The first screen's two buttons: flat, white words (owner, LS.2 review 3: 3). */
.button-dark {
  color: var(--palette-white);
  background: var(--palette-black);
}

.button-dark .button-arrow {
  color: var(--palette-black);
  background: var(--palette-white);
}

.button-dark:hover {
  background: var(--palette-gray-800);
}

/* HUB orange, white words: 4.6:1 (owner, LS.2 review 5). */
.button-orange {
  color: var(--palette-white);
  background: var(--palette-orange-700);
}

.button-orange:hover {
  background: var(--palette-orange-800);
}

.button-light {
  color: var(--palette-black);
  background: var(--palette-gray-300);
}

.button-light .button-arrow {
  color: var(--palette-white);
  background: var(--palette-black);
}

.button-light:hover {
  background: var(--palette-gray-200);
}

.button-outline {
  color: var(--palette-black);
  border-color: var(--palette-gray-200);
  background: var(--palette-white);
}

.button-outline:hover {
  background: var(--palette-gray-50);
}

/* In a black card the colours turn over. */
.card .button-light {
  color: var(--palette-black);
  background: var(--palette-white);
}

.card .button-light:hover {
  background: var(--palette-gray-200);
}

.round {
  display: inline-grid;
  place-items: center;
  inline-size: var(--control-height-sm);
  block-size: var(--control-height-sm);
  padding: 0;
  border: var(--border-width) solid var(--palette-gray-200);
  border-radius: var(--radius-round);
  color: var(--palette-black);
  background: var(--palette-white);
  cursor: pointer;
}

.round:hover {
  background: var(--palette-gray-50);
}

.round svg {
  inline-size: var(--space-5);
  block-size: var(--space-5);
}

:focus-visible {
  outline: var(--line-width-sm) solid var(--palette-orange-700);
  outline-offset: var(--space-1);
}

/* ---------- The bar: menu in the middle, language at the end (owner, LS.2 review 3: 1) ---------- */

/* The bar and the first screen: one plain grey (owner, LS.2 review 1). */
.top {
  background: var(--site-palette-gray-hero);
}

.bar {
  display: grid;
  grid-template-columns: var(--grid-three);
  grid-template-areas: ". menu end";
  align-items: center;
  gap: var(--space-5);
  min-block-size: var(--height-count);
}

.menu {
  grid-area: menu;
  justify-self: center;
  display: flex;
  gap: var(--space-8);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.menu a {
  text-decoration: none;
}

.menu a:hover,
.language a:hover,
.foot a:hover {
  color: var(--palette-orange-700);
}

.bar-end {
  grid-area: end;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.language {
  display: flex;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
}

.language a {
  color: var(--palette-gray-500);
  text-decoration: none;
}

.language [aria-current] {
  color: var(--palette-black);
}

.menu-button {
  display: none;
}

/* A phone, with the script: the menu is a panel the ☰ button opens (owner, LS-Q20). */
@media (max-width: 767px) {
  .js .menu-button {
    display: inline-grid;
  }

  .js .menu {
    display: none;
  }

  .js .menu[data-open] {
    position: absolute;
    inset-inline: var(--space-5);
    inset-block-start: var(--height-count);
    display: grid;
    gap: var(--space-5);
    padding: var(--space-7);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-xl);
    background: var(--palette-white);
    box-shadow: var(--shadow-3);
  }

  .menu {
    flex-wrap: wrap;
    gap: var(--space-5);
  }

  .bar {
    position: relative;
    flex-wrap: wrap;
  }
}

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

/* Not positioned, so the phone's menu panel lies above it without a stacking number. */
.hero {
  overflow: hidden;
  min-block-size: calc(var(--height-screen) - var(--height-count));
  display: grid;
  grid-template-rows: var(--grid-one) auto;
  grid-template-areas: "intro" "brand";
  background: var(--site-palette-gray-hero);
}

.intro {
  grid-area: intro;
  display: grid;
  gap: var(--space-8);
  padding-block: var(--space-8);
}

.intro-text {
  display: grid;
  align-content: center;
  gap: var(--space-8);
}

/* One step thinner than bold, same size (owner, 2026-11-17: 2a, 3a). */
.motto {
  font-size: var(--site-font-size-display);
  font-weight: var(--site-font-weight-motto);
  line-height: var(--site-line-height-display);
  letter-spacing: var(--site-letter-spacing-display);
}

/* From a tablet the motto keeps the left half, as in the reference (owner, LS.2 review 4, kept in 5). */
@media (min-width: 768px) {
  .intro {
    grid-template-columns: var(--grid-two);
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.brand {
  grid-area: brand;
  display: grid;
  margin-block-start: var(--space-7);
}

/* JUST.STRUCT: as wide as the column (site.js fitWordmark), white at the top of the letters to black
   at their foot (owner, LS.2 review 3: 5). The line is trimmed to the letters, cap to baseline, so the
   fade spans exactly them. Bold, one step under extrabold (owner, 2026-11-17). */
.wordmark {
  font-size: var(--site-font-size-wordmark);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  white-space: nowrap;
  text-box: trim-both cap alphabetic;
  /* Round letters stand a little over the cap line and under the baseline: room for their ink. */
  padding-block: var(--space-2);
  color: var(--palette-black);
}

/* The three words right under JUST.STRUCT, nothing around them (owner, LS.2 review 3: 4). */
.claims {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin-block: var(--space-4) var(--space-7);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--letter-spacing-caps);
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- About ---------- */

.about {
  display: grid;
  gap: var(--space-9);
  padding-block: var(--space-12);
}

.about-text {
  display: grid;
  align-content: center;
  gap: var(--space-10);
}

/* Light, close lines (owner, LS.2 review 6a). */
.lead {
  font-size: var(--site-font-size-lead);
  font-weight: var(--font-weight-light);
  line-height: var(--site-line-height-lead);
  letter-spacing: var(--site-letter-spacing-display);
  color: var(--palette-gray-500);
}

.lead-strong {
  color: var(--palette-black);
}

.news {
  display: grid;
  gap: var(--space-5);
}

.news-label {
  padding-block-end: var(--space-4);
  border-block-end: var(--border-width) solid var(--palette-gray-200);
  font-size: var(--font-size-xs);
  color: var(--palette-gray-600);
}

.news-items {
  display: grid;
  gap: var(--space-4);
}

.news-item {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-snug);
}

/* The year in the line's own colour (owner, LS.2 review 7). */
.news-year {
  margin-inline-end: var(--space-3);
  font-weight: var(--font-weight-bold);
}

/* With the script, one item at a time, in the same place (LS-Q20). */
.js .news-items {
  grid-template-areas: "item";
}

.js .news-item {
  grid-area: item;
  visibility: hidden;
}

.js .news-item[data-current] {
  visibility: visible;
}

.news-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.news-controls .button {
  margin-inline-start: auto;
}

.news-controls .round {
  display: none;
}

.js .news-controls .round {
  display: inline-grid;
}

/* The map of About: light grey dots of land, where the globe was, at least as tall as the words
   beside it (owner, LS.2). Beside them from 1100 px; above them on a narrower screen, where half the
   column could not hold it tall enough. */
.about-map {
  align-self: center;
}

.about-map svg {
  inline-size: 100%;
  block-size: auto;
}

.map-dots {
  fill: none;
  stroke: var(--palette-gray-200);
  stroke-width: var(--site-map-dot);
  stroke-linecap: round;
}

@media (min-width: 1100px) {
  .about {
    grid-template-columns: var(--grid-two);
    grid-template-areas: "map text";
  }

  .about-map {
    grid-area: map;
  }

  .about-text {
    grid-area: text;
  }
}

/* ---------- We Build → Structures ---------- */

.pills {
  display: grid;
  grid-template-columns: var(--grid-two);
  gap: var(--space-3);
  padding-block: var(--space-8);
}

.pill {
  display: grid;
  place-items: center;
  aspect-ratio: var(--site-ratio-pill);
  border-radius: var(--radius-round);
  font-size: var(--site-font-size-title);
  font-weight: var(--font-weight-medium);
  letter-spacing: var(--site-letter-spacing-display);
}

/* Each pill is metal: its colour lit at the top, a sheen across it (owner, LS.2 review 8a). */
.pill {
  box-shadow: var(--site-sheen-rim);
}

.pill-plain {
  background: var(--site-sheen), linear-gradient(var(--palette-gray-50), var(--palette-gray-200));
}

.pill-orange {
  color: var(--palette-white);
  background:
    var(--site-sheen),
    linear-gradient(
      to bottom right,
      var(--site-palette-orange-lit),
      var(--palette-orange-700),
      var(--site-palette-orange-dim),
      var(--site-palette-orange-deep)
    );
}

.pill-arrow {
  color: var(--palette-white);
  background: var(--site-sheen), linear-gradient(var(--palette-gray-850), var(--palette-black));
}

.pill-arrow svg {
  inline-size: var(--control-height-md);
  block-size: var(--control-height-md);
}

.pill-faded {
  color: var(--palette-white);
  background: var(--site-sheen), linear-gradient(var(--palette-gray-200), var(--palette-gray-300));
}

@media (min-width: 768px) {
  .pills {
    grid-template-columns: var(--grid-four);
  }
}

/* ---------- Explore what we do: two black cards ---------- */

.work {
  display: grid;
  gap: var(--space-8);
  padding-block: var(--space-12);
}

.section-title {
  font-size: var(--site-font-size-display);
  font-weight: var(--font-weight-medium);
  line-height: var(--site-line-height-display);
  letter-spacing: var(--site-letter-spacing-display);
  text-align: center;
}

/* Cards, their tiles and the phone's menu: HUB's large rounding, 20 px; the screens keep 4 px (owner,
   2026-11-17: 1a). */
.card {
  display: grid;
  gap: var(--space-9);
  padding: var(--space-7);
  border-radius: var(--radius-lg);
  color: var(--palette-white);
  background: var(--palette-black);
  scroll-margin-block-start: var(--space-7);
}

.card-text {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--space-7);
}

.card-title {
  font-size: var(--site-font-size-title);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
  letter-spacing: var(--site-letter-spacing-display);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--palette-gray-400);
}

.tiles {
  display: grid;
  gap: var(--space-3);
}

/* Words in the middle of the tile, both ways (owner, LS.2 review 10). */
.tile {
  display: grid;
  place-content: center;
  gap: var(--space-3);
  text-align: center;
  min-block-size: var(--height-count);
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-sm);
  color: var(--palette-gray-400);
  background: var(--palette-gray-850);
}

/* Services: three wide tiles, one under the other, each its title above its words, all as tall as
   the tallest (owner, LS.2). */
.tiles-services {
  grid-auto-rows: var(--grid-one);
}

/* Title and words from the tile's left edge, in its middle top to bottom (owner, LS.2). */
.tiles-services .tile {
  place-content: center stretch;
  text-align: start;
}

.tile-name {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-medium);
  color: var(--palette-white);
}

/* The HUB card's screens: the large one at the top right, the small one at the top left, the middle
   one over the large one's lower left corner, drawn last (owner, LS.2). */
.screens {
  position: relative;
  align-self: center;
  aspect-ratio: var(--site-ratio-screens);
}

.screen {
  position: absolute;
  block-size: auto;
  border: var(--border-width) solid var(--palette-gray-800);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-3);
}

.screen-big {
  inset-block-start: 0;
  inset-inline-end: 0;
  inline-size: var(--site-screen-big);
}

.screen-small {
  inset-block-start: var(--site-screen-small-top);
  inset-inline-start: 0;
  inline-size: var(--site-screen-small);
}

.screen-medium {
  inset-block-start: var(--site-screen-medium-top);
  inset-inline-start: var(--site-screen-medium-left);
  inline-size: var(--site-screen-medium);
}

/* From a tablet: more room inside the card. */
@media (min-width: 768px) {
  .card {
    padding: var(--space-10);
  }
}

/* From 1100 px the card has room for its words beside its tiles (owner, LS.2 review 9a). */
@media (min-width: 1100px) {
  .card {
    grid-template-columns: var(--grid-two);
  }
}

/* With room on the screen both ways, and the script, the cards lie one on the other: Services in
   front, the HUB card showing under it by --space-7; scrolling through the stack they change places
   (owner, LS.2 review 3: 7; site.js swapCards). The stack's own height is the scroll they take. */
.stage {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 1100px) and (min-height: 720px) {
  /* The scroll the change takes: room inside the stack (a pinned box moves only within its
     container's content, never into its padding). */
  .stack[data-swap]::after {
    content: "";
    display: block;
    block-size: var(--height-screen);
  }

  .stack[data-swap] .stage {
    position: sticky;
    inset-block-start: var(--space-7);
    grid-template-areas: "card";
    padding-block-end: var(--space-7);
  }

  .stack[data-swap] .card {
    grid-area: card;
    position: relative;
    transform-origin: bottom center;
  }
}

/* ---------- A page of text: the documents, the 404 ---------- */

.text-page {
  max-inline-size: var(--width-xl);
  padding-block: var(--space-10) var(--space-12);
}

.text-page h1 {
  font-size: var(--site-font-size-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--site-line-height-display);
  letter-spacing: var(--site-letter-spacing-display);
}

.text-page > * + *,
.text-page article > * + * {
  margin-block-start: var(--space-5);
}

/* A document's bar (owner, 2026-11-17: 1a, 2a, 4a): white, no line, as high as the home page's; the
   arrow on the text column's left edge, above the title. */
.top-plain {
  background: var(--palette-white);
}

.back-bar {
  display: flex;
  align-items: center;
  max-inline-size: var(--width-xl);
  min-block-size: var(--height-count);
}

[data-version-line] {
  font-size: var(--font-size-sm);
  color: var(--palette-gray-600);
}

/* A legal document (the owner's texts, D14): numbered sections, bulleted lists, and each row of a
   table as a record of labelled lines on every width — five columns do not fit the column (owner,
   2026-11-17: 4a). */
.text-page article h2 {
  margin-block-start: var(--space-9);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
}

.text-page article ul {
  padding-inline-start: var(--space-7);
  list-style: disc;
}

.text-page article li + li {
  margin-block-start: var(--space-3);
}

.record {
  padding-block-start: var(--space-5);
  border-block-start: var(--border-width) solid var(--palette-gray-200);
}

.record + .record {
  margin-block-start: var(--space-7);
}

.record h3 {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-snug);
}

.record dl {
  margin: 0;
}

.record dt {
  margin-block-start: var(--space-3);
  font-size: var(--font-size-sm);
  color: var(--palette-gray-600);
}

.record dd {
  margin: 0;
}

/* ---------- The foot ---------- */

/* On black, no line above (owner, LS.2 review 12); the black spans the screen, the words the column. */
.foot-band {
  background: var(--palette-black);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-5);
  padding-block: var(--space-8);
  font-size: var(--font-size-xs);
  color: var(--palette-gray-400);
}

.foot nav {
  display: flex;
  gap: var(--space-7);
  letter-spacing: var(--letter-spacing-caps);
}

.foot a {
  text-decoration: none;
}

/* ---------- Less motion when the device asks (LS-Q20) ---------- */

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

  .button {
    transition: none;
  }
}
