/* LON B. — tokens, type and shared components.
   One device: the blue full stop. Yellow is the signature surface, ink and paper carry
   the rest, blue marks the dot and actions, green means "live" and nothing else. */

@font-face { font-family: Grotesk; src: url('./assets/space-grotesk.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: DM; src: url('./assets/dm-sans.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: Instrument; src: url('./assets/instrument-serif-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: JBMono; src: url('./assets/jetbrains-mono.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --yellow: #f6f044;
  --ink: #171917;
  --paper: #f7f5eb;
  --blue: #214eea;
  --blue-on-ink: #6f8cff;
  --green: #b9f47b;
  --muted: #4b4e47;
  --muted-on-ink: #b9bbae;
  --hairline: #17191733;
  --hairline-on-ink: #f7f5eb33;

  --display: Grotesk, 'Helvetica Neue', Arial, sans-serif;
  --body: DM, 'Helvetica Neue', Arial, sans-serif;
  --serif: Instrument, 'Iowan Old Style', Georgia, serif;
  --mono: JBMono, ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Eight steps. Nothing on the page uses a size outside this scale. */
  --t-1: .875rem;
  --t-2: 1rem;
  --t-3: 1.125rem;
  --t-4: 1.375rem;
  --t-5: clamp(1.625rem, 1.3rem + 1.1vw, 2rem);
  --t-6: clamp(2rem, 1.35rem + 2.4vw, 3.25rem);
  --t-7: clamp(2.5rem, 1.2rem + 4.8vw, 5rem);
  --t-8: clamp(3rem, .6rem + 8vw, 7.75rem);

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --section-y: clamp(4rem, 3rem + 5vw, 8rem);
  --header-h: 4.5rem;
  --line: 2px solid var(--ink);
  --shadow: 6px 6px 0 var(--ink);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 1rem); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--t-3)/1.6 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: .08em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: var(--blue); color: var(--paper); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: -5rem; left: 1rem; z-index: 200; padding: .75rem 1rem; background: var(--ink); color: var(--paper); font-weight: 700; }
.skip:focus { top: 1rem; }
.brand-colour-filters { position: absolute; }

/* ── Type roles ── */
h2, h3, h4, .hero-display, .brand-mark, .footer-mark, .intro-mark { font-family: var(--display); font-weight: 700; }
h2 { font-size: var(--t-7); line-height: 1; letter-spacing: -.055em; text-wrap: balance; }
h3 { font-size: var(--t-5); line-height: 1.1; letter-spacing: -.04em; }
h4 { font-size: var(--t-3); line-height: 1.3; letter-spacing: -.02em; }
.idea { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.02em; }

/* The full stop. A real character, so it reads and copies as punctuation. */
.stop { display: inline-block; color: var(--blue); }

/* ── Buttons and links ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 3.25rem; padding: .75rem 1.5rem; border: var(--line); border-radius: 0; background: var(--ink); color: var(--paper); font: 700 var(--t-2)/1.2 var(--body); text-decoration: none; text-align: center; transition: transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out), background-color 160ms; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--outline-light { background: transparent; color: var(--paper); border-color: var(--paper); }
.btn .ext { font-family: Arial, sans-serif; }
@media (hover: hover) {
  .btn:hover { transform: translate(-3px, -3px); box-shadow: 5px 5px 0 var(--blue); }
  .btn--ghost:hover { background: var(--paper); box-shadow: 5px 5px 0 var(--ink); }
  .btn--light:hover, .btn--outline-light:hover { box-shadow: 5px 5px 0 var(--yellow); }
  .btn--outline-light:hover { background: var(--paper); color: var(--ink); }
}
.btn:active { transform: translate(0, 0); box-shadow: none; }
.link-button { padding: .5rem 0; min-height: 2.75rem; border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: .2em; }
.link-button--ink { color: var(--ink); }

/* ── Small parts ── */
.tag { display: inline-flex; align-items: center; gap: .5rem; font: 700 var(--t-1)/1.4 var(--body); letter-spacing: .01em; }
.tag--on-ink { color: var(--yellow); }
.status-dot { width: .625rem; height: .625rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 2px var(--ink); flex-shrink: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { padding: .3rem .7rem; border: 1.5px solid var(--ink); font-size: var(--t-1); line-height: 1.4; }
.chips--on-ink li { border-color: var(--hairline-on-ink); color: var(--paper); }
.toggle, .human-toggle { position: relative; display: block; width: 2rem; height: 2rem; flex-shrink: 0; border-radius: 50%; background: var(--blue); transition: transform 240ms var(--ease-out); }
.toggle::before, .toggle::after, .human-toggle::before, .human-toggle::after { content: ''; position: absolute; top: 50%; left: 50%; width: .75rem; height: 2px; margin: -1px 0 0 -.375rem; background: var(--paper); }
.toggle::after, .human-toggle::after { transform: rotate(90deg); transition: transform 240ms var(--ease-out); }
[open] > summary .toggle::after, [open] > summary .human-toggle::after { transform: rotate(0deg); }

/* ── Section scaffolding ── */
.section-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 2rem var(--gutter); align-items: end; margin-bottom: clamp(2.5rem, 5vw, 4.5rem); }
.section-head > p { max-width: 34rem; font-size: var(--t-3); }
@media (max-width: 860px) { .section-head { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 1.25rem; } }

/* ── Header: sticky, with the dot riding the rule as a progress marker ── */
.site-header { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: var(--header-h); padding-inline: var(--gutter); background: var(--yellow); border-bottom: var(--line); }
.brand { display: flex; align-items: baseline; gap: .875rem; min-height: 2.75rem; text-decoration: none; }
.brand-mark { font-size: var(--t-4); line-height: 2.75rem; letter-spacing: -.06em; }
.brand-name { font-size: var(--t-1); font-weight: 500; color: var(--muted); }
.site-nav { display: flex; align-items: center; gap: clamp(.875rem, 2.2vw, 2rem); }
.site-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; font: 600 var(--t-2)/1 var(--display); letter-spacing: -.01em; text-decoration: none; }
.site-nav a:not(.site-nav-cta) { background: linear-gradient(var(--ink), var(--ink)) no-repeat 0 78% / 0 2px; transition: background-size 240ms var(--ease-out); }
.site-nav a:not(.site-nav-cta):hover, .site-nav a[aria-current="true"]:not(.site-nav-cta) { background-size: 100% 2px; }
.site-nav-cta { padding: 0 1rem; background: var(--ink); color: var(--paper); }
.rail { position: absolute; inset: auto var(--gutter) -2px var(--gutter); height: 2px; pointer-events: none; }
.rail-dot { position: absolute; left: calc(var(--progress, 0) * (100% - .875rem)); top: 50%; width: .875rem; height: .875rem; margin-top: -.4375rem; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px var(--yellow); }
@media (max-width: 720px) {
  :root { --header-h: 3.75rem; }
  .brand-name { display: none; }
  .brand-mark { font-size: var(--t-3); }
  .site-nav { gap: .75rem; }
  .site-nav a { font-size: var(--t-1); }
  .site-nav-cta { padding: 0 .625rem; min-height: 2.5rem !important; }
}
@media (max-width: 350px) { .site-nav { gap: .5rem; } }

/* ── Footer ── */
.site-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2rem var(--gutter); align-items: end; padding: clamp(2.5rem, 5vw, 4rem) var(--gutter); background: var(--ink); color: var(--paper); }
.footer-mark { font-size: var(--t-7); line-height: .9; letter-spacing: -.07em; }
.footer-mark .stop { color: var(--blue-on-ink); }
.footer-meta { display: grid; gap: .25rem; justify-items: end; text-align: right; font-size: var(--t-1); color: var(--muted-on-ink); }
.footer-meta a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--paper); font-weight: 700; }
.site-footer :focus-visible { outline-color: var(--yellow); }
@media (max-width: 640px) { .site-footer { grid-template-columns: minmax(0, 1fr); } .footer-meta { justify-items: start; text-align: left; } }

/* ── Dialog ── */
.dialog { width: min(40rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); padding: clamp(1.5rem, 4vw, 2.75rem); border: var(--line); background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 var(--ink); overflow: auto; }
.dialog::backdrop { background: #171917bf; }
.dialog h2 { font-size: var(--t-6); padding-right: 3rem; }
.dialog-close { position: absolute; top: 1rem; right: 1rem; width: 2.75rem; height: 2.75rem; border: var(--line); background: var(--yellow); font: 700 var(--t-4)/1 Arial, sans-serif; }
.dialog-note { margin-top: 1rem; font-size: var(--t-2); color: var(--muted); }
.dialog-note .link-button { min-height: 0; padding: 0; }
.dialog form { display: grid; gap: 1.125rem; margin-top: 1.5rem; }
.field { display: grid; gap: .375rem; font-size: var(--t-2); font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; min-height: 3rem; padding: .625rem .75rem; border: var(--line); border-radius: 0; background: #fff; font-weight: 400; }
.field textarea { resize: vertical; }
.field ::placeholder { color: #6b6e66; opacity: 1; }
.dialog form .btn { justify-self: start; }
.result-kicker { margin-top: 1.5rem; font-size: var(--t-2); font-weight: 700; }
#enquiry-draft { margin-top: .75rem; max-height: 18rem; padding: 1rem; overflow: auto; border: var(--line); background: #fff; font: 400 var(--t-1)/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; margin-top: 1.25rem; }
.copy-status { min-height: 1.5rem; margin-top: .5rem; font-size: var(--t-1); font-weight: 700; color: var(--blue); }

/* ── Intro: the dot lands, the page lifts. Shown only when the inline boot script allows it. ── */
.intro-mark { position: relative; font-size: clamp(4rem, 19vw, 17rem); line-height: 1; letter-spacing: -.07em; white-space: nowrap; }
.intro-dot { display: inline-block; width: .19em; height: .19em; margin-left: .04em; border-radius: 50%; background: var(--blue); }

/* ── Embedded browsers that darken a light-only page ──
   Repaint the yellow and blue surfaces as images, and pin the text on them back to ink. */
@media (forced-colors: none) {
  .browser-recolours-page {
    --paint-yellow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1024' height='512'%3E%3Crect width='1024' height='512' fill='%23f6f044'/%3E%3C/svg%3E");
    --paint-blue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1024' height='512'%3E%3Crect width='1024' height='512' fill='%23214eea'/%3E%3C/svg%3E");
  }
  .browser-recolours-page :is(.site-header, .hero, .about, .intro) { background-image: var(--paint-yellow); background-size: cover; }
  .browser-recolours-page .contact-flood { background-image: var(--paint-blue); background-size: cover; }
  .browser-recolours-page :where(
    .site-header .brand, .site-header .site-nav a:not(.site-nav-cta), .intro-mark,
    .hero .status, .hero-kicker, .hero-display, .hero-lede, .hero .btn--ghost, .hero-facts, .mascot-caption,
    .about-head, .about-prompt
  ) { filter: url(#brand-colour-ink); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
