/* ============================================================
   PROJECT PAGE v2 — additive layer on top of style.css
   ------------------------------------------------------------
   Loaded by case-study pages built from projects/template.html (the v2 layout
   and pages built from it), after assets/style.css. Everything in
   here is new vocabulary or a scoped override; nothing in style.css
   is edited, so v1 pages are untouched.

   New components:
     .hero-v2 / .ph-copy / .ph-visual / .hero-frame  two-column hero
     .hero-status                                        pulsing status badge
     .ph-actions                                       button row
     .meta-strip                                         bordered meta grid
     .subnav / .subnav-progress                          sticky in-page nav
     .stats-section / .stat-strip / .stat-card           at-a-glance numbers
     .flow-grid / .flow-card                             operating flow as cards
     .toolbar / .filter-chips / .filter-chip             group filters
     .link-btn                                           expand / collapse all
     .cap-tag / .cap-screen                              group tag + screen link
     .stack-grid / .stack-group                          tech stack strip
     .to-top                                             back-to-top button
   ============================================================ */

/* the sticky sub-nav sits under the fixed site nav, so in-page anchors
   need more headroom than the 88px style.css reserves */
html{ scroll-padding-top:132px; }

/* ---------- HERO ---------- */
.page-hero.hero-v2{ padding-bottom:48px; }
.hero-v2 .page-hero-inner{
  max-width:1180px; margin:0 auto;
  display:grid; grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
  gap:56px; align-items:center;
}
.hero-v2 .tagline{ margin-bottom:22px; }
.hero-status{
  display:inline-flex; align-items:center; gap:8px;
  font-family:'JetBrains Mono'; font-size:11px; letter-spacing:.6px; text-transform:uppercase;
  color:var(--text); padding:6px 12px 6px 10px; border-radius:100px;
  border:1px solid rgba(79,124,255,.35); background:rgba(79,124,255,.10);
  margin-bottom:18px;
}
.hero-status i{
  width:7px; height:7px; border-radius:50%; background:var(--blue);
  box-shadow:0 0 0 0 rgba(79,124,255,.6); animation:status-ping 2.2s ease-out infinite;
}
.hero-status.is-live i{ background:#3ddc97; box-shadow:0 0 0 0 rgba(61,220,151,.6); }
@keyframes status-ping{
  0%{ box-shadow:0 0 0 0 rgba(79,124,255,.55); }
  70%{ box-shadow:0 0 0 8px rgba(79,124,255,0); }
  100%{ box-shadow:0 0 0 0 rgba(79,124,255,0); }
}
.ph-actions{ display:flex; gap:12px; flex-wrap:wrap; margin-top:26px; }
.ph-actions .btn-ghost{ backdrop-filter:blur(8px); }

/* screenshot in a browser-style frame; the whole frame is a button that
   opens the shared lightbox on the matching .gallery-item (see
   project-page.js), so there is one source of truth for the image. */
.ph-visual{ position:relative; }
.ph-visual::before{
  content:''; position:absolute; inset:-40px -30px; z-index:0; pointer-events:none;
  background:radial-gradient(ellipse 60% 55% at 50% 50%, rgba(79,124,255,.22), transparent 70%);
  filter:blur(40px);
}
.hero-frame{
  position:relative; z-index:1; display:block; width:100%; text-align:left;
  border:1px solid rgba(255,255,255,.12); border-radius:16px; overflow:hidden;
  background:linear-gradient(155deg,#141a2b,#0c0f18); cursor:zoom-in;
  box-shadow:0 30px 70px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(79,124,255,.08);
  transform:perspective(1400px) rotateY(-5deg) rotateX(2deg);
  transition:transform .5s cubic-bezier(.22,1,.36,1), border-color .3s ease, box-shadow .4s ease;
}
.hero-frame:hover{
  transform:perspective(1400px) rotateY(0) rotateX(0) translateY(-4px);
  border-color:rgba(79,124,255,.45);
  box-shadow:0 34px 80px -30px rgba(79,124,255,.45), 0 0 0 1px rgba(79,124,255,.2);
}
.hero-frame:focus-visible{ outline:2px solid var(--blue); outline-offset:3px; }
.hf-bar{
  display:flex; align-items:center; gap:5px; height:30px; padding:0 12px;
  background:rgba(10,13,20,.6); border-bottom:1px solid var(--border);
}
.hf-bar span{ width:7px; height:7px; border-radius:50%; background:#2b3350; }
.hf-bar small{
  margin-left:8px; font-family:'JetBrains Mono'; font-size:10px; letter-spacing:.3px; color:var(--muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.hf-screen{ position:relative; aspect-ratio:16/10; overflow:hidden; background:#0e1220; }
.hf-screen.wide{ aspect-ratio:21/10; }
.hf-screen img{ width:100%; height:100%; object-fit:cover; object-position:top left; display:block; }
.hf-hint{
  position:absolute; right:12px; bottom:12px; z-index:2;
  font-family:'JetBrains Mono'; font-size:10.5px; color:var(--text);
  background:rgba(10,13,20,.78); border:1px solid var(--border); border-radius:100px; padding:5px 10px;
  opacity:0; transform:translateY(6px); transition:opacity .25s ease, transform .25s ease;
}
.hero-frame:hover .hf-hint, .hero-frame:focus-visible .hf-hint{ opacity:1; transform:translateY(0); }
/* placeholder when a page has no cover screenshot yet */
.hf-screen.empty{ display:grid; place-items:center; }
.hf-screen.empty span{ font-family:'JetBrains Mono'; font-size:11.5px; color:var(--muted); letter-spacing:.5px; text-transform:uppercase; }

.meta-strip{
  grid-column:1 / -1;
  /* auto-fit so a strip with fewer cells (pages whose client/timeline are
     not public) still fills the row instead of leaving empty columns */
  display:grid; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr));
  margin-top:8px; border:1px solid var(--border); border-radius:14px; overflow:hidden;
  background:var(--surface);
}
.meta-strip .meta-item{ padding:16px 20px; border-right:1px solid var(--border); }
.meta-strip .meta-item:last-child{ border-right:0; }
.meta-strip .meta-item b{ font-size:14.5px; }

@media(max-width:1000px){
  .hero-v2 .page-hero-inner{ grid-template-columns:1fr; gap:36px; }
  .hero-frame{ transform:none; max-width:720px; }
  .ph-visual::before{ inset:-20px; }
}
@media(max-width:600px){
  .meta-strip{ grid-template-columns:repeat(2,1fr); }
  .meta-strip .meta-item{ padding:14px 16px; }
  .meta-strip .meta-item:nth-child(2n){ border-right:0; }
  .meta-strip .meta-item:nth-child(-n+2){ border-bottom:1px solid var(--border); }
  .ph-actions .btn-primary, .ph-actions .btn-ghost{ flex:1 1 auto; justify-content:center; }
}

/* ---------- STICKY SECTION NAV ---------- */
/* --nav-h is written by project-page.js from the real fixed-nav height,
   which changes when .scrolled shrinks its padding. */
.subnav{
  position:sticky; top:var(--nav-h, 62px); z-index:90;
  background:rgba(10,13,20,.78); backdrop-filter:blur(14px);
  border-bottom:1px solid var(--border);
}
.subnav-inner{
  display:flex; align-items:center; gap:2px; padding:0 6vw;
  overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
}
.subnav-inner::-webkit-scrollbar{ display:none; }
.subnav a{
  flex:none; padding:14px 13px; font-family:'JetBrains Mono'; font-size:11.5px; letter-spacing:.5px;
  text-transform:uppercase; color:var(--muted); white-space:nowrap;
  border-bottom:2px solid transparent; margin-bottom:-1px;
  transition:color .2s ease, border-color .2s ease;
}
.subnav a:hover{ color:var(--text); }
.subnav a.active{ color:var(--text); border-bottom-color:var(--blue); }
.subnav-progress{
  position:absolute; left:0; bottom:-1px; height:2px; width:var(--progress, 0%);
  background:linear-gradient(90deg, var(--blue), var(--violet)); pointer-events:none;
  transition:width .1s linear;
}
@media(max-width:600px){
  .subnav-inner{ padding:0 5vw; }
  .subnav a{ padding:12px 11px; font-size:11px; }
}

/* ---------- AT-A-GLANCE STATS ---------- */
.stats-section{ padding:40px 6vw 0; }
.stat-strip{
  max-width:1100px; margin:0 auto;
  display:grid; grid-template-columns:repeat(4,1fr); gap:14px;
}
.stat-card{
  position:relative; overflow:hidden;
  background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px 22px;
  transition:border-color .25s ease, transform .25s ease;
}
.stat-card::before{
  content:''; position:absolute; top:0; left:16px; right:16px; height:1px;
  background:linear-gradient(90deg, transparent, rgba(79,124,255,.6), transparent);
}
.stat-card:hover{ border-color:rgba(79,124,255,.35); transform:translateY(-2px); }
.stat-card b{
  display:block; font-family:'Space Grotesk'; font-weight:600; font-size:30px; line-height:1.1;
  background:linear-gradient(120deg, #e9edf7, var(--blue) 70%, var(--violet));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.stat-card span{ display:block; margin-top:6px; font-family:'JetBrains Mono'; font-size:11px; letter-spacing:.5px; text-transform:uppercase; color:var(--muted); }
@media(max-width:800px){ .stat-strip{ grid-template-columns:repeat(2,1fr); } .stats-section{ padding:28px 5vw 0; } }
@media(max-width:600px){ .stat-card{ padding:16px 18px; } .stat-card b{ font-size:26px; } }

/* ---------- OPERATING FLOW AS CARDS ---------- */
.flow-grid{
  max-width:1100px; margin:0 auto;
  display:grid; grid-template-columns:repeat(auto-fit, minmax(230px,1fr)); gap:14px;
}
.flow-card{
  position:relative; overflow:hidden;
  background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:20px;
  transition:border-color .25s ease, transform .25s ease, box-shadow .3s ease;
}
.flow-card:hover{ border-color:rgba(185,131,255,.4); transform:translateY(-3px); box-shadow:0 18px 40px -24px rgba(185,131,255,.35); }
.flow-card .wf-num{ width:30px; height:30px; font-size:12px; }
.flow-card p{ margin-top:14px; font-size:13.5px; color:var(--text); line-height:1.55; }
@media(max-width:600px){
  .flow-grid{ grid-template-columns:1fr; gap:10px; }
  .flow-card{ display:flex; gap:14px; align-items:flex-start; padding:16px; }
  .flow-card .wf-num{ flex:none; }
  .flow-card p{ margin-top:4px; }
}

/* ---------- FILTER TOOLBARS (capabilities + gallery) ---------- */
.toolbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  margin:0 auto 18px;
}
.toolbar.cap-toolbar{ max-width:900px; }
.toolbar.gallery-toolbar{ max-width:1100px; }
.filter-chips{ display:flex; gap:8px; flex-wrap:wrap; }
.filter-chip{
  font-family:'JetBrains Mono'; font-size:11.5px; padding:7px 12px; border-radius:100px;
  border:1px solid var(--border); color:var(--muted); background:transparent; cursor:pointer;
  transition:border-color .2s ease, color .2s ease, background .2s ease, transform .2s ease;
}
.filter-chip small{ font-size:10px; opacity:.7; margin-left:5px; }
.filter-chip:hover{ color:var(--text); border-color:rgba(255,255,255,.25); transform:translateY(-1px); }
.filter-chip[aria-pressed="true"]{ color:var(--text); border-color:rgba(79,124,255,.55); background:rgba(79,124,255,.12); }
.filter-chip:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
.toolbar-actions{ display:flex; align-items:center; gap:4px; }
.link-btn{
  background:none; border:0; cursor:pointer; padding:6px 8px; border-radius:8px;
  font-family:'JetBrains Mono'; font-size:11.5px; color:var(--blue);
  transition:background .2s ease, color .2s ease;
}
.link-btn:hover{ background:rgba(79,124,255,.12); color:var(--text); }
.link-btn:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
.toolbar-count{ font-family:'JetBrains Mono'; font-size:11.5px; color:var(--muted); }
@media(max-width:600px){
  .toolbar{ align-items:stretch; }
  .filter-chips{ flex-wrap:nowrap; overflow-x:auto; padding-bottom:4px; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  .filter-chips::-webkit-scrollbar{ display:none; }
  .filter-chip{ flex:none; }
}

/* filtered-out cards: the [hidden] attribute is what the JS toggles */
.cap-item[hidden], .gallery-item[hidden]{ display:none; }
.filter-empty{ text-align:center; color:var(--muted); font-size:13.5px; padding:24px 0; }
.filter-empty[hidden]{ display:none; }

/* group tag on the accordion summary; sits before the +/× indicator */
.cap-tag{
  margin-left:auto; flex:none; font-family:'JetBrains Mono'; font-style:normal; font-weight:400;
  font-size:10px; letter-spacing:.4px; text-transform:uppercase; color:var(--muted);
  border:1px solid var(--border); border-radius:100px; padding:3px 9px; white-space:nowrap;
}
@media(max-width:640px){ .cap-tag{ display:none; } }

/* "See this screen" link inside an accordion body -> opens the lightbox
   on the gallery item whose data-screen matches (project-page.js) */
.cap-screen{
  display:inline-flex; align-items:center; gap:6px; margin-top:14px;
  font-family:'JetBrains Mono'; font-size:11.5px; color:var(--blue);
  border:1px solid rgba(79,124,255,.3); border-radius:100px; padding:6px 12px;
  transition:background .2s ease, border-color .2s ease, transform .2s ease;
}
.cap-screen:hover{ background:rgba(79,124,255,.12); border-color:rgba(79,124,255,.55); transform:translateY(-1px); }

/* ---------- TECH STACK STRIP ---------- */
.stack-grid{
  max-width:900px; margin:0 auto 28px;
  display:grid; grid-template-columns:repeat(auto-fit, minmax(200px,1fr)); gap:14px;
}
.stack-group{
  background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:18px;
  transition:border-color .25s ease;
}
.stack-group:hover{ border-color:rgba(79,124,255,.3); }
.stack-group h4{
  font-family:'JetBrains Mono'; font-weight:500; font-size:11px; letter-spacing:.5px; text-transform:uppercase;
  color:var(--violet); margin-bottom:12px;
}
.stack-group .pill-row{ gap:6px; }
.stack-group .pill{ font-size:11px; padding:4px 10px; }
.stack-group .pill.planned{ border-style:dashed; opacity:.75; }

/* ---------- BACK TO TOP ---------- */
/* bottom-left on purpose: the chat widget launcher owns bottom-right */
.to-top{
  position:fixed; left:18px; bottom:18px; z-index:80;
  width:42px; height:42px; border-radius:50%; cursor:pointer;
  display:grid; place-items:center; font-size:16px; color:var(--text);
  background:rgba(10,13,20,.85); border:1px solid var(--border); backdrop-filter:blur(10px);
  opacity:0; pointer-events:none; transform:translateY(8px);
  transition:opacity .25s ease, transform .25s ease, border-color .2s ease;
}
.to-top.visible{ opacity:1; pointer-events:auto; transform:none; }
.to-top:hover{ border-color:rgba(79,124,255,.5); }
.to-top:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
@media(max-width:600px){ .to-top{ left:12px; bottom:12px; width:38px; height:38px; } }

/* ---------- SECTION SPACING TWEAKS ---------- */
/* the hero already carries a lot of context, so the first content
   section (stats strip + overview) can sit a little tighter */
.stats-section + section{ padding-top:56px; }
@media(max-width:600px){ .stats-section + section{ padding-top:44px; } }

@media(prefers-reduced-motion:reduce){
  .hero-frame, .hero-frame:hover{ transform:none; }
  .hero-status i{ animation:none; }
}

/* ---------- HERO WITHOUT A COVER SCREENSHOT ----------
   Pages whose gallery is still placeholders have no .ph-visual, so the
   two-column grid would leave an empty right half. Collapse to one
   column and keep the copy readable rather than stretched. */
.hero-v2.hero-solo .page-hero-inner{ grid-template-columns:1fr; gap:0; }
.hero-v2.hero-solo .ph-copy{ max-width:820px; }
