/* Shared layer: reset, type helpers, buttons, header, mobile menu, footer and the inner-page head.
   Every page loads tokens.css, then this file, then its own file in pages/<name>/. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); scroll-padding-top: var(--header); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 var(--fs-body)/var(--lh-body) var(--ff); overflow-x: clip; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, figure, ol, ul, dl, dd { margin: 0; padding: 0; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
ol, ul { list-style: none; }
.mono, .label { font-size: var(--fs-label); font-weight: 500; letter-spacing: var(--track); text-transform: uppercase; }
.label { color: var(--cue); font-weight: 500; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 40; background: var(--cue); color: var(--on-cue); padding: .6rem var(--s-2); }
.skip:focus { top: 1rem; }
:focus-visible { outline: 2px solid var(--cue); outline-offset: 3px; }
::selection { background: var(--cue); color: var(--on-cue); }
.h2 { font: 800 var(--fs-h2)/var(--lh-head) var(--ff); font-stretch: var(--head-stretch); text-transform: uppercase; letter-spacing: -.01em; }
/* Buttons. Primary: a solid accent block, one per section at most. Secondary (.btn-2): a fine outline, for everything else.
   Hover and keyboard focus ease the colour to the accent, nothing moves or sweeps. Pressed (filters) fills with the accent */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: var(--btn-h); padding: 0 var(--btn-px); border: var(--btn-bw) solid var(--cue); border-radius: 0; background: var(--cue); color: var(--on-cue); cursor: pointer; text-decoration: none; white-space: nowrap; font: 600 var(--fs-small)/1 var(--ff); letter-spacing: var(--track); text-transform: uppercase; transition: color var(--btn-fade), background-color var(--btn-fade), border-color var(--btn-fade); }
.btn:is(:focus-visible, :active) { background: var(--cue-2); border-color: var(--cue-2); }
.btn-2 { background: none; border-color: var(--line-2); color: var(--text); }
.btn-2:is(:focus-visible, :active) { background: none; border-color: var(--cue); color: var(--cue); }
.btn-2[aria-pressed="true"] { background: var(--cue); border-color: var(--cue); color: var(--on-cue); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
@media (hover: hover) { .btn:hover { background: var(--cue-2); border-color: var(--cue-2); } .btn-2:not([aria-pressed="true"]):hover { background: none; border-color: var(--cue); color: var(--cue); } }
section { padding: var(--section) var(--pad); }

/* Header */
.top { position: fixed; inset: 0 0 auto; z-index: 20; height: var(--header); display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter); border-bottom: 1px solid transparent; transition: background .4s, border-color .4s; }
.past .top, .no-hero .top { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); border-color: var(--line); }
.brand { position: relative; display: block; color: var(--text); }
.brand::after { content: ''; position: absolute; inset: -10px -4px; } /* 44px touch target without moving the dock target */
.brand [data-logo] { display: block; width: 92px; }
/* Dock: on the home page the hero logo is the header logo until it lands in the brand slot */
.dock:not(.docked):not(.menu-open) .brand { visibility: hidden; }
.dock .hero-name .spin { transform-origin: 0 0; will-change: transform; }
.docked .hero-name .spin { visibility: hidden; }
/* Spin: the header logo, and the hero logo that docks into it, turn forever as a solid badge. Stacked copies give it depth:
   front, accent edge layers, back. Depth and perspective scale with --w (the logo width, set by runtime.js), so the hero logo
   shrunk onto the header looks exactly like it. Reduced motion stops it with every other animation. */
.spin { --w: 92px; position: relative; display: block; width: 100%; aspect-ratio: 4216 / 1128; -webkit-perspective: calc(var(--w) * 3.2); perspective: calc(var(--w) * 3.2); }
.spin .rot { position: absolute; inset: 0; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; }
:root:not(.dock) .brand .rot, .docked .brand .rot { animation: turn 5s linear infinite; } /* hero logo stays flat; header logo starts turning from flat the moment it docks */
.spin .ly { position: absolute; inset: 0; transform: translateZ(calc(var(--w) * var(--z))); color: color-mix(in srgb, var(--cue), var(--shadow) calc(var(--t) * 72%)); }
.spin .face { color: inherit; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.spin .back { transform: translateZ(calc(var(--w) * var(--z))) rotateY(180deg); }
.spin svg { position: relative; display: block; width: 100%; height: 100%; }
.spin .slab, .brand .face::before { inset: 4.3% 1.15%; border-radius: calc(var(--w) * .016); }
.spin .slab { background: color-mix(in srgb, var(--cue), var(--bg) calc(35% + var(--t) * 50%)); }
.brand .face::before { content: ''; position: absolute; background: var(--bg-2); }
@keyframes turn { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
.nav { display: none; position: relative; gap: .5rem; font: 500 var(--fs-label)/1 var(--ff); letter-spacing: var(--track); text-transform: uppercase; }
/* Current page keeps an accent outline box. A lighter box (the ghost, added by runtime.js) glides from it to whichever link
   the pointer or focus is on, and glides back when it leaves. Boxes sit 5px inside the 44px touch target. */
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .9rem; text-decoration: none; color: color-mix(in srgb, var(--text) 72%, transparent); transition: color .3s; position: relative; z-index: 1; }
.nav a:hover, .nav a:focus-visible, .nav a[aria-current] { color: var(--text); }
.nav a:focus-visible { outline: none; }
.nav a[aria-current]::before { content: ''; position: absolute; inset: 5px 0; border: 1px solid var(--cue); z-index: -1; }
.nav-ghost { position: absolute; box-sizing: border-box; top: 5px; bottom: 5px; left: 0; width: 0; border: 1px solid color-mix(in srgb, var(--cue) 45%, transparent); opacity: 0; pointer-events: none; transition: transform .45s var(--ease), width .45s var(--ease), opacity .3s; }
.nav-ghost.on { opacity: 1; }
.nav-ghost.jump { transition: opacity .3s; }
.menu-btn { width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; display: grid; place-content: center; gap: 7px; cursor: pointer; }
.menu-btn span { display: block; width: 24px; height: 2px; background: var(--text); transition: transform .35s var(--ease); }
.menu-open .menu-btn span:first-child { transform: translateY(4.5px) rotate(45deg); }
.menu-open .menu-btn span:last-child { transform: translateY(-4.5px) rotate(-45deg); }
/* Mobile menu: the page itself turns to frosted glass (blurred and dimmed) while the links sit over it, low on the left
   under the thumb, all shown at once. Blurring the page, not a layer over it, means Safari's floating bottom
   bar, which shows the page under it and clips fixed layers, sees the same glass. The page is locked still meanwhile */
.menu { position: fixed; inset: 0; z-index: 19; padding: var(--header) var(--gutter) calc(var(--s-5) + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; justify-content: safe flex-end; overflow-y: auto; overscroll-behavior: contain; touch-action: none; visibility: hidden; opacity: 0; transition: opacity .3s, visibility .3s; }
.menu a { display: flex; align-items: center; align-self: flex-start; min-height: 44px; font: 700 clamp(2.25rem, 11vw, 4rem)/1.05 var(--ff); font-stretch: var(--head-stretch); text-transform: uppercase; text-decoration: none; color: color-mix(in srgb, var(--text) 62%, transparent); transition: color .2s; }
.menu a:hover, .menu a:focus-visible { color: var(--text); }
.menu a[aria-current] { color: var(--text); }
.menu a[aria-current]::after { content: ''; width: .22em; height: .22em; margin-left: .3em; border-radius: 50%; background: var(--cue); } /* a small accent dot marks where you are */
.menu-open .menu { visibility: visible; opacity: 1; }
main, .foot { transition: filter .3s; }
.menu-open main, .menu-open .foot { filter: blur(24px) brightness(.38); }
@media (max-height: 500px) { .menu { justify-content: safe flex-start; padding-block: var(--header) var(--s-2); touch-action: pan-y; } .menu a { font-size: 8vh; } }
.menu-open .top { background: transparent; border-color: transparent; backdrop-filter: none; }
.menu-open, .menu-open body { overflow: hidden; } /* no page scroll while the menu is open */
.menu-open .top { touch-action: none; }
@media (min-width: 1024px) { .nav { display: flex; } .menu-btn, .menu { display: none; } }

/* Readout: small caps facts with a cue square before each (hero, page heads) */
.readout { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font: 500 var(--fs-label)/1.3 var(--ff); letter-spacing: var(--track); text-transform: uppercase; color: color-mix(in srgb, var(--on-photo) 82%, transparent); padding-top: var(--s-2); border-top: 1px solid color-mix(in srgb, var(--on-photo) 18%, transparent); }
.readout > span { white-space: nowrap; }
.readout > span::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: var(--s-1); vertical-align: 2px; background: var(--cue); }
.readout b { font-weight: 500; color: var(--on-photo); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Footer. Phone: logo, links, then a rule with the icons on the right.
   Wide: logo on the left, centred on the block of links, rule and icons on the right; the rule starts where the links start */
.foot { display: grid; grid-template-columns: 1fr; grid-template-areas: "logo" "nav" "base"; align-items: center; gap: var(--s-3); padding: var(--s-4) var(--gutter) var(--s-3); background: var(--bg); border-top: 1px solid var(--line); }
.foot-logo { position: relative; grid-area: logo; justify-self: start; width: 140px; color: var(--text); line-height: 0; transition: color .3s; }
.foot-logo:hover { color: var(--cue); }
.foot-logo::after { content: ''; position: absolute; inset: -6px 0; } /* 44px touch target at the small logo size */
.foot-logo svg { width: 100%; height: auto; }
.foot-nav { grid-area: nav; display: flex; flex-wrap: wrap; gap: 0 var(--s-3); font: 500 var(--fs-label)/1 var(--ff); letter-spacing: var(--track); text-transform: uppercase; }
.foot-nav a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; color: color-mix(in srgb, var(--text) 72%, transparent); }
.foot-nav a:hover, .foot-nav a[aria-current] { color: var(--text); }
/* The icons sit on the base row under the rule; the negative margin lines the glyph up with the edge, not the 44px hit area */
.foot-social { grid-area: base; justify-self: end; align-self: end; display: flex; gap: var(--s-1); margin-right: -12px; position: relative; z-index: 1; } /* above .foot-base, which shares the grid cell */
.foot-social a { display: grid; place-items: center; width: 44px; height: 44px; color: color-mix(in srgb, var(--text) 72%, transparent); transition: color .2s; }
.foot-social a:hover { color: var(--cue); }
.foot-social svg { width: 20px; height: 20px; }
.foot-base { grid-area: base; min-height: calc(44px + var(--s-2)); border-top: 1px solid var(--line); }
/* Phones: the desktop layout scaled down. Logo left, centred; links over a rule with the icons on the right */
@media (max-width: 759px) {
  .foot { grid-template-columns: 1fr auto; grid-template-areas: "logo nav" "logo base"; gap: var(--s-1) var(--s-2); padding: var(--s-3) var(--gutter) calc(var(--s-3) + env(safe-area-inset-bottom, 0px)); }
  .foot-base { min-height: 44px; }
  .foot-logo { width: 120px; }
  .foot-nav { gap: 0 var(--s-3); justify-content: flex-end; }
}
@media (min-width: 760px) {
  .foot { grid-template-columns: 1fr auto; grid-template-areas: "logo nav" "logo base"; gap: var(--s-2) var(--s-4); padding: var(--s-4) var(--gutter); }
  .foot-logo { width: 168px; }
  .foot-nav { gap: 0 var(--s-4); }
}

@keyframes tick { to { transform: translateX(-50%); } }

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

/* Inner pages: the page head */
.page-head { padding-top: calc(var(--header) + var(--s-5)); padding-bottom: var(--s-4); display: grid; gap: var(--s-3); }
.page-title { font: 800 var(--fs-display)/var(--lh-head) var(--ff); font-stretch: var(--head-stretch); text-transform: uppercase; }
.page-intro { color: var(--muted); max-width: 52ch; font-size: var(--fs-body); }
.page-head .readout { color: var(--muted); border-color: var(--line); }
.page-head .readout b { color: var(--text); }


/* Hover motion: text links draw a rule, so no target answers with colour alone */
.foot-nav a { background-image: linear-gradient(var(--cue), var(--cue)); background-repeat: no-repeat; background-position: 0 calc(50% + .95em); background-size: 0 2px; transition: color .3s, background-size .3s var(--ease); }
.foot-nav a:hover, .foot-nav a[aria-current] { background-size: 100% 2px; }
.brand [data-logo] { transition: transform .3s var(--ease); }
.brand:hover [data-logo] { transform: scale(1.08); }
[data-optional]:not([href]) { display: none; } /* held back until content.json gives it an address */

