/* maxanderson.dev: one stylesheet for the home page, the write-ups and the plain pages (privacy, 404).
   Native scrolling, nothing pinned. Motion: each section fades in once, the hero's footage cuts as an edit, plus hover states.
   White ground, navy ink, one blue accent. Each project carries its own colour (--pc), taken from its footage. */
@font-face{font-family:Chivo;src:url(fonts/chivo-var.woff2) format("woff2");font-weight:100 900;font-display:swap}
:root{color-scheme:light;--bg:#fff;--ink:#0d1330;--mute:#545a72;--line:#dfe2ea;--acc:#1f3fc4;--dark:#0b0d12;--g:clamp(20px,4vw,64px);--navh:56px}
*{box-sizing:border-box}
html{scroll-padding-top:calc(var(--navh) + 8px)}
@media (prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}
html,body{margin:0;background:var(--bg);color:var(--ink)}
body{font-family:Chivo,system-ui,sans-serif;font-size:17px;line-height:1.55;-webkit-font-smoothing:antialiased}
img,video{display:block;max-width:100%}
a{color:inherit}
:focus-visible{outline:3px solid var(--acc);outline-offset:3px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- nav ---------- */
.nav{position:sticky;top:0;z-index:20;height:var(--navh);display:flex;align-items:center;gap:28px;padding:0 var(--g);background:var(--bg);border-bottom:1px solid var(--line);font-size:15px;font-weight:600}
.nav a{text-decoration:none;padding:4px 0;border-bottom:2px solid transparent}
.nav a:hover{border-color:currentColor}
.nav .me{font-weight:800;margin-right:auto;border:0}
@media (max-width:480px){.nav{gap:18px}}

/* ---------- hero: one screen. The name, with project footage cut behind it ---------- */
.hero{height:calc(100vh - var(--navh));height:calc(100svh - var(--navh));min-height:480px;display:flex;flex-direction:column;padding:clamp(16px,3vh,40px) var(--g) clamp(20px,4vh,48px)}
.name{flex:1;margin:0;display:flex;flex-direction:column;justify-content:center;font-weight:900;font-size:clamp(64px,15vw,260px);line-height:.85;letter-spacing:-.045em;text-transform:none}
.reel{display:none}
/* site.js fits MAX and ANDERSON to the same ink width and sets --bx/--by/--bw/--bh to the block it covers */
.fit .name{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);flex:none}
.fit .reel{display:block;position:relative;flex:1;min-height:0;isolation:isolate;animation:in .8s ease-out}
.cut{position:absolute;left:var(--bx);top:var(--by);width:var(--bw);height:var(--bh);overflow:hidden;opacity:0;background:var(--ink)}
.cut.on{opacity:1}
.cut video,.cut img{width:100%;height:100%;object-fit:cover}
/* a white sheet with black type, screened over the footage: the footage only shows through the letters */
.knock{position:absolute;inset:0;background:#fff;mix-blend-mode:screen}
.knock svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.knock text{font-family:Chivo;font-weight:900;fill:#000}
.hero-foot{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:20px 40px;align-items:end;padding-top:clamp(16px,3vh,32px)}
.intro{grid-column:1;margin:0;font-size:clamp(20px,1.9vw,28px);line-height:1.3;font-weight:600;max-width:34ch}
.go{grid-column:1;display:flex;flex-wrap:wrap;gap:12px}
.go a{font-size:16px;font-weight:700;text-decoration:none;padding:11px 18px;border:2px solid var(--ink);border-radius:3px}
.go a:first-child{background:var(--ink);color:var(--bg)}
.go a:hover{background:var(--acc);border-color:var(--acc);color:#fff}
/* which project is playing behind the name, with a bar that fills until the next cut */
.playing{grid-column:2;grid-row:1/3;align-self:end;list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:14px;font-weight:600;color:var(--mute);text-align:right}
.playing:empty{display:none}
.playing li{position:relative;padding-bottom:4px}
.playing li.on{color:var(--ink)}
.playing li::after{content:"";position:absolute;right:0;bottom:0;width:100%;height:2px;background:var(--acc);transform:scaleX(0);transform-origin:100% 50%}
.playing li.on::after{animation:fill var(--beat,2200ms) linear forwards}
@keyframes fill{to{transform:none}}
@keyframes in{from{opacity:0}to{opacity:1}}

/* the hero edit: punch-in on most cuts, a whip on some, a slam and thump when the intro sting lands */
.knock{z-index:5}
.cut.on{z-index:2}
.cut.out{opacity:1;z-index:1}
.cut.fw{background:transparent}
.cut.fp>*{animation:punch .34s cubic-bezier(.15,.7,.2,1)}
.cut.fs>*{animation:slam .6s cubic-bezier(.1,.8,.2,1)}
.cut.fw>*{animation:whipin .22s cubic-bezier(.3,0,.2,1)}
.cut.out>*{animation:whipout .22s cubic-bezier(.5,0,.8,.4) forwards}
.fit .reel.thump{animation:thump .45s cubic-bezier(.15,.7,.2,1)}
@keyframes punch{from{transform:scale(1.14)}to{transform:none}}
@keyframes slam{from{transform:scale(1.5)}to{transform:none}}
@keyframes whipin{from{transform:translateX(-45%) scale(1.1);filter:blur(16px)}to{transform:none;filter:none}}
@keyframes whipout{to{transform:translateX(45%) scale(1.1);filter:blur(16px)}}
@keyframes whipin-m{from{transform:translateX(-45%)}to{transform:none}}
@keyframes whipout-m{to{transform:translateX(45%)}}
@keyframes thump{from{transform:scale(1.04)}to{transform:none}}
/* phones: whips without the blur, which is the expensive part */
@media (max-width:760px){.cut.fw>*{animation-name:whipin-m}.cut.out>*{animation-name:whipout-m}}
@media (max-width:760px){
  .hero{height:auto;min-height:0;padding-top:clamp(40px,10vh,96px)}
  .hero.tight .reel{flex:none;height:var(--rh)}
  .hero-foot{padding-top:32px}
  .projects{padding-top:24px}
  .hero-foot{grid-template-columns:1fr}
  .playing{display:none}
}

/* ---------- shared project bits ---------- */
.kind{margin:0 0 10px;font-size:15px;display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center}
.kind b{font-weight:700}
.kind b::before{content:"";display:inline-block;width:.7em;height:.7em;margin-right:8px;background:var(--pc,var(--acc));vertical-align:-.02em}
.kind span{color:var(--mute)}
.tags{list-style:none;margin:0 0 20px;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.tags li{font-size:13px;font-weight:600;padding:4px 9px;border:1.5px solid var(--line);border-radius:2px}
.more{display:inline-block;font-weight:700;text-decoration:none;padding-bottom:3px;border-bottom:3px solid var(--pc,var(--acc))}
.more:hover{border-color:var(--ink)}
h3 a{text-decoration:none;background:linear-gradient(var(--pc,var(--acc)),var(--pc,var(--acc))) 0 100%/0 .08em no-repeat;transition:background-size .4s ease}
h3 a:hover,h3 a:focus-visible{background-size:100% .08em}

/* dark panels: the results table and the server facts are the media for the two lead projects */
.res,.spec{color:#fff}
.res{width:100%;border-collapse:collapse;font-size:clamp(15px,1.25vw,19px);line-height:1.25}
.res caption{text-align:left;font-size:14px;color:rgba(255,255,255,.7);padding-bottom:14px}
.res thead th{font-size:13px;font-weight:700;color:var(--pc);text-align:left;padding:0 0 8px}
.res tbody th{text-align:left;font-weight:600;padding:11px 16px 11px 0;border-top:1.5px solid rgba(255,255,255,.16)}
.res td{padding:11px 12px 11px 0;border-top:1.5px solid rgba(255,255,255,.16);white-space:nowrap}
.res td.y{color:rgba(255,255,255,.72)}
.res td.n{color:var(--pc);font-weight:800}
.spec{margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px 32px}
.spec>div{border-top:1.5px solid rgba(255,255,255,.16);padding-top:12px}
.spec dt{font-size:14px;font-weight:700;color:var(--pc)}
.spec dd{margin:4px 0 0;font-size:clamp(18px,1.6vw,24px);font-weight:700;line-height:1.2;overflow-wrap:anywhere}
.spec .live{grid-column:1/-1}
.spec .live[hidden]{display:none}
.spec .live dd{font-size:17px;font-weight:600;color:rgba(255,255,255,.88)}

/* ---------- home: projects ---------- */
.projects{padding:clamp(48px,10vh,120px) var(--g) 0}
.lead{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(24px,4vw,72px);align-items:center;padding:clamp(40px,7vh,88px) 0;border-top:2px solid var(--ink)}
.lead h3{font-weight:900;font-size:clamp(48px,6.4vw,112px);line-height:.9;letter-spacing:-.04em;margin:0 0 20px}
.lead-txt>p:not(.kind){font-size:clamp(17px,1.3vw,20px);margin:0 0 20px;max-width:44ch}
.lead-media{background:var(--dark);border-radius:4px;padding:clamp(20px,3vw,44px)}
.lead+.lead{grid-template-columns:minmax(0,7fr) minmax(0,5fr)}
.lead+.lead .lead-txt{order:2}
.more-h{font-weight:900;font-size:clamp(32px,3.6vw,56px);line-height:1;letter-spacing:-.03em;margin:clamp(56px,10vh,120px) 0 clamp(28px,4vh,48px);padding-top:clamp(40px,7vh,88px);border-top:2px solid var(--ink)}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(48px,7vh,80px) clamp(24px,3vw,48px)}
.card-media{display:block;aspect-ratio:16/9;overflow:hidden;border-radius:4px;background:var(--dark);outline:3px solid transparent;outline-offset:4px;transition:outline-color .2s}
.card:hover .card-media{outline-color:var(--pc)}
/* media is shown whole, never cropped: the frame matches the 16:9 footage and anything else letterboxes */
.card-media>video,.card-media>img{width:100%;height:100%;object-fit:contain}
.card-ui .card-media>img{object-position:0 0}
.card-txt{padding-top:20px}
.card h3{font-weight:900;font-size:clamp(34px,3.4vw,56px);line-height:.95;letter-spacing:-.035em;margin:0 0 14px}
.card-txt>p:not(.kind){margin:0 0 18px;max-width:46ch}
/* phone screenshots: shown whole, side by side, on the project's colour */
.phones{display:flex;justify-content:center;align-items:center;gap:4%;height:100%;padding:4% 8%;background:var(--pc)}
.phones>*{height:100%;width:auto;aspect-ratio:540/1092;object-fit:contain;border-radius:10px;min-width:0}
/* five cards in two columns: the last one runs the full width */
.grid>.card:last-child:nth-child(odd){grid-column:1/-1;display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:clamp(24px,3vw,48px);align-items:center}
.grid>.card:last-child:nth-child(odd) .card-media{aspect-ratio:16/9}
.grid>.card:last-child:nth-child(odd) .card-txt{padding-top:0}

/* ---------- contact ---------- */
.contact{padding:clamp(80px,14vh,160px) var(--g) clamp(48px,8vh,96px)}
.contact h2{font-weight:900;font-size:clamp(64px,12vw,200px);line-height:.85;letter-spacing:-.045em;margin:0}
.contact-l{font-size:clamp(17px,1.4vw,21px);color:var(--mute);max-width:52ch;margin:28px 0 36px}
.ct{margin:0;max-width:1200px}
.ct>div{display:grid;grid-template-columns:120px 1fr;align-items:baseline;gap:20px;padding:18px 0;border-top:2px solid var(--ink)}
.ct>div:last-child{border-bottom:2px solid var(--ink)}
.ct dt{font-size:15px;font-weight:700;color:var(--mute)}
.ct dd{margin:0;display:flex;flex-wrap:wrap;align-items:baseline;gap:10px 22px}
.ct dd a{font-weight:800;font-size:clamp(22px,3.2vw,48px);letter-spacing:-.025em;line-height:1.1;text-decoration:none;overflow-wrap:anywhere;background:linear-gradient(var(--acc),var(--acc)) 0 100%/0 .08em no-repeat;transition:background-size .4s ease}
.ct dd a:hover,.ct dd a:focus-visible{background-size:100% .08em}
.ct>div:nth-child(n+3) dd a{font-size:clamp(20px,2.2vw,32px)}
.copy{font:inherit;font-size:14px;font-weight:700;color:var(--ink);background:none;border:2px solid var(--ink);border-radius:3px;padding:6px 12px;cursor:pointer}
.copy:hover{background:var(--ink);color:var(--bg)}
.foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;padding:24px var(--g) 32px;border-top:1px solid var(--line);font-size:14px;color:var(--mute)}
.foot a{color:var(--ink);font-weight:600}

/* ---------- write-ups ---------- */
.w-head{padding:clamp(48px,10vh,120px) var(--g) clamp(28px,5vh,56px)}
.w-head h1{font-weight:900;font-size:clamp(60px,11vw,190px);line-height:.85;letter-spacing:-.045em;margin:6px 0 28px}
.w-one{font-size:clamp(20px,2vw,30px);line-height:1.3;font-weight:600;max-width:36ch;margin:0 0 24px}
.w-hero{margin:0 var(--g)}
.w-hero>video,.w-hero>img{display:block;width:auto;height:auto;max-width:100%;max-height:82vh;margin:0 auto;border-radius:4px;background:var(--dark)}
.w-ui>img{object-fit:contain;object-position:0 0;background:none}
.w-table>table,.w-spec>dl{background:var(--dark);border-radius:4px;padding:clamp(20px,3vw,48px)}
.w-table>table{border-collapse:separate;border-spacing:0}
.w-phone .phones{height:min(78vh,720px);border-radius:4px;padding:clamp(20px,4vh,48px)}
.w-hero figcaption{font-size:14px;color:var(--mute);margin-top:12px;max-width:80ch}
.facts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px clamp(20px,3vw,48px);margin:clamp(40px,7vh,80px) var(--g) 0}
.facts>div{border-top:2px solid var(--ink);padding-top:12px}
.facts dt{font-size:14px;font-weight:600;color:var(--mute)}
.facts dd{margin:4px 0 0;font-size:clamp(17px,1.5vw,22px);font-weight:800;line-height:1.2}
.w-body{padding:clamp(24px,5vh,64px) var(--g) clamp(24px,4vh,48px);max-width:1500px}
.sec{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:clamp(20px,4vw,64px);padding:clamp(32px,6vh,64px) 0;border-top:2px solid var(--line)}
.sec:first-child{border-top:0}
.sec h2{position:sticky;top:calc(var(--navh) + 24px);align-self:start;margin:0;font-weight:900;font-size:clamp(30px,3.6vw,60px);line-height:.95;letter-spacing:-.035em}
.sec h2::before{content:"";display:block;width:48px;height:6px;background:var(--pc,var(--acc));margin-bottom:18px}
.prose{font-size:clamp(17px,1.2vw,19px);line-height:1.6;max-width:62ch}
.prose p{margin:0 0 1.1em}
.prose ul,.prose ol{margin:0 0 1.1em;padding-left:1.2em}
.prose li{margin:0 0 .7em;padding-left:.2em}
.prose li::marker{color:var(--mute);font-weight:800}
.prose b{font-weight:800}
.prose a{color:var(--acc)}
.gal{display:grid;gap:clamp(24px,4vh,48px);padding:0 var(--g) clamp(48px,8vh,96px)}
.gal figure{margin:0}
.gal img,.gal video{display:block;width:auto;height:auto;max-width:100%;max-height:86vh;margin:0 auto;border-radius:4px;background:var(--dark)}
.gal figcaption{font-size:14px;color:var(--mute);margin-top:10px}
.next{display:block;margin:0 var(--g);padding:clamp(48px,10vh,120px) clamp(24px,4vw,64px);background:var(--pc);color:var(--ink);text-decoration:none;border-radius:4px}
.next span{display:block;font-size:15px;font-weight:700;margin-bottom:12px}
.next b{display:inline-block;font-weight:900;font-size:clamp(56px,9vw,160px);line-height:.85;letter-spacing:-.045em;transition:transform .4s ease}
.next:hover b{transform:translateX(24px)}

/* plain pages: privacy, 404 */
.plain .w-head h1{margin-bottom:12px}
.plain .w-date{margin:0;color:var(--mute);font-size:15px}

/* ---------- one fade-in per section, once ---------- */
.js .fx{opacity:0;translate:0 24px;transition:opacity .8s ease-out,translate .8s ease-out}
.js .fx.in{opacity:1;translate:0 0}
@media (prefers-reduced-motion:reduce){
  .js .fx{opacity:1;translate:none;transition:none}
  .fit .reel{animation:none}
  .playing li.on::after{animation:none;transform:none}
}

/* ---------- narrow screens: one column, same order ---------- */
@media (max-width:860px){
  .lead{grid-template-columns:1fr}
  .lead+.lead{grid-template-columns:1fr}
  .lead+.lead .lead-txt{order:0}
  .grid{grid-template-columns:1fr}
  .grid>.card:last-child:nth-child(odd){display:block}
  .grid>.card:last-child:nth-child(odd) .card-txt{padding-top:20px}
  .facts{grid-template-columns:repeat(2,minmax(0,1fr))}
  .sec{grid-template-columns:1fr}
  .sec h2{position:static}
  .spec{grid-template-columns:1fr;gap:16px}
}
@media (max-width:560px){
  .lead-media{padding:16px;margin:0 calc(-1 * var(--g));border-radius:0}
  .res{font-size:14px}
  .res tbody th{padding-right:10px}
  .res td{padding-right:8px}
  .ct>div{grid-template-columns:1fr;gap:6px}
  .w-table,.w-spec{margin:0}
  .w-table>table,.w-spec>dl{border-radius:0;padding:20px var(--g)}
  .w-table figcaption,.w-spec figcaption{padding:0 var(--g)}
}
