/* ═══════════════════════════════════════════════════════════════════════
   Atrics Inc
   Warm paper, deep espresso ink, brass that reads as hardware rather than
   a marketing colour. Light serif display for the craft, clean sans for
   everything that has to be read quickly.

   Reference the client gave: Eské Studio. We borrow the quality bar, not
   the identity. Eské sells 20,000 sq ft and a showroom, Atrics sells work
   made one at a time by hand.

   LAYOUT MODEL: one sticky viewport, seven absolutely-positioned cards
   stacked first-on-top. Scrolling lifts each card off to reveal the next.
   Cards use svh, never vh or dvh: svh is the only viewport unit that does
   not change when a mobile address bar collapses, and a full-screen card
   stack is exactly where that resize would cause a visible jump.
   ═══════════════════════════════════════════════════════════════════════ */

:root{
  --paper:#f7f4ef;
  --paper2:#efe9e0;
  --ink:#1f1a15;
  --ink-soft:#3a322a;
  --muted:#6b6157;
  --dim:#9a9084;
  --line:#ded6c9;
  --line2:#cec4b4;
  --brass:#9c7430;
  --on-dark:#f2ece2;
  --black:#121110;          /* nav bar: warm near-black, not a cold #000 */

  --display:'Cormorant Garamond', 'Palatino Linotype', Palatino, Georgia, serif;
  --body:'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --pad:clamp(20px, 5vw, 76px);
  --maxw:1280px;
  --cardh:100svh;
}

*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  background:var(--ink);
  color:var(--ink);
  font-family:var(--body);
  font-size:16px;
  line-height:1.6;
  letter-spacing:-.006em;
  -webkit-font-smoothing:antialiased;
  /* NO overflow-x:hidden here. Setting one axis to hidden computes the other
     to auto, which turns <body> into a scroll container, and position:sticky
     on a descendant then anchors to that container instead of the viewport.
     iOS Safari breaks on this specifically, which killed the card stack on
     phones. .stack-viewport already clips horizontally, so it was redundant
     anyway. If horizontal overflow ever appears, fix it at the source. */
}
img{display:block;max-width:100%}
a{color:inherit}

.skip{position:absolute;left:-9999px;top:0;background:var(--ink);color:var(--paper);padding:12px 18px;z-index:300}
.skip:focus{left:12px;top:12px}
:focus-visible{outline:2px solid var(--brass);outline-offset:3px}

h1,h2,h3{font-family:var(--display);font-weight:300;line-height:1.05;letter-spacing:-.018em}

.eyebrow,.sec-label{
  font-family:var(--body);font-size:11.5px;font-weight:500;
  letter-spacing:.17em;text-transform:uppercase;color:var(--brass);
}
.sec-label{display:flex;align-items:center;gap:12px;margin-bottom:22px}
.sec-label span{
  font-variant-numeric:tabular-nums;color:var(--dim);
  border:1px solid var(--line2);border-radius:99px;padding:3px 9px;letter-spacing:.08em;
}

.btn{
  display:inline-block;text-decoration:none;
  background:var(--brass);color:#1a1510;
  padding:15px 30px;border-radius:2px;
  font-size:13px;font-weight:500;letter-spacing:.09em;text-transform:uppercase;
  transition:background .25s;
}
.btn:hover{background:#b0853a}
.btn-light{background:var(--on-dark);color:var(--ink)}
.btn-light:hover{background:#fff}

/* ── header ───────────────────────────────────────────────────────── */
/* Solid black, always. This replaces the old transparent-then-solid toggle
   and its scrim, which existed only to keep the nav legible while cards
   lifted through it. A permanent bar makes that whole problem disappear. */
.site-head{
  position:fixed;inset:0 0 auto 0;z-index:200;
  display:flex;align-items:center;justify-content:space-between;gap:24px;
  padding:20px var(--pad);
  background:var(--black);
  color:var(--on-dark);
}
.wordmark{font-family:var(--display);font-size:25px;text-decoration:none}
.wordmark span{color:var(--brass);margin-left:.18em}
.nav-links{display:flex;gap:32px}
.nav-links a{font-size:13.5px;text-decoration:none;opacity:.8;transition:opacity .25s}
.nav-links a:hover{opacity:1}
.nav-cta{
  font-size:12.5px;letter-spacing:.07em;text-transform:uppercase;text-decoration:none;
  padding:10px 18px;border:1px solid currentColor;border-radius:2px;opacity:.9;
  transition:opacity .25s;
}
.nav-cta:hover{opacity:1}

/* ── the stack ────────────────────────────────────────────────────── */
/* .stack height is set by main.js to (cards * 100svh); that height IS the
   scroll distance driving the lift. The fallback below keeps the page
   usable if JS never runs. */
.stack{position:relative}
.stack-viewport{
  position:sticky;top:0;
  height:var(--cardh);
  overflow:hidden;
}
.card{
  position:absolute;inset:0;
  height:var(--cardh);
  overflow:hidden;
  will-change:transform;
  background:var(--paper);
  box-shadow:0 -18px 50px -24px rgba(20,14,8,.45);   /* reads as a lifted card edge */
}

/* ── card 01 · hero ───────────────────────────────────────────────── */
/* No photograph. Warm paper, ink type, centred. The type is the hero. */
.card-hero{background:var(--paper);display:grid;place-items:center;text-align:center}
.hero-inner{
  max-width:min(980px,88vw);
  padding:0 var(--pad);
  display:flex;flex-direction:column;align-items:center;
}
.card-hero .eyebrow{margin-bottom:24px}
/* Two-clause headline scale. The old 8.6vw/124px was sized for a four-word
   line; at that size this headline renders five lines, clips under the nav
   and pushes the eyebrow off screen. Measured, not guessed. */
.card-hero h1{
  font-size:clamp(34px,5.6vw,76px);margin-bottom:26px;
  text-wrap:balance;color:var(--ink);
}
.card-hero .lede{
  max-width:52ch;font-size:clamp(15px,1.4vw,18.5px);
  color:var(--muted);margin-bottom:34px;
}
/* A hairline above the eyebrow gives the centred block something to sit
   against, so it reads as composed rather than merely floating. */
.hero-inner:before{
  content:"";width:52px;height:1px;background:var(--brass);
  margin-bottom:26px;opacity:.8;
}

.scroll-cue{
  position:absolute;z-index:2;bottom:26px;left:50%;transform:translateX(-50%);
  width:1px;height:48px;background:var(--line2);overflow:hidden;
}
.scroll-cue span{display:block;width:100%;height:40%;background:var(--brass);animation:cue 2.4s cubic-bezier(.7,0,.3,1) infinite}
@keyframes cue{0%{transform:translateY(-100%)}60%,100%{transform:translateY(260%)}}

/* ── cards 02-04 · split ──────────────────────────────────────────── */
.card-split{display:grid;grid-template-columns:1fr 1fr}
.card-split.reverse .split-media{order:2}
.split-media{position:relative;overflow:hidden;background:var(--ink)}
.split-media img{width:100%;height:100%;object-fit:cover}
.split-copy{
  display:flex;flex-direction:column;justify-content:center;
  padding:clamp(32px,5.4vw,86px);background:var(--paper2);
}
.split-copy h2{font-size:clamp(28px,3.7vw,52px);margin-bottom:18px}
.split-copy p{max-width:44ch;color:var(--muted);font-size:clamp(14.5px,1.1vw,17px)}

/* ── cards 05-06 · plain ──────────────────────────────────────────── */
.card-plain{display:grid;place-items:center;background:var(--paper)}
.card-plain.alt{background:var(--paper2)}
.card-inner{width:100%;max-width:var(--maxw);margin:0 auto;padding:clamp(28px,5svh,64px) var(--pad)}
.card-plain h2{font-size:clamp(28px,4vw,54px);margin-bottom:clamp(28px,4.5svh,56px)}

.svc-list{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:1px;background:var(--line);border-block:1px solid var(--line);
}
.svc{background:var(--paper);padding:clamp(20px,2.6vw,34px)}
.card-plain.alt .svc{background:var(--paper2)}
.svc h3{font-size:clamp(21px,2.2vw,30px);margin-bottom:9px}
.svc p{color:var(--muted);max-width:40ch;font-size:14.5px;line-height:1.55}
.area{margin-top:24px;color:var(--muted);font-size:14.5px}
.area strong{color:var(--ink);font-weight:500}

.work-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
/* Each slot is a real <button>: it opens a dialog, so it must be reachable
   by keyboard and announced as an action, not styled as a decorative figure. */
.slot{
  position:relative;margin:0;padding:0;border:0;cursor:pointer;
  aspect-ratio:4/5;max-height:44svh;width:100%;
  border-radius:2px;overflow:hidden;background:var(--line);
  display:block;text-align:left;font:inherit;color:inherit;
}
.slot img{width:100%;height:100%;object-fit:cover;transition:transform .8s cubic-bezier(.4,0,.2,1)}
.slot:hover img,.slot:focus-visible img{transform:scale(1.05)}
.slot:after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(180deg,rgba(20,14,8,0) 42%,rgba(20,14,8,.78) 100%);
  transition:opacity .4s;
}
.slot-meta{
  position:absolute;left:14px;right:14px;bottom:12px;z-index:2;
  display:flex;flex-direction:column;gap:1px;color:var(--on-dark);
}
.slot-what{font-family:var(--display);font-size:22px;line-height:1.15}
.slot-where{font-size:11px;letter-spacing:.15em;text-transform:uppercase;color:rgba(242,236,226,.66)}
.slot-open{
  position:absolute;z-index:2;left:0;right:0;top:50%;transform:translateY(-50%);
  text-align:center;font-size:11px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--on-dark);opacity:0;transition:opacity .35s;
}
.slot-open:before{
  content:"";display:block;width:34px;height:1px;background:currentColor;
  margin:0 auto 10px;opacity:.7;
}
.slot:hover .slot-open,.slot:focus-visible .slot-open{opacity:1}
.slot:hover:after,.slot:focus-visible:after{opacity:.92}

/* ── card 07 · visit ──────────────────────────────────────────────── */
.card-visit{display:grid;place-items:center;background:var(--ink);color:var(--on-dark)}
.card-visit .sec-label{color:#d8bb84}
.card-visit .sec-label span{color:rgba(242,236,226,.5);border-color:rgba(242,236,226,.22)}
.visit-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:clamp(32px,5vw,80px);align-items:start}
.card-visit h2{font-size:clamp(30px,4.3vw,58px);margin-bottom:18px}
.card-visit .lede{color:rgba(242,236,226,.74);max-width:46ch;margin-bottom:28px;font-size:16.5px}
.fine{margin-top:13px;font-size:13px;color:rgba(242,236,226,.42)}
.visit-facts{display:grid;gap:22px}
.visit-facts dt{font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:#d8bb84;margin-bottom:6px}
.visit-facts dd{color:rgba(242,236,226,.88);line-height:1.5}
.visit-facts .pending{
  color:rgba(242,236,226,.45);
  border-bottom:1px dashed rgba(242,236,226,.28);
  display:inline-block;padding-bottom:2px;
}
.card-foot{
  grid-column:1/-1;margin-top:clamp(28px,5svh,60px);padding-top:20px;
  border-top:1px solid rgba(242,236,226,.14);
  display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;
  font-size:13px;color:rgba(242,236,226,.5);
}
.foot-mark{font-family:var(--display);font-size:20px;color:var(--on-dark)}
.foot-mark span{color:var(--brass);margin-left:.18em}

/* ── project showcase modal ───────────────────────────────────────── */
.pm{position:fixed;inset:0;z-index:400;display:grid;place-items:center;padding:clamp(12px,3vw,44px)}
.pm[hidden]{display:none}
.pm-backdrop{
  position:absolute;inset:0;background:rgba(14,10,7,.72);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  opacity:0;transition:opacity .4s ease;
}
.pm.is-open .pm-backdrop{opacity:1}

.pm-dialog{
  position:relative;width:min(1240px,100%);max-height:min(880px,92svh);
  background:var(--paper);border-radius:3px;overflow:hidden;
  box-shadow:0 40px 90px -30px rgba(14,10,7,.7);
  opacity:0;transform:translateY(14px) scale(.985);
  transition:opacity .42s cubic-bezier(.4,0,.2,1),transform .42s cubic-bezier(.4,0,.2,1);
}
.pm.is-open .pm-dialog{opacity:1;transform:none}

.pm-close{
  position:absolute;z-index:6;top:12px;right:14px;
  width:38px;height:38px;border:0;border-radius:99px;cursor:pointer;
  background:rgba(18,17,16,.62);color:var(--on-dark);
  font-size:23px;line-height:1;
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
  transition:background .25s;
}
.pm-close:hover{background:rgba(18,17,16,.86)}

/* Explicit height, not max-height:inherit. And min-height:0 on the columns:
   grid items default to min-height:auto, so the media column refused to
   shrink below the stage image and pushed the thumbnail strip out of the
   clipped dialog entirely. */
.pm-panel{
  display:grid;grid-template-columns:1.15fr .85fr;
  height:min(880px,92svh);
}
.pm-panel[hidden]{display:none}

.pm-media{display:flex;flex-direction:column;background:var(--ink);min-width:0;min-height:0}
.pm-stage{margin:0;flex:1 1 auto;min-height:0;overflow:hidden}
.pm-stage img{width:100%;height:100%;object-fit:cover;display:block}
.pm-strip{
  display:flex;gap:8px;padding:10px;overflow-x:auto;flex:none;
  background:rgba(0,0,0,.28);
  scrollbar-width:thin;scroll-snap-type:x proximity;
}
.pm-thumb{
  flex:0 0 auto;width:94px;height:66px;padding:0;cursor:pointer;
  border:1px solid transparent;border-radius:2px;overflow:hidden;background:none;
  opacity:.55;transition:opacity .25s,border-color .25s;scroll-snap-align:start;
}
.pm-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.pm-thumb:hover{opacity:.85}
.pm-thumb.is-on{opacity:1;border-color:var(--brass)}

.pm-copy{padding:clamp(26px,3.2vw,48px);overflow-y:auto;min-width:0;min-height:0}
.pm-kicker{
  font-size:11px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--brass);margin-bottom:14px;
}
.pm-copy h3{font-size:clamp(24px,2.5vw,38px);margin-bottom:26px;text-wrap:balance}
.pm-steps{display:grid;gap:20px}
.pm-steps dt{
  font-size:10.5px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--ink);margin-bottom:6px;
  display:flex;align-items:center;gap:9px;
}
.pm-steps dt:before{content:"";width:16px;height:1px;background:var(--brass);flex:none}
.pm-steps dd{color:var(--muted);font-size:15px;line-height:1.6}

/* ── progress rail ────────────────────────────────────────────────── */
.rail{
  position:fixed;z-index:150;right:clamp(12px,1.6vw,22px);top:50%;transform:translateY(-50%);
  display:flex;flex-direction:column;gap:11px;
}
.rail button{
  width:7px;height:7px;padding:0;border:0;border-radius:99px;cursor:pointer;
  background:rgba(122,110,95,.42);
  transition:background .3s, transform .3s;
}
.rail button:hover{transform:scale(1.35)}
.rail button.is-on{background:var(--brass);transform:scale(1.35)}

/* ═══ responsive ═══════════════════════════════════════════════════ */
@media (max-width:900px){
  .nav-links{display:none}
  /* Stack the dialog and let the whole thing scroll; a two-column dialog on
     a phone gives both halves too little room to be worth reading. */
  .pm-panel{grid-template-columns:1fr;grid-template-rows:auto auto;height:auto;max-height:92svh;overflow-y:auto}
  .pm-media{min-height:auto}
  .pm-stage{flex:none;height:38svh}
  .pm-thumb{width:74px;height:54px}
  .pm-copy{overflow:visible}
  .card-split{grid-template-columns:1fr;grid-template-rows:38svh 1fr}
  .card-split.reverse .split-media{order:0}
  .split-copy{padding:clamp(26px,6vw,44px) var(--pad)}
  .visit-grid{grid-template-columns:1fr;gap:30px}
  .work-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .slot{max-height:26svh}
}

@media (max-width:600px){
  .svc-list{grid-template-columns:1fr}
  .svc{padding:15px 18px}
  .svc p{font-size:13.5px}
  .card-plain h2{margin-bottom:22px}
  .rail{right:9px;gap:9px}
  .site-head{padding:14px var(--pad)}
  .wordmark{font-size:20px}
  .card-foot{display:none}          /* the visit card has to fit one screen */
}

/* Very short viewports: let a dense card scroll internally rather than clip. */
@media (max-height:660px){
  .card-plain,.card-visit{place-items:start center;overflow-y:auto}
  .slot{max-height:none}
}

/* ═══ no-JS / reduced motion ═══════════════════════════════════════
   The stack needs JS to set its height and drive the lift. Without it the
   whole thing must collapse into an ordinary scrolling document, or the
   cards pile invisibly on top of each other. main.js adds .is-static. */
/* Body scroll lock while the showcase is open. Lenis is stopped separately
   in main.js; this covers the native scroll underneath it. */
.is-locked{overflow:hidden}

.is-static .stack-viewport{position:static;height:auto;overflow:visible}
.is-static .card{position:relative;inset:auto;height:auto;min-height:var(--cardh);transform:none!important;box-shadow:none}
.is-static .rail{display:none}
.is-static .scroll-cue{display:none}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
  .stack-viewport{position:static;height:auto;overflow:visible}
  .card{position:relative;inset:auto;height:auto;min-height:var(--cardh);transform:none!important;box-shadow:none}
  .rail,.scroll-cue{display:none}
  .card-plain,.card-visit{place-items:start center}
  .card-foot{display:flex}
}

/* ── Material spec · section 03 ──────────────────────────────────────
   The claim in 01/02 is that Atrics knows materials from the supply
   side. This is the evidence, so it is set as a spec sheet, not prose. */
.spec{margin-top:26px;border-top:1px solid var(--line);display:grid;gap:0}
.spec > div{
  display:grid;grid-template-columns:minmax(96px,.28fr) 1fr;gap:16px;
  padding:10px 0;border-bottom:1px solid var(--line);align-items:baseline;
}
.spec dt{
  font-size:10.5px;letter-spacing:.15em;text-transform:uppercase;
  color:var(--dim);padding-top:3px;
}
.spec dd{font-size:14px;line-height:1.5;color:var(--muted);max-width:46ch}
.lede-sm{color:var(--muted);font-size:15px;margin:-10px 0 22px}
/* Phone and email are the two things a visitor on a phone actually taps. */
.visit-facts a{color:inherit;text-decoration:none;border-bottom:1px solid rgba(216,187,132,.5);transition:border-color .2s}
.visit-facts a:hover{border-bottom-color:#d8bb84}
@media(max-width:640px){
  .spec > div{grid-template-columns:1fr;gap:3px;padding:11px 0}
  .spec dt{padding-top:0}
}

.card-foot a{color:inherit;text-decoration:none;border-bottom:1px solid var(--line2)}
.card-foot a:hover{color:var(--brass);border-color:var(--brass)}
