/* Four themes, one per hero function. The class is set on <html> before first paint (see the inline script in build.mjs). */
:root { --ground:#15110E; --ink:#EFE7DC; --soft:#CFC4B6; --rule:#2F2822; --band:#1B1613; --accent:#FFA630; --on-accent:#1B1206; --body:'Archivo',system-ui,sans-serif; --head:'Archivo',system-ui,sans-serif; --hw:500; --track:-0.03em; --logo:none; }
html.marbles { --ground:#2540DE; --ink:#FFFFFF; --soft:#E4E9FF; --rule:#4E66EA; --band:#1C33C2; --accent:#FFFFFF; --on-accent:#1C33C2; --body:'Onest',system-ui,sans-serif; --head:'Onest',system-ui,sans-serif; }
html.ridge { --ground:#E9EDF2; --ink:#0F1B33; --soft:#2E3B55; --rule:#C5CEDB; --band:#DDE3EB; --accent:#2447F0; --on-accent:#FFFFFF; --body:'Instrument Sans',system-ui,sans-serif; --head:'Newsreader',Georgia,serif; --hw:400; --logo:invert(1); }
html.flute { --ground:#E8452C; --ink:#1A0B07; --soft:#3A150D; --rule:#B9351F; --band:#D93D25; --accent:#1A0B07; --on-accent:#F6EFE6; --body:'Instrument Sans',system-ui,sans-serif; --head:'Instrument Sans',system-ui,sans-serif; --logo:invert(1); }

* { box-sizing:border-box; }
html { scroll-behavior:smooth; background:var(--ground); }
body { margin:0; background:var(--ground); color:var(--ink); font-family:var(--body); -webkit-font-smoothing:antialiased; }
a { color:inherit; text-decoration:none; }
img { max-width:100%; }
.wrap { max-width:1280px; margin:0 auto; padding:0 32px; }
h1,h2,h3 { font-family:var(--head); font-weight:var(--hw); letter-spacing:var(--track); margin:0; }
:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }

header { position:relative; z-index:3; }
body.home header { position:absolute; top:0; left:0; right:0; }
header .wrap { height:100px; display:flex; align-items:center; justify-content:space-between; }
header img { height:50px; width:auto; display:block; filter:var(--logo); }
nav { display:flex; gap:4px; font-size:15px; font-weight:500; }
nav a { padding:13px 14px; }
nav a[aria-current] { text-decoration:underline; text-underline-offset:6px; }

/* Home hero */
.hero { position:relative; height:100vh; height:100svh; min-height:620px; overflow:hidden; contain:layout paint; }
.hero canvas { position:absolute; inset:0; width:100%; height:100%; display:block; }
.hero .copy { position:absolute; left:0; right:0; bottom:0; padding-bottom:64px; pointer-events:none; }
.hero .copy a, .hero .copy button { pointer-events:auto; }
.hero h1 { font-size:clamp(34px,4.2vw,58px); line-height:1.06; max-width:640px; }
.hero p { margin:20px 0 0; max-width:500px; font-size:18px; line-height:1.6; color:var(--soft); }
.cta { display:flex; flex-wrap:wrap; align-items:center; gap:8px 28px; margin-top:28px; }
.btn { display:inline-flex; align-items:center; height:50px; padding:0 24px; border-radius:6px; background:var(--accent); color:var(--on-accent); font-weight:600; }
.link { padding:14px 0; font-weight:500; border-bottom:1px solid currentColor; }
html.ridge .hero .copy { bottom:auto; top:132px; }
html.marbles .hero .copy::before { content:''; position:absolute; left:-10%; right:35%; top:-140px; bottom:-40px; background:radial-gradient(ellipse at 40% 60%, #2540DEF2 0, #2540DEE0 45%, #2540DE00 72%); z-index:-1; }
html.marbles .hero .copy { z-index:1; }
.fnsel { display:none; }
html.flute .fnsel { display:flex; align-items:center; gap:2px; position:absolute; z-index:2; right:max(32px, calc((100vw - 1280px) / 2 + 32px)); bottom:66px; padding:4px; border-radius:24px; background:#1A0B07E6; color:#F6EFE6; font:500 14px/1 var(--body); }
.fnsel span { padding:0 10px 0 14px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.fnsel button { height:40px; padding:0 16px; border:0; border-radius:20px; background:none; color:inherit; font:inherit; cursor:pointer; }
.fnsel button.on { background:#F6EFE6; color:#1A0B07; }

/* Section furniture */
.sec-head { display:flex; align-items:baseline; justify-content:space-between; gap:16px; padding-top:96px; padding-bottom:28px; }
.sec-head h2, .pair h2 { font-size:clamp(26px,2.6vw,36px); }
.sec-head p { margin:6px 0 0; color:var(--soft); font-size:17px; }
.pair { display:flex; flex-wrap:wrap; gap:16px 64px; padding-top:96px; padding-bottom:96px; }
.pair > :first-child { flex:0 0 300px; }
.pair > :last-child { flex:999 1 420px; min-width:0; }
.svc { margin:0; padding:0; list-style:none; font-size:clamp(22px,2.3vw,30px); letter-spacing:-0.02em; }
.svc li { padding:18px 0; border-bottom:1px solid var(--rule); }
.svc li:first-child { padding-top:0; } .svc li:last-child { border:0; }
.svc li p { margin:12px 0 0; max-width:760px; font-size:17px; line-height:1.65; letter-spacing:0; color:var(--soft); }
.band { background:var(--band); }
.band p, .lead { margin:0; max-width:760px; font-size:clamp(20px,2.1vw,28px); line-height:1.42; letter-spacing:-0.015em; }
.contact { padding-top:104px; padding-bottom:104px; }
.contact h2, .contact h1 { font-size:clamp(32px,4vw,56px); line-height:1.05; }
.contact a { display:inline-block; margin-top:22px; padding:8px 0; font-size:clamp(18px,1.9vw,24px); color:var(--accent); border-bottom:1px solid var(--accent); }
.contact .also { display:block; margin-top:28px; }
.contact .also a { font-size:17px; margin-top:0; color:inherit; border-color:currentColor; }
footer .wrap { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px 32px; padding-top:22px; padding-bottom:30px; font-size:14px; color:var(--soft); border-top:1px solid var(--rule); }
footer .wrap > span:last-child { display:flex; gap:20px; }

/* Project cards: one treatment everywhere */
.card { position:relative; display:block; overflow:hidden; border-radius:28px; background:#000; color:#fff; }
.card img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; transition:transform 1.2s cubic-bezier(.2,.7,.2,1); }
.card:hover img { transform:scale(1.03); }
.card::after { content:''; position:absolute; inset:0; background:linear-gradient(#000000C7 0%, #00000059 26%, #00000000 50%); }
.card .t { position:absolute; z-index:1; left:44px; top:38px; right:230px; }
.card .name { display:block; font-family:var(--head); font-weight:600; font-size:clamp(28px,3.4vw,46px); letter-spacing:-0.03em; line-height:1.08; }
.card .tag { display:block; margin-top:8px; font-size:clamp(17px,1.7vw,23px); }
.card .go { position:absolute; z-index:1; right:44px; top:42px; display:inline-flex; align-items:center; height:44px; padding:0 20px; border-radius:22px; background:#fff; color:#000; font-size:15px; font-weight:600; }

.car { display:flex; gap:24px; overflow-x:auto; scroll-snap-type:x mandatory; scrollbar-width:none; padding:0 max(32px, calc((100vw - 1280px) / 2 + 32px)); }
.car::-webkit-scrollbar { display:none; }
.car .card { flex:0 0 min(1216px, 86vw); aspect-ratio:40/21; scroll-snap-align:center; }
.car .card::after { display:none; }
.car-ctl { display:flex; justify-content:center; align-items:center; gap:14px; padding:28px 0 96px; }
.dots { display:flex; align-items:center; gap:10px; height:48px; padding:0 20px; border-radius:24px; background:color-mix(in srgb, var(--ink) 14%, transparent); }
.dots button { width:8px; height:8px; padding:0; border:0; border-radius:4px; background:var(--ink); opacity:.45; cursor:pointer; transition:width .35s, opacity .35s; }
.dots button.on { width:44px; opacity:1; }
.play { width:48px; height:48px; border:0; border-radius:24px; background:color-mix(in srgb, var(--ink) 14%, transparent); color:var(--ink); cursor:pointer; display:flex; align-items:center; justify-content:center; }

/* Inner pages */
.page-head { padding-top:56px; padding-bottom:40px; }
.page-head h1 { font-size:clamp(34px,4.2vw,58px); line-height:1.06; }
.page-head p { margin:14px 0 0; font-size:clamp(18px,1.8vw,23px); color:var(--soft); }
.kicker { margin:0 0 14px !important; font:500 13px/1 ui-monospace,SFMono-Regular,Menlo,monospace !important; letter-spacing:.04em; text-transform:uppercase; color:var(--accent) !important; }
.grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:24px; padding-bottom:96px; }
.grid { gap:40px 24px; }
.grid .card { overflow:visible; border-radius:0; background:none; color:var(--ink); }
.grid .card::after { display:none; }
.grid .card img { position:relative; inset:auto; display:block; height:auto; aspect-ratio:12/7; border-radius:24px; background:var(--band); transition:opacity .3s; }
.grid .card:hover img { transform:none; opacity:.86; }
.grid .card .t { position:static; display:block; padding:18px 4px 0; }
.grid .card .name { font-size:clamp(22px,2.2vw,30px); }
.grid .card .tag { margin-top:6px; font-size:17px; color:var(--soft); }

.proj { padding-top:8px; padding-bottom:64px; }
.prose p { margin:0 0 18px; max-width:680px; font-size:18px; line-height:1.65; color:var(--soft); }
.prose .ext { display:flex; flex-wrap:wrap; gap:8px 28px; margin-top:28px; }
.did h2 { font-size:15px; font-family:var(--body); font-weight:600; letter-spacing:0; margin-bottom:14px; }
.did ul { margin:0; padding:0; list-style:none; font-size:17px; }
.did li { padding:11px 0; border-bottom:1px solid var(--rule); }
.did li:last-child { border:0; }
.proj .pair { padding-top:0; padding-bottom:0; gap:32px 64px; }
.proj .pair > :first-child { flex:999 1 420px; min-width:0; }
.proj .pair > :last-child { flex:0 0 320px; }
.gal { display:flex; flex-direction:column; gap:24px; padding-bottom:72px; }
.gal .row { display:flex; gap:24px; align-items:flex-start; }
.gal .g { position:relative; min-width:0; border-radius:20px; overflow:hidden; background:var(--band); }
.gal img, .gal video { display:block; width:100%; height:auto; }
.gal .slides { display:grid; }
.gal .slides img { grid-area:1/1; opacity:0; transition:opacity .8s ease; }
.gal .slides img.on { opacity:1; }
.gal .has-slides { cursor:pointer; }
.gal .snav { position:absolute; top:50%; z-index:1; width:44px; height:44px; margin-top:-22px; display:grid; place-items:center; border:0; border-radius:22px; background:#000000A6; color:#fff; cursor:pointer; opacity:0; transition:opacity .2s, background .2s; }
.gal .snav.prev { left:16px; } .gal .snav.next { right:16px; }
.gal .has-slides:hover .snav, .gal .snav:focus-visible { opacity:1; }
.gal .snav:hover { background:#000000D9; }
@media (hover:none) { .gal .snav { opacity:.85; width:36px; height:36px; margin-top:-18px; } .gal .snav.prev { left:10px; } .gal .snav.next { right:10px; } }
.gal .sdots { position:absolute; left:0; right:0; bottom:16px; display:flex; justify-content:center; gap:8px; pointer-events:none; }
.gal .sdots span { width:7px; height:7px; border-radius:50%; background:#FFFFFF80; box-shadow:0 0 0 1px #0000001F; transition:background .3s, width .3s; }
.gal .sdots span.on { width:20px; border-radius:4px; background:#FFF; }
.pn { display:flex; justify-content:space-between; gap:24px; padding-top:28px; padding-bottom:28px; border-top:1px solid var(--rule); font-size:17px; font-weight:500; }
.pn a { padding:12px 0; max-width:45%; }
.pn span { display:block; font-size:13px; font-weight:400; color:var(--soft); margin-bottom:4px; }
.pn a:last-child { text-align:right; }

/* The ƒ button: pick the hero function */
.fn[hidden] { display:none; }
.fn { position:fixed; right:16px; bottom:16px; z-index:9; display:flex; flex-direction:column; align-items:flex-end; gap:8px; font:500 13px/1 system-ui,sans-serif; }
.hero .fn { position:absolute; z-index:4; }
.fn > button { width:44px; height:44px; border:0; border-radius:22px; background:#000000CC; color:#fff; font:italic 500 20px/1 Georgia,'Times New Roman',serif; cursor:pointer; opacity:.55; transition:opacity .2s; }
.fn > button:hover, .fn > button[aria-expanded="true"], .fn > button:focus-visible { opacity:1; }
.fn div { display:flex; flex-direction:column; gap:2px; padding:4px; border-radius:16px; background:#000000E6; }
.fn div[hidden] { display:none; }
.fn div button { height:40px; padding:0 14px; border:0; border-radius:12px; background:none; color:#fff; font:inherit; text-align:left; cursor:pointer; white-space:nowrap; }
.fn div button.on { background:#fff; color:#000; }
#egg { position:fixed; inset:0; z-index:8; pointer-events:none; }

@media (max-width:900px){ .grid{grid-template-columns:1fr} .proj .pair > :last-child{flex:1 1 100%} }
@media (max-width:640px){
  .wrap{padding-left:16px;padding-right:16px} nav a{padding:13px 8px} .pair > :first-child{flex-basis:100%}
  .sec-head{padding-top:64px;padding-bottom:24px} .pair{padding-top:64px;padding-bottom:64px} .contact{padding-top:72px;padding-bottom:72px} .car-ctl{padding-bottom:64px}
  .page-head{padding-top:32px;padding-bottom:32px} .grid{padding-bottom:64px} .car{padding:0 16px;gap:12px} .car .card{flex-basis:calc(100vw - 48px)}
  .card::after{background:linear-gradient(#000000E0 0%, #000000A6 30%, #00000000 58%)}
  .proj .pair{padding-top:0;padding-bottom:0} .pair{row-gap:24px}
  .card{border-radius:20px} .card .t{left:24px;top:24px;right:24px} .card .go{right:auto;left:24px;top:auto;bottom:24px}
  .grid .card img{border-radius:16px}
  .gal, .gal .row{gap:12px} .gal .row{flex-wrap:wrap} .gal .row .g{flex:1 1 100% !important} .gal .row.n4 .g{flex:1 1 40% !important} .gal .row .g.has-slides{flex:1 1 40% !important} .gal .g{border-radius:12px}
}
/* Phones get their own hero for every theme: full-height canvas behind, copy at the bottom. */
html[data-form=mobile] .hero { height:100vh; height:100svh; min-height:560px; }
html[data-form=mobile] .hero canvas { position:absolute; height:100%; min-height:0; }
html[data-form=mobile] .hero .copy { position:absolute; top:auto; bottom:0; padding:0 0 40px; }
html[data-form=mobile] .hero .copy::before { display:none; }
html[data-form=mobile] body.home header { position:absolute; }
html[data-form=mobile] .fnsel { display:none; }
html.flute[data-form=mobile] .hero { touch-action:pan-y; }
html[data-form=mobile] .hero .cta { flex-direction:column; align-items:flex-start; }   /* link always on its own line, clear of the ƒ button */
.tilt { display:inline-flex; align-items:center; gap:8px; height:36px; margin:0 8px 14px 0; padding:0 14px 0 11px; border:1px solid color-mix(in srgb, var(--ink) 45%, transparent); border-radius:18px; background:color-mix(in srgb, var(--ground) 75%, transparent); color:var(--ink); font:500 12px/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.03em; cursor:pointer; }
@media (prefers-reduced-motion:reduce){ html{scroll-behavior:auto} .card img, .gal .slides img{transition:none} }

/* Work page: categories */
.cats { display:flex; flex-wrap:wrap; gap:8px; padding-bottom:8px; }
.cats a { display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 16px; border:1px solid var(--rule); border-radius:20px; color:var(--ink); font-size:15px; text-decoration:none; }
.cats a:hover { border-color:var(--ink); }
.cats a span { color:var(--soft); font:500 12px/1 ui-monospace,SFMono-Regular,Menlo,monospace; }
.cat { scroll-margin-top:16px; }
.cat-head { padding-top:72px; padding-bottom:28px; }
.cat-head h2 { font-size:clamp(26px,2.6vw,36px); }
.cat-head p { margin:6px 0 0; color:var(--soft); font-size:17px; }
.cat .grid { padding-bottom:88px; }
.kicker a { color:inherit; text-decoration:none; }
.kicker a:hover { text-decoration:underline; }
@media (max-width:640px){ .cat-head{padding-top:48px;padding-bottom:20px} .cat .grid{padding-bottom:56px} }
.pair .more { display:inline-block; margin-top:24px; padding:10px 0; }
html[data-form=desktop] .hero .tilt { display:none; }
