/* Palpable Studio — shared shell for the subpages (about, products, services,
 * contact, 404). The landing page has its own sheet (css/style.css); the two
 * are never loaded together. The menu block mirrors the landing's menu. */

/* Inter (rsms.me/inter, SIL OFL), self-hosted, latin subset. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("/assets/fonts/Inter-Light.latin.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: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/Inter-Regular.latin.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: "Inter";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/Inter-ExtraBold.latin.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;
}

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

/* ---- Page transitions ----
 * Leaving: the old page fades out. Browsers with cross-document view
 * transitions do it themselves (the old page's snapshot fades over the new
 * one; the header is its own group, so it stays put between subpages);
 * elsewhere js/site.js adds .is-leaving before it navigates.
 * Arriving: the content fades in with a plain CSS animation (no script, so
 * nothing can be left invisible). None of it with reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}

::view-transition-old(root) {
  z-index: 1;
  mix-blend-mode: normal;
  animation: page-out 0.2s ease both;
}

::view-transition-new(root) {
  mix-blend-mode: normal;
  animation: none;
}

@keyframes page-out {
  to { opacity: 0; }
}

@keyframes page-in {
  from { opacity: 0; }
}

.page,
.site-footer {
  animation: page-in 0.3s ease 0.1s backwards;
}

html.is-leaving body {
  opacity: 0;
  transition: opacity 0.22s ease;
}

/* --top: header band, same heights as the landing's menu band, so the menu
 * does not jump between pages. */
:root {
  --top: 96px;
  --pad: clamp(20px, 4vw, 48px);
  --ink: #F5F1E8;
  --ink-bright: #FFFFFF;
  --muted: #A8A49C;            /* 6.9:1 on the charcoal */
  --charcoal: #1B1B1B;
  --surface: #2A2A2A;
  --accent: #FFFFFF;           /* focus rings, hover details, the Send button; never a selected state */
  --error: #FF9B8A;            /* 8.2:1 on the charcoal */
  --line: rgba(245, 241, 232, 0.16);
  --line-strong: rgba(245, 241, 232, 0.5);
  color-scheme: dark;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

[hidden] {
  display: none !important;
}

.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;
}

html {
  background: var(--charcoal);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--charcoal);
  overflow-wrap: break-word;
}

:focus {
  outline: none;
}

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

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 5;
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--charcoal);
  text-decoration: none;
  background: var(--accent);
  border-radius: 8px;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  outline-color: var(--ink-bright);
}

/* ---- Header: text mark left, menu centre ---- */
.site-header {
  position: relative;
  z-index: 3;
  view-transition-name: site-header;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  flex: none;
  height: var(--top);
  padding: 0 var(--pad);
}

.site-mark {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px; /* the menu's */
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
  transition: color 0.15s ease;
}

.site-mark:hover,
.site-mark:focus-visible {
  color: var(--ink-bright);
}

/* ---- Menu (same look and behaviour as the landing page) ---- */
.menu-list {
  display: flex;
  gap: clamp(20px, 4vw, 56px); /* the landing's: the row does not move between it and the subpages */
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-list a,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px 0 calc(4px + 0.14em); /* balances the trailing letter-space */
  font: inherit;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.7;
  border-radius: 6px;
  transition: opacity 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

/* Hover / keyboard focus: brighter, same hue. */
.menu-list a:hover,
.menu-list a:focus-visible,
.menu-toggle:hover,
.menu-toggle:focus-visible {
  color: var(--ink-bright);
  opacity: 1;
}

/* The page you are on: bolder and brighter. */
.menu-list a[aria-current="page"],
.menu-list a[aria-current="page"]:hover,
.menu-list a[aria-current="page"]:focus-visible {
  font-weight: 800;
  color: var(--ink-bright);
  opacity: 1;
}

/* Every item reserves the width of its ExtraBold label (an invisible copy,
 * zero height), so the row sits in the same place whichever page is current. */
.menu-list a {
  flex-direction: column;
  justify-content: center;
}

.menu-list a::after {
  content: attr(data-label);
  display: block;
  height: 0;
  overflow: hidden;
  font-weight: 800;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.menu-toggle,
.menu-close {
  display: none;
  margin: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.site-header a:focus-visible,
.site-header button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Narrow landscape windows (720 to 880px): a centred row would run into the
 * mark, so the menu sits at the right edge instead. */
@media (min-width: 720px) and (max-width: 879.98px) and (min-aspect-ratio: 1/1) {
  .site-header {
    grid-template-columns: auto 1fr;
    column-gap: 24px;
  }

  .menu-nav {
    justify-self: end;
    margin-right: -4px;
  }

  .menu-list {
    gap: 14px;
  }
}

/* Mobile = portrait (height > width) or narrower than 720px, the landing's
 * rule (js/site.js uses the same query): mark left, "Menu" button right,
 * full-screen overlay. */
@media (max-width: 719.98px), not all and (min-aspect-ratio: 1/1) {
  :root {
    --top: 72px;
  }

  .site-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
  }

  .menu-toggle {
    display: inline-flex;
    margin-right: -12px; /* the label, not the tap area, lines up with the page edge */
    padding-left: calc(12px + 0.14em);
    padding-right: 12px;
  }

  .menu-panel {
    position: fixed;
    inset: 0;
    display: flex;
    padding: 72px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(27, 27, 27, 0.92);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
  }

  .menu-panel.is-open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.25s ease;
  }

  .menu-list {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: auto; /* centred, and still scrollable if the screen is very short */
  }

  .menu-list a {
    min-height: 56px;
    font-size: clamp(26px, 8vw, 40px);
  }

  .menu-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    font: inherit;
    font-size: 40px;
    font-weight: 300;
    line-height: 1;
    color: var(--ink);
    opacity: 0.7;
    border-radius: 8px;
    transition: opacity 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .menu-close:hover,
  .menu-close:focus-visible {
    color: var(--ink-bright);
    opacity: 1;
  }
}

/* Set by js/site.js for a frame or two while the layout switches between the
 * desktop row and the mobile overlay: no fade of the closed panel. */
.site-header.is-switching .menu-panel {
  transition: none;
}

/* No JavaScript on mobile: the button cannot open anything, so the links sit
 * in the header as a plain wrapping row. */
@media (scripting: none) and (max-width: 719.98px), (scripting: none) and (not all and (min-aspect-ratio: 1/1)) {
  .site-header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--top);
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .menu-toggle,
  .menu-close {
    display: none;
  }

  .menu-panel {
    position: static;
    display: block;
    padding: 0;
    overflow: visible;
    background: none;
    visibility: visible;
    opacity: 1;
  }

  .menu-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 16px;
    margin: 0 0 0 -4px;
  }

  .menu-list a {
    min-height: 44px;
    font-size: 13px;
  }
}

/* Overlay open: nothing behind it scrolls. */
html.menu-open,
html.menu-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

/* ---- Page column ---- */
.page {
  flex: 1 0 auto;
  padding: clamp(24px, 9vh - 28px, 76px) var(--pad) 0;
}

.column {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

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

/* Headings: Inter ExtraBold, a size down from the Light they replace and
 * tracked in, so the weight reads as deliberate. Body copy stays Light. */
h1 {
  margin-bottom: clamp(28px, 5vh, 48px);
  font-size: clamp(2rem, 4.4vw, 3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.prose > * + * {
  margin-top: 1.25em;
}

.lead {
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.45;
}

.page a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.page a:hover,
.page a:focus-visible {
  color: var(--ink-bright);
  text-decoration-color: var(--accent);
}

.ext {
  display: inline-block; /* keeps the arrow out of the underline */
  margin-left: 0.2em;
  text-decoration: none;
}

hr {
  height: 0;
  margin: clamp(48px, 9vh, 88px) 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---- Icon + label rows (footer, contact) ---- */
.rows {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  list-style: none;
}

.row,
.page .row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.row:hover,
.row:focus-visible,
.page .row:hover,
.page .row:focus-visible {
  color: var(--ink-bright);
}

.row svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.row:hover svg,
.row:focus-visible svg {
  color: var(--accent);
}

/* ---- Footer ---- */
.site-footer {
  flex: none;
  padding: clamp(72px, 14vh, 136px) var(--pad) 40px;
}

.site-footer .column {
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.footer-line {
  margin-bottom: 12px;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.site-footer .rows {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0 32px;
  font-size: 0.9375rem;
}

.site-footer .row svg {
  width: 16px;
  height: 16px;
}

/* ---- About ---- */
.founder {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  align-items: stretch;
}

/* Desktop: the tall photo runs the full height of the bio beside it. The
 * image is out of flow, so the text alone sets that height; the photo is
 * cropped to fit (centred). */
.founder-photo {
  position: relative;
  display: block;
  min-height: 320px;
  overflow: hidden;
  background: var(--surface);
  border-radius: 8px;
}

.founder-photo img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.founder-role {
  margin-top: 6px;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.founder-text > p + p {
  margin-top: 1.25em;
}

.founder-text > .founder-role + p {
  margin-top: 1.5em;
}

@media (max-width: 719.98px), not all and (min-aspect-ratio: 1/1) {
  .founder {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Phones: the wide photo, whole, above the bio. */
  .founder-photo {
    min-height: 0;
  }

  .founder-photo img {
    position: static;
    height: auto;
  }
}

/* ---- Products ---- */
.list {
  padding: 0;
  list-style: none;
}

.list li {
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.list li:first-child {
  padding-top: 0;
}

.item-name {
  display: block;
  font-size: clamp(1.25rem, 2.2vw, 1.625rem);
  font-weight: 400;
  line-height: 1.25;
}

.item-line {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.subheading {
  margin: clamp(48px, 9vh, 80px) 0 22px;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

/* ---- Services: accordion ---- */
.services-intro {
  margin-bottom: clamp(28px, 5vh, 48px);
}

/* The list of realms. Any number of rows can be open at once.
 * --arrow-s / --arrow-gap: the arrow beside the list (see "the realms arrow"
 * below). Here, the narrow form: the arrow stands inside the column and the
 * rows (not the title or the intro) are moved in just enough to clear it. */
.services {
  --arrow-s: clamp(8px, 1.2vw, 12px);   /* 8px on a phone */
  --arrow-gap: calc(1.5 * var(--arrow-s));
  position: relative;
  padding-left: calc(2 * var(--arrow-s) + var(--arrow-gap));
}

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

/* The list's top rule: the arrow runs from it to the last row's rule. */
.service:first-of-type {
  border-top: 1px solid var(--line);
}

/* Closed: Regular, dimmed. Open: ExtraBold, white (no accent colour).
 * overflow: js/site.js animates the height when the title gains or loses
 * its second line. */
.service summary {
  display: block;
  padding: 20px 0;
  overflow: hidden;
  font-size: clamp(1rem, 1.75vw, 1.5rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: rgba(245, 241, 232, 0.74);
  list-style: none; /* no disclosure triangle */
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

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

.service summary::marker {
  content: "";
}

/* The title: the realm's name and, while the row is open, its
 * ": description" after it (.service-more). One run of text, so it wraps as
 * a sentence inside the column (two lines as a rule, three on a phone) and
 * is read out as one name. A closed row is one line, centred in 36px. */
.service-label {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.service-title {
  display: block;
  min-width: 0;
  text-wrap: balance;
}

/* Shown by the open attribute alone, so it works without JavaScript. It
 * goes at once when the row starts to close (.is-closing, js/site.js). */
.service-more {
  display: none;
}

.service[open]:not(.is-closing) .service-more {
  display: inline;
  animation: service-more-in 0.2s ease both;   /* none with reduced motion (end of this sheet) */
}

@keyframes service-more-in {
  from { opacity: 0; }
}

.service summary:hover {
  color: var(--ink-bright);
}

/* .is-closing is set by js/site.js while the panel rolls back up. */
.service[open]:not(.is-closing) > summary,
.service[open]:not(.is-closing) > summary:hover {
  font-weight: 800;
  color: var(--ink-bright);
}

.service-body {
  overflow: hidden; /* js/site.js animates its height */
}

.service-body p {
  padding: 0 0 26px;
  font-size: 1rem;
  font-weight: 300;
  color: var(--muted);
}

/* ---- Services: the realms arrow ----
 * A vertical double-headed arrow with its label set into the shaft, beside
 * the list. Decorative (aria-hidden; the list carries the name).
 * It is a box pinned to the list's top and bottom rules, so it gets longer
 * and shorter with the list, frame by frame, with no script: a column of
 * head, shaft, label, shaft, head, in which the two shaft pieces share
 * whatever height is left.
 * --arrow-s is the shaft's thickness. The heads are twice as wide, and the
 * label's capitals are exactly as tall as the shaft is thick: Inter's cap
 * height is 0.727em, so the font size is --arrow-s / 0.727; with a line
 * height of 1 the capitals sit in the middle of the line (to 0.001em), i.e.
 * on the shaft's axis. */
.realms-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(2 * var(--arrow-s));
  overflow: hidden;   /* a list too short for the label: never past the rules */
  color: var(--arrow-ink, #5A5A5A);
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.realms-arrow::before,
.realms-arrow::after {
  content: "";
  flex: none;
  width: 100%;
  height: calc(1.7 * var(--arrow-s));
  background: currentColor;
}

.realms-arrow::before {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.realms-arrow::after {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* A pixel under each head: no hairline where they meet. */
.realms-arrow-shaft {
  flex: 1 1 0;
  width: var(--arrow-s);
  min-height: 0;
  background: currentColor;
}

.realms-arrow-shaft:first-child {
  margin-top: -1px;
}

.realms-arrow-shaft:last-child {
  margin-bottom: -1px;
}

/* Reads from the bottom up: set top to bottom, then turned half a turn.
 * Padding: the gap to the shaft ends; the last letter's tracking (at the
 * top, once turned) is taken off it. */
.realms-arrow-label {
  flex: none;
  padding: calc(0.55 * var(--arrow-s)) 0 calc(0.55 * var(--arrow-s) - 0.06em);
  font-size: calc(var(--arrow-s) / 0.727);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* Wide windows: the arrow stands in the page's left margin, outside the
 * column, so the title, the intro and the rows keep one left edge.
 * --arrow-room: that margin (the page padding below 1276px, then half of
 * what the window has beyond the 1000px layout) less 12px kept clear at the
 * window's edge. The arrow (two shafts wide) and its gap to the list take a
 * share of it: slim in a 1280px window, full size (16px shaft) from about
 * 1310px. */
@media (min-width: 1100px) and (min-aspect-ratio: 1/1) {
  .services {
    --arrow-room: calc(max(min(4vw, 48px), (100vw - 1000px) / 2) - 12px);
    --arrow-s: clamp(10px, var(--arrow-room) / 3.2, 16px);
    --arrow-gap: min(2.25 * var(--arrow-s), var(--arrow-room) - 2 * var(--arrow-s));
    padding-left: 0;
  }

  .realms-arrow {
    right: calc(100% + var(--arrow-gap));
    left: auto;
  }
}

/* ---- Services: Pause / Play ----
 * One icon on the title's line, at the right-hand edge (two bars for pause,
 * a triangle for play; inline SVG in the page): it stops and restarts the
 * image that changes by itself (the shape on desktop, the reel on mobile).
 * js/services.js shows it and runs it (aria-label, aria-pressed and
 * .is-paused); without JavaScript and with reduced motion it stays hidden.
 * It is out of flow, so it never moves, resizes or re-wraps anything else
 * and takes no cell of the desktop grid; this rule only gives it its
 * containing block. */
.services-layout {
  position: relative;
}

/* Box: a 44px tap target (padding around a 13px icon), so that on phones it
 * ends exactly under the "MENU" button's edge.
 * Top: the icon is centred on the title's x-height. Inter's baseline lies
 * 0.3638em below the middle of a line ((ascender 0.969em - descender
 * 0.241em) / 2); the title's baseline is 0.8888em of the h1's font size
 * below the layout's top (half its 1.05 line + 0.3638em); the icon's middle
 * sits half an x-height (0.26em) above it, and the button's middle is 22px
 * below its top. */
.services-pause {
  position: absolute;
  top: calc(0.6288 * clamp(2rem, 4.4vw, 3rem) - 22px);   /* h1's font size: keep the two in step */
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0 -15.5px 0 0; /* the icon, not the tap area, lines up with the page edge */
  padding: 0 15.5px;
  font: inherit;
  line-height: 0;
  color: var(--ink);
  opacity: 0.7;
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
  user-select: none;
  -webkit-user-select: none;
}

.services-pause-icon {
  display: block;
  width: 13px;
  height: 13px;
  fill: currentColor;
}

/* One icon at a time: the bars while the images run, the triangle while
 * they are paused (js/services.js sets .is-paused). */
.services-pause-icon-play,
.services-pause.is-paused .services-pause-icon-pause {
  display: none;
}

.services-pause.is-paused .services-pause-icon-play {
  display: block;
}

/* Keyboard focus and a press: full strength, same hue, like the menu, and a
 * visible ring on keyboard focus. Hover too, but only where the pointer can
 * hover: on a phone a tapped button would stay bright, and here that would
 * read as a state. */
.services-pause:focus-visible,
.services-pause:active {
  color: var(--ink-bright);
  opacity: 1;
}

.services-pause:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -4px;
}

@media (hover: hover) {
  .services-pause:hover {
    color: var(--ink-bright);
    opacity: 1;
  }
}

/* ---- Services, desktop: list left, one image in a morphing shape right ---- */
@media (min-width: 720px) and (min-aspect-ratio: 1/1) {
  /* A full-width grid of four columns: spacer | list | track | spacer.
   * The two equal spacers centre the middle pair exactly as a centred
   * 1000px column would be (the width of the other pages' column), and the
   * list is that column less --track: a width that depends on the window's
   * width only. Nothing about the image (the gap, the shape, a row opening
   * beside it) can move the list, resize it or re-wrap its text.
   * The image breaks the column: its box takes the track and the right-hand
   * spacer, so it runs past the column's right edge to the page's right
   * margin (the one the header keeps), with no viewport arithmetic. */
  .services-layout {
    --track: calc(min(34vw, 460px) + clamp(40px, 6vw, 104px));   /* right of the list, inside the 1000px */
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      calc(min(100%, 1000px) - var(--track))
      var(--track)
      minmax(0, 1fr);
    max-width: none;
  }

  .services-layout > h1 {
    grid-column: 2;
    grid-row: 1;
  }

  .services-main {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }

  /* The area the shape lives in: this box.
   * Top: the cap height of the intro's first line, 0.437em of the body's font
   * size below the paragraph's top (Inter: half-leading 0.195em + ascender
   * 0.969em - cap height 0.727em).
   * Bottom: the list's last rule. The column stretches with the row and has
   * nothing in flow, so it follows the list as rows open and close and
   * never makes the row taller itself.
   * Left: the list plus --shape-gap (js/services.js, LOOK.gap), which is
   * held back so the area stays at least 160px wide.
   * Right: the page margin.
   * It is tied to the list and scrolls with it. */
  .shape-col {
    position: relative;
    grid-column: 3 / 5;
    grid-row: 2;
    align-self: stretch;
    min-width: 0;
    margin-top: calc(0.437 * 1.0625rem);   /* the body's font size */
    margin-left: min(var(--shape-gap, clamp(40px, 6vw, 104px)), 100% - 160px);
    max-width: var(--shape-w, none);   /* js/services.js, LOOK.ratio: width / height with the rows closed */
  }

  /* Some open: the closed ones step back a little more. */
  .services:has(.service[open]:not(.is-closing)) .service:not([open]) > summary:not(:hover),
  .services:has(.service[open]:not(.is-closing)) .service.is-closing > summary:not(:hover) {
    color: rgba(245, 241, 232, 0.5); /* 4.9:1 on the charcoal */
  }
}

/* The image is one button, as large as the area: click, tap, Enter or Space
 * shows the next image. js/services.js cuts it to the shape with clip-path
 * (so only the shape itself is clickable and shows the pointer), builds the
 * two layers inside it and draws the focus ring next to it. No shadow, no
 * outline: the image sits flat on the charcoal.
 * --shape-gap and --ht-mix / --ht-blur are set on the layout by
 * js/services.js from its LOOK object, --shape-h on each layer from its
 * measurements; the values here are only fallbacks. */
.shape {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden; /* the layers are taller than the area */
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  /* Until its first image is ready: not seen, not focusable. */
  visibility: hidden;
  opacity: 0;
}

.shape.is-on {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Keyboard focus: the ring follows the shape (an outline would be the
 * area's rectangle, and the clip would cut it). It is an SVG path on the
 * shape's outline, redrawn by js/services.js whenever the clip changes. */
.shape:focus-visible {
  outline: none;
  border-radius: 0;
}

.shape-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}

.shape-ring path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.shape:focus-visible + .shape-ring {
  opacity: 1;
}

@media (forced-colors: active) {
  .shape-ring path {
    stroke: Highlight;
  }
}

/* A layer: an image and, over it, its halftone. Two of them: the one on
 * show (.is-front) and the one holding the next image, unseen until a morph
 * brings it in (.is-in) above the other while js/services.js raises its
 * opacity: a dissolve, the one underneath staying opaque to the end.
 * Anchored at the area's top-left and as wide as it, with a height of its
 * own, --shape-h: the area's with the rows that were open when the layer
 * got its image, plus room for one more row. So when a row opens the clip
 * only shows more of the layer, and nothing is re-fitted or repainted while
 * it unrolls. */
.shape-layer {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: var(--shape-h, 100%);
  background: var(--mat, #242424);
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.shape-layer.is-front {
  opacity: 1;
}

.shape-layer.is-in {
  z-index: 1;
}

/* --pos: per-image focal point for the crop (js/services.js). */
.shape-layer img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Wide diagrams, text pages and tall screenshots: shown whole. The mat
 * fills the layer; the image is held inside --fit-*, a rectangle that lies
 * within the layer's shape as the area is and with one row more or fewer
 * open (worked out by js/services.js for each shape). */
.shape-layer.is-mat img {
  top: var(--fit-y, 0);
  left: var(--fit-x, 0);
  width: var(--fit-w, 100%);
  height: var(--fit-h, 100%);
  object-fit: contain;
  object-position: 50% 50%;
}

/* LOOK.follow (js/services.js): image, clip and halftone share one
 * rectangle, --img-*: the image's own proportions, covering the bounding
 * box of the layer's shape. --img-t moves it with the shape (a morph, a row
 * opening) without a new layout or a new halftone. */
.shape-layer.is-follow img,
.shape-layer.is-follow video,
.shape-layer.is-follow canvas {
  top: var(--img-y, 0);
  left: var(--img-x, 0);
  width: var(--img-w, 100%);
  height: var(--img-h, 100%);
  transform: var(--img-t, none);
  transform-origin: 0 0;
}

/* A clip ('video' in js/services.js) plays over its still, the same crop,
 * only while its layer is on show (.is-playing). */
.shape-layer video {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  opacity: 0;
  pointer-events: none;
}

.shape-layer.is-playing video {
  opacity: 1;
}

/* The halftone (painted by js/services.js) lies over the image; --ht-mix
 * blends the two. */
.shape-layer canvas {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  opacity: var(--ht-mix, 1);
  filter: var(--ht-blur, none);
}

/* Until image and halftone are in place the layer is a plain dark tile.
 * .is-late: they arrived while the layer was already in view (a slow
 * image), so they fade in instead of popping. */
.shape-layer:not(.is-ready) {
  background: #242424;
}

.shape-layer:not(.is-ready) img,
.shape-layer:not(.is-ready) canvas {
  opacity: 0;
}

.shape-layer.is-late img,
.shape-layer.is-late canvas {
  transition: opacity 0.2s ease;
}

/* Measuring probe (js/services.js): a copy of the list, laid out at the
 * list's width for an instant to learn its height with every row closed
 * and what each row adds when open. Never seen. */
.shape-probe {
  position: fixed;
  top: 0;
  left: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ---- Services, mobile: no image beside the list; the images run as a
 * halftone reel behind the page (built by js/services.js as the first child
 * of <body>). ---- */
@media (max-width: 719.98px), not all and (min-aspect-ratio: 1/1) {
  .shape-col {
    display: none;
  }

  .service summary {
    padding: 14px 0;
    font-size: clamp(1rem, 5.2vw, 1.25rem);
  }

  .service-body p {
    padding-bottom: 22px;
  }

  /* Text over the reel: the muted grey is lifted so it keeps 4.5:1 even on
   * the brightest dot (see --reel-o). The arrow is lifted with it, to stay
   * clear of the dots. */
  html.has-reel {
    --muted: #BDB9B1;
    --arrow-ink: #6E6E6E;
  }

  html.has-reel body {
    background: transparent; /* the reel sits between <html>'s charcoal and the content */
  }
}

/* Recipe: the two images (grey, cross-fading) lie at half strength over a
 * grid of soft dots; a steep contrast() then thresholds the sum, so each dot
 * grows with the brightness under it: a real halftone, dots on a 45° screen
 * about 5px apart, like the landing ring. "lighten" against the charcoal
 * turns the black between dots back into the page colour, and the whole
 * layer is shown at low opacity. Nothing here repaints while scrolling. */
.reel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100%;
  height: 100vh;
  height: 100lvh;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  isolation: isolate;
  pointer-events: none;
  transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

/* --reel-o: 0.18 makes the brightest dot #444444; the text over it keeps at
 * least 4.9:1 (measured on every image). */
html.has-reel .reel {
  visibility: visible;
  opacity: var(--reel-o, 0.18);
  transition: opacity 0.8s ease;
}

.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--charcoal);
  mix-blend-mode: lighten;
}

.reel-tone {
  position: absolute;
  inset: 0;
  background: #000;
  -webkit-filter: grayscale(1) contrast(14);
  filter: grayscale(1) contrast(14);
}

.reel-dots {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 50%, #FFF 0, rgba(255, 255, 255, 0) 2.5px),
    radial-gradient(circle at 50% 50%, #FFF 0, rgba(255, 255, 255, 0) 2.5px);
  background-position: 0 0, 3.5px 3.5px;
  background-size: 7px 7px;
}

.reel-imgs {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0.5;
}

.reel-imgs img,
.reel-imgs video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  -webkit-filter: brightness(0.85);
  filter: brightness(0.85); /* white stays a field of separate dots, never a slab */
  transition: opacity 1.2s ease;
}

.reel-imgs img.is-on,
.reel-imgs video.is-on {
  opacity: 1;
}

/* No JavaScript: no image and no reel, one readable column; the arrow in
 * its narrow form (the column's margin is not the grid's). */
@media (scripting: none) {
  .services-layout {
    display: block;
    max-width: 72ch;
  }

  .shape-col {
    display: none;
  }

  .services {
    --arrow-s: clamp(8px, 1.2vw, 12px);
    --arrow-gap: calc(1.5 * var(--arrow-s));
    padding-left: calc(2 * var(--arrow-s) + var(--arrow-gap));
  }

  .realms-arrow {
    right: auto;
    left: 0;
  }
}

/* ---- Contact ---- */
.form {
  display: grid;
  gap: 22px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 10px 0 12px;
  font: inherit;
  font-size: 1.0625rem; /* 16px or more: no zoom on focus in iOS */
  line-height: 1.5;
  color: var(--ink);
  background: transparent;
  /* No box: one rule under the field, like the rules of the lists. */
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  min-height: 160px;
  resize: vertical;
}

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

.field input:focus-visible,
.field textarea:focus-visible {
  /* The rule turns white and doubles in weight (the shadow adds the second pixel without moving anything). */
  border-color: var(--accent);
  box-shadow: 0 1px 0 var(--accent);
  outline: 0;
}

.field [aria-invalid="true"] {
  border-color: var(--error);
}

.field-error {
  font-size: 0.875rem;
  color: var(--error);
}

/* Honeypot: off-screen, out of the tab order and the accessibility tree. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 6px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0;
  padding: 10px 24px;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: var(--charcoal);
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 999px;
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.6;
  cursor: default;
}

.form-status {
  font-size: 1rem;
}

/* Empty: kept in the accessibility tree (a live region must exist before its
 * text arrives) but takes no space in the form. */
.form-status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.form-status a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ---- Narrow screens ---- */
@media (max-width: 719.98px), not all and (min-aspect-ratio: 1/1) {
  body {
    font-size: 1rem;
  }

  .site-footer .rows {
    flex-direction: column;
  }
}

/* ---- Reduced motion: no overlay fade, no hover fades (js/site.js also skips
 * the accordion animation). ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
