/* Dylan Hughes. Brushed aluminium and graphite, with cabinet-black bands and one plasma accent taken from the
   pinball dot-matrix display. The home page is a pinball machine (html.machine) with ordinary HTML underneath:
   without WebGL it is a plain page of aluminium cards. */

@font-face { font-family: 'Archivo'; src: url('../fonts/archivo.woff2') format('woff2'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../fonts/instrument-sans.woff2') format('woff2'); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'Martian Mono'; src: url('../fonts/martian-mono.woff2') format('woff2'); font-weight: 100 800; font-stretch: 75% 112.5%; font-display: swap; }

:root {
  --alu: #e3e5e2;
  --alu-2: #d7dbd7;
  --alu-hi: #eef0ed;
  --rule: #bcc2be;
  --ink: #16181a;
  --slate: #576067;
  --cab: #0c0d0e;
  --cab-2: #17191b;
  --cab-rule: #2b2f32;
  --cab-ink: #ecedea;
  --cab-mute: #9ba1a5;
  --plasma: #ff6a13;
  --room: #07080a;

  --display: 'Archivo', 'Arial Narrow', sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'Martian Mono', ui-monospace, monospace;

  --wrap: 1360px;
  --gutter: clamp(20px, 4vw, 56px);
  --header: 68px;
  --panel: min(460px, 36vw);
  --ease: cubic-bezier(.2, .7, 0, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }
body { margin: 0; background: var(--alu); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--plasma); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--plasma); color: var(--cab); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; z-index: 100; left: 16px; top: -80px; padding: 12px 18px; background: var(--ink); color: var(--alu); border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.mono { font-family: var(--mono); font-size: 11px; font-stretch: 87.5%; font-weight: 450; letter-spacing: .07em; text-transform: uppercase; line-height: 1.5; }
.display { font-family: var(--display); font-stretch: 112%; font-weight: 680; letter-spacing: -.035em; line-height: .96; text-wrap: balance; }
.led { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--plasma); box-shadow: 0 0 0 3px rgba(255, 106, 19, .16), 0 0 10px rgba(255, 106, 19, .55); }
.kicker { display: flex; align-items: center; gap: 12px; color: var(--slate); }

/* Buttons. Keys are the small square-cornered controls, like the ones on a cabinet. */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.btn { display: inline-flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 22px; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: 15px; text-decoration: none; transition: background-color .3s, color .3s, border-color .3s, transform .4s var(--ease); }
.btn-arrow { display: inline-block; transition: transform .45s var(--ease); }
.btn:hover .btn-arrow { transform: translateY(2px); }
.btn[href^="/work"]:hover .btn-arrow, .btn-plasma:hover .btn-arrow { transform: translateX(4px); }
.btn-solid { background: var(--ink); color: var(--alu); }
.btn-solid:hover { background: #2a2e31; }
.btn-line { border-color: var(--rule); }
.btn-line:hover { border-color: var(--ink); }
.btn-plasma { background: var(--plasma); color: var(--cab); }
.btn-plasma:hover { background: #ff8441; }
.band-dark .btn-line { border-color: var(--cab-rule); }
.band-dark .btn-line:hover { border-color: var(--cab-ink); }
.key { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 12px; background: transparent; border: 1px solid var(--rule); border-radius: 5px; color: var(--ink); transition: background-color .25s, border-color .25s; }
.key:hover { background: var(--alu-2); border-color: var(--slate); }
.key[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--alu); }
.key-dark { border-color: var(--cab-rule); color: var(--cab-ink); }
.key-dark:hover { background: var(--cab-2); border-color: var(--cab-mute); }
.link-out { font-weight: 600; font-size: 15px; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--ease); padding-block: 4px; }
.link-out:hover { background-size: 100% 1px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--alu); border-bottom: 1px solid transparent; transition: transform .55s var(--ease), background-color .35s, color .35s, border-color .35s; view-transition-name: site-header; }
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header.is-hidden { transform: translateY(-100%); }
.site-header.on-dark, .site-header.menu-open { background: var(--cab); color: var(--cab-ink); border-bottom-color: var(--cab-rule); }
.header-row { display: flex; align-items: center; gap: 32px; height: var(--header); }
.wordmark { display: inline-flex; align-items: center; gap: 12px; font-family: var(--display); font-stretch: 118%; font-weight: 740; font-size: 17px; letter-spacing: -.02em; text-decoration: none; }
.wordmark-mark { width: 22px; height: 22px; border-radius: 5px; background: var(--cab) radial-gradient(circle, var(--plasma) 1.2px, transparent 1.6px) 0 0 / 4.4px 4.4px; box-shadow: inset 0 0 0 3px var(--cab); }
.on-dark .wordmark-mark, .menu-open .wordmark-mark { box-shadow: inset 0 0 0 3px var(--cab), 0 0 0 1px var(--cab-rule); }
.nav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.nav a { position: relative; font-size: 14px; font-weight: 550; text-decoration: none; padding-block: 10px; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 4px; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); transform-origin: left; }
.clock { display: flex; align-items: center; gap: 10px; color: var(--slate); white-space: nowrap; min-width: 150px; justify-content: flex-end; }
.on-dark .clock, .menu-open .clock { color: var(--cab-mute); }
.menu-button { display: none; }

/* The dot-matrix display (the flat page, the 404 page) */
.dmd-bezel { position: relative; background: var(--cab); border-radius: 20px; padding: clamp(8px, 1.3vw, 18px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 1px 0 rgba(255, 255, 255, .6), 0 40px 70px -40px rgba(12, 13, 14, .6); }
.dmd-bezel::after { content: ''; position: absolute; inset: clamp(8px, 1.3vw, 18px); border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04), inset 0 12px 30px rgba(0, 0, 0, .55); pointer-events: none; }
.dmd canvas { display: block; width: 100%; aspect-ratio: 4 / 1; border-radius: 8px; background: #0a0908; cursor: pointer; }
.dmd-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.dmd-status { display: inline-flex; align-items: center; gap: 10px; color: var(--slate); }
.dmd-controls { display: flex; gap: 8px; }
.dots { display: block; width: 30px; height: 30px; }
.dots svg { display: block; width: 100%; height: 100%; }

/* Shared section type */
.band-dark { background: var(--cab); color: var(--cab-ink); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: clamp(40px, 5vw, 72px); }
.section-title { font-size: clamp(40px, 6vw, 92px); }
.section-note { max-width: 32ch; color: var(--slate); font-size: 16px; }
.band-dark .section-note { color: var(--cab-mute); }
.spec { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 28px; align-content: start; border-top: 1px solid var(--rule); padding-top: 20px; }
.spec dt { color: var(--slate); margin-bottom: 6px; }
.spec dd { font-size: 15px; line-height: 1.5; }
.band-dark .spec { border-top-color: var(--cab-rule); }
.band-dark .spec dt { color: var(--cab-mute); }

/* --- Home page content: placards --------------------------------------------------------------------------- */
.placard { position: relative; background: linear-gradient(170deg, var(--alu-hi), var(--alu) 46%, #dadeda); color: var(--ink); border-radius: 16px; padding: clamp(24px, 2.4vw, 32px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 1px 0 rgba(0, 0, 0, .2), 0 30px 80px -30px rgba(0, 0, 0, .55); }
/* Four screw heads, as on a machined plate. */
.placard::before { content: ''; position: absolute; inset: 11px; pointer-events: none; background:
  radial-gradient(circle at 3px 3px, #9aa0a3 1.6px, #c3c8c6 2.3px, transparent 2.8px) top left / 6px 6px no-repeat,
  radial-gradient(circle at 3px 3px, #9aa0a3 1.6px, #c3c8c6 2.3px, transparent 2.8px) top right / 6px 6px no-repeat,
  radial-gradient(circle at 3px 3px, #9aa0a3 1.6px, #c3c8c6 2.3px, transparent 2.8px) bottom left / 6px 6px no-repeat,
  radial-gradient(circle at 3px 3px, #9aa0a3 1.6px, #c3c8c6 2.3px, transparent 2.8px) bottom right / 6px 6px no-repeat; }
.placard .kicker { margin-bottom: 16px; }
.placard-title { font-size: clamp(30px, 2.6vw, 40px); line-height: 1; }
.placard-lede { color: var(--slate); font-size: 16px; line-height: 1.55; margin-block: 14px 22px; }
.placard-tag { color: var(--slate); margin-bottom: 10px; }
.placard-media { display: block; overflow: hidden; border-radius: 10px; margin-bottom: 20px; background: var(--cab); aspect-ratio: 16 / 9; }
.placard-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: transform .8s var(--ease); }
.placard-media:hover img { transform: scale(1.03); }
.placard .spec { margin-bottom: 22px; }
.placard .actions { gap: 10px 18px; }

.hero-title { font-size: clamp(38px, 5vw, 76px); }
.hero-lede { color: var(--slate); font-size: 17px; line-height: 1.6; margin-block: 22px 28px; max-width: 46ch; }

.about-head { display: grid; grid-template-columns: 92px 1fr; gap: 20px; align-items: center; margin-bottom: 20px; }
.about-portrait { overflow: hidden; border-radius: 10px; aspect-ratio: 4 / 5; background: var(--alu-2); }
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }
.about-head .kicker { margin-bottom: 10px; }
.story p { font-size: 15.5px; line-height: 1.6; }
.story p + p { margin-top: .8em; }
.story p:first-child { font-size: 18px; line-height: 1.45; font-weight: 500; }

.skill-list { display: grid; gap: 4px; margin-top: 20px; }
.skill-list li { display: grid; grid-template-columns: 26px 1fr; gap: 14px; padding: 12px 12px 12px 10px; border-radius: 10px; border-left: 2px solid transparent; transition: background-color .4s, border-color .4s; }
.skill-list li.lit { background: rgba(255, 255, 255, .55); border-left-color: var(--plasma); }
.skill-list .dots { width: 24px; height: 24px; margin-top: 3px; }
.skill-list h3 { font-family: var(--display); font-stretch: 110%; font-weight: 660; font-size: 18px; letter-spacing: -.02em; line-height: 1.2; }
.skill-list p { color: var(--slate); font-size: 14.5px; line-height: 1.5; margin-top: 3px; }
.skill-list .chips { color: var(--ink); font-size: 10.5px; letter-spacing: .03em; margin-top: 8px; }

.timeline { display: grid; margin-block: 18px 22px; }
.timeline li { position: relative; padding: 12px 0 12px 22px; border-top: 1px solid var(--rule); }
.timeline li::before { content: ''; position: absolute; left: 0; top: 19px; width: 9px; height: 9px; border-radius: 2px; background: var(--rule); transition: background-color .3s, box-shadow .3s; }
.timeline li.lit::before { background: var(--plasma); box-shadow: 0 0 10px rgba(255, 106, 19, .6); }
.timeline .mono { color: var(--slate); }
.timeline h3 { font-family: var(--display); font-stretch: 108%; font-weight: 640; font-size: 16.5px; letter-spacing: -.015em; line-height: 1.25; margin-top: 2px; }
.timeline .org { color: var(--slate); font-size: 13.5px; margin-top: 1px; }
.timeline p:last-child { font-size: 14px; line-height: 1.5; margin-top: 4px; }

.contact-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-block: 18px; border-block: 1px solid var(--rule); }
.contact-email { font-family: var(--display); font-stretch: 108%; font-weight: 640; font-size: clamp(20px, 1.9vw, 27px); letter-spacing: -.025em; text-decoration: none; background: linear-gradient(var(--plasma), var(--plasma)) 0 100% / 0 2px no-repeat; transition: background-size .5s var(--ease); padding-bottom: 3px; overflow-wrap: anywhere; }
.contact-email:hover { background-size: 100% 2px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-top: 14px; }
.contact-links a { font-weight: 600; text-decoration: none; padding-block: 8px; }
.contact-links a:hover { color: var(--plasma); }
.play-row { display: flex; align-items: center; gap: 18px; margin-top: 20px; }
.play-row .hint { color: var(--slate); }

/* Flat home page: aluminium cards in a column. */
html:not(.machine) .home main { width: 100%; max-width: 820px; margin-inline: auto; padding: clamp(32px, 6vw, 72px) var(--gutter) 96px; display: grid; gap: clamp(28px, 4vw, 44px); }
html:not(.machine) .home .station-hero .hero-copy { background: none; box-shadow: none; padding: 0; }
html:not(.machine) .home .station-hero .hero-copy::before { display: none; }
html:not(.machine) .home .station-hero .dmd { margin-top: 36px; }
html:not(.machine) .home .dmd-strip { margin-top: 14px; }
html:not(.machine) .home .work { display: grid; gap: 20px; }
html:not(.machine) .home .flat-heading { font-size: clamp(32px, 4vw, 52px); margin-top: 24px; }
html:not(.machine) .home .site-footer { background: var(--cab); }
.scroll-cue { display: none; }
.machine .flat-only, html:not(.machine) .machine-only, html:not(.can-machine) .footer-view .flat-only { display: none !important; }

/* --- The machine ---------------------------------------------------------------------------------------------- */
.stage, .boot, .hud, .shade { display: none; }
.machine body { background: var(--room); color: var(--cab-ink); }
.machine .stage { display: block; position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; }
.machine .boot { display: flex; position: fixed; inset: 0; z-index: 90; align-items: center; justify-content: center; gap: 12px; background: var(--room); color: var(--cab-mute); opacity: 0; visibility: hidden; transition: opacity .9s ease, visibility 0s .9s; }
.machine.booting .boot { opacity: 1; visibility: visible; transition: none; }
.boot-led { width: 8px; height: 8px; border-radius: 50%; background: var(--plasma); box-shadow: 0 0 12px var(--plasma); animation: boot-pulse 1.1s ease-in-out infinite; }
@keyframes boot-pulse { 50% { opacity: .25; } }

/* A soft shade on the side that carries the copy, so type always reads over the playfield. JS sets --l, --r and
   (on tall screens) --b from the stations in view. */
.machine .shade { display: block; position: fixed; inset: 0; z-index: 1; pointer-events: none; background:
  linear-gradient(90deg, rgba(7, 8, 10, calc(var(--l, 0) * .9)), rgba(7, 8, 10, calc(var(--l, 0) * .72)) 30%, rgba(7, 8, 10, calc(var(--l, 0) * .3)) 44%, rgba(7, 8, 10, 0) 56%),
  linear-gradient(270deg, rgba(7, 8, 10, calc(var(--r, 0) * .9)), rgba(7, 8, 10, calc(var(--r, 0) * .72)) 30%, rgba(7, 8, 10, calc(var(--r, 0) * .3)) 44%, rgba(7, 8, 10, 0) 56%),
  linear-gradient(0deg, rgba(7, 8, 10, calc(var(--b, 0) * .9)), rgba(7, 8, 10, calc(var(--b, 0) * .75)) 40%, rgba(7, 8, 10, 0) 62%); }

/* Callouts: hairlines from the parts to the copy, like dimension lines on a cut plan. */
.machine .hud { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; overflow: visible; }
.hud-line { fill: none; stroke: rgba(227, 229, 226, .5); stroke-width: 1.1; stroke-dasharray: 1; stroke-dashoffset: 1; stroke-linejoin: round; }
.hud-ring { fill: rgba(255, 106, 19, .08); stroke: var(--plasma); stroke-width: 1.4; animation: hud-pulse 2.4s ease-in-out infinite; }
.hud-dot { fill: var(--plasma); }
.hud-tick { fill: rgba(227, 229, 226, .8); }
.hud-link.lit .hud-line { stroke: rgba(255, 140, 70, .85); }
.hud-link:not(.lit) .hud-ring { stroke: rgba(227, 229, 226, .45); fill: none; animation: none; }
.hud-link:not(.lit) .hud-dot { fill: rgba(227, 229, 226, .7); }
/* The exploded view's callouts: numbered part names on short leaders, like a CAD drawing's balloons. */
.cad { display: none; }
.machine .cad { display: block; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; }
.cad-tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; translate: 0 -50%; white-space: nowrap; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #dfe2e0; text-shadow: 0 1px 8px rgba(7, 8, 10, .9); }
.cad-tag::before { content: ''; width: 26px; height: 1px; background: rgba(255, 138, 74, .85); }
.cad-tag i { font-style: normal; color: var(--plasma); }
.cad.left .cad-tag { flex-direction: row-reverse; translate: -100% -50%; }
@keyframes hud-pulse { 50% { stroke-opacity: .35; } }

.machine .site-header { position: fixed; inset: 0 0 auto; background: linear-gradient(rgba(7, 8, 10, .8), rgba(7, 8, 10, 0)); color: var(--cab-ink); border-bottom-color: transparent; }
.machine .site-header.menu-open { background: var(--cab); }
.machine .clock { color: var(--cab-mute); }
.machine .wordmark-mark { box-shadow: inset 0 0 0 3px var(--cab), 0 0 0 1px var(--cab-rule); }
.machine main { position: relative; z-index: 2; }
.machine .flat-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Each station is a long stretch of scroll. Its copy holds still across from the part, set straight onto the
   scene over a soft pool of shadow rather than on a card. */
.machine .station { display: flex; align-items: flex-start; min-height: 230vh; padding-inline: max(var(--gutter), calc((100vw - 1480px) / 2)); }
.machine .station[data-side="right"] { justify-content: flex-end; }
.machine .station-hero { min-height: 135vh; }
.machine .station .placard {
  position: sticky; top: max(calc(var(--header) + 24px), calc(50vh + var(--header) / 2 - var(--ph, 320px) / 2));
  width: min(500px, 36vw); opacity: 0; will-change: opacity, transform; isolation: isolate;
  background: none; box-shadow: none; border-radius: 0; padding: 0; color: var(--cab-ink); text-shadow: 0 1px 16px rgba(0, 0, 0, .55);
}
/* Each section's copy reads like a drawing's title block: a hairline across the top with the section's number at
   its end, then the copy set straight onto the scene over the side shade. */
.machine .station .placard::before { content: none; }
/* Behind the copy the scene goes soft, like a lens focused past it: a feathered blur with no edge, not a card. It
   follows whichever section's copy is showing. */
.lens { display: none; }
.machine .lens { display: block; position: fixed; left: 0; top: 0; z-index: 1; pointer-events: none; opacity: 0; background: rgba(7, 8, 10, .3);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-mask: radial-gradient(closest-side, #000 58%, transparent); mask: radial-gradient(closest-side, #000 58%, transparent); }
.machine.tall .lens { display: none; }
.machine main { counter-reset: station; }
.machine .station:not(.station-hero) { counter-increment: station; }
.machine .station:not(.station-hero) .placard { border-top: 1px solid rgba(227, 229, 226, .2); padding-top: 20px; }
.machine .station:not(.station-hero) .placard::after { content: counter(station, decimal-leading-zero); position: absolute; top: 9px; right: 0; font-family: var(--mono); font-size: 11px; font-stretch: 87.5%; letter-spacing: .08em; color: rgba(227, 229, 226, .42); }
/* Long lists follow the machine: the entry its part is showing stays bright and the rest step back. */
.machine .skill-list li, .machine .timeline li { transition: opacity .5s var(--ease); }
.machine .has-current > li:not(.current) { opacity: .4; }
.machine .placard .kicker { color: #a9afb3; }
.machine .placard-title { font-size: clamp(38px, 3.8vw, 62px); color: #f5f6f3; }
.machine .placard-tag { color: #ff8a4a; }
.machine .placard-lede, .machine .story p, .machine .skill-list p, .machine .timeline p { color: #bcc2c6; }
.machine .placard-lede { font-size: 17.5px; }
.machine .placard-media, .machine .about-portrait { display: none; }
.machine .about-head { display: block; margin-bottom: 18px; }
.machine .story p:first-child { color: var(--cab-ink); font-size: 21px; }
.machine .spec { border-top-color: rgba(227, 229, 226, .18); }
.machine .spec dt, .machine .timeline .mono, .machine .timeline .org, .machine .play-row .hint { color: #8f969b; }
.machine .btn-solid { background: var(--cab-ink); color: var(--cab); text-shadow: none; }
.machine .btn-solid:hover { background: #fff; }
.machine .btn-plasma { text-shadow: none; }
.machine .btn-line { border-color: rgba(227, 229, 226, .35); color: var(--cab-ink); }
.machine .btn-line:hover { border-color: var(--cab-ink); }
.machine .key { border-color: rgba(227, 229, 226, .3); color: var(--cab-ink); }
.machine .key:hover { background: rgba(255, 255, 255, .07); border-color: var(--cab-ink); }
.machine .skill-list li { padding-left: 14px; }
.machine .skill-list li.lit { background: rgba(255, 255, 255, .045); }
.machine .skill-list h3 { color: var(--cab-ink); }
.machine .skill-list .chips { color: #d5d9db; }
.machine .timeline li { border-top-color: rgba(227, 229, 226, .14); }
.machine .timeline li::before { background: rgba(227, 229, 226, .25); }
.machine .timeline h3 { color: var(--cab-ink); }
.machine .contact-row { border-color: rgba(227, 229, 226, .16); }
.machine .contact-email { font-size: clamp(22px, 2.1vw, 32px); }

/* Copy arrives in a short stagger when the camera reaches its station. */
.machine.motion .placard > * { transition: opacity .7s var(--ease), transform .7s var(--ease); }
.machine.motion .placard:not(.is-here):not(.on-glass) > * { opacity: 0; transform: translateY(12px); }
.machine.motion .placard.is-here > :nth-child(2) { transition-delay: .06s; }
.machine.motion .placard.is-here > :nth-child(3) { transition-delay: .12s; }
.machine.motion .placard.is-here > :nth-child(4) { transition-delay: .18s; }
.machine.motion .placard.is-here > :nth-child(5) { transition-delay: .24s; }
.machine.motion .placard.is-here > :nth-child(n+6) { transition-delay: .3s; }

/* The hero copy on the backglass: laid out at the glass's design size (1320 × 1000) and mapped onto the glass
   by a perspective transform each frame. */
.hero-copy.on-glass { opacity: 0; background: none; box-shadow: none; border-radius: 0; color: var(--cab-ink); padding: 96px 0 0 104px; text-shadow: none; z-index: 3; }
.hero-copy.on-glass::before { display: none; }
.hero-copy.on-glass > * { width: 640px; }
.hero-copy.on-glass .kicker { width: 1000px; font-size: 25px; gap: 18px; color: #c3c8cb; margin-bottom: 44px; }
.hero-copy.on-glass .led { width: 12px; height: 12px; }
.hero-copy.on-glass .hero-title { font-size: 86px; line-height: .98; letter-spacing: -.035em; color: #f4f5f2; }
.hero-copy.on-glass .hero-lede { font-size: 33px; line-height: 1.45; color: #b9bfc3; margin-block: 40px 52px; max-width: none; }
.hero-copy.on-glass .actions { gap: 22px; }
.hero-copy.on-glass .btn { min-height: 92px; padding: 0 38px; font-size: 29px; border-radius: 14px; gap: 22px; }
.hero-copy.on-glass .btn-line { border-color: rgba(227, 229, 226, .4); color: var(--cab-ink); border-width: 2px; }
.hero-copy.on-glass .btn-line:hover { border-color: var(--cab-ink); }

/* Display controls and the scroll cue sit at the foot of the screen while the backbox is in view. */
.machine .dmd-strip { position: fixed; z-index: 3; left: var(--gutter); bottom: 22px; justify-content: flex-start; padding: 6px 6px 6px 16px; border-radius: 10px; background: rgba(12, 13, 14, .7); border: 1px solid var(--cab-rule); backdrop-filter: blur(8px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.machine .dmd-status { color: var(--cab-mute); }
.machine .dmd-strip .key { min-height: 32px; }
.machine .dmd-strip .key[aria-pressed="true"] { background: var(--cab-ink); color: var(--cab); }
.machine .scroll-cue { display: flex; position: fixed; z-index: 3; right: var(--gutter); bottom: 32px; align-items: center; gap: 12px; color: var(--cab-mute); transition: opacity .5s var(--ease); }
.scroll-ball { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #b7bcc0 45%, #4b5054); animation: cue-bounce 1.6s var(--ease) infinite; }
@keyframes cue-bounce { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(4px); } }
.machine:not([data-station="hero"]) .dmd-strip, .machine.booting .dmd-strip { opacity: 0; transform: translateY(8px); pointer-events: none; }
.machine:not([data-station="hero"]) .scroll-cue, .machine.scrolled .scroll-cue, .machine.booting .scroll-cue { opacity: 0; }

.machine .site-footer { position: relative; z-index: 2; background: linear-gradient(rgba(7, 8, 10, 0), rgba(7, 8, 10, .9) 40%); border-top: 0; margin-top: 0; }
.machine .cursor { opacity: 1; transition: transform .14s var(--ease); }

/* Tall screens: the part fills the top of the screen; the copy scrolls up over a shadow at the bottom. */
@media (max-width: 899px), (max-aspect-ratio: 21/20) {
  .machine .station { display: block; min-height: 0; padding: 62vh 22px 26vh; }
  .machine .station .placard { position: relative; top: auto; width: 100%; max-width: 560px; margin-inline: auto; }
  .machine .station .placard::before { inset: -56px -40px; background: linear-gradient(rgba(7, 8, 10, 0), rgba(7, 8, 10, .82) 64px, rgba(7, 8, 10, .82) calc(100% - 64px), rgba(7, 8, 10, 0)); -webkit-backdrop-filter: none; backdrop-filter: none; -webkit-mask: none; mask: none; }
  .machine .station-hero { min-height: 0; padding-top: 52vh; padding-bottom: 18vh; }
  .machine .station-hero .hero-copy { opacity: 1 !important; transform: none !important; }
  .machine .placard-title { font-size: clamp(32px, 8.4vw, 44px); }
  .machine .dmd-strip { left: 14px; right: 14px; bottom: auto; top: calc(var(--header) + 8px); justify-content: space-between; }
  .machine .dmd-name { display: none; }
  .machine .scroll-cue { display: none; }
  .machine.motion .station-hero .placard:not(.is-here) > * { opacity: 1; transform: none; }
}

/* Cursor label over interactive parts and the featured project, for fine pointers only. */
.cursor { position: fixed; z-index: 60; left: 0; top: 0; pointer-events: none; padding: 11px 15px; border-radius: 999px; background: var(--plasma); color: var(--cab); font: 600 14px/1 var(--body); white-space: nowrap; transform: translate(-50%, -50%) scale(0); opacity: 0; }

/* Footer */
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px 24px; flex-wrap: wrap; margin-top: clamp(96px, 12vw, 168px); padding-block: 28px; border-top: 1px solid var(--cab-rule); color: var(--cab-mute); }
.site-footer a { text-decoration: none; color: var(--cab-ink); padding-block: 8px; }
.site-footer a:hover { color: var(--plasma); }

/* --- Case study pages ------------------------------------------------------------------------------------------ */
.case-hero { padding-block: clamp(32px, 6vh, 64px) clamp(40px, 6vw, 72px); }
.back { display: inline-flex; align-items: center; gap: 10px; color: var(--slate); text-decoration: none; padding-block: 10px; margin-bottom: clamp(24px, 4vh, 48px); }
.back:hover { color: var(--ink); }
.case-hero .kicker { margin-bottom: 0; }
.case-page-title { font-size: clamp(42px, 7vw, 112px); max-width: 13ch; margin-top: 20px; }
.case-hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px clamp(40px, 7vw, 120px); margin-top: clamp(32px, 4vw, 56px); align-items: start; }
.case-lede { font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; color: var(--slate); max-width: 38ch; margin-bottom: 32px; }
.case-shot { padding-bottom: clamp(80px, 10vw, 140px); }
.case-media { display: block; border-radius: 18px; background: var(--cab-2); padding: clamp(16px, 5vw, 80px) clamp(16px, 5vw, 80px) 0; overflow: hidden; }
.case-media-inner { display: block; overflow: hidden; border-radius: 10px 10px 0 0; box-shadow: 0 -1px 0 rgba(255, 255, 255, .08), 0 30px 80px rgba(0, 0, 0, .5); }
.case-media img { width: 100%; }
.case-media.full { padding-bottom: clamp(16px, 5vw, 80px); }
.case-media.full .case-media-inner { border-radius: 10px; }
.compare-section, .gallery-section { padding-block: clamp(96px, 12vw, 160px); }
.compare { position: relative; }
.compare-frame { position: relative; overflow: hidden; border-radius: 14px; aspect-ratio: 1600 / 1012; background: var(--cab-2); --pos: 50%; }
.compare-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.compare-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--plasma); pointer-events: none; }
.compare-handle::after { content: ''; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: var(--plasma) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0d0e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E") center / 22px no-repeat; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.compare-tag { position: absolute; top: 16px; padding: 7px 10px; border-radius: 5px; background: rgba(12, 13, 14, .82); color: var(--cab-ink); pointer-events: none; }
.compare-tag-before { left: 16px; }
.compare-tag-after { right: 16px; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.compare:has(.compare-range:focus-visible) .compare-handle::after { outline: 2px solid var(--cab-ink); outline-offset: 3px; }
.compare figcaption { color: var(--cab-mute); margin-top: 16px; }
.deliverables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(48px, 6vw, 88px) clamp(40px, 7vw, 120px); }
.deliverable { position: relative; padding-top: 28px; }
.deliverable .rule { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: 0 50%; }
.deliverable .mono { color: var(--slate); }
.deliverable h3 { font-family: var(--display); font-stretch: 110%; font-weight: 660; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.08; letter-spacing: -.03em; margin-block: 14px 16px; }
.deliverable p:not(.mono) { color: var(--slate); font-size: 16.5px; line-height: 1.6; max-width: 46ch; }
.deliverable p + p:not(.mono) { margin-top: 12px; }
.deliverable .link-out { display: inline-block; margin-top: 18px; }
.case-work { padding-block: clamp(96px, 12vw, 168px); }
.case-facts { padding-bottom: clamp(8px, 2vw, 24px); }
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.gallery figure { display: grid; gap: 14px; }
.gallery .shot { overflow: hidden; border-radius: 12px; background: var(--cab-2); box-shadow: 0 0 0 1px var(--cab-rule), 0 24px 60px -24px rgba(0, 0, 0, .7); }
.gallery figcaption { color: var(--cab-mute); font-size: 15px; line-height: 1.5; max-width: 52ch; }
.gallery figcaption strong { display: block; color: var(--cab-ink); font-family: var(--display); font-stretch: 110%; font-weight: 640; font-size: 19px; letter-spacing: -.02em; margin-bottom: 4px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); }
.facts div { padding: 24px 24px 0 0; }
.facts dt { color: var(--slate); }
.facts dd { font-family: var(--display); font-stretch: 112%; font-weight: 680; font-size: clamp(34px, 4vw, 56px); letter-spacing: -.04em; line-height: 1; margin-top: 10px; }
.facts dd small { display: block; font-family: var(--body); font-stretch: 100%; font-weight: 400; font-size: 14.5px; letter-spacing: 0; line-height: 1.45; color: var(--slate); margin-top: 10px; }
.next-case { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-block: 28px; border-top: 1px solid var(--cab-rule); margin-top: clamp(48px, 6vw, 80px); }
.next-case a { font-family: var(--display); font-stretch: 112%; font-weight: 660; font-size: clamp(24px, 3vw, 40px); letter-spacing: -.03em; text-decoration: none; }
.next-case a:hover { color: var(--plasma); }
.case-work .next-case { border-top-color: var(--rule); }
.next-case .mono { color: var(--cab-mute); }
.case-work .next-case .mono { color: var(--slate); }
.case-lede + .case-lede { margin-top: -12px; }
.gallery-note { color: var(--cab-mute); font-size: 15px; line-height: 1.55; max-width: 60ch; margin-top: clamp(40px, 5vw, 64px); }
.gallery-note a { color: var(--cab-ink); }
.contact { padding-top: clamp(104px, 13vw, 184px); }
.contact-title { font-size: clamp(44px, 7.6vw, 120px); max-width: 13ch; }
.contact-lede { color: var(--cab-mute); font-size: clamp(17px, 1.4vw, 20px); max-width: 42ch; margin-top: 32px; }
.contact .contact-row { margin-top: clamp(40px, 5vw, 64px); padding-block: 28px 0; border-bottom: 0; border-top-color: var(--cab-rule); }
.contact .contact-email { font-size: clamp(24px, 3.4vw, 48px); }
.contact .contact-links { margin-left: auto; margin-top: 0; }

/* 404 */
.lost { min-height: calc(100vh - var(--header)); display: grid; align-content: center; padding-block: 64px; }
.lost .dmd { max-width: 960px; }
.lost-title { font-size: clamp(36px, 5vw, 72px); margin-top: clamp(32px, 5vh, 56px); }
.lost p:not(.mono) { color: var(--slate); margin-block: 16px 32px; max-width: 40ch; }

/* Motion: initial states, applied only when the intro will run. */
.motion [data-intro], .motion [data-intro-lines] { visibility: hidden; }

/* Page transitions. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .6s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(18px); } }

/* Responsive */
@media (max-width: 1100px) {
  .clock { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  :root { --header: 60px; }
  .menu-button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; margin-left: auto; border: 1px solid var(--rule); border-radius: 5px; background: transparent; font-weight: 600; font-size: 14px; }
  .on-dark .menu-button, .menu-open .menu-button, .machine .menu-button { border-color: var(--cab-rule); }
  .header-row { gap: 16px; }
  .js .nav { position: fixed; z-index: -1; inset: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: var(--header) var(--gutter) 40px; background: var(--cab); color: var(--cab-ink); visibility: hidden; opacity: 0; transition: opacity .4s var(--ease), visibility 0s .4s; }
  .js .nav a { font-family: var(--display); font-stretch: 112%; font-weight: 660; font-size: clamp(40px, 11vw, 64px); letter-spacing: -.035em; line-height: 1.1; padding-block: 6px; }
  .js .nav a::after { bottom: 6px; height: 2px; }
  .js .nav.is-open { visibility: visible; opacity: 1; transition: opacity .4s var(--ease); }
  .js .nav .nav-resume { font-family: var(--body); font-size: 16px; font-weight: 600; margin-top: 24px; }
  html:not(.js) .header-row { height: auto; flex-wrap: wrap; padding-block: 14px; }
  html:not(.js) .nav { flex-wrap: wrap; gap: 4px 20px; margin-left: 0; width: 100%; }
  .menu-button { display: none; }
  .js .menu-button { display: inline-flex; }
  .dmd-bezel { border-radius: 12px; }
  .dmd canvas { border-radius: 4px; }
  .dmd-bezel::after { border-radius: 4px; }
  .case-hero-grid, .gallery { grid-template-columns: 1fr; }
  .case-media { border-radius: 12px; }
  .deliverables { grid-template-columns: 1fr; }
  .contact .contact-links { margin-left: 0; width: 100%; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .spec { grid-template-columns: 1fr; gap: 16px; }
  .dmd-status { flex-wrap: wrap; }
  .actions .btn { flex: 1 1 auto; justify-content: space-between; }
  .contact-row .key { min-height: 44px; }
  .footer-made { order: 3; width: 100%; }
  .compare-tag { top: 10px; }
  .compare-tag-before { left: 10px; }
  .compare-tag-after { right: 10px; }
  .facts { grid-template-columns: 1fr; }
  .about-head { grid-template-columns: 72px 1fr; gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .site-header, .dmd, .cursor, .actions, .contact-row .key, .skip, .case-media, .stage, .boot, .dmd-strip, .scroll-cue { display: none !important; }
  body, .band-dark, .machine body { background: #fff; color: #000; }
  .placard { box-shadow: none; opacity: 1 !important; transform: none !important; }
  .machine .station { min-height: 0; display: block; }
  .machine .station .placard { position: static; width: auto; }
  .display { font-size: 24pt !important; }
}
