/* Apex Line Studio website v7 (brand/design-rules.md §10b): one ground, one accent, one family.
   Anton = display, Mulish = text. Red appears only on the line's square and the red pill.
   The apex line is a racing line: it holds the left margin, changes lanes into the Paper section, and ends as BUILD's full stop.
   Photos are graded with grade.py --web; shading is edge-only, never a CSS filter. */
:root{
  --black:#0A0A0A; --paper:#F0F0F0; --dim:#C9C9C9; --grey:#8A8A8A; --ink:#333; --red:#B91C1C;
  --m:clamp(20px,3vw,48px); --pad:clamp(90px,14svh,150px);
  --display:"Anton",Impact,sans-serif; --text:"Mulish",system-ui,sans-serif;
  --ease:cubic-bezier(.16,1,.3,1);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{margin:0}
body{background:var(--black);color:var(--paper);font:400 18px/1.55 var(--text);-webkit-font-smoothing:antialiased;overflow-x:clip}
img{display:block;max-width:100%}
figure,h1,h2,h3,p,ul,ol,dl,dd{margin:0} ul,ol{padding:0;list-style:none}
a{color:inherit}
:focus-visible{outline:2px solid var(--paper);outline-offset:4px}
::selection{background:var(--red);color:#fff}

.wrap{padding-left:var(--m);padding-right:var(--m)}
.display{font:400 clamp(72px,11vw,200px)/.85 var(--display);text-transform:uppercase;letter-spacing:-.005em}
.ln{display:block;overflow:hidden;padding-bottom:.04em;white-space:nowrap} .ln>span{display:block}
.pill{display:inline-flex;align-items:center;height:48px;padding:0 24px;border-radius:999px;border:1px solid rgba(240,240,240,.35);font:700 15px/1 var(--text);text-decoration:none;
  transition:background-color .35s var(--ease),border-color .35s var(--ease),transform .5s var(--ease)}
.pill:hover{border-color:var(--paper);transform:translateY(-2px)}
.pill-red{background:var(--red);border-color:var(--red);color:#fff} .pill-red:hover{background:#9E1818;border-color:#9E1818}
.anchor{position:absolute;width:0;height:0}  /* where the line passes; measured by main.js */

/* ---- nav */
.nav{position:fixed;inset:0 0 auto;z-index:10;display:flex;align-items:center;gap:clamp(20px,3vw,48px);padding:18px var(--m);transition:background-color .4s var(--ease)}
.nav.solid{background:rgba(10,10,10,.92)}
.logo{width:clamp(130px,11vw,180px)} .logo img{width:100%;height:auto}
.links{display:flex;gap:clamp(18px,2vw,30px);font:600 15px/1 var(--text)} .links a{text-decoration:none;opacity:.85} .links a:hover{opacity:1}
.nav .pill{margin-left:auto;height:42px;padding:0 20px;font-size:14px}

/* ---- the line: above every section, inverted so it reads on black and on Paper */
main{position:relative}
main section{position:relative;z-index:2}
.thread{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:3;overflow:visible;mix-blend-mode:difference}
.thread path{fill:none;stroke:var(--paper);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.thread.tip{mix-blend-mode:normal}
.thread rect{fill:var(--red);transform-box:fill-box;transform-origin:center;animation:breathe 2.4s var(--ease) infinite alternate}
@keyframes breathe{to{transform:scale(1.3)}}

/* ---- hero */
.hero{height:100svh;min-height:620px;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;z-index:0!important}
.bg{position:absolute;inset:0;z-index:-1} .bg img,.bg video{width:100%;height:100%;object-fit:cover;object-position:50% 50%}
.bg .still{display:none}
.shade{position:absolute;inset:0;z-index:-1;pointer-events:none;  /* edge-only shading, never a flat tint */
  background:linear-gradient(to bottom,rgba(10,10,10,.6),rgba(10,10,10,0) 28%,rgba(10,10,10,0) 50%,rgba(10,10,10,.88))}
.hero-in{position:relative;padding-bottom:clamp(36px,6svh,64px)}
.hero h1{margin:0 0 clamp(36px,7svh,80px) -.03em;font-size:clamp(76px,13vw,240px)}
.hero h1 .ln:nth-child(2){padding-left:.9em}  /* staggered, so the two lines lean like a corner */
.hero-foot{position:relative;display:flex;justify-content:space-between;align-items:flex-end;gap:40px;padding-top:26px}
.hero-foot .anchor{left:0;top:0}
.lede{max-width:40ch;font-size:clamp(17px,1.35vw,20px);line-height:1.5;padding-left:38px}  /* the line starts at its left */
.actions{display:flex;gap:12px;flex:none}
/* load: the lines rise, the clip settles, the rest fades up */
.hero .ln>span{animation:rise 1.1s var(--ease) both} .hero .ln:nth-child(2)>span{animation-delay:.12s}
.hero .bg img,.hero .bg video{animation:settle 2.4s cubic-bezier(.2,.7,.2,1) both}
.hero-foot,.nav{animation:fade 1s .5s var(--ease) both}
@keyframes rise{from{transform:translateY(108%)}}
@keyframes settle{from{transform:scale(1.1)}}
@keyframes fade{from{opacity:0;transform:translateY(14px)}}

/* ---- reveals: each block's parts fade up once as it enters */
[data-reveal]>*{opacity:0;transform:translateY(22px);transition:opacity .9s var(--ease),transform 1s var(--ease)}
[data-reveal].in>*{opacity:1;transform:none}
[data-reveal].in>*:nth-child(2){transition-delay:.08s} [data-reveal].in>*:nth-child(3){transition-delay:.16s}

/* ---- about: the statement left, the numbers right */
.about{display:grid;grid-template-columns:7fr 4fr;gap:40px var(--m);align-items:end;padding-top:var(--pad);padding-bottom:var(--pad)}
.about .anchor{left:var(--m);top:var(--pad)}
.statement{font-size:clamp(26px,2.6vw,40px);line-height:1.22;max-width:30ch;padding-left:38px;color:var(--grey);text-wrap:pretty}  /* the line passes to its left */
.statement b{font-weight:inherit;color:var(--paper)}
.stats{display:flex;gap:clamp(36px,4vw,72px);justify-content:flex-end}
.stats dd{font:400 clamp(56px,6vw,96px)/.9 var(--display);font-variant-numeric:tabular-nums}
.stats dt{margin-top:10px;font-size:15px;color:var(--dim)}

/* ---- work: three bands by kind; a giant word with the same five-tile mosaic laid over its lower part */
.work{padding-bottom:var(--pad)}
.intro{position:relative;display:flex;justify-content:space-between;gap:40px;padding-left:38px;margin-bottom:clamp(28px,4vw,56px);font-size:15px;color:var(--grey)}
.intro .anchor{left:0;top:.6em}
.intro p:first-of-type{color:var(--paper);font-weight:700}
.band{position:relative;padding-left:38px}  /* the line runs down its left */
.band+.band{margin-top:clamp(48px,6vw,96px)}
.word{position:relative;z-index:0;margin:0 0 -.2em -.04em;font:400 clamp(64px,14.5vw,260px)/.8 var(--display);text-transform:uppercase;letter-spacing:-.01em;white-space:nowrap}
.flip .word{text-align:right;margin-right:-.04em}
.mosaic{position:relative;z-index:1;display:grid;grid-template-columns:repeat(6,1fr);grid-auto-rows:clamp(120px,11.5vw,170px);gap:8px}
.mosaic li:nth-child(1){grid-area:1/1/3/3} .mosaic li:nth-child(2){grid-area:1/3/2/5} .mosaic li:nth-child(3){grid-area:2/3/3/4}
.mosaic li:nth-child(4){grid-area:2/4/3/5} .mosaic li:nth-child(5){grid-area:1/5/3/7}
.flip .mosaic li:nth-child(1){grid-area:1/5/3/7} .flip .mosaic li:nth-child(5){grid-area:1/1/3/3}  /* mirrored, same shape */
.mosaic figure{position:relative;height:100%;overflow:hidden;background:#151515;cursor:zoom-in}
.mosaic img{width:100%;height:100%;object-fit:cover;transition:transform 1.2s var(--ease)}
.mosaic figure::after{content:"";position:absolute;left:14px;bottom:14px;width:10px;height:10px;background:var(--red);opacity:0;transform:scale(.4);transition:.5s var(--ease)}
.mosaic figure:hover img{transform:scale(1.05)} .mosaic figure:hover::after{opacity:1;transform:none}
/* tiles land one after another as the band enters */
.mosaic li{opacity:0;transform:translateY(16px);transition:opacity .8s var(--ease),transform .9s var(--ease)}
.band.in .mosaic li{opacity:1;transform:none}
.band.in .mosaic li:nth-child(2){transition-delay:.07s} .band.in .mosaic li:nth-child(3){transition-delay:.14s}
.band.in .mosaic li:nth-child(4){transition-delay:.21s} .band.in .mosaic li:nth-child(5){transition-delay:.28s}
.work>.anchor{left:var(--m);bottom:calc(var(--pad) - 40px)}
/* a tile opens full size */
.lb{border:0;padding:0;background:transparent;max-width:92vw;max-height:92vh;cursor:zoom-out}
.lb::backdrop{background:rgba(10,10,10,.94)}
.lb img{display:block;max-width:92vw;max-height:86vh;object-fit:contain}
.lb p{margin-top:12px;text-align:center;font-size:14px;color:var(--dim)}

/* ---- services: the one Paper section; the line runs down the list, a black square at each service */
.services{background:var(--paper);color:var(--black);padding:var(--pad) 0 calc(var(--pad) + 40px)}
.svc{display:grid;grid-template-columns:5fr 6fr;gap:40px var(--m);align-items:start}
.svc-head .display{font-size:clamp(64px,9vw,170px)}
.svc-head p{margin-top:28px;max-width:30ch;font-size:clamp(18px,1.6vw,24px);line-height:1.3;color:var(--ink);text-wrap:pretty}
.list{display:grid;gap:clamp(36px,4vw,56px)}
.list li{position:relative;padding-left:38px}
.list li::before{content:"";position:absolute;left:-4px;top:calc(clamp(30px,3vw,46px)*.5 - 4px);width:8px;height:8px;background:var(--black)}
.list .anchor{left:0;top:0} .list .anchor.out{top:auto;bottom:0}
.list h3{font:400 clamp(30px,3vw,46px)/1 var(--display);text-transform:uppercase}
.list p{margin-top:10px;max-width:44ch;font-size:17px;color:var(--ink);text-wrap:pretty}

/* ---- brands: one line, "Trabajamos con", with the client names rolling through it (after AREA 17) */
.brands{padding-top:clamp(70px,10svh,110px);padding-bottom:var(--pad)}
.brands .anchor{left:var(--m);top:0}
/* the active client lights up; its logo sits on a soft gradient at the right, over our footage when we shot for them */
.reel{overflow:hidden;padding-top:calc(clamp(70px,10svh,110px) + 4.5vw);padding-bottom:calc(var(--pad) + 4.5vw)}  /* 20% taller than the other blocks, so more of the vertical clips shows */
.reel-bg{position:absolute;inset:0 16.6% 0 31.6%;z-index:-1;-webkit-mask-image:linear-gradient(transparent,#000 22%,#000 78%,transparent);mask-image:linear-gradient(transparent,#000 22%,#000 78%,transparent)}
.reel-bg video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;opacity:0;transition:opacity 1s var(--ease);-webkit-mask-image:linear-gradient(to right,transparent,#000 24%,#000 76%,transparent);mask-image:linear-gradient(to right,transparent,#000 24%,#000 76%,transparent)}
.reel-bg video.on{opacity:.55}
.reel-in{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:0 .32em;padding-left:38px;font:400 clamp(44px,5.6vw,104px)/1 var(--display);text-transform:uppercase}
.reel-lead{font:inherit;white-space:nowrap}
.reel-names{height:5em;overflow:hidden;-webkit-mask-image:linear-gradient(transparent,#000 32%,#000 68%,transparent);mask-image:linear-gradient(transparent,#000 32%,#000 68%,transparent)}
.reel-names ol{transition:translate .8s var(--ease)}
.reel-names li{height:1em;white-space:nowrap;color:#3a3a3a;transition:color .6s var(--ease)}
.reel-names li.on{color:var(--paper)}
.reel-names button{font:inherit;color:inherit;text-transform:inherit;background:none;border:0;padding:0;cursor:pointer}
.reel-names li:not(.on) button:hover{color:#6a6a6a}
.reel-names button:focus{outline:none} .reel-names button:focus-visible{outline:1px solid var(--grey);outline-offset:6px}  /* a ring for keyboards, not after a click */
.reel-logo{display:flex;align-items:center;justify-content:center;width:clamp(120px,13vw,200px);aspect-ratio:2/1}
.reel-logo img{width:100%;height:76%;object-fit:contain;object-position:right center;transition:opacity .3s,translate .45s var(--ease)}
.reel-logo img.swap{opacity:0;translate:0 10px}

/* ---- contact: the line turns under BUILD and its red square lands as the full stop */
.contact{display:grid;grid-template-columns:7fr 4fr;gap:40px var(--m);align-items:end;padding-bottom:clamp(60px,9svh,100px)}
.contact>.anchor{left:var(--m);top:0}
.contact .display{padding-left:38px;font-size:clamp(84px,14vw,250px);line-height:.95}  /* .85 stacks LET'S onto BUILD */
.tail{position:relative;display:inline-block;width:0;height:0}
.tail .anchor{left:.12em;top:.07em}
.contact-side{display:flex;flex-direction:column;align-items:flex-start;gap:22px;padding-bottom:.3em}
.contact-side p{max-width:34ch;color:var(--dim)}
.mail{font-weight:700;text-decoration:underline;text-underline-offset:6px;text-decoration-thickness:2px}

/* ---- footer */
.foot{position:relative;display:flex;justify-content:space-between;align-items:center;padding-top:24px;padding-bottom:28px;font-size:14px;color:var(--grey)}
.foot img{width:140px;height:auto}

/* ---- phone: the line runs straight down the 20px gutter, so nothing needs an inset */
@media (max-width:760px){
  .links{display:none}
  .nav{padding:14px 20px} .logo{width:122px}
  .display,.hero h1,.svc-head .display{font-size:19vw}
  .hero h1 .ln:nth-child(2){padding-left:.3em}
  .bg .film{display:none} .bg .still{display:block}
  .hero h1{margin-bottom:28px}
  .hero-foot{flex-direction:column;align-items:stretch;gap:22px}
  .actions .pill{flex:1;justify-content:center;padding:0 12px;font-size:14px;white-space:nowrap}
  .about,.contact,.svc{grid-template-columns:1fr;gap:36px}
  .statement,.intro,.contact .display,.band,.lede,.list li{padding-left:0}
  .statement{font-size:24px}
  .stats{justify-content:flex-start}
  .intro{flex-direction:column;gap:4px}
  .word{font-size:14vw}
  .mosaic{grid-template-columns:1fr 1fr;grid-auto-rows:46vw;gap:6px}
  .band .mosaic li:nth-child(n){grid-area:auto} .band .mosaic li:nth-child(1){grid-area:1/1/2/3}  /* .band outranks the mirrored desktop areas */
  .list li::before{left:-15px}  /* back on the gutter line */
  .reel-bg{inset:0}
  .reel-in{grid-template-columns:1fr;gap:16px 0;padding-left:0;font-size:12vw} .reel-names{height:3em} .reel-logo{width:46%} .reel-logo img{object-position:left center}
  .contact .display{font-size:24vw}
}
@media (prefers-reduced-motion:reduce){
  .hero .ln>span,.hero .bg img,.hero .bg video,.hero-foot,.nav,.thread rect{animation:none}
  [data-reveal]>*,.mosaic li{opacity:1;transform:none;transition:none}
}
