/* Copyright (c) 2026 QuarkX Sdn. Bhd. (202501056786 / 1658192-K). All rights reserved. */

/*
 * Stylesheet for the static sub-pages (the plant system, the records system, Speaking, Brochure).
 *
 * Deliberately self-contained. The homepage stylesheet is coupled to the WebGL
 * scroll experience (fixed canvas, scroll track, pinned sections) and applying it
 * here would drag that machinery onto pages that are plain documents. Tokens are
 * duplicated from it so the two worlds stay visually identical.
 *
 * Contents
 *   1. Reset and base
 *   3. Header
 *   4. Page hero
 *   5. Prose sections
 *   6. Spec rows
 *   7. Loop diagram
 *   8. Cards
 *   9. Comparison table
 *  10. Form
 *  11. Dark band and CTA
 *  12. Footer
 *  13. Responsive
 */

/* Tokens live in tokens.css, which every page loads first. */


/* ---------- 2. Reset and base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Content sits one step lighter than the header bar, so the chrome reads
     as chrome and the page as paper. */
  background: var(--paper-bright);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0 0 var(--space-md);
  max-width: 68ch;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--cream);
  padding: 0.7rem 1.1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid var(--coral-deep);
  outline-offset: 3px;
}

/*
 * Kicker: the homepage recipe verbatim, including the short rule before the
 * text. The rule is what makes it read as a printed section mark rather than a
 * floating label. The rule inherits currentColor so the same class works on
 * the dark band, where the kicker brightens to coral.
 */
.kicker {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--coral-deep);
  margin: 0 0 var(--space-lg);
}

.kicker::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: currentColor;
  opacity: 0.6;
  flex-shrink: 0;
}

/* ---------- 3. Header ---------- */

/* Transparent over the page top, gaining its paper ground on scroll and
   stepping out of the way on the way down, exactly as the homepage header
   behaves. js/pages.js drives the two classes. */
.page-header {
  position: sticky;
  top: 0;
  /* Above the mobile menu overlay (z 90), as on the homepage: the toggle is
     the close button, so the header must ride over the menu it opens. */
  z-index: 100;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 300ms ease,
    border-color 300ms ease,
    transform 420ms var(--ease);
}

.page-header.is-solid {
  /* A floating material rather than an opaque bar; the soft shadow is the
     scroll edge, not a drawn divider. */
  background: rgba(240, 231, 218, 0.55);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(34, 26, 19, 0.06), 0 8px 24px rgba(34, 26, 19, 0.05);
}

.page-header.is-hidden {
  transform: translateY(-110%);
}

/* The homepage header-inner, metric for metric. Its third flex slot (the
   mobile menu button, zero-width on desktop) is what centres the nav, so a
   zero-width pseudo-element stands in for it here: without one the nav sits
   flush right and appears to jump ~300px when crossing between the homepage
   and a sub-page. */
.page-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: var(--header-h);
}

.page-header .container::after {
  content: "";
  width: 0;
}

.page-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.page-logo img {
  height: 30px;
  width: auto;
}

/*
 * Navigation: the homepage nav verbatim, uppercase and letterspaced. The
 * underline wipes through on hover exactly as it does there; the only
 * addition is that the current page keeps its underline, which the homepage
 * never needed because it was the only page.
 */
.page-nav {
  display: flex;
  gap: clamp(1.1rem, 2.4vw, 2.4rem);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-nav a {
  position: relative;
  text-decoration: none;
  color: var(--ink-sec);
  padding-block: 0.35rem;
  transition: color var(--ease) 180ms;
}

.page-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--coral-deep);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 350ms var(--ease);
}

.page-nav a:hover {
  color: var(--ink);
}

.page-nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

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

.page-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ---------- 4. Page hero ---------- */

.page-hero {
  padding-block: clamp(3rem, 8vw, var(--space-2xl)) var(--space-xl);
}

.page-hero h1 {
  font-size: var(--text-4xl);
  line-height: 1.02;
  letter-spacing: -0.015em;
  max-width: 14ch;
  margin-bottom: var(--space-md);
}

.page-hero .lede {
  font-size: var(--text-lg);
  color: var(--ink-sec);
  max-width: 54ch;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--ink-line);
  font-size: var(--text-sm);
  /* Small print holds AA contrast; --ink-faint is reserved for large text. */
  color: var(--ink-sec);
}

.hero-meta strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- 5. Prose sections ---------- */

/*
 * Sections are separated by whitespace alone, exactly as the homepage does
 * it: one clean paper field, with the dark band as the page's single strong
 * block. Alternating cream tints were tried and read as staining, because
 * the steps between them were too small to look deliberate.
 */
.section {
  padding-block: clamp(2.6rem, 6vw, var(--space-2xl));
}

.section-heading {
  font-size: var(--text-3xl);
  line-height: 1.06;
  margin-bottom: var(--space-lg);
  max-width: 18ch;
}

.section-lede {
  color: var(--ink-sec);
  font-size: var(--text-lg);
  margin-bottom: var(--space-lg);
}

/* ---------- 6. Spec rows ---------- */
/*
 * Chiller plants and trade documents are both sold on datasheets, so the
 * datasheet is the native form for stating what a system is made of.
 */

.spec {
  border-top: 1px solid var(--ink-line-strong);
  margin-top: var(--space-lg);
}

.spec-row {
  display: grid;
  grid-template-columns: minmax(11rem, 22%) 1fr;
  gap: var(--space-md);
  padding-block: var(--space-md);
  border-bottom: 1px solid var(--ink-line);
  align-items: baseline;
}

.spec-key {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.spec-val {
  color: var(--ink-sec);
}

.spec-val p:last-child {
  margin-bottom: 0;
}

/* ---------- 7. Loop diagram ---------- */
/*
 * The signature element. Every competitor stops at a dashboard; the claim these
 * products rest on is that the loop closes and the system acts. The return edge
 * is therefore the only animated part of the page.
 */

.loop {
  margin: var(--space-lg) 0 0;
  padding: var(--space-lg) 0;
}

.loop svg {
  width: 100%;
  height: auto;
  display: block;
}

.loop-node {
  fill: var(--paper-raised);
  stroke: var(--ink-line-strong);
  stroke-width: 1;
}

.loop-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  fill: var(--ink);
}

.loop-sub {
  font-family: var(--font-ui);
  font-size: 9.5px;
  fill: var(--ink-sec);
}

/* The portrait diagram renders near 1:1 with its viewBox on a phone, so its
   sub-labels need a real-world legible size; the desktop SVG scales up and
   keeps the smaller unit. */
svg.loop-mobile .loop-sub {
  font-size: 11px;
}

svg.loop-mobile .loop-label {
  font-size: 12.5px;
}

.loop-edge {
  stroke: var(--ink-line-strong);
  stroke-width: 1.2;
  fill: none;
}

.loop-return {
  stroke: var(--coral);
  stroke-width: 1.6;
  fill: none;
  stroke-dasharray: 5 6;
  animation: loop-flow 1.8s linear infinite;
}

.loop-return-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  fill: var(--coral-deep);
  letter-spacing: 0.05em;
}

@keyframes loop-flow {
  to {
    stroke-dashoffset: -22;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loop-return {
    animation: none;
  }
  .page-nav a::after,
  .button,
  .button::after,
  .page-header {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ---------- 8. Cards ---------- */
/*
 * The homepage separates its cards with hairline left borders and lets serif
 * headings carry the weight: columns on paper, not boxes on a screen. Boxed
 * cards with filled backgrounds were the single loudest tell that these pages
 * came from a different site.
 */

/*
 * Card grids declare their count. Auto-fit wrapped a four-card set as three
 * plus a stranded one at laptop widths; explicit counts keep the arrangement
 * symmetric at every size: four across, then two by two, then a column.
 */
.cards {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.cards-3 {
  grid-template-columns: repeat(3, 1fr);
}

.cards-4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1100px) {
  .cards-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .cards-3,
  .cards-4 {
    grid-template-columns: 1fr;
  }
}

/* A card is a lighter tile on the cream, with no outline: the homepage's own
   tile recipe, so the two worlds stay identical. */
.card {
  background: rgba(255, 255, 255, 0.45);
  border-radius: var(--radius-tile);
  padding: var(--space-lg);
}

.card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-xl);
  line-height: 1.15;
  margin-bottom: var(--space-sm);
  max-width: 16ch;
}

/* Two reserved heading lines keep every card body in a row starting level,
   whether its heading wraps or not. Single-column layouts skip this: with
   nothing beside a card the reservation only leaves a hole. */
@media (min-width: 721px) {
  /* The heading track is sized by the tallest heading in the row, so bodies
     start together however many lines a title takes. A reserved two lines
     could not survive a four-line one. */
  .cards-3,
  .cards-4 {
    grid-template-rows: auto 1fr;
  }

  .cards-3 .card,
  .cards-4 .card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    align-content: start;
  }

  .cards-3 .card h3,
  .cards-4 .card h3 {
    min-height: 0;
  }
}

.card p {
  font-size: var(--text-sm);
  color: var(--ink-sec);
  margin-bottom: 0;
}

/*
 * Step numbers use the homepage's numeral treatment: a large translucent serif
 * figure above the heading. Numbered only where the content genuinely is a
 * sequence.
 */
.card-step::before {
  content: attr(data-step);
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1;
  color: var(--maroon);
  opacity: 0.45;
  margin-bottom: var(--space-md);
}

/* ---------- 9. Comparison table ---------- */

.table-scroll {
  overflow-x: auto;
  margin-top: var(--space-lg);
  border-top: 1px solid var(--ink-line-strong);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: var(--text-sm);
}

th,
td {
  text-align: left;
  padding: 0.8rem var(--space-md) 0.8rem 0;
  border-bottom: 1px solid var(--ink-line);
  vertical-align: top;
}

thead th {
  font-weight: 600;
  color: var(--ink-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

/* The brochure's comparison marks, filled for present and hollow for absent,
   centred under centred column heads so the eye reads columns, not words. */
.yes {
  color: var(--coral-deep);
  font-size: 1.1em;
}

.no {
  color: var(--ink-faint);
}

.table-scroll thead th:not(:first-child),
.table-scroll td:not(:first-child) {
  text-align: center;
}

.table-legend {
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  margin-top: var(--space-sm);
}

/* ---------- 10. Form ---------- */

.form {
  margin-top: var(--space-lg);
  max-width: 42rem;
}

.field {
  margin-bottom: var(--space-md);
}

.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 0.35rem;
}

/* Inputs draw their borders and focus rings from the copper ramp, so the form
   reads as one set of controls in the same family as the buttons beside it. */
/* Filled fields, no resting outline: the border is reserved for focus, when
   it carries information. */
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: var(--text-base);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.7rem 0.85rem;
  transition: border-color var(--ease) 180ms, box-shadow var(--ease) 180ms;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--copper-200);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--copper-500);
  box-shadow: 0 0 0 3px var(--copper-100);
}

.field textarea {
  resize: vertical;
  min-height: 6rem;
}

.field-hint {
  font-size: var(--text-xs);
  color: var(--ink-sec);
  margin-top: 0.3rem;
}

/* ---------- 11. Dark band and CTA ---------- */

.band {
  background: var(--bg);
  color: var(--cream);
  padding-block: clamp(2.6rem, 6vw, var(--space-2xl));
}

.band h2 {
  font-size: var(--text-3xl);
  line-height: 1.06;
  margin-bottom: var(--space-md);
  max-width: 18ch;
}

.band p {
  color: var(--cream-dim);
  font-size: var(--text-lg);
}

/*
 * Buttons: the homepage's paper-link pill, kept verbatim so an action looks
 * the same wherever it appears. Ink pill on paper hovering to the accent ink;
 * inverted to a cream pill on the dark band, hovering to coral. The copper
 * arrow leads the label and moves on hover.
 */
.button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background var(--ease) 180ms,
    color var(--ease) 180ms,
    transform var(--ease) 120ms;
}

.button::after {
  content: "→";
  font-weight: 400;
  transition: transform var(--ease) 180ms;
}

.button:hover::after {
  transform: translateX(4px);
}

/* A pressed control should move, or the click feels unacknowledged. */
.button:active {
  transform: translateY(1px);
}

/* Dark band: cream pill, coral under the pointer. */
.button {
  background: var(--cream);
  color: var(--ink);
}

.button::after {
  color: var(--copper-600);
}

.button:hover {
  background: var(--coral);
}

.button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
}

/* Paper ground: ink pill, accent ink under the pointer, as on the homepage. */
.button-ink {
  background: var(--ink);
  color: var(--paper);
}

.button-ink::after {
  color: var(--copper-300);
}

.button-ink:hover {
  background: var(--maroon);
}

.button-ink:focus-visible {
  outline-color: var(--coral-deep);
}

/* ---------- 12. Footer ---------- */

.page-footer {
  background: var(--bg-deep);
  color: var(--cream-dim);
  padding-block: var(--space-xl);
  font-size: var(--text-sm);
}

.footer-legal {
  padding-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
  justify-content: space-between;
}

/* ---------- 13. Responsive ---------- */

@media (max-width: 720px) {
  /* The desktop nav-centering phantom would steal the right-hand slot from
     the menu toggle. */
  .page-header .container::after {
    content: none;
  }

  /* Tighter gaps so all five items fit one line at 390px; if a narrower
     screen still wraps, the small row gap keeps the rows reading as one
     block instead of a stranded last item. */
  .page-nav {
    justify-content: flex-start;
    gap: 0.4rem 0.8rem;
  }

  .spec-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }
}

/* ---------- 14. Utilities ---------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.note {
  font-size: var(--text-sm);
  color: var(--ink-sec);
  max-width: 68ch;
  margin-top: var(--space-md);
}

/* The escalation node is drawn dashed: it is the path that exists because the
   system declined to guess, not part of the happy path. */
.loop-node-review {
  fill: none;
  stroke: var(--coral-bdr);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

/* Long talk and paper titles need more measure than a section label does. */
.section-heading-wide {
  max-width: 26ch;
}

/*
 * Below the diagram's natural width the nodes become unreadable, so the loop
 * scrolls sideways instead of scaling down. LOOP_MIN_WIDTH is the point at which
 * the 12px node labels stop fitting inside a node box.
 */
.loop {
  --loop-min-width: 640px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.loop svg {
  min-width: var(--loop-min-width);
}

/* ---------- 15. Alignment corrections ---------- */

/*
 * The section already draws a rule beneath itself, so the final spec row's
 * border doubled it with a gap between the two lines.
 */
.spec-row:last-child {
  border-bottom: 0;
}

/*
 * Left-aligned values in quarter-width columns left rivers of space between the
 * attribute and its answers. Narrowing the value columns pulls each answer back
 * towards the attribute it belongs to.
 */
.table-scroll table {
  max-width: 58rem;
}

.table-scroll th:not(:first-child),
.table-scroll td:not(:first-child) {
  width: 11rem;
}

/* Spacing that belongs to a call to action, not to a paragraph. */
.cta-actions {
  margin-top: var(--space-lg);
  margin-bottom: 0;
}

/* On the dark ground the kicker brightens; its rule follows via currentColor. */
.band .kicker {
  color: var(--coral);
}

/* The footer wordmark is a quiet link, not an emphasised one. */
.footer-legal a {
  color: inherit;
}

/*
 * A secondary line beneath a call to action. It exists because mailto: does
 * nothing at all for a visitor with no mail client configured, which is most
 * people on webmail: the address has to be readable as text, not only clickable.
 */
/* Scoped under .band because ".band p" would otherwise outrank this and
   inflate the line to lede size, which read as a second paragraph rather
   than a footnote to the button. */
.band .cta-fallback {
  margin-top: var(--space-md);
  margin-bottom: 0;
  font-size: var(--text-sm);
  color: var(--cream-dim);
}

.cta-fallback a {
  color: var(--cream);
  border-bottom: 1px solid var(--coral-bdr);
  text-decoration: none;
}

.cta-fallback a:hover {
  border-bottom-color: var(--coral);
}

/* ---------- 16. Reveal motion ---------- */
/*
 * The homepage reveals content as it enters the viewport; these pages do the
 * same with a small IntersectionObserver in js/pages.js. The script adds
 * reveal-pending only when it runs and motion is allowed, so without
 * JavaScript everything is simply visible.
 */
.reveal-pending {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 900ms var(--ease),
    transform 900ms var(--ease);
}

.reveal-pending.reveal-in {
  opacity: 1;
  transform: none;
}

/* Siblings arrive as a cascade, not a block. */
.cards .card:nth-child(2),
.page-hero [data-reveal]:nth-child(2) {
  transition-delay: 90ms;
}

.cards .card:nth-child(3),
.page-hero [data-reveal]:nth-child(3) {
  transition-delay: 180ms;
}

.cards .card:nth-child(4),
.page-hero [data-reveal]:nth-child(4) {
  transition-delay: 270ms;
}

/* ---------- 17. Form outcomes ---------- */

/* Off-screen rather than display:none, so the honeypot stays fillable by
   naive bots while invisible and unreachable for people. */
.gotcha {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
}

.form-outcome {
  max-width: 34rem;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-tile);
  background: var(--copper-100);
}

.form-outcome p {
  margin: 0;
}

.form-outcome a {
  color: var(--copper-700);
}

.form-outcome-error {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--maroon);
}

.form-outcome[hidden] {
  display: none;
}

/*
 * Scroll affordance for wide tables. On narrow screens the comparison table
 * clips with no visible hint that it moves; these edge shadows appear only
 * while there is more table in that direction, using the classic
 * background-attachment trick.
 */
.table-scroll {
  background:
    linear-gradient(to right, var(--paper-bright) 30%, rgba(248, 243, 235, 0)),
    linear-gradient(to left, var(--paper-bright) 30%, rgba(248, 243, 235, 0)) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(34, 26, 19, 0.16), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(34, 26, 19, 0.16), transparent) 100% 0;
  background-repeat: no-repeat;
  background-size:
    40px 100%,
    40px 100%,
    14px 100%,
    14px 100%;
  background-attachment: local, local, scroll, scroll;
}

/* The record hub is the heart of the records system diagram: the one surface in the
   drawing that is not just another box. */
.loop-hub {
  fill: var(--copper-50);
  stroke: var(--copper-300);
  stroke-width: 1.2;
}

/* ---------- 18. Product rail ---------- */
/*
 * A quiet vertical rail on the left, fixed while the page scrolls, no ground
 * of its own. It only exists on viewports wide enough that it cannot touch
 * the 1320px content frame.
 */
.product-rail {
  display: none;
}

@media (min-width: 1480px) {
  .product-rail {
    position: fixed;
    left: 1.4rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .product-rail-label {
    font-size: var(--text-xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 0.2rem;
  }

  .product-rail a {
    font-size: var(--text-sm);
    text-decoration: none;
    color: var(--ink-sec);
    padding-left: 0.7rem;
    border-left: 2px solid transparent;
    transition: color var(--ease) 150ms, border-color var(--ease) 150ms;
  }

  .product-rail a:hover {
    color: var(--ink);
  }

  .product-rail a[aria-current="page"] {
    color: var(--ink);
    font-weight: 600;
    border-left-color: var(--copper-500);
  }
}

/* ---------- 19. Back to top ---------- */
/* An ink pill in the corner, present only after the first viewport: nobody
   needs a rocket while still on the launch pad. */
.to-top {
  position: fixed;
  right: 1.3rem;
  bottom: 1.3rem;
  z-index: 40;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity var(--ease) 220ms,
    transform var(--ease) 220ms,
    background var(--ease) 180ms;
  display: grid;
  place-items: center;
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover {
  background: var(--maroon);
}

.to-top:focus-visible {
  outline: 2px solid var(--coral-deep);
  outline-offset: 3px;
}

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

/* On a phone the card owns the full width: the desktop heading measure would
   strangle titles into three-word lines, and the desktop bottom padding turns
   every tile bottom-heavy. */
@media (max-width: 720px) {
  .card {
    padding: 1.35rem 1.25rem 1.5rem;
  }

  .card h3 {
    max-width: none;
  }
}

/* Press feedback on the press itself, instant and physical. */
.button:active {
  transform: translateY(1px) scale(0.98);
  transition-duration: 100ms;
}

.paper-link:active,
.to-top:active {
  transform: scale(0.97);
  transition-duration: 100ms;
}

/* Users who ask for less transparency or more contrast get exactly that. */
@media (prefers-reduced-transparency: reduce) {
  .page-header.is-solid {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

@media (prefers-contrast: more) {
  .page-header.is-solid {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: 1px solid var(--ink-line-strong);
  }
}

/* The staircase's top step is the only filled box in that drawing: the point
   of the whole climb. */
.stair-ai {
  fill: var(--coral-deep);
}

.stair-ai-label {
  fill: var(--paper);
}

/* ---------- 20. Mobile menu ---------- */
/* The homepage collapses its nav behind a button on phones; the sub-pages now
   do the same instead of wrapping six items across the chrome. */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--ink);
  transition: transform var(--ease) 220ms, opacity var(--ease) 180ms;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(3.75px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  transform: translateY(-3.75px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-lg);
  padding: calc(var(--header-h) + 1.25rem) var(--gutter) var(--space-lg);
  background: rgba(240, 231, 218, 0.94);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 450ms var(--ease), visibility 450ms;
}

.mobile-menu.is-open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu-nav {
  display: grid;
  gap: 0.4rem;
}

.mobile-link {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-menu);
  line-height: 1.25;
  text-decoration: none;
  color: var(--ink);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 500ms var(--ease), transform 500ms var(--ease);
}

.mobile-menu.is-open .mobile-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.is-open .mobile-link:nth-child(2) { transition-delay: 40ms; }
.mobile-menu.is-open .mobile-link:nth-child(3) { transition-delay: 80ms; }
.mobile-menu.is-open .mobile-link:nth-child(4) { transition-delay: 120ms; }
.mobile-menu.is-open .mobile-link:nth-child(5) { transition-delay: 160ms; }
.mobile-menu.is-open .mobile-link:nth-child(6) { transition-delay: 200ms; }

.mobile-link:hover {
  color: var(--coral-deep);
}

.mobile-menu-meta {
  display: grid;
  gap: 0.3rem;
  font-size: var(--text-sm);
  color: var(--ink-faint);
}

.mobile-menu-meta a {
  color: var(--coral-deep);
  text-decoration: none;
}

@media (max-width: 720px) {
  .page-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .menu-toggle span {
    transition: none;
  }
}

/* When a dark band or the footer slides behind the rail, its inks invert so
   the words stay readable; js/pages.js watches the overlap. */
.product-rail a,
.product-rail-label {
  transition: color var(--ease) 200ms, border-color var(--ease) 200ms;
}

.product-rail.on-dark .product-rail-label {
  color: var(--muted);
}

.product-rail.on-dark a {
  color: var(--cream-dim);
}

.product-rail.on-dark a:hover {
  color: var(--cream);
}

.product-rail.on-dark a[aria-current="page"] {
  color: var(--cream);
  border-left-color: var(--copper-300);
}

/* The submit is the most important tap on the site; on a phone it reads at
   full body size and spans the form's width. */
@media (max-width: 720px) {
  .form .button {
    font-size: var(--text-base);
    width: 100%;
    justify-content: center;
  }
}

/* The architecture has two drawings: landscape for wide screens, a portrait
   twin at full width on phones. Sideways scrolling was mobile-tolerated, not
   mobile-friendly. */
.loop svg.loop-mobile {
  display: none;
}

@media (max-width: 720px) {
  .loop svg.loop-desktop {
    display: none;
  }

  .loop svg.loop-mobile {
    display: block;
  }

  .loop {
    overflow: visible;
  }

  .loop svg {
    min-width: 0;
  }
}

/* The systems rail is desktop-only, so the mobile menu carries the eight
   case studies as a compact grid beneath the main links. */
.mobile-menu {
  overflow-y: auto;
}

.mobile-menu-label {
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}

.mobile-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 1.2rem;
}

.mobile-menu-grid a {
  font-size: var(--text-base);
  color: var(--ink-sec);
  text-decoration: none;
  padding-block: 0.15rem;
}

.mobile-menu-grid a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 1.5px solid var(--copper-500);
  width: fit-content;
}

/* The one photograph on the site: real proof, in the tile language. It holds
   the prose measure rather than the full container, so the reading column
   stays calm. */
.talk-photo {
  margin: var(--space-lg) 0;
  max-width: 68ch;
}

.talk-photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-tile);
  display: block;
}

/* ---------- Agenda note ---------- */
/*
 * A talk's coverage is a sequence, so it earns numbers. The card sits on the
 * brighter paper like an index card laid on the page.
 */

.agenda {
  margin: var(--space-lg) 0 0;
  background: var(--paper-bright);
  border: 1px solid var(--ink-line-strong);
  border-radius: var(--radius-tile);
  padding: calc(var(--space-lg) * 0.9) var(--space-lg);
}

.agenda-label {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--copper-600);
  margin: 0 0 var(--space-md);
}

.agenda-list {
  list-style: none;
  counter-reset: agenda;
  margin: 0;
  padding: 0;
}

.agenda-list li {
  counter-increment: agenda;
  display: flex;
  align-items: baseline;
  gap: var(--space-md);
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--ink-line);
  color: var(--ink-sec);
}

.agenda-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.agenda-list li::before {
  content: "0" counter(agenda);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--copper-500);
  flex: 0 0 auto;
}

/* Required markers match the heading's count of three. */
.field .req {
  font-weight: 400;
  font-size: var(--text-xs);
  color: var(--ink-sec);
  letter-spacing: 0.02em;
}

/* ---------- Enquiry ---------- */
/*
 * The form used to sit alone in the left half of the widest screens, so the
 * page was emptiest exactly where a reader hesitates. The other half now
 * answers what they are about to ask.
 */

.enquiry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.85fr);
  gap: clamp(var(--space-xl), 5vw, 5rem);
  align-items: start;
}

.enquiry-aside {
  display: grid;
  gap: var(--space-lg);
  padding-top: 0.35rem;
}

.enquiry-block h3 {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper-600);
  margin: 0 0 var(--space-xs);
}

.enquiry-block p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--ink-sec);
}

@media (max-width: 860px) {
  .enquiry {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}

/* ---------- Reach ---------- */
/*
 * Eight doorways to the industry pages, set as a plain ruled index rather
 * than another set of tiles: this page is a way in, not a display case.
 */

.reach {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 var(--space-2xl);
  margin-top: var(--space-lg);
}

.reach-item {
  display: grid;
  gap: 0.2rem;
  padding-block: var(--space-md);
  border-bottom: 1px solid var(--ink-line);
  text-decoration: none;
  transition: border-color 300ms ease;
}

.reach-item:hover {
  border-bottom-color: var(--coral-deep);
}

.reach-place {
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--ink);
}

.reach-what {
  font-size: var(--text-sm);
  color: var(--ink-sec);
}

@media (max-width: 720px) {
  .reach {
    grid-template-columns: 1fr;
  }
}

/* Prose reads in the serif; the furniture takes the grotesque. */
.page-nav a,
.button,
.mobile-menu-label,
.mobile-menu-grid a,
.hero-meta,
.spec-key,
.faq-question,
.field label,
.field input,
.field select,
.field textarea,
.field-hint,
.agenda-label,
.enquiry-block h3,
.reach-what,
.loop-label,
.loop-sub,
.loop-return-label,
.footer-legal,
.to-top {
  font-family: var(--font-ui);
}

/* Display cuts for the large sizes, text cuts for the reading sizes. */
.page-hero h1,
.section-heading,
.band h2 {
  font-variation-settings: "opsz" 72;
}

/* ---------- Event notice ---------- */
/*
 * A dated engagement sitting inside a talk's own section. It borrows the
 * agenda tile's shape so the two read as siblings, and takes a copper edge
 * because this is the one block on the page that goes stale: the rule is a
 * standing reminder that it has a date on it.
 */
.event {
  margin: var(--space-lg) 0 0;
  background: var(--paper-bright);
  border: 1px solid var(--ink-line-strong);
  border-left: 2px solid var(--copper-500);
  border-radius: var(--radius-tile);
  padding: calc(var(--space-lg) * 0.9) var(--space-lg);
}

.event-label {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--copper-600);
  margin: 0 0 var(--space-sm);
}

/* The date carries the section's display face, because on a page about
   speaking the when is the headline. */
.event-when {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-sm);
  max-width: none;
}

.event-where {
  margin-bottom: var(--space-md);
}

.event-note {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--ink-sec);
  margin: var(--space-sm) 0 0;
}

.event .cta-actions {
  margin-bottom: 0;
}

/*
 * The next outing is the one perishable thing on the talks page, so it sits
 * directly under the hero rather than inside a talk. It takes the hero's
 * bottom space as its own and adds none of its own on top, so the two read
 * as one opening block.
 */
.section-first {
  padding-top: 0;
}

/* The engineers' section is linked to from that block, so it needs to clear
   the header when jumped to. */
#engineers {
  scroll-margin-top: var(--header-h);
}
