/* ==========================================================================
   Raskoh site styles, built on the Raskoh design system

   Plain CSS, no build step. One file, in this order:
     1. Fonts                          8. Sections
     2. Tokens                         9. Products
     3. Base                          10. Inner pages
     4. Type styles                   11. Forms
     5. Design-system components      12. Footer
     6. Phone menu                    13. Utilities
     7. Home hero

   Sections 2, 4 and 5 are the design system: its tokens, its type scale and the
   CSS of its components (Logo, Label, Button, ContourPattern, SiteHeader, Hero),
   with the same names. Change those there first, then mirror the change here.
   Nothing below section 2 hardcodes a colour.

   Themes. Each page opens and closes on the Spruce theme: header, hero or page
   head, the home page's closing band and the footer. Everything between them
   carries data-theme="paper" and is set on the Paper theme. data-theme="spruce"
   puts a Spruce surface back inside a Paper one (a product's code sample).
   ========================================================================== */

/* 1. Fonts -------------------------------------------------------------- */

/* Instrument Sans (400 to 700) for everything people read, IBM Plex Mono 400 for labels.
   Both are served from this site: no request goes to Google Fonts. */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304,
    U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Tokens ------------------------------------------------------------- */

/* From the design system's tokens.json. Names and values are the same. */

:root {
  /* Brand colours */
  --spruce: #0f2a27;
  --lichen: #c9f27b; /* the summit: the primary button and the summit marker. Never text. */
  --paper: #f1f4f1;
  --moss: #52635e;
  --white: #ffffff;

  --font-sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 28px;
  --space-7: 40px;
  --space-8: 48px; /* page side padding on desktop */
  --space-9: 80px; /* header height; section padding on phones */
  --space-10: 120px; /* between page sections on desktop */

  --radius-sm: 6px; /* documents */
  --radius-md: 8px; /* buttons and inputs */
  --radius-lg: 10px; /* cards */
  --radius-xl: 14px; /* large panels and screenshot frames */
  --radius-full: 999px;

  /* Layout (not tokens, but fixed by the design system's layout rules) */
  --content: 1200px;
  --gutter: var(--space-8);
  --measure: 34em; /* about 68 characters of body text a line */
  --columns: repeat(12, minmax(0, 1fr)); /* the 12-column grid every section is set on */
  --section-gap: var(--space-10); /* between page sections */
  --header-offset: 0px; /* the header's height where it stays in view (see SiteHeader) */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Spruce theme: the default, and any surface marked data-theme="spruce". */
:root,
[data-theme="spruce"] {
  color-scheme: dark;
  --ground: var(--spruce);
  --ground-raised: #163631;
  --ink: var(--white);
  --ink-muted: #a9bdb8;
  --line: #22413c; /* contour lines and hairline dividers only */
  --line-strong: #688a82; /* borders of secondary buttons and inputs */
  --action: var(--lichen);
  --on-action: var(--spruce);
  --summit: var(--lichen);
  --logo: var(--paper);
  --focus: var(--lichen);
  --shadow-card: 0 18px 36px rgba(0, 0, 0, 0.32);
  --shadow-float: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* Paper theme: the body of every page, between the Spruce opening and close. */
[data-theme="paper"] {
  color-scheme: light;
  --ground: var(--paper);
  --ground-raised: var(--white);
  --ink: var(--spruce);
  --ink-muted: var(--moss);
  --line: #d2dcd8;
  --line-strong: #74867f;
  --action: var(--spruce);
  --on-action: var(--white);
  --summit: var(--spruce);
  --logo: var(--spruce);
  --focus: var(--spruce);
  --shadow-card: 0 18px 36px rgba(15, 42, 39, 0.14);
  --shadow-float: 0 30px 60px rgba(15, 42, 39, 0.22), 0 2px 6px rgba(15, 42, 39, 0.1);
}

/* Below 960px every section is one column. Twelve tracks would keep their eleven gaps
   (308px) even when empty, which is wider than a phone's content area. */
@media (max-width: 959px) {
  :root {
    --columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  :root {
    --gutter: 24px;
    --section-gap: var(--space-9);
  }
}

/* 3. Base --------------------------------------------------------------- */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem; /* body: 17px */
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

[data-theme] {
  background: var(--ground);
  color: var(--ink);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd,
figure,
address {
  margin: 0;
}

address {
  font-style: normal;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.22em;
}

a {
  transition: color 0.2s, text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: currentColor;
}

/* Keyboard focus on every interactive element: 2px solid `focus` at 2px offset. */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

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

svg {
  display: block;
}

/* Where a link to #something lands: clear of the header when it stays in view. */
[id] {
  scroll-margin-top: calc(var(--header-offset) + var(--space-6));
}

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

/* 4. Type styles -------------------------------------------------------- */

/* display-1: once per page, for the headline that opens it. */
.display-1 {
  font-size: 4.5rem; /* 72px */
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.display-2 {
  font-size: 3rem; /* 48px */
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.heading {
  font-size: 1.75rem; /* 28px */
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lead {
  font-size: 1.375rem; /* 22px */
  line-height: 1.4;
  font-weight: 500;
}

.note {
  color: var(--ink-muted);
  font-size: 0.9375rem; /* body-sm: 15px */
  line-height: 1.55;
}

@media (max-width: 720px) {
  .display-1 {
    font-size: 3rem; /* display-1 is 48px below 720px */
    line-height: 1.06;
  }

  .display-2 {
    font-size: 2.25rem;
  }

  .lead {
    font-size: 1.25rem;
  }
}

/* 5. Design-system components ------------------------------------------- */

/* Logo */

.rk-logo {
  display: inline-flex;
  align-items: center;
  color: var(--logo);
}

.rk-logo-stacked {
  flex-direction: column;
  align-items: flex-start;
}

.rk-mark {
  display: block;
  flex-shrink: 0;
}

.rk-mark-ring {
  stroke: var(--logo);
}

.rk-mark-summit {
  fill: var(--summit);
}

.rk-mark-dark .rk-mark-ring {
  stroke: var(--paper);
}

.rk-mark-dark .rk-mark-summit {
  fill: var(--lichen);
}

.rk-mark-light .rk-mark-ring {
  stroke: var(--spruce);
}

.rk-mark-light .rk-mark-summit {
  fill: var(--spruce);
}

.rk-wordmark {
  font-family: var(--font-sans);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.42em;
  margin-right: -0.42em; /* trims the trailing tracking */
  white-space: nowrap;
}

.rk-logo-tone-dark .rk-wordmark {
  color: var(--paper);
}

.rk-logo-tone-light .rk-wordmark {
  color: var(--spruce);
}

/* Horizontal lockup at a 30px symbol: gap 0.36x, wordmark 0.42x the symbol's height.
   Add a rule like this for any other size you pass to {% logo %}. */
.rk-logo-30 {
  gap: 11px;
}

.rk-logo-30 .rk-wordmark {
  font-size: 13px;
}

/* Label */

.rk-label {
  font-family: var(--font-mono);
  font-weight: 400;
  color: var(--ink-muted);
}

.rk-label-eyebrow {
  font-size: 0.75rem; /* 12px */
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rk-label-coordinates {
  font-size: 0.8125rem; /* 13px */
  line-height: 1.4;
  letter-spacing: 0.16em;
}

/* Button */

.rk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 44px;
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.875rem; /* ui: 14px */
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.2s, box-shadow 0.2s;
}

.rk-btn-primary {
  background: var(--action);
  color: var(--on-action);
}

.rk-btn-primary:hover {
  opacity: 0.9;
}

.rk-btn-secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.rk-btn-secondary:hover {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.rk-btn:focus-visible,
.rk-header-home:focus-visible,
.rk-header-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.rk-btn:focus-visible {
  border-radius: var(--radius-md);
}

/* ContourPattern */

.rk-contour {
  display: block;
}

.rk-contour-lines {
  stroke: var(--line);
}

.rk-contour-summit {
  fill: var(--summit);
}

.rk-contour-label {
  fill: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

/* SiteHeader. Sits on top of the hero or page head below it, so the contour lines
   run to the top of the page. */

.site-header {
  position: relative;
  z-index: 10;
}

/* Where the browser can tie an animation to scrolling, the header stays at the top of
   the window and takes a solid ground and a hairline once the page has moved. No script.
   Elsewhere it scrolls away with the page. */
@supports (animation-timeline: scroll()) {
  .site-header {
    position: sticky;
    top: 0;
    animation: header-settle 1ms linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 120px;
  }

  :root {
    --header-offset: var(--space-9);
  }
}

@keyframes header-settle {
  from {
    background-color: transparent;
    box-shadow: 0 1px 0 transparent;
  }

  to {
    background-color: var(--ground);
    box-shadow: 0 1px 0 var(--line);
  }
}

.rk-header {
  height: var(--space-9);
  max-width: var(--content);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: 0 var(--gutter);
  color: var(--ink);
}

.rk-header-home {
  display: inline-flex;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-md);
}

.rk-header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.rk-header-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--ink-muted);
  text-decoration: none;
  border-radius: 4px;
}

.rk-header-link:hover,
.rk-header-link[aria-current="page"] {
  color: var(--ink);
}

.rk-header-nav .rk-btn {
  margin-left: var(--space-2);
}

/* Hero */

.rk-hero {
  position: relative;
  overflow: hidden;
  min-height: calc(640px + var(--space-9));
  margin-top: calc(-1 * var(--space-9)); /* slides under the header */
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--ground);
  color: var(--ink);
}

.rk-hero-art {
  position: absolute;
  inset: 0;
}

.rk-hero-body {
  position: relative;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: calc(var(--space-9) + var(--space-10)) var(--gutter) var(--space-10);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}

.rk-hero-title {
  margin: 0;
  max-width: 11em;
  font-family: var(--font-sans);
  font-size: 4.5rem; /* display-1: 72px, once per page */
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.rk-hero-lead {
  margin: 0;
  max-width: 34em;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink-muted);
}

.rk-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-2);
}

/* Between 960px and 1439px the pattern is drawn a little under full size.
   Keep the coordinates beside the summit readable. */
@media (min-width: 960px) and (max-width: 1439px) {
  .rk-hero .rk-contour-label {
    font-size: 12.5px;
  }
}

/* Below 960px the summit would sit behind the headline. Draw the pattern at full size
   and pin the summit to the top right, under the header: 170px from the right edge,
   120px from the top. The copy starts below it. */
@media (max-width: 959px) {
  .rk-hero {
    min-height: 640px;
    align-items: flex-start;
  }

  .rk-hero-art {
    inset: auto;
    top: -210px; /* 120 - 330 (the summit's y in the 1440 x 800 box) */
    right: -210px; /* 170 - (1440 - 1060) */
    width: 1440px;
    height: 800px;
  }

  .rk-hero-art .rk-contour {
    overflow: visible;
  }

  .rk-hero-body {
    padding-top: 184px;
  }
}

@media (max-width: 720px) {
  .rk-hero-body {
    padding-bottom: var(--space-9);
  }

  .rk-hero-title {
    font-size: 3rem; /* display-1 is 48px below 720px */
    line-height: 1.06;
  }
}

/* 6. Phone menu --------------------------------------------------------- */

/* Below 720px the header links hide and a Menu button opens them. */

.menu {
  display: none;
}

.menu summary {
  list-style: none;
  user-select: none;
}

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

.menu[open] summary {
  box-shadow: inset 0 0 0 1px var(--ink);
}

.menu-panel {
  position: absolute;
  top: calc(var(--space-9) - var(--space-2));
  right: var(--gutter);
  left: var(--gutter);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--ground-raised);
  box-shadow: var(--shadow-card);
}

.menu-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-md);
  color: var(--ink);
  text-decoration: none;
}

.menu-link[aria-current="page"] {
  color: var(--ink-muted);
}

.menu-panel .rk-btn {
  margin-top: var(--space-2);
}

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

  .menu {
    display: block;
  }
}

/* 7. Home hero ---------------------------------------------------------- */

/* The design system's Hero, made as tall as the window (within limits) and closed with
   a rail of company facts along its bottom edge. */

.hero {
  flex-direction: column;
  align-items: stretch;
  border-bottom: 0; /* it meets the Paper body: the change of ground is the edge */
  min-height: max(720px, min(100vh, 960px));
  min-height: max(720px, min(100svh, 960px));
}

.hero .rk-hero-body {
  flex: 1;
  justify-content: center;
  padding-block: calc(var(--space-9) + var(--space-9)) var(--space-9);
}

/* The lead under the hero headline takes the `lead` type style. */
.hero .rk-hero-lead {
  max-width: 26em;
  font-size: 1.375rem;
  line-height: 1.4;
  font-weight: 500;
}

.hero .rk-hero-actions {
  padding-top: var(--space-4);
}

.hero-rail {
  position: relative;
  width: 100%;
  max-width: var(--content);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-5) var(--space-6);
  padding-block: var(--space-5) var(--space-6);
  border-top: 1px solid var(--line);
}

.rail dt,
.product-facts dt,
.facts dt {
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rail dd {
  margin-top: var(--space-2);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.rail a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.rail a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.rail a + a,
.rail span + a,
.rail a + span,
.rail span + span {
  margin-left: var(--space-4);
}

@media (max-width: 959px) {
  .hero {
    min-height: 0;
    align-items: stretch;
  }

  .hero .rk-hero-body {
    justify-content: flex-start;
    padding-block: 184px var(--space-9);
  }
}

@media (max-width: 720px) {
  .hero .rk-hero-body {
    padding-bottom: var(--space-8);
  }

  .hero .rk-hero-lead {
    font-size: 1.25rem;
  }

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

/* The copy settles into place once, when the page opens. The pattern stays still. */
@media (prefers-reduced-motion: no-preference) {
  .hero .rk-hero-body > * {
    animation: settle 0.8s var(--ease) both;
  }

  .hero .rk-hero-body > :nth-child(2) {
    animation-delay: 0.06s;
  }

  .hero .rk-hero-body > :nth-child(3) {
    animation-delay: 0.12s;
  }

  .hero .rk-hero-body > :nth-child(4) {
    animation-delay: 0.18s;
  }

  .hero-rail {
    animation: appear 0.8s ease 0.3s both;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

/* 8. Sections ----------------------------------------------------------- */

/* The sections between the hero and the closing band sit together on Paper
   (data-theme="paper" in index.njk). */
.page-sections {
  padding-bottom: var(--section-gap);
}

/* Every section opens the same way: a hairline, a numbered label, then the headline
   on the left with its lead set against it on the right. */

.section {
  padding-top: var(--section-gap);
  /* A link to a section lands on its hairline, not on the space above it. */
  scroll-margin-top: calc(var(--header-offset) + var(--space-6) - var(--section-gap));
}

.section-head {
  display: grid;
  grid-template-columns: var(--columns);
  column-gap: var(--space-6);
  row-gap: var(--space-7);
  align-items: end;
  margin-bottom: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.section-head > .rk-label {
  grid-column: 1 / -1;
}

.section-head > h2 {
  grid-column: 1 / span 7;
}

.section-head > .lead {
  grid-column: 9 / -1;
  padding-bottom: 0.15em;
  color: var(--ink-muted);
}

.section-num {
  margin-right: var(--space-5);
}

.section-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-6);
}

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

.email {
  overflow-wrap: anywhere;
}

/* A text link with an arrow that leans forward on hover. */
.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.arrow-link .icon {
  transition: transform 0.25s var(--ease), color 0.2s;
}

.arrow-link:hover .icon {
  transform: translateX(4px);
  color: var(--ink);
}

/* Outline icons at 1.5px stroke in `ink-muted`. */
.icon {
  flex: none;
  width: 1em;
  height: 1em;
  color: var(--ink-muted);
}

.arrow-link .icon,
.rk-btn .icon,
.rail .icon,
.footer-nav .icon {
  width: 14px;
  height: 14px;
}

/* A numbered list set as rows: number, headline, then the text against it. */
.index {
  padding: 0;
  list-style: none;
  counter-reset: index;
  border-bottom: 1px solid var(--line);
}

.index li {
  counter-increment: index;
  display: grid;
  grid-template-columns: var(--columns);
  column-gap: var(--space-6);
  row-gap: var(--space-3);
  align-items: baseline;
  padding-block: var(--space-7);
  border-top: 1px solid var(--line);
}

/* 01, 02, 03 as labels: mono, numerals only. */
.index li::before {
  content: "0" counter(index);
  grid-column: 1 / span 1;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
}

.index h3 {
  grid-column: 2 / span 4;
}

.index p {
  grid-column: 7 / -1;
  max-width: var(--measure);
  color: var(--ink-muted);
}

/* The closing band of the home page: back on Spruce, full width, with the pattern
   rising from the bottom right. The pattern file is generated by src/contour-close.njk. */
.closing {
  padding-block: var(--section-gap);
  scroll-margin-top: var(--header-offset);
  background: var(--ground) url("/assets/patterns/contour-close.svg?v=1") right bottom / cover no-repeat;
}

.closing .wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.closing h2 {
  max-width: 14em;
  margin-top: var(--space-5);
}

.closing .lead {
  color: var(--ink-muted);
}

.closing .actions {
  padding-top: var(--space-5);
}

@media (max-width: 959px) {
  .section-head {
    row-gap: var(--space-5);
  }

  .section-head > h2,
  .section-head > .lead {
    grid-column: 1 / -1;
  }

  .section-head > .lead {
    max-width: 26em;
    padding-bottom: 0;
  }

  .section-head > .rk-label {
    margin-bottom: var(--space-3);
  }

  .index li {
    grid-template-columns: 3rem minmax(0, 1fr);
    column-gap: 0;
  }

  .index li::before {
    grid-column: 1;
  }

  .index h3,
  .index p {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  .section-head {
    margin-bottom: var(--space-7);
  }

  .index li {
    padding-block: var(--space-6);
  }
}

/* 9. Products ----------------------------------------------------------- */

/* A product is one large panel: `ground-raised` (white on Paper), `radius-xl`, lifted
   with `shadow-card`, no border. Copy on the left; the product's code sample, if it has
   one, on the right. */

.product-stack {
  display: grid;
  gap: var(--space-7);
}

.product {
  display: grid;
  grid-template-columns: var(--columns);
  column-gap: var(--space-6);
  row-gap: var(--space-8);
  align-items: center;
  padding: var(--space-8);
  border-radius: var(--radius-xl);
  background: var(--ground-raised);
  box-shadow: var(--shadow-card);
}

.product-copy {
  grid-column: 1 / span 8;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-4);
}

.product--example .product-copy {
  grid-column: 1 / span 5;
}

.product-copy .status {
  margin-bottom: var(--space-4);
}

.product-desc {
  max-width: 30em;
  color: var(--ink-muted);
}

.product-copy .actions {
  padding-top: var(--space-4);
}

.product-facts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5) var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

.product-facts dd {
  margin-top: var(--space-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.status {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}

.status--live::before {
  background: var(--ink);
  box-shadow: none;
}

/* The code sample: a Spruce surface inside the panel (data-theme="spruce" in product.njk),
   lines numbered. Code is the one place mono is set in mixed case. */
.code {
  grid-column: 7 / -1;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--ground);
}

.code figcaption {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--line);
  text-wrap: balance; /* when the label needs two lines, split it evenly */
}

.code pre {
  margin: 0;
  padding: var(--space-5) var(--space-5) var(--space-5) 0;
  overflow-x: auto;
  counter-reset: code-line;
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem; /* 13px */
  line-height: 1.85;
  tab-size: 2;
}

.code pre:focus-visible {
  outline-offset: -2px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.code code {
  display: block;
  width: max-content;
  min-width: 100%;
  font: inherit;
}

.code-line {
  display: block;
  counter-increment: code-line;
}

.code-line::before {
  content: counter(code-line);
  display: inline-block;
  width: 3.25em;
  padding-right: 1.25em;
  text-align: right;
  opacity: 0.5;
  user-select: none;
}

.code-value {
  color: var(--ink);
}

.list-note {
  margin-top: var(--space-7);
}

@media (max-width: 959px) {
  .product {
    padding: var(--space-7);
    row-gap: var(--space-7);
  }

  .product .product-copy,
  .product .code {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .product {
    padding: var(--space-6) var(--space-5);
  }

  .product-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .code pre {
    font-size: 0.75rem;
  }
}

/* 10. Inner pages ------------------------------------------------------- */

/* Page head: Spruce, under the header, with the contour pattern as its background.
   The pattern file is generated by src/contour-band.njk. The page body below it is on
   Paper (data-theme="paper" in layouts/page.njk). */

.page-head {
  margin-top: calc(-1 * var(--space-9)); /* slides under the header */
  padding: calc(var(--space-9) + var(--space-10)) 0 var(--space-9);
  background: var(--ground) url("/assets/patterns/contour-band.svg?v=1") right top / cover no-repeat;
}

.page-head-grid {
  display: grid;
  grid-template-columns: var(--columns);
  column-gap: var(--space-6);
  row-gap: var(--space-5);
  align-items: end;
}

.page-head-grid > .rk-label {
  grid-column: 1 / -1;
}

.page-head-grid > h1 {
  grid-column: 1 / span 7;
}

.page-head-grid > .lead {
  grid-column: 8 / -1;
  padding-bottom: 0.3em;
  color: var(--ink-muted);
}

.page-body {
  flex: 1;
  padding: var(--space-9) 0 var(--space-10);
}

/* Rows: a label on the left, its content on the right, a hairline between rows. */

.row {
  display: grid;
  grid-template-columns: var(--columns);
  column-gap: var(--space-6);
  row-gap: var(--space-4);
  padding-block: var(--space-8);
  border-top: 1px solid var(--line);
}

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

.row:last-child {
  padding-bottom: 0;
}

.row-label {
  grid-column: 1 / span 4;
  padding-top: 0.55em;
  font-weight: 400;
}

.row-body {
  grid-column: 5 / -1;
  display: grid;
  gap: var(--space-4);
  align-content: start;
  justify-items: start;
  min-width: 0;
}

.row-body > p,
.row-body > address {
  max-width: var(--measure);
}

.row-body > .note {
  margin-top: var(--space-2);
}

.row-body > .actions {
  gap: var(--space-2) var(--space-7);
}

/* A list of links set as rows, each with a headline, a line under it and an arrow. */
.link-list {
  width: 100%;
  padding: 0;
  list-style: none;
  border-bottom: 1px solid var(--line);
}

.link-list li {
  border-top: 1px solid var(--line);
}

.link-list a,
.link-list div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: var(--space-5);
  row-gap: var(--space-1);
  align-items: center;
  padding-block: var(--space-5);
  text-decoration: none;
}

.link-list .heading,
.link-list-note {
  grid-column: 1;
}

.link-list-note {
  color: var(--ink-muted);
}

.link-list .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  transition: transform 0.25s var(--ease), color 0.2s;
}

.link-list a:hover .icon {
  transform: translate(3px, -3px);
  color: var(--ink);
}

/* Short definitions: a term and what we mean by it. */
.defs {
  width: 100%;
}

.defs > div {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--space-1) var(--space-6);
  padding-block: var(--space-4);
  border-top: 1px solid var(--line);
}

.defs > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.defs > div:last-child {
  padding-bottom: 0;
}

.defs dt {
  font-weight: 600;
}

.defs dd {
  color: var(--ink-muted);
}

.prose {
  max-width: var(--measure);
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose h2 {
  margin-top: var(--space-8);
  font-size: 1.75rem; /* heading */
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin-top: var(--space-6);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: var(--space-3);
}

.prose ul {
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: var(--space-2);
}

.prose li::marker {
  color: var(--ink-muted);
}

.prose strong {
  font-weight: 600;
}

/* A [PLACEHOLDER] still to be filled in. */
.placeholder {
  padding: 0.1em 0.4em;
  border-radius: 4px;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: inherit;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Documents (company information, privacy policy): notes or a list of contents on the
   left, the document as a sheet on the right. */

.doc {
  display: grid;
  grid-template-columns: var(--columns);
  column-gap: var(--space-6);
  row-gap: var(--space-7);
  align-items: start;
}

.doc-aside {
  grid-column: 1 / span 4;
  position: sticky;
  top: var(--space-6);
  display: grid;
  gap: var(--space-4);
  max-width: 21em;
}

@supports (animation-timeline: scroll()) {
  .doc-aside {
    top: calc(var(--space-9) + var(--space-6)); /* clear of the header, which stays in view */
  }
}

.doc-main {
  grid-column: 5 / -1;
  min-width: 0;
}

/* The sheet holds its text to the reading measure and shares out the rest as padding. */
.sheet {
  padding: var(--space-8) max(var(--space-8), (100% - var(--measure)) / 2);
  border-radius: var(--radius-sm);
  background: var(--ground-raised);
  box-shadow: var(--shadow-card);
}

.sheet.prose {
  max-width: none;
}

.toc ol {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  align-items: baseline;
}

.toc li::before {
  content: counter(toc, decimal-leading-zero);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.toc a {
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-decoration: none;
}

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

.facts > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-1) var(--space-6);
  padding-block: var(--space-5);
  border-top: 1px solid var(--line);
}

.facts > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.facts > div:last-child {
  padding-bottom: 0;
}

.facts dt {
  padding-top: 0.35em;
}

.facts dd {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.plain-list {
  padding: 0;
  list-style: none;
}

@media (max-width: 959px) {
  .page-head-grid > h1,
  .page-head-grid > .lead {
    grid-column: 1 / -1;
  }

  .page-head-grid > .lead {
    max-width: 26em;
    padding-bottom: 0;
  }

  .row {
    padding-block: var(--space-7);
  }

  .row-label,
  .row-body {
    grid-column: 1 / -1;
  }

  .row-label {
    padding-top: 0;
  }

  .doc-aside,
  .doc-main {
    grid-column: 1 / -1;
  }

  .doc-aside {
    position: static;
    max-width: var(--measure);
  }
}

@media (max-width: 720px) {
  .page-head {
    padding: calc(var(--space-9) + var(--space-8)) 0 var(--space-8);
  }

  .page-body {
    padding: var(--space-8) 0 var(--space-9);
  }

  /* On phones the sheet gives its padding back to the text. */
  .sheet {
    padding: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .defs > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 480px) {
  .facts > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 11. Forms ------------------------------------------------------------- */

/* The form is a white panel on the Paper page body. */

.contact-form {
  width: 100%;
  max-width: 560px;
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  background: var(--ground-raised);
  box-shadow: var(--shadow-card);
}

.contact-form form {
  display: grid;
  gap: var(--space-5);
  justify-items: start;
}

.field {
  display: grid;
  gap: var(--space-2);
  width: 100%;
}

.field label {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--ground);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink);
  font: inherit;
  line-height: 1.3;
}

.field textarea {
  line-height: 1.6;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-radius: var(--radius-md);
}

/* Spam honeypot: present for bots, removed from view and from the tab order for people. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 720px) {
  .contact-form {
    padding: var(--space-5);
  }
}

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

.site-footer {
  padding-block: var(--space-9) var(--space-7);
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.9375rem; /* body-sm */
  line-height: 1.55;
}

.footer-grid {
  display: grid;
  grid-template-columns: var(--columns);
  column-gap: var(--space-6);
  row-gap: var(--space-8);
}

.footer-brand {
  grid-column: 1 / span 5;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-5);
}

.footer-brand p {
  max-width: 25em;
}

.footer-nav {
  grid-column: 7 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-7) var(--space-6);
}

.footer-nav h2 {
  margin-bottom: var(--space-4);
}

.footer-nav ul {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.footer-nav li {
  color: var(--ink);
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
  text-decoration: none;
}

.footer-nav a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

.footer-legal {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-9);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3) var(--space-7);
}

.footer-bottom .rk-label {
  white-space: nowrap;
}

@media (max-width: 959px) {
  .footer-brand,
  .footer-nav {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .site-footer {
    padding-block: var(--space-8) var(--space-6);
  }

  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-legal {
    margin-top: var(--space-8);
  }
}

/* 13. Utilities --------------------------------------------------------- */

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

.skip-link {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  background: var(--ink);
  color: var(--ground);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
