/* ==========================================================================
   jomontolalu.com
   Design tokens -> base -> type -> layout -> components -> stage -> sections
   Spacing: strict 4px scale. Radius: 4px everywhere. Borders: 1px hairlines.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette (the only colours in use, on the page and in the WebGL scene) */
  --stone: #E5E6E1;
  --petrol: #0B1618;
  --chalk: #E8EAE6;
  --sea-light: #7FC9B6;
  --sea-deep: #17564A;
  --ink: #14181A;

  /* Channel values for alpha composition */
  --stone-rgb: 229 230 225;
  --petrol-rgb: 11 22 24;
  --chalk-rgb: 232 234 230;
  --ink-rgb: 20 24 26;

  /* Derived tones: always a palette colour at reduced alpha, never a new hue */
  --ink-mid: rgb(var(--ink-rgb) / .72);
  --chalk-mid: rgb(var(--chalk-rgb) / .66);
  --line-on-light: rgb(var(--ink-rgb) / .16);
  --line-on-dark: rgb(var(--chalk-rgb) / .18);
  --lift-on-light: rgb(var(--ink-rgb) / .045);
  --lift-on-dark: rgb(var(--chalk-rgb) / .06);
  --glass-on-light: rgb(var(--stone-rgb) / .80);
  --glass-on-dark: rgb(var(--petrol-rgb) / .80);

  /* Chapter-aware roles (light chapter by default) */
  --bg: var(--stone);
  --fg: var(--ink);
  --fg-mid: var(--ink-mid);
  --line: var(--line-on-light);
  --lift: var(--lift-on-light);
  --glass: var(--glass-on-light);
  --signal: var(--sea-deep);

  /* 4px spacing scale */
  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;
  --s-48: 48px;
  --s-64: 64px;
  --s-96: 96px;
  --s-128: 128px;
  --s-160: 160px;
  --s-192: 192px;

  --gutter: var(--s-24);
  --section-y: var(--s-96);
  --masthead-h: 72px;
  --container: 1240px;
  /* The copy column: the empty floor between the two walls of the stage.
     The stage measures this column and fits the canyon to it. */
  --canyon: var(--container);

  /* Hit areas and icons (multiples of 4) */
  --tap-sm: 40px;
  --tap-md: 44px;
  --tap-lg: 48px;
  --icon-sm: 16px;
  --icon-md: 24px;
  --facts-key-col: 200px;

  /* Type: one display face, one body face */
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;

  --size-xs: 0.875rem;
  --size-sm: 0.9375rem;
  --size-body: 1.125rem;
  --size-lead: clamp(1.1875rem, 1.05rem + 0.60vw, 1.375rem);
  --size-h3: clamp(1.375rem, 1.20rem + 0.80vw, 1.75rem);
  --size-h2: clamp(1.75rem, 1.40rem + 1.75vw, 2.75rem);
  --size-display: clamp(2.5rem, 1.60rem + 4.50vw, 5.375rem);

  --measure: 60ch;
  --measure-lead: 46ch;
  --measure-display: 16ch;

  /* Shape and motion */
  --radius: 4px;
  --blur: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fast: 160ms;
  --t-base: 240ms;
  --t-slow: 420ms;

  color-scheme: light;
}

html[data-chapter="dark"] {
  --bg: var(--petrol);
  --fg: var(--chalk);
  --fg-mid: var(--chalk-mid);
  --line: var(--line-on-dark);
  --lift: var(--lift-on-dark);
  --glass: var(--glass-on-dark);
  --signal: var(--sea-light);
  color-scheme: dark;
}

/* Section-scoped roles: each section carries its own contrast pair,
   independent of the chapter the masthead is currently reading. */
.scene-light {
  --fg: var(--ink);
  --fg-mid: var(--ink-mid);
  --line: var(--line-on-light);
  --lift: var(--lift-on-light);
  --glass: var(--glass-on-light);
  --signal: var(--sea-deep);
  color: var(--fg);
}

.scene-dark {
  --fg: var(--chalk);
  --fg-mid: var(--chalk-mid);
  --line: var(--line-on-dark);
  --lift: var(--lift-on-dark);
  --glass: var(--glass-on-dark);
  --signal: var(--sea-light);
  color: var(--fg);
}

@media (min-width: 900px) {
  :root {
    --canyon: clamp(600px, 62vw, 840px);
  }
}

@media (min-width: 1024px) {
  :root {
    --gutter: var(--s-32);
    --section-y: var(--s-160);
  }
}

@media (min-width: 1440px) {
  :root {
    --section-y: var(--s-192);
  }
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--masthead-h) + var(--s-16) + env(safe-area-inset-top, 0px));
  background-color: var(--stone);
  transition: background-color var(--t-slow) var(--ease);
}

html[data-chapter="dark"] {
  background-color: var(--petrol);
}

body {
  margin: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: 400;
  line-height: 1.75;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: color var(--t-slow) var(--ease);
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

p,
dl,
dd,
dt,
figure {
  margin: 0;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

b,
strong {
  font-weight: 600;
}

:focus {
  outline: 2px solid var(--signal);
  outline-offset: var(--s-4);
  border-radius: var(--radius);
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: var(--s-4);
  border-radius: var(--radius);
}

.skip {
  position: absolute;
  left: var(--s-16);
  top: var(--s-16);
  transform: translateY(-200%);
  z-index: 100;
  background: var(--ink);
  color: var(--stone);
  padding: var(--s-12) var(--s-16);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: var(--size-xs);
  font-weight: 500;
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease);
}

.skip:focus {
  transform: translateY(0);
}

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

/* --------------------------------------------------------------------------
   3. Type ramp
   -------------------------------------------------------------------------- */
.t-display {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--size-display);
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: var(--measure-display);
  margin: 0;
  text-wrap: balance;
}

.t-h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-h2);
  line-height: 1.08;
  letter-spacing: -0.028em;
  max-width: 22ch;
  margin: 0;
  text-wrap: balance;
}

.t-h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-h3);
  line-height: 1.25;
  letter-spacing: -0.018em;
  max-width: 26ch;
  margin: 0;
  text-wrap: balance;
}

.t-lead {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--size-lead);
  line-height: 1.55;
  max-width: var(--measure-lead);
  text-wrap: pretty;
}

.t-body {
  font-size: var(--size-body);
  line-height: 1.75;
  max-width: var(--measure);
  text-wrap: pretty;
}

.t-kicker {
  font-family: var(--font-display);
  font-size: var(--size-sm);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--fg-mid);
  max-width: 54ch;
}

.t-quiet {
  color: var(--fg-mid);
}

.flow > * + * {
  margin-top: var(--flow-space, var(--s-24));
}

.flow > .t-kicker + * {
  --flow-space: var(--s-24);
}

.flow > .t-display + * {
  --flow-space: var(--s-32);
}

.flow > .t-h2 + * {
  --flow-space: var(--s-24);
}

.flow > .t-h3 + * {
  --flow-space: var(--s-12);
}

.flow > .actions,
.flow > .facts,
.flow > .channels {
  --flow-space: var(--s-48);
}

/* --------------------------------------------------------------------------
   4. Layout: masthead and footer span the full container; every section
      sits in the canyon, a centred column with its own 12-column grid.
      The periphery is left to the architecture.
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main .container {
  max-width: calc(var(--canyon) + 2 * var(--gutter));
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: var(--s-48);
}

.section {
  position: relative;
  padding-top: var(--section-y);
  padding-bottom: var(--section-y);
}

.section-head {
  margin-bottom: var(--s-24);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-12);
}

.col-full,
.col-hero,
.col-head,
.col-body,
.col-cap,
.col-contact {
  grid-column: 1 / -1;
}

@media (min-width: 768px) {
  .col-cap {
    grid-column: span 6;
  }
}

@media (min-width: 900px) {
  .section-head {
    margin-bottom: var(--s-48);
  }
}

/* Once the canyon is wide enough, About splits into heading and body */
@media (min-width: 1200px) {
  .col-head {
    grid-column: 1 / span 5;
  }

  .col-body {
    grid-column: 6 / span 7;
  }
}

/* --------------------------------------------------------------------------
   5. Components
   -------------------------------------------------------------------------- */

/* Buttons */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--fg);
  --btn-line: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  min-height: var(--tap-lg);
  padding: var(--s-12) var(--s-24);
  border: 1px solid var(--btn-line);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-display);
  font-size: var(--size-sm);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--t-fast) var(--ease),
    color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.btn--solid {
  --btn-bg: var(--fg);
  --btn-fg: var(--bg);
  --btn-line: var(--fg);
}

.btn--solid:hover {
  --btn-bg: var(--signal);
  --btn-line: var(--signal);
}

.scene-dark .btn--solid,
html[data-chapter="dark"] .btn--solid {
  --btn-fg: var(--petrol);
}

.scene-light .btn--solid {
  --btn-fg: var(--stone);
}

.btn--ghost {
  --btn-line: var(--line);
  background: var(--glass);
}

.btn--ghost:hover {
  --btn-line: var(--fg);
}

.btn[disabled] {
  cursor: default;
  opacity: .72;
}

/* Square spinner, in keeping with the modular block language */
.btn__spinner {
  width: var(--icon-sm);
  height: var(--icon-sm);
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: var(--radius);
  display: none;
}

.btn[data-state="working"] .btn__spinner {
  display: block;
  animation: spin 720ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn[data-state="done"] {
  --btn-line: var(--signal);
  color: var(--signal);
}

.status {
  min-height: var(--s-24);
  margin-top: var(--s-12);
  font-family: var(--font-display);
  font-size: var(--size-xs);
  line-height: 1.45;
  color: var(--fg-mid);
}

.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--line);
  transition: text-decoration-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.link:hover {
  text-decoration-color: currentColor;
  color: var(--signal);
}

/* Facts list */
.facts {
  border-top: 1px solid var(--line);
}

.facts__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  padding-top: var(--s-16);
  padding-bottom: var(--s-16);
  border-bottom: 1px solid var(--line);
}

.facts__key {
  font-family: var(--font-display);
  font-size: var(--size-xs);
  font-weight: 500;
  line-height: 1.6;
  color: var(--fg-mid);
}

.facts__val {
  font-size: var(--size-body);
  line-height: 1.6;
}

/* Capability cards: frosted panels over the architecture */
.cap {
  height: 100%;
  padding: var(--s-32);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
}

.cap__title {
  margin-bottom: var(--s-16);
}

.cap__body {
  font-size: var(--size-body);
  line-height: 1.7;
  color: var(--fg-mid);
  max-width: 42ch;
  text-wrap: pretty;
}

/* Work list */
.work-list {
  border-top: 1px solid var(--line);
}

.work-item {
  border-bottom: 1px solid var(--line);
}

.work-link {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: var(--s-24);
  row-gap: var(--s-12);
  padding: var(--s-32) var(--s-16);
  margin-left: calc(var(--s-16) * -1);
  margin-right: calc(var(--s-16) * -1);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color var(--t-base) var(--ease);
}

.work-link:hover {
  background: var(--lift);
}

.work-link:hover .work-item__name {
  color: var(--signal);
}

.work-item__name {
  transition: color var(--t-base) var(--ease);
}

.work-item__body {
  margin-top: var(--s-12);
  font-size: var(--size-body);
  line-height: 1.7;
  color: var(--fg-mid);
  max-width: 54ch;
  text-wrap: pretty;
}

.work-item__foot {
  margin-top: var(--s-24);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-24);
  font-family: var(--font-display);
  font-size: var(--size-xs);
  line-height: 1.45;
  color: var(--fg-mid);
}

.work-item__foot b {
  font-weight: 500;
  color: var(--fg);
}

.work-item__icon {
  width: var(--tap-sm);
  height: var(--tap-sm);
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg-mid);
  transition:
    color var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease),
    transform var(--t-base) var(--ease);
}

.work-link:hover .work-item__icon {
  color: var(--signal);
  border-color: var(--signal);
  transform: translate(2px, -2px);
}

/* Contact channels */
.channels {
  border-top: 1px solid var(--line);
}

.channel {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-16);
  padding-top: var(--s-16);
  padding-bottom: var(--s-16);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease);
}

.channel:hover {
  color: var(--signal);
}

.channel__name {
  font-family: var(--font-display);
  font-size: var(--size-sm);
  font-weight: 500;
  line-height: 1.45;
}

.channel__handle {
  font-size: var(--size-sm);
  line-height: 1.45;
  color: var(--fg-mid);
  text-align: right;
}

/* --------------------------------------------------------------------------
   6. Masthead and navigation
   -------------------------------------------------------------------------- */
.masthead {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgb(var(--stone-rgb) / .88);
  -webkit-backdrop-filter: saturate(140%) blur(var(--blur));
  backdrop-filter: saturate(140%) blur(var(--blur));
  border-bottom: 1px solid transparent;
  transition: background-color var(--t-slow) var(--ease), border-color var(--t-base) var(--ease);
}

html[data-chapter="dark"] .masthead {
  background: rgb(var(--petrol-rgb) / .88);
}

.masthead[data-scrolled="true"] {
  border-bottom-color: var(--line);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .masthead {
    background: var(--bg);
  }

  .cap {
    background: var(--bg);
  }
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-16);
  min-height: var(--masthead-h);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--s-12);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: var(--size-sm);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.wordmark__mark {
  width: var(--icon-md);
  height: var(--icon-md);
  flex: none;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--s-32);
}

.nav a {
  display: inline-block;
  padding-top: var(--s-8);
  padding-bottom: var(--s-8);
  font-family: var(--font-display);
  font-size: var(--size-sm);
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
  color: var(--fg-mid);
  transition: color var(--t-fast) var(--ease);
}

.nav a:hover,
.nav a[aria-current="location"] {
  color: var(--fg);
}

.masthead__cta {
  display: none;
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-8);
  min-height: var(--tap-md);
  padding: var(--s-8) var(--s-12);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: var(--size-xs);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
}

.menu-toggle__bars {
  display: grid;
  gap: var(--s-4);
  width: var(--icon-sm);
}

.menu-toggle__bars i {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform var(--t-base) var(--ease);
}

.masthead[data-open="true"] .menu-toggle__bars i:first-child {
  transform: translateY(2.5px);
}

.masthead[data-open="true"] .menu-toggle__bars i:last-child {
  transform: translateY(-2.5px);
}

@media (max-width: 899px) {
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition:
      opacity var(--t-base) var(--ease),
      transform var(--t-base) var(--ease),
      visibility var(--t-base);
  }

  .masthead[data-open="true"] .nav {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--s-8) var(--gutter) var(--s-24);
  }

  .nav a {
    display: block;
    padding-top: var(--s-16);
    padding-bottom: var(--s-16);
    border-bottom: 1px solid var(--line);
    font-size: var(--size-body);
    font-family: var(--font-display);
  }

  .nav__list li:last-child a {
    border-bottom: 0;
  }
}

@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }

  .masthead__cta {
    display: inline-flex;
  }

  .nav {
    visibility: visible;
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   7. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  position: relative;
  z-index: 10;
  background: var(--petrol);
  color: var(--chalk-mid);
  border-top: 1px solid var(--line-on-dark);
  padding-top: var(--s-48);
  padding-bottom: calc(var(--s-48) + env(safe-area-inset-bottom, 0px));
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-16) var(--s-48);
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: var(--size-xs);
  line-height: 1.6;
}

.site-footer a {
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--sea-light);
}

/* --------------------------------------------------------------------------
   8. Boot overlay
   -------------------------------------------------------------------------- */
.boot {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  background: var(--stone);
  display: grid;
  align-content: end;
  padding: var(--s-64) var(--gutter) calc(var(--s-64) + env(safe-area-inset-bottom, 0px));
  transition: opacity var(--t-slow) var(--ease), visibility var(--t-slow);
}

.boot[data-done="true"] {
  opacity: 0;
  visibility: hidden;
}

.no-js .boot {
  display: none;
}

.boot__inner {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
}

.boot__label {
  margin-bottom: var(--s-12);
  font-family: var(--font-display);
  font-size: var(--size-xs);
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink-mid);
}

.boot__track {
  height: 1px;
  width: 100%;
  background: var(--line-on-light);
  overflow: hidden;
}

.boot__bar {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ink);
  transition: width var(--t-base) var(--ease);
}

/* --------------------------------------------------------------------------
   9. Stage: one fixed WebGL canvas owns every section background.
      The canvas paints stone above the top edge of #work and petrol below
      it, so the DOM stays transparent and the architecture reads through.
      Its two walls are fitted to the canyon column on every resize.
   -------------------------------------------------------------------------- */
.stage {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  contain: layout paint style;
}

html:not([data-webgl="on"]) .stage {
  visibility: hidden;
}

html[data-webgl="off"] .stage,
.no-js .stage {
  display: none;
}

/* Static fallback: two quiet banks of vertical slats either side of the canyon */
.stage-fallback {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  display: none;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 12px, rgb(var(--ink-rgb) / .07) 12px 13px);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 24%, transparent 76%, #000 100%);
  mask-image: linear-gradient(90deg, #000 0%, transparent 24%, transparent 76%, #000 100%);
}

html[data-chapter="dark"] .stage-fallback {
  background: repeating-linear-gradient(90deg, transparent 0 12px, rgb(var(--chalk-rgb) / .07) 12px 13px);
}

html[data-webgl="off"] .stage-fallback,
.no-js .stage-fallback {
  display: block;
}

main {
  position: relative;
  z-index: 10;
}

/* Without the canvas, the dark chapter paints its own ground */
html:not([data-webgl="on"]) #work,
html:not([data-webgl="on"]) #contact {
  background: var(--petrol);
}

/* --------------------------------------------------------------------------
   10. Section scrims. On phones the walls step in behind the copy, so the
       scrim is a full veil. From 900px it is a band down the canyon only:
       it steadies the long shadows under the text and leaves the walls on
       the periphery untouched.
   -------------------------------------------------------------------------- */
.scrim {
  --veil: var(--stone-rgb);
  --veil-a: .72;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
}

.scene-dark > .scrim {
  --veil: var(--petrol-rgb);
}

.scrim--hero {
  background: linear-gradient(180deg,
    rgb(var(--stone-rgb) / .56) 0%,
    rgb(var(--stone-rgb) / .84) 24%,
    rgb(var(--stone-rgb) / .94) 64%);
}

.scrim--about {
  background: linear-gradient(180deg,
    rgb(var(--stone-rgb) / .56) 0%,
    rgb(var(--stone-rgb) / .86) 32%,
    rgb(var(--stone-rgb) / .86) 100%);
}

.scrim--capabilities {
  background: rgb(var(--stone-rgb) / .48);
}

.scrim--work {
  background: linear-gradient(180deg,
    rgb(var(--petrol-rgb) / .64) 0%,
    rgb(var(--petrol-rgb) / .84) 24%,
    rgb(var(--petrol-rgb) / .84) 100%);
}

.scrim--contact {
  background: linear-gradient(180deg,
    rgb(var(--petrol-rgb) / .92) 0%,
    rgb(var(--petrol-rgb) / .84) 48%,
    rgb(var(--petrol-rgb) / .48) 100%);
}

@media (min-width: 900px) {
  .scrim,
  .scrim--hero,
  .scrim--about,
  .scrim--capabilities,
  .scrim--work,
  .scrim--contact {
    --edge: calc(50% - var(--canyon) / 2 - var(--s-32));
    background: linear-gradient(90deg,
      rgb(var(--veil) / 0) calc(var(--edge) - var(--s-64)),
      rgb(var(--veil) / var(--veil-a)) var(--edge),
      rgb(var(--veil) / var(--veil-a)) calc(100% - var(--edge)),
      rgb(var(--veil) / 0) calc(100% - var(--edge) + var(--s-64)));
  }

  .scrim--hero {
    --veil-a: .6;
  }

  .scrim--work,
  .scrim--contact {
    --veil-a: .8;
  }
}

/* --------------------------------------------------------------------------
   11. Sections
   -------------------------------------------------------------------------- */
#hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: end;
  padding-top: calc(var(--s-128) + env(safe-area-inset-top, 0px));
  padding-bottom: var(--s-96);
}

#about {
  border-top: 1px solid var(--line-on-light);
}

#work {
  border-top: 1px solid var(--line-on-dark);
  isolation: isolate;
}

#contact {
  min-height: 92vh;
  min-height: 92svh;
  display: grid;
  align-content: center;
  isolation: isolate;
}

@media (min-width: 900px) {
  #about {
    min-height: 100vh;
    min-height: 100svh;
  }

  .facts__row {
    grid-template-columns: var(--facts-key-col) 1fr;
    gap: var(--s-24);
    align-items: baseline;
  }

  .work-link {
    padding-left: var(--s-24);
    padding-right: var(--s-24);
    margin-left: calc(var(--s-24) * -1);
    margin-right: calc(var(--s-24) * -1);
  }
}

/* --------------------------------------------------------------------------
   12. Entrances
   -------------------------------------------------------------------------- */
[data-reveal] {
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease);
}

[data-reveal].is-in,
.no-js [data-reveal] {
  opacity: 1;
}

.boot-in {
  opacity: 0;
  transform: translateY(12px);
}

.no-js .boot-in {
  opacity: 1;
  transform: none;
}

html[data-booted="true"] .boot-in {
  opacity: 1;
  transform: none;
  transition: opacity 640ms var(--ease), transform 640ms var(--ease);
}

html[data-booted="true"] .boot-in:nth-child(2) {
  transition-delay: 80ms;
}

html[data-booted="true"] .boot-in:nth-child(3) {
  transition-delay: 160ms;
}

html[data-booted="true"] .boot-in:nth-child(4) {
  transition-delay: 240ms;
}

/* --------------------------------------------------------------------------
   13. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
  }

  .boot-in {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   14. Print
   -------------------------------------------------------------------------- */
@media print {
  .masthead,
  .stage,
  .stage-fallback,
  .boot,
  .skip,
  .scrim {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .section {
    padding-top: var(--s-32);
    padding-bottom: var(--s-32);
  }

  #work,
  #contact,
  .site-footer {
    background: #fff !important;
    color: #000 !important;
  }

  [data-reveal],
  .boot-in {
    opacity: 1 !important;
    transform: none !important;
  }

  .work-link[href]::after {
    content: " (" attr(href) ")";
    font-size: var(--size-xs);
  }
}
