/* Peña Media Group — identity "Lapis" */
:root{
  --void:#060A16; --deep:#101B3A; --navy:#254376; --azure:#5B8FE0;
  --ice:#A8C4E8; --marble:#EDE7DA; --ash:#A8B0C4; --quiet:#79829A;
  --seam:#1A2340; --panel:#0B1124;

  --sans:"Jost","Helvetica Neue",Arial,sans-serif;
  --serif:"Cormorant Garamond","Times New Roman",serif;
  --mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;

  --pad:clamp(22px,5vw,72px);
  --gap:clamp(58px,7vw,110px);
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
/* clip rather than hidden: hidden on the root turns it into a scroll container
   and breaks position:sticky further down the page. */
html,body{overflow-x:clip;max-width:100%;}
body{
  margin:0;background:var(--void);color:var(--marble);
  font-family:var(--sans);font-weight:300;font-size:16.5px;line-height:1.72;
  -webkit-font-smoothing:antialiased;
}
.grain{position:fixed;inset:0;z-index:99;pointer-events:none;opacity:.04;mix-blend-mode:overlay;}
.wrap{max-width:1140px;margin:0 auto;padding:0 var(--pad);}
a{color:var(--azure);text-decoration:none;border-bottom:1px solid rgba(91,143,224,.3);transition:border-color .2s,color .2s;}
a:hover{color:var(--ice);border-bottom-color:var(--ice);}
a:focus-visible,button:focus-visible{outline:2px solid var(--azure);outline-offset:3px;}
p{margin:0;}
img{max-width:100%;}

/* ---------- nav ---------- */
.nav{position:relative;z-index:5;border-bottom:1px solid var(--seam);background:rgba(6,10,22,.72);backdrop-filter:blur(8px);}
/* padding-block only: these elements are also .wrap, and the shorthand was
   resetting its horizontal padding to zero — which only showed on a phone, where
   max-width and margin:auto are no longer doing the indenting instead. */
.nav-in{display:flex;align-items:center;justify-content:space-between;gap:24px;padding-block:13px;flex-wrap:wrap;}
.brand{display:flex;align-items:center;gap:14px;border:0;}
.brand:hover{border:0;}
/* Sized against the nav links, not against its own artwork — at 46px it read as a
   banner rather than a mark. MEDIA GROUP stops resolving this small and becomes
   texture, which is the right trade in a 50px-tall bar. */
.brand .lockup{display:block;height:56px;width:auto;}
@media (max-width:560px){ .brand .lockup{height:38px;} }
.nav ul{display:flex;gap:clamp(16px,2.4vw,34px);list-style:none;margin:0;padding:0;flex-wrap:wrap;}
.nav a.lnk{
  font-size:11px;letter-spacing:.26em;text-transform:uppercase;font-weight:400;
  color:var(--ash);border:0;padding:4px 0;
}
.nav a.lnk:hover,.nav a.lnk[aria-current="page"]{color:var(--marble);}
.nav a.lnk[aria-current="page"]{border-bottom:1px solid var(--azure);}

/* ---------- type ---------- */
.label{font-weight:400;font-size:10.5px;letter-spacing:.42em;text-transform:uppercase;color:var(--quiet);margin:0;}
.spec{font-family:var(--mono);font-size:10.5px;letter-spacing:.13em;text-transform:uppercase;color:var(--ash);}
h1,h2,h3{margin:0;text-wrap:balance;}
h1{font-family:var(--serif);font-weight:300;font-size:clamp(30px,5vw,58px);line-height:1.1;letter-spacing:.004em;}
h1 em{font-style:italic;color:var(--ice);}
h2{font-family:var(--serif);font-weight:300;font-size:clamp(25px,3.4vw,40px);line-height:1.16;}
h2 em{font-style:italic;color:var(--ice);}
.lede{max-width:60ch;color:var(--ash);}
.hairline{height:1px;border:0;margin:0;background:linear-gradient(90deg,rgba(91,143,224,.5) 0%,rgba(26,35,64,.9) 30%,rgba(26,35,64,0) 100%);}

/* ---------- hero ---------- */
.hero{position:relative;overflow:hidden;min-height:500px;display:flex;align-items:center;border-bottom:1px solid var(--seam);}
.hero-stage{position:absolute;inset:0;z-index:0;}
#gl{display:block;width:100%;height:100%;}
#fallback{position:absolute;inset:0;width:100%;height:100%;}
.hero::after{
  content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:
    radial-gradient(128% 94% at 72% 50%, rgba(6,10,22,0) 0%, rgba(6,10,22,.6) 58%, rgba(6,10,22,.94) 100%),
    linear-gradient(90deg, rgba(6,10,22,.93) 0%, rgba(6,10,22,.55) 46%, rgba(6,10,22,0) 74%);
}
.hero-in{position:relative;z-index:2;width:100%;padding-block:clamp(66px,10vw,128px);display:flex;flex-direction:column;gap:clamp(26px,3.4vw,40px);}
.hero h1{max-width:17ch;}
.hero-meta{display:flex;flex-wrap:wrap;gap:9px 28px;}

/* ---------- sections ---------- */
.sec{padding:var(--gap) 0;border-bottom:1px solid var(--seam);}
.sec-head{display:flex;flex-direction:column;gap:16px;margin-bottom:clamp(32px,4vw,52px);}

/* ---------- register ---------- */
.register{display:flex;flex-direction:column;gap:2px;}
.entry{
  position:relative;display:grid;
  grid-template-columns:clamp(240px,38vw,500px) minmax(0,1fr);
  gap:clamp(22px,3.4vw,52px);
  padding:clamp(26px,3.2vw,38px) clamp(18px,2.4vw,32px);
  align-items:stretch;
  background:radial-gradient(120% 180% at 0% 50%, rgba(91,143,224,.06) 0%, rgba(91,143,224,0) 46%),
             linear-gradient(180deg,var(--panel) 0%,var(--void) 100%);
  border-top:1px solid var(--seam);
}
.entry::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:2px;
  background:linear-gradient(180deg,rgba(91,143,224,0) 0%,var(--azure) 45%,rgba(91,143,224,0) 100%);
  box-shadow:0 0 16px rgba(91,143,224,.6);opacity:.85;
}
.entry:last-child{border-bottom:1px solid var(--seam);}
.entry .glyph{margin-top:3px;filter:drop-shadow(0 0 9px rgba(91,143,224,.5));}
/* Grid items default to min-width:auto, so the long mono units line set a
   min-content floor the column could not shrink below — that was the 18px of
   horizontal scroll on a phone, not the images. */
.entrybody{display:flex;flex-direction:column;gap:12px;justify-content:center;min-width:0;}
.entry .units{overflow-wrap:anywhere;}
.entry .kind{font-family:var(--mono);font-size:10.5px;letter-spacing:.16em;text-transform:uppercase;color:var(--azure);}
.entry .name{font-family:var(--serif);font-weight:300;font-size:clamp(26px,3.2vw,38px);line-height:1.05;letter-spacing:.01em;color:var(--marble);margin:0;}
.entry .role{font-size:16.5px;color:var(--ash);max-width:62ch;}
.entry .units{font-family:var(--mono);font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--navy);filter:brightness(1.75);}
/* The lore, demoted: a closing aside rather than the first thing read. */
/* Was set in --quiet, which is really a rule colour — at 15.5px italic on this
   ground it fell below readable contrast. Lifted to the body tone and up a size. */
.entry .myth{font-family:var(--serif);font-style:italic;font-size:17px;line-height:1.5;color:var(--ash);max-width:58ch;padding-top:6px;}

/* ---------- generic columns ---------- */
.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(248px,1fr));gap:clamp(24px,3.2vw,46px);}
.col{display:flex;flex-direction:column;gap:10px;}
.col h3{font-weight:400;font-size:10.5px;letter-spacing:.3em;text-transform:uppercase;color:var(--azure);}
.col p{font-size:15px;color:var(--ash);}

/* ---------- clips ---------- */
.clips{display:flex;flex-direction:column;}
.clip{display:grid;grid-template-columns:120px minmax(0,1fr);gap:clamp(14px,2.4vw,36px);padding:clamp(22px,2.6vw,30px) 0;border-bottom:1px solid var(--seam);align-items:baseline;}
.clip:first-child{border-top:1px solid var(--seam);}
.clip h3{font-size:clamp(17px,1.9vw,22px);font-weight:400;font-family:var(--serif);line-height:1.3;}
.clip p{font-size:14.5px;color:var(--ash);margin-top:7px;}

/* ---------- form ---------- */
form{display:grid;gap:18px;max-width:560px;}
label{display:grid;gap:7px;font-size:11px;letter-spacing:.24em;text-transform:uppercase;color:var(--ash);font-weight:400;}
input,textarea{
  font-family:var(--sans);font-size:16px;font-weight:300;color:var(--marble);
  background:var(--panel);border:1px solid var(--seam);padding:13px 15px;border-radius:0;
}
input:focus,textarea:focus{outline:none;border-color:var(--azure);}
textarea{min-height:150px;resize:vertical;}
button{
  font-family:var(--sans);font-size:11px;letter-spacing:.3em;text-transform:uppercase;font-weight:400;
  color:var(--void);background:var(--azure);border:0;padding:15px 30px;cursor:pointer;justify-self:start;
  transition:background .2s;
}
button:hover{background:var(--ice);}
.formnote{font-size:13.5px;color:var(--quiet);}
.ok{border-left:2px solid var(--azure);background:rgba(91,143,224,.08);padding:14px 16px;font-size:14.5px;}
.err{border-left:2px solid #C96A5A;background:rgba(201,106,90,.08);padding:14px 16px;font-size:14.5px;color:#E3A294;}

/* ---------- footer ---------- */
footer{padding:clamp(40px,5vw,66px) 0 clamp(54px,7vw,88px);}
.foot{display:flex;justify-content:space-between;gap:24px;flex-wrap:wrap;align-items:flex-end;}
.foot ul{display:flex;gap:22px;list-style:none;margin:0;padding:0;flex-wrap:wrap;}
.foot a{font-size:11px;letter-spacing:.24em;text-transform:uppercase;color:var(--ash);border:0;}
.foot a:hover{color:var(--marble);}

@media (max-width:760px){
  .entry{grid-template-columns:minmax(0,1fr);}
  .entry > *{min-width:0;max-width:100%;}
  .plateframe{min-height:0;aspect-ratio:16/10;}
  .clip{grid-template-columns:1fr;gap:6px;}
}
@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  *{animation-duration:.001ms !important;transition-duration:.001ms !important;}
}

/* ---------- long-form clips ---------- */
.prose{max-width:66ch;margin-top:clamp(26px,3.2vw,40px);display:flex;flex-direction:column;gap:20px;}
.prose p{font-size:16.5px;color:var(--ash);}
.prose h2,.prose h3{font-family:var(--serif);font-weight:300;font-size:clamp(20px,2.3vw,27px);color:var(--marble);margin-top:14px;}
.prose ul,.prose ol{color:var(--ash);padding-left:20px;display:flex;flex-direction:column;gap:8px;margin:0;}
.prose img{height:auto;border:1px solid var(--seam);}
.prose blockquote{margin:0;padding-left:18px;border-left:2px solid var(--azure);font-family:var(--serif);font-style:italic;font-size:19px;color:var(--marble);}
.prose a{word-break:break-word;}

/* ---------- system plates ---------- */
/* Big enough to actually be looked at. At 104px these compressed to abstraction;
   the picture is half the reason to stop on an entry. */
/* The plate matches the height of the text beside it. The image is taken out of
   flow inside a frame so its own proportions cannot stretch the row — otherwise a
   short entry ends up with a tall picture and a column of dead space under the copy. */
.plateframe{position:relative;align-self:stretch;min-width:0;max-width:100%;min-height:230px;border:1px solid var(--seam);overflow:hidden;}
.plateframe .plate{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;display:block;
  filter:saturate(.8) contrast(1.05);}
.workplate{
  width:100%;aspect-ratio:16/9;object-fit:cover;display:block;
  border:1px solid var(--seam);margin-bottom:clamp(22px,2.8vw,34px);
  filter:saturate(.76) contrast(1.05);
}

/* ---------- work page screenshots ---------- */
.workshot{margin-bottom:clamp(24px,3vw,38px);}
.workshot img{width:100%;height:auto;display:block;border:1px solid var(--seam);box-shadow:0 18px 48px rgba(0,0,0,.55);}
.workshot figcaption{font-family:var(--mono);font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--quiet);margin-top:10px;}

/* ---------- the machinery rail ---------- */
/* Eight screenshots stacked vertically pushed the project list two screens down.
   A rail keeps the whole proof inside one band and lets someone who wants more
   go sideways for it instead of scrolling past it. */
.sec.tight{padding-top:clamp(44px,5vw,70px);padding-bottom:clamp(40px,4.6vw,62px);}
.tight-head{margin-bottom:clamp(22px,2.6vw,32px);}

.rail{
  display:flex;gap:clamp(16px,2vw,26px);
  overflow-x:auto;overflow-y:hidden;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  /* Align the first card with the text column above it, and tell scroll-snap about
     that padding — without scroll-padding the first snap position lands past it and
     the card sits flush against the viewport edge. */
  --gutter:max(var(--pad), calc((100% - 1140px) / 2));
  padding:4px var(--gutter) 22px;
  scroll-padding-inline:var(--gutter);
  scrollbar-width:thin;scrollbar-color:var(--navy) transparent;
}
.rail::-webkit-scrollbar{height:8px;}
.rail::-webkit-scrollbar-track{background:var(--panel);}
.rail::-webkit-scrollbar-thumb{background:var(--navy);border-radius:0;}
.rail:focus-visible{outline:2px solid var(--azure);outline-offset:4px;}

.rail-card{
  flex:0 0 clamp(290px,38vw,520px);
  scroll-snap-align:start;
  margin:0;display:flex;flex-direction:column;gap:13px;
}
.rail-card img{
  width:100%;height:auto;display:block;
  border:1px solid var(--seam);
  box-shadow:0 16px 42px rgba(0,0,0,.55);
}
.rail-card figcaption{font-size:14.5px;color:var(--ash);}
.rail-card figcaption strong{color:var(--marble);font-weight:400;}
.rail-card figcaption em{font-style:normal;color:var(--ice);}
.rail-card .cap{
  font-family:var(--mono);font-size:10px;letter-spacing:.16em;text-transform:uppercase;
  color:var(--azure);display:block;margin-bottom:5px;
}
.railnote{margin-top:6px;font-size:14.5px;}

/* ---------- rail: the focused card lifts ---------- */
.sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}

.shot-open{
  display:block;position:relative;padding:0;border:0;background:none;cursor:zoom-in;
  width:100%;line-height:0;
  transition:transform .42s cubic-bezier(.16,1,.3,1), filter .42s ease, box-shadow .42s ease;
  transform:scale(.955);filter:brightness(.74) saturate(.8);
}
.shot-open img{width:100%;height:auto;display:block;border:1px solid var(--seam);}
/* The card nearest the reading edge is the one Enter will open, so it says so
   visually: full brightness, lifted, and a rim in the accent. */
.rail-card.is-current .shot-open{
  transform:scale(1) translateY(-6px);
  filter:none;
  box-shadow:0 22px 54px rgba(0,0,0,.6), 0 0 0 1px rgba(91,143,224,.55), 0 0 34px rgba(91,143,224,.22);
}
.shot-open:hover{filter:none;transform:scale(1) translateY(-6px);}
.shot-open:focus-visible{outline:2px solid var(--azure);outline-offset:5px;filter:none;}

.expand{
  position:absolute;right:11px;bottom:11px;
  display:grid;place-items:center;width:32px;height:32px;
  background:rgba(6,10,22,.78);border:1px solid rgba(91,143,224,.45);color:var(--ice);
  opacity:0;transform:translateY(5px);transition:opacity .3s ease, transform .3s ease;
}
.rail-card.is-current .expand,.shot-open:hover .expand,.shot-open:focus-visible .expand{opacity:1;transform:none;}

.rail-card figcaption{transition:color .42s ease,opacity .42s ease;opacity:.62;}
.rail-card.is-current figcaption{opacity:1;}
kbd{font-family:var(--mono);font-size:.85em;border:1px solid var(--seam);padding:1px 6px;color:var(--marble);}

/* ---------- lightbox ---------- */
/* display:grid here outranks the browser's [hidden]{display:none}, so the overlay
   stayed on screen permanently with an empty frame. Hidden has to win explicitly. */
.lightbox[hidden]{display:none !important;}
.lightbox{
  position:fixed;inset:0;z-index:200;display:grid;place-items:center;
  background:rgba(4,7,15,.94);backdrop-filter:blur(10px);
  padding:clamp(52px,6vw,80px) clamp(10px,7vw,110px) clamp(16px,6vw,80px);
  animation:lbIn .28s cubic-bezier(.16,1,.3,1);
}
@keyframes lbIn{from{opacity:0}to{opacity:1}}
.lb-stage{margin:0;display:flex;flex-direction:column;gap:16px;max-width:1500px;max-height:100%;}
.lb-stage img{
  max-width:100%;max-height:min(78vh,78dvh);object-fit:contain;display:block;
  border:1px solid var(--seam);box-shadow:0 40px 110px rgba(0,0,0,.75);
  animation:lbImg .4s cubic-bezier(.16,1,.3,1);
}
@keyframes lbImg{from{opacity:0;transform:scale(.97) translateY(10px)}to{opacity:1;transform:none}}
.lb-stage figcaption{font-size:15.5px;color:var(--ash);text-align:center;}
.lb-stage .cap{font-family:var(--mono);font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--azure);display:block;margin-bottom:6px;}
.lb-btn{
  position:absolute;background:rgba(6,10,22,.7);border:1px solid var(--seam);color:var(--marble);
  width:46px;height:46px;font-size:26px;line-height:1;cursor:pointer;display:grid;place-items:center;
  transition:border-color .2s,color .2s,background .2s;
}
.lb-btn:hover{border-color:var(--azure);color:var(--ice);background:rgba(37,67,118,.5);}
.lb-close{top:22px;right:22px;}
.lb-prev{left:18px;top:50%;transform:translateY(-50%);}
.lb-next{right:18px;top:50%;transform:translateY(-50%);}
body.lb-open{overflow:hidden;}

@media (prefers-reduced-motion: reduce){
  .shot-open,.rail-card figcaption,.expand{transition:none;}
  .shot-open{transform:none;filter:none;}
  .lightbox,.lb-stage img{animation:none;}
}
@media (max-width:640px){
  .lb-prev,.lb-next{top:auto;bottom:16px;transform:none;}
  .lb-prev{left:16px;} .lb-next{right:16px;}
}

/* ---------- the one moving card ---------- */
.shot-video{width:100%;height:auto;display:block;border:1px solid var(--seam);background:var(--panel);}
/* A clip that only plays while it is the one being read: everywhere else it is a
   still, which keeps a background video off the critical path on a phone. */
@media (prefers-reduced-motion: reduce){ .shot-video{ } }
.lb-stage video{
  max-width:100%;max-height:78vh;display:block;
  border:1px solid var(--seam);box-shadow:0 40px 110px rgba(0,0,0,.75);background:#000;
}
.lb-stage video[hidden],.lb-stage img[hidden]{display:none !important;}

@media (max-width:760px){
  /* On a phone a 16:9 capture is only ~200px tall inside the frame, which is
     unreadable. Let it use the full width and most of the height, and allow a
     pinch-zoomable scroll if the detail still needs it. */
  .lightbox{padding:48px 0 10px;align-content:center;}
  .lb-stage{width:100%;gap:10px;}
  /* Fitting a 16:9 interface capture to a 390px width leaves it ~210px tall,
     which is far too small to read. Let the image run to full height instead and
     scroll the frame sideways — the detail is the whole point of opening it. */
  .lb-stage{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;}
  /* The stage is a column flexbox, so stretch was pinning the image to the
     container width and object-fit:contain letterboxed it inside a tall empty
     box. align-self lets it take its real width and overflow into the scroll. */
  .lb-stage img{max-height:none;max-width:none;height:min(76dvh,640px);width:auto;align-self:flex-start;object-fit:fill;}
  .lb-stage video{width:100%;max-width:100%;height:auto;max-height:none;}
  .lb-stage figcaption{position:sticky;left:0;font-size:14px;padding:0 10px;}
  .lb-close{top:10px;right:10px;width:40px;height:40px;}
  .lb-prev,.lb-next{bottom:10px;width:40px;height:40px;}
}
