/* ============================================================
   OpenDev — /work + case study pages
   Builds on /styles.css (tokens, nav, buttons, cursor, loader,
   page transition). Only new patterns live here.
   ============================================================ */

:root {
  /* Tokens reused from styles.css — named here for the new components */
  --glow-weak: rgba(78, 195, 255, 0.08);
  --glow-mid: rgba(78, 195, 255, 0.35);
  --glow-strong: rgba(78, 195, 255, 0.6);
  --card-bg: rgba(8, 14, 26, 0.58);
  --notch: 12px;
  --notch-path: polygon(
    var(--notch) 0, 100% 0, 100% calc(100% - var(--notch)),
    calc(100% - var(--notch)) 100%, 0 100%, 0 var(--notch)
  );
  --ease-out: cubic-bezier(0.22, 0.85, 0.25, 1);
  --wrap-pad: 56px;
}

/* ---------- Page shell ---------- */

.work-page {
  overflow-x: hidden;
}

/* Same HUD dot grid + glow the homepage sections use, fixed behind the page */
.work-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 1px 1px, rgba(78, 195, 255, 0.07) 1px, transparent 1.5px),
    radial-gradient(ellipse at 70% 0%, rgba(78, 195, 255, 0.09) 0%, transparent 55%),
    linear-gradient(to bottom, var(--bg-deep), var(--bg));
  background-size: 28px 28px, 100% 100%, 100% 100%;
}

.w-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding-left: var(--wrap-pad);
  padding-right: var(--wrap-pad);
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

/* ---------- Focus states (clip-path hides outlines, so use inset rings) ---------- */

.work-page a:focus-visible,
.work-page button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 4px;
}
.work-page .btn-clip:focus-visible,
.work-page .nav-toggle:focus-visible,
.work-page .chip:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 18px var(--glow-mid);
}

/* ---------- Top bar: fixed over the page ---------- */

.work-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(1, 3, 10, 0.85) 0%, rgba(1, 3, 10, 0) 100%);
  transition: transform 0.4s var(--ease-out), background 0.3s ease;
}
.work-topbar.is-hidden { transform: translateY(-100%); }
.work-topbar.is-solid {
  background: rgba(2, 6, 15, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--line-soft);
}
body.nav-open .work-topbar { transform: none; }

/* ---------- Boot loader (once per session) ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  background: radial-gradient(ellipse at center, var(--glow-weak) 0%, transparent 60%), var(--bg-deep);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
html.show-boot .boot { display: grid; }
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---------- Cursor: VIEW bubble over cards ---------- */

.cursor-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  color: var(--bg);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.25s var(--ease-out);
}
.cursor-ring.is-view {
  --size: 88px;
  background: var(--accent);
  border-color: var(--accent);
  mix-blend-mode: normal;
}
.cursor-ring.is-view .cursor-label { opacity: 1; transform: none; }
.cursor-ring.is-view + .cursor-dot { opacity: 0; }

/* ---------- Shared bits: terminal line, chips, status ---------- */

.terminal {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--accent);
  text-shadow: 0 0 10px var(--glow-strong);
  text-transform: uppercase;
}
.terminal-lg { font-size: clamp(14px, 1.6vw, 20px); }
.terminal-prefix { color: var(--ink); }
.terminal-cursor {
  display: inline-block;
  margin-left: 2px;
  animation: pt-blink 0.9s steps(2) infinite;
}

.chip {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-dim);
  padding: 6px 10px;
  box-shadow: inset 0 0 0 1px var(--line);
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  padding: 6px 10px;
  background: rgba(2, 6, 15, 0.82);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--ink-dim);
}
.status-live::before { background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pillar-pulse 2.4s ease-in-out infinite; }
.status-live { color: var(--accent); }
.status-concept::before { background: transparent; box-shadow: inset 0 0 0 1px var(--ink-dim); }
.status-progress::before { background: var(--ink); animation: pt-blink 1.2s steps(2) infinite; }

/* ---------- Hero ---------- */

.w-hero {
  padding-top: clamp(130px, 18vh, 200px);
  padding-bottom: clamp(48px, 7vw, 90px);
}
.w-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: clamp(28px, 4vw, 56px);
}
.w-hero-top .section-index { min-width: 220px; }

.w-hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 10.5vw, 168px);
  line-height: 0.92;
  letter-spacing: -0.005em;
  text-transform: uppercase;
  color: var(--ink);
}
.w-line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.w-line-inner { display: inline-block; }
.w-line:nth-child(2) { padding-left: clamp(0px, 8vw, 140px); }

.w-hero-foot {
  margin-top: clamp(28px, 4vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 520px) auto;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
}
.w-hero-sub {
  font-size: clamp(17px, 1.35vw, 21px);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-dim);
}

/* ---------- Filters ---------- */

.w-filters-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  padding-bottom: 18px;
  border-top: 1px solid var(--line-soft);
  margin-bottom: clamp(28px, 4vw, 48px);
}
.w-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.w-filters .chip {
  font-size: 11px;
  padding: 11px 14px;
  min-height: 40px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.w-filters .chip:hover { color: var(--ink); background: var(--glow-weak); }
.w-filters .chip[aria-pressed="true"] {
  color: var(--bg);
  background: #f5fbff;
  box-shadow: 0 0 18px var(--glow-mid);
}
.w-count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* ---------- Media (shared by featured, cards, gallery) ---------- */

.media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--card-bg);
  clip-path: var(--notch-path);
}
.media img,
.media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease-out), opacity 0.4s ease;
}
.media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  pointer-events: none;
}
/* Recordings sit over the still; cards fade them in on hover */
.card-link .media video { opacity: 0; }
.card-link .media.is-playing video { opacity: 1; }
.card-link .media.is-playing img { transform: none; }

/* Placeholder until real assets are dropped into /assets/work */
.media.is-missing img,
.media.is-missing video { opacity: 0; }
.media.is-missing {
  background:
    radial-gradient(circle at 1px 1px, rgba(78, 195, 255, 0.14) 1px, transparent 1.5px) 0 0 / 18px 18px,
    radial-gradient(ellipse at 30% 20%, rgba(78, 195, 255, 0.16), transparent 60%),
    var(--card-bg);
}
.media.is-missing::before {
  content: attr(data-placeholder);
  position: absolute;
  left: 18px;
  bottom: 16px;
  max-width: calc(100% - 190px);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  word-break: break-all;
  text-transform: uppercase;
}

/* ---------- Featured case ---------- */

.w-featured {
  display: block;
  position: relative;
  margin-bottom: clamp(56px, 8vw, 110px);
}
.w-featured .media { aspect-ratio: 21 / 9; }
.w-featured .media-inner {
  position: absolute;
  inset: -4%;
  will-change: transform;
}
.w-featured-info {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: start;
  padding-top: 26px;
}
.w-featured-kicker {
  position: absolute;
  top: 22px;
  left: 26px;
  z-index: 2;
  display: flex;
  gap: 10px;
  align-items: center;
}
.w-featured-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 6vw, 92px);
  line-height: 0.95;
  text-transform: uppercase;
  will-change: transform;
}
.w-featured .card-outcome { max-width: 46ch; font-size: clamp(16px, 1.3vw, 19px); }

/* ---------- Project grid (asymmetric, 12 cols) ---------- */

.w-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2.4vw, 36px);
  row-gap: clamp(48px, 6vw, 88px);
  align-items: start;
  grid-auto-flow: dense;
  margin-bottom: clamp(80px, 10vw, 140px);
}
.card.span-7 { grid-column: span 7; }
.card.span-5 { grid-column: span 5; }
.card.span-4 { grid-column: span 4; }
.card.span-6 { grid-column: span 6; }
.card.is-offset { margin-top: clamp(40px, 7vw, 120px); }
.card.is-hidden { display: none; }

.card-link {
  display: block;
  color: inherit;
}
.card-link .media img { transform: scale(1.001); }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.card-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--accent);
}
.card-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(20px, 1.9vw, 30px);
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--ink);
  flex: 1;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.card-year {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
}
.card-client {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 12px 0 10px;
}
.card-outcome {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-dim);
  max-width: 52ch;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.card-status {
  position: absolute;
  top: 16px;
  left: 18px;
  z-index: 2;
}

/* "VIEW CASE →" reveal */
.card-cta {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.3em;
  padding: 11px 14px;
  background: #f5fbff;
  color: var(--bg);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.4s var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .card-link:hover .media img,
  .w-featured:hover .media img { transform: scale(1.06); }
  .card-link:hover .card-cta,
  .card-link:focus-visible .card-cta,
  .w-featured:hover .card-cta { opacity: 1; transform: none; }
  .card-link:hover .card-name,
  .w-featured:hover .w-featured-name {
    color: var(--accent);
    text-shadow: 0 0 18px var(--glow-mid);
  }
}
.card-link:focus-visible .card-cta { opacity: 1; transform: none; }

/* Touch: no hover-only info — the CTA is always visible */
@media (hover: none), (pointer: coarse) {
  .card-cta { opacity: 1; transform: none; padding: 9px 12px; font-size: 10px; }
}

/* ---------- Capabilities marquee ---------- */

.w-marquee {
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: clamp(22px, 3vw, 36px) 0;
  background: rgba(1, 3, 10, 0.6);
}
.w-marquee-track {
  display: flex;
  width: max-content;
  animation: w-marquee 32s linear infinite;
}
.w-marquee:hover .w-marquee-track { animation-play-state: paused; }
.w-marquee-group {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
  padding-right: clamp(20px, 3vw, 44px);
  flex-shrink: 0;
}
.w-marquee span {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 4.6vw, 64px);
  letter-spacing: 0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(233, 243, 255, 0.55);
  white-space: nowrap;
}
.w-marquee span:nth-of-type(odd) {
  color: var(--ink);
  -webkit-text-stroke: 0;
}
.w-marquee i {
  font-style: normal;
  color: var(--accent);
  font-size: clamp(20px, 3vw, 40px);
  text-shadow: 0 0 12px var(--glow-strong);
}
@keyframes w-marquee {
  to { transform: translateX(-50%); }
}

/* ---------- Numbers ---------- */

.w-numbers {
  padding-top: clamp(80px, 10vw, 140px);
  padding-bottom: clamp(80px, 10vw, 140px);
}
.w-numbers .section-index { max-width: 260px; margin-bottom: clamp(32px, 4vw, 56px); }
.w-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.w-stat {
  position: relative;
  padding: 26px 24px 30px;
  background: var(--card-bg);
  box-shadow: inset 0 0 0 1px var(--line);
  clip-path: var(--notch-path);
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 14px;
  min-height: 168px;
}
.w-stat dt {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.w-stat dd {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 4.6vw, 72px);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.w-stat-suffix { color: var(--accent); text-shadow: 0 0 18px var(--glow-mid); }
.w-stat-prefix { font-size: 0.4em; letter-spacing: 0.2em; color: var(--ink-dim); vertical-align: 0.6em; }
.w-stat dd.w-stat-text { font-size: clamp(22px, 2.2vw, 32px); line-height: 1.15; letter-spacing: 0.04em; }

/* ---------- CTA ---------- */

.w-cta {
  padding-top: clamp(80px, 10vw, 140px);
  padding-bottom: clamp(80px, 10vw, 140px);
  border-top: 1px solid var(--line-soft);
}
.w-cta .section-index { max-width: 260px; margin-bottom: 32px; }
.w-cta-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 9vw, 140px);
  line-height: 0.95;
  text-transform: uppercase;
  margin-bottom: 26px;
}
.w-cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 44px;
}
.w-cta-actions .btn-clip { padding: 18px 26px; }
.w-cta-actions .meta-email { font-size: clamp(16px, 1.4vw, 20px); }

/* ---------- Footer ---------- */

.w-footer { border-top: 1px solid var(--line-soft); }
.w-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 36px;
  padding-bottom: 28px;
}
.w-footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.w-footer .bottombar { background: none; padding-bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px)); }

.w-noscript { color: var(--ink-dim); padding: 40px 0; }

/* ============================================================
   Case study
   ============================================================ */

.c-hero {
  padding-top: clamp(130px, 18vh, 200px);
  padding-bottom: clamp(40px, 5vw, 72px);
}
.c-back {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-dim);
  text-transform: uppercase;
  min-height: 44px;
  transition: color 0.2s ease, gap 0.2s ease;
}
.c-back:hover { color: var(--accent); gap: 14px; }
.c-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin: 28px 0 clamp(24px, 3vw, 40px);
}
.c-hero-top .section-index { min-width: 220px; }
.c-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(44px, 9.5vw, 150px);
  line-height: 0.92;
  text-transform: uppercase;
}
.c-client {
  font-size: clamp(17px, 1.35vw, 21px);
  font-weight: 500;
  color: var(--ink-dim);
  margin-top: 18px;
}
.c-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: clamp(32px, 4vw, 56px);
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}
.c-meta dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.c-meta dd {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.c-cover { margin-bottom: clamp(64px, 8vw, 120px); }
.c-cover .media { aspect-ratio: 21 / 9; }

.c-block {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 80px;
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--line-soft);
}
.c-block .section-index { align-self: start; position: sticky; top: 110px; }
.c-block p {
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  max-width: 34em;
}
.c-block p + p { margin-top: 18px; }
.c-stack { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.c-stack .chip { font-size: 11px; padding: 9px 13px; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(78, 195, 255, 0.4); background: var(--glow-weak); }

.c-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(18px, 2vw, 30px);
  padding-top: clamp(48px, 6vw, 80px);
  padding-bottom: clamp(48px, 6vw, 80px);
  border-top: 1px solid var(--line-soft);
}
.c-gallery .section-index { grid-column: 1 / -1; max-width: 260px; margin-bottom: 12px; }
.c-gallery figure { grid-column: span 6; }
.c-gallery figure:first-of-type { grid-column: 1 / -1; }
.c-gallery figure:nth-of-type(3) { margin-top: clamp(40px, 6vw, 100px); }
.c-gallery figcaption {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-top: 12px;
}

.c-incoming {
  padding-top: clamp(64px, 9vw, 130px);
  padding-bottom: clamp(64px, 9vw, 130px);
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 22px;
}
.c-incoming .terminal { font-size: clamp(16px, 2.4vw, 28px); }
.c-incoming p:not(.terminal) { color: var(--ink-dim); max-width: 52ch; font-size: 17px; line-height: 1.5; }

.c-next {
  display: block;
  padding-top: clamp(64px, 9vw, 130px);
  padding-bottom: clamp(64px, 9vw, 130px);
  border-top: 1px solid var(--line-soft);
}
.c-next-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.35em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.c-next-name {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
  margin-top: 16px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(40px, 8vw, 128px);
  line-height: 0.95;
  text-transform: uppercase;
  transition: color 0.25s ease, text-shadow 0.25s ease;
}
.c-next-arrow { color: var(--accent); transition: transform 0.4s var(--ease-out); display: inline-block; }
.c-next:hover .c-next-name { color: var(--accent); text-shadow: 0 0 24px var(--glow-mid); }
.c-next:hover .c-next-arrow { transform: translateX(16px); }

/* ============================================================
   Motion: elements GSAP reveals start hidden only when GSAP
   is actually running (html.has-gsap is set by work.js)
   ============================================================ */

html.has-gsap .reveal { opacity: 0; transform: translateY(40px); }

@media (prefers-reduced-motion: reduce) {
  .w-marquee-track { animation: none; }
  .terminal-cursor,
  .status::before { animation: none !important; }
  .media img, .media video, .card-cta, .c-next-arrow { transition: none !important; }
  html.has-gsap .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   Responsive — mobile first collapse
   ============================================================ */

@media (max-width: 1100px) {
  :root { --wrap-pad: 40px; }
  .card.span-7, .card.span-5, .card.span-4 { grid-column: span 6; }
  .card.is-offset { margin-top: 0; }
  .card:nth-child(even of :not(.is-hidden)) { margin-top: clamp(32px, 5vw, 64px); }
  .w-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-block { grid-template-columns: 200px minmax(0, 1fr); gap: 48px; }
}

@media (max-width: 760px) {
  :root { --wrap-pad: 22px; }

  .w-hero-foot { grid-template-columns: 1fr; }
  .w-line:nth-child(2) { padding-left: 0; }

  /* Filters: one row that scrolls sideways */
  .w-filters-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-left: 0;
    padding-right: 0;
  }
  .w-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--wrap-pad);
    padding: 2px var(--wrap-pad);
    scrollbar-width: none;
  }
  .w-filters::-webkit-scrollbar { display: none; }
  .w-filters .chip { scroll-snap-align: start; flex-shrink: 0; }
  .w-count { padding: 0 var(--wrap-pad); }

  .w-featured .media { aspect-ratio: 16 / 10; }
  .w-featured-info { grid-template-columns: 1fr; gap: 14px; }

  .w-grid { grid-template-columns: 1fr; row-gap: 56px; }
  .card.span-7, .card.span-5, .card.span-4, .card.span-6 { grid-column: 1 / -1; }
  .card.is-offset,
  .card:nth-child(even of :not(.is-hidden)) { margin-top: 0; }

  .w-stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .w-stat { min-height: 132px; padding: 20px 18px 22px; }
  .w-stat dt { font-size: 10px; letter-spacing: 0.25em; }

  .w-cta-actions { flex-direction: column; align-items: stretch; }
  .w-cta-actions .btn-clip { justify-content: center; }
  .w-cta-actions .meta-email { align-self: center; }

  .w-footer-top { flex-direction: column; align-items: flex-start; }

  .c-meta { grid-template-columns: 1fr 1fr; }
  .c-cover .media { aspect-ratio: 16 / 10; }
  .c-block { grid-template-columns: 1fr; gap: 20px; }
  .c-block .section-index { position: static; max-width: 260px; }
  .c-gallery figure,
  .c-gallery figure:first-of-type { grid-column: 1 / -1; }
  .c-gallery figure:nth-of-type(3) { margin-top: 0; }
}

@media (max-width: 420px) {
  .w-stats { grid-template-columns: 1fr; }
}

/* ---------- Floating back button ---------- */

.back-btn {
  position: fixed;
  left: max(24px, env(safe-area-inset-left));
  bottom: max(24px, calc(env(safe-area-inset-bottom) + 12px));
  z-index: 18;
  background: rgba(2, 6, 15, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
}
.back-btn.is-shown { opacity: 1; pointer-events: auto; transform: none; }
.back-btn.is-shown:hover { transform: translateY(-1px); background: rgba(78, 195, 255, 0.12); }
.back-btn:focus-visible { opacity: 1; pointer-events: auto; transform: none; }
@media (max-width: 640px) {
  .back-btn { left: 16px; bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px)); }
}
