/* Irrational Solution: shared styles. Dark, warm monochrome, flat, one type system. */
:root {
  --bg: #111111;
  --surface: #191918;
  --surface-2: #201f1e;
  --line: #2e2d2b;
  --text: #f7f6f3;
  --text-2: #a8a7a3;
  --text-3: #8a8985;
  --paper: #f7f6f3;
  --paper-ink: #111111;

  /* Older names, still used by the page stylesheets */
  --ink: var(--text);
  --bone: #f7f6f3;
  --white: var(--surface);
  --rule: var(--line);
  --mute: var(--text-2);
  --soft: var(--text-3);
  --rule-dark: var(--line);

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: 24px;
  color-scheme: dark;
}
@media (min-width: 900px) { :root { --gutter: 48px; } }

/* A light sheet on the dark page, for documents such as the sample report */
.paper {
  --bg: #f7f6f3; --surface: #ffffff; --surface-2: #f1f0ec; --line: #eaeaea;
  --text: #111111; --text-2: #6b6a67; --text-3: #8a8985;
  --ink: #111111; --white: #ffffff; --rule: #eaeaea; --mute: #6b6a67; --soft: #a8a7a3;
  background: var(--bg); color: var(--text); color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p, figure { margin: 0; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
a.shot:focus-visible { outline-offset: -3px; }

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

.skip {
  position: absolute; left: 12px; top: 12px; z-index: 100;
  padding: 10px 14px; background: var(--paper); color: var(--paper-ink);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* ── Header: a translucent layer that content scrolls under ── */
.site-header { background: var(--bg); color: var(--text); border-bottom: 1px solid var(--line); }
@media (min-width: 761px) {
  .site-header { position: sticky; top: 0; z-index: 50; background: rgba(17, 17, 17, 0.86); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
}
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; min-height: 44px; }
.brand img { width: 28px; height: 28px; }
.brand span { font-family: var(--serif); font-weight: 500; font-size: 20px; letter-spacing: -0.02em; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 28px; font-size: 14px; }
.nav a { text-decoration: none; }
.nav a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-2); }
.nav a:not(.btn):hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
@media (max-width: 760px) {
  .site-header .bar { position: relative; flex-wrap: wrap; padding-top: 10px; padding-bottom: 6px; row-gap: 0; }
  .nav { width: 100%; gap: 18px; }
  .nav a:not(.btn) { white-space: nowrap; }
  .nav .btn { position: absolute; top: 10px; right: var(--gutter); }
}
@media (max-width: 360px) { .brand span { font-size: 17px; } .nav { gap: 14px; font-size: 13px; } }

/* ── Buttons and links: feedback on press, not on release ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; border-radius: 5px;
  background: var(--paper); color: var(--paper-ink);
  font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform 100ms ease-out, background-color 160ms var(--ease);
}
.btn:hover { background: #ffffff; }
.btn:active { transform: scale(0.97); }
.btn--small { min-height: 44px; padding: 0 18px; font-size: 14px; }
.textlink { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 5px; }
.textlink:hover { text-decoration-color: currentColor; }

/* ── Hero ── */
.hero { border-bottom: 1px solid var(--line); }
.hero > .inner {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center; gap: 56px; padding-top: 88px; padding-bottom: 72px;
}
.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(38px, 5.2vw, 62px); line-height: 1.05; letter-spacing: -0.03em;
  text-wrap: balance;
}
.hero .lede { margin-top: 26px; max-width: 30em; font-size: 18px; color: var(--text-2); }
.actions { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.hero-art { display: flex; flex-direction: column; gap: 16px; }
.hero-art svg { width: 100%; height: auto; }
.digits { font-family: var(--mono); font-size: 15px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.specialisms { list-style: none; margin: 0; padding: 0 0 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 28px 48px; }
.specialisms li { padding-top: 20px; border-top: 1px solid var(--line); }
.specialisms h2 { font-family: var(--sans); font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: 0; }
.specialisms p { margin-top: 8px; font-size: 15px; line-height: 1.55; color: var(--text-2); }
.strip { border-top: 1px solid var(--line); font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.strip .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; padding-top: 22px; padding-bottom: 22px; }
.strip strong { color: var(--text); font-weight: 400; }
@media (max-width: 860px) {
  .hero > .inner { grid-template-columns: minmax(0, 1fr); gap: 44px; padding-top: 64px; padding-bottom: 64px; }
  .hero-art { max-width: 460px; }
}
@media (max-width: 640px) { .strip .inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .strip strong { grid-column: 1 / -1; } }

/* Construction drawing: lines draw once on load */
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1300ms var(--ease) forwards; }
.draw.d2 { animation-delay: 220ms; } .draw.d3 { animation-delay: 440ms; } .draw.d4 { animation-delay: 660ms; }
.eye { opacity: 0; animation: eye 300ms linear 1500ms forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes eye { to { opacity: 1; } }

/* Scramble-to-settle digits (script.js): the real text holds the layout */
.scr { position: relative; display: inline-block; white-space: nowrap; }
.scr[data-busy] .scr-real { color: transparent; }
.scr-fx { position: absolute; inset: 0; }

/* ── Sections ── */
.band { padding: 96px 0; }
.band + .band { border-top: 1px solid var(--line); }
.band--tight { padding-top: 64px; padding-bottom: 64px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 48px; margin-bottom: 36px; }
h2, .h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.08; letter-spacing: -0.025em; text-wrap: balance; }
.section-head p { max-width: 34em; color: var(--text-2); }
.prose { max-width: 38em; }
.prose p + p { margin-top: 1em; }
.mute { color: var(--text-2); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── Cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 14px; padding: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card h3 { font-size: 14px; font-weight: 600; line-height: 1.3; }
.card .figure { margin-top: 18px; font-family: var(--mono); font-weight: 500; font-size: 27px; line-height: 1.1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.card .unit { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-top: -6px; }
.card p { font-size: 14px; line-height: 1.55; color: var(--text-2); }
.after-cards { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; font-size: 14px; color: var(--text-2); }

/* ── Deliverable preview ── */
.deliverable { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; }
.cover { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 44px 32px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.cover img { width: min(300px, 100%); }
.cover .digits { font-size: 13px; }
.deliverable .card { justify-content: center; padding: 40px; gap: 18px; }
.deliverable .card p { font-size: 16px; }
@media (max-width: 760px) { .deliverable { grid-template-columns: minmax(0, 1fr); } }

/* ── Work (home page cards) ── */
.work { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.work .card { padding: 0; overflow: hidden; gap: 0; }
.work .shot { background: #0b0b0b; border-bottom: 1px solid var(--line); }
.work .shot img { width: 100%; height: auto; }
.work .body { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 12px 48px; padding: 28px; }
.work .body .title { display: flex; flex-direction: column; gap: 12px; }
.work .body .text { display: flex; flex-direction: column; gap: 10px; }
.work h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; }
.work .caption { font-family: var(--mono); font-size: 12px; color: var(--text-3); }
@media (max-width: 760px) {
  .work .body { grid-template-columns: minmax(0, 1fr); padding: 22px; }
}
.card-logo { align-self: flex-start; height: 24px; width: auto; margin-bottom: 4px; }
.card-logo--qm { display: inline-flex; align-items: center; gap: 9px; height: 28px; font-size: 13px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); }
.card-logo--qm img { width: 28px; height: 28px; }
.tag { align-self: flex-start; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-2); }
.paper .tag { border-color: transparent; background: #edf3ec; color: #346538; }
.paper .tag--blue { background: #e1f3fe; color: #1f6c9f; }

/* ── Why the name ── */
.why { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.equation { display: flex; flex-direction: column; gap: 10px; padding: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: clamp(18px, 2.2vw, 24px); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; overflow: hidden; }
.equation .lhs { display: inline-block; width: 2.2em; color: var(--text-3); }
@media (max-width: 860px) { .why { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

/* ── Closing call ── */
.closing { border-top: 1px solid var(--line); background: var(--surface); }
.closing .inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; padding-top: 72px; padding-bottom: 72px; }
.closing p { color: var(--text-2); margin-top: 10px; }

/* ── Footer ── */
.site-footer { color: var(--text-2); border-top: 1px solid var(--line); font-size: 14px; }
.site-footer .inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px 48px; padding-top: 36px; padding-bottom: 40px; }
.site-footer .brand { color: var(--text); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.site-footer nav a:hover { color: var(--text); }
.site-footer .fine { width: 100%; font-family: var(--mono); font-size: 12px; color: var(--text-3); }

/* ── Inner pages ── */
.page-head { padding-top: 88px; padding-bottom: 48px; }
.page-head h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.03; letter-spacing: -0.03em; text-wrap: balance; }
.page-head .lede { margin-top: 22px; max-width: 36em; font-size: 18px; color: var(--text-2); }

/* Booking bar on phones (script.js shows it once the page's own button is out of view) */
.call-bar { display: none; }
@media (max-width: 760px) {
  .call-bar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); background: rgba(17, 17, 17, 0.92); border-top: 1px solid var(--line); }
  .call-bar[hidden] { display: none; }
  .call-bar .btn { width: 100%; }
  .site-footer .inner { padding-bottom: 96px; }
}
@media print { .call-bar { display: none !important; } }

/* One-shot reveal for blocks as they enter view (script.js adds .is-in) */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .draw { animation: none; stroke-dashoffset: 0; }
  .eye { animation: none; opacity: 1; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --line: #6b6a67; --text-2: #d5d4cf; --text-3: #c4c3be; }
  .site-header { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Screenshots link to the full image. Phones get a version cut at a clean boundary, shown whole. */
a.shot { display: block; position: relative; cursor: zoom-in; }
.shot picture, .shot img { display: block; width: 100%; height: auto; }
/* A label on the image says it opens larger; it is always shown, so touch screens get it too */
a.shot::after {
  content: "View full screenshot"; position: absolute; right: 12px; bottom: 12px;
  padding: 7px 12px 7px 32px; font-family: var(--sans); font-size: 13px; font-weight: 500; line-height: 18px; color: var(--text);
  background: rgba(17, 17, 17, 0.88) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23f7f6f3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9.5 2.5h4v4M13.5 2.5 9 7M6.5 13.5h-4v-4M2.5 13.5 7 9'/%3E%3C/svg%3E") 10px 50% / 14px 14px no-repeat;
  border: 1px solid var(--text-3); border-radius: 5px;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease), transform 100ms ease-out;
}
a.shot:hover::after, a.shot:focus-visible::after { background-color: #2b2a28; border-color: var(--text); }
a.shot:active::after { transform: scale(0.97); }

/* The viewer: the full screenshot over the page, with a way out that is always in view */
html:has(dialog.viewer[open]) { overflow: hidden; }
dialog.viewer {
  width: min(1240px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); margin: auto; padding: 0;
  display: none; flex-direction: column; overflow: hidden;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
dialog.viewer[open] { display: flex; animation: viewer-in 260ms var(--ease); }
dialog.viewer::backdrop { background: rgba(8, 8, 8, 0.82); animation: viewer-fade 200ms ease-out; }
@keyframes viewer-in { from { opacity: 0; transform: scale(0.98); } }
@keyframes viewer-fade { from { opacity: 0; } }
.viewer-bar { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 10px 10px 20px; border-bottom: 1px solid var(--line); }
.viewer-cap { font-size: 14px; line-height: 1.45; color: var(--text-2); text-wrap: pretty; }
.viewer-close {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--paper-ink); background: var(--paper); border: 0; border-radius: 5px; cursor: pointer;
  transition: transform 100ms ease-out, background-color 160ms var(--ease);
}
.viewer-close:hover { background: #e6e5e1; }
.viewer-close:active { transform: scale(0.97); }
.viewer-close svg { width: 12px; height: 12px; }
.viewer-close kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; color: #55544f; border: 1px solid #b9b8b3; border-radius: 4px; }
.viewer-body { overflow: auto; overscroll-behavior: contain; background: #0b0b0b; cursor: zoom-out; }
.viewer-body img { display: block; width: 100%; height: auto; margin: 0 auto; }
.viewer-foot { flex-shrink: 0; padding: 9px 20px; font-size: 13px; color: var(--text-3); border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  dialog.viewer { width: 100vw; max-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; }
  .viewer-bar { padding: 8px 8px 8px 16px; }
  .viewer-cap { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .viewer-close kbd { display: none; }
  /* a wide screenshot keeps a readable scale and scrolls sideways */
  .viewer-body img.is-wide { width: 900px; max-width: none; }
  .viewer-foot { padding: 9px 16px calc(9px + env(safe-area-inset-bottom)); }
  a.shot::after { right: 8px; bottom: 8px; padding: 6px 10px 6px 28px; font-size: 12px; background-position: 8px 50%; }
}
@media (prefers-reduced-motion: reduce) { dialog.viewer[open], dialog.viewer::backdrop { animation: none; } }
.asked { display: none; }
@media (max-width: 760px) {
  .asked { display: block; margin-bottom: 14px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
}

@media print {
  :root { color-scheme: light; }
  .paper { --bg: #ffffff; background: #ffffff; }
  :root { --bg: #ffffff; --surface: #ffffff; --surface-2: #ffffff; --line: #cfcec9; --text: #111111; --text-2: #4a4946; --text-3: #6b6a67; }
  .site-header { position: static; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .draw { animation: none; stroke-dashoffset: 0; }
  .eye { animation: none; opacity: 1; }
  .scr-fx { display: none; }
  .scr[data-busy] .scr-real { color: inherit; }
}
