/* ==========================================================================
   work.css — the showcase surface.
   Extends styles.css (the committed dark blueprint world). Loaded after it.
   Signature device: the System Cutaway — a shipped system, opened up.
   ========================================================================== */

:root {
  --cut-gap: 1px;
  --ease-mech: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   Page opening — deliberately NOT the centered kicker/headline/paragraph
   pattern the rest of the site over-uses.
   -------------------------------------------------------------------------- */

.work-top { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 4vw, 3rem); }

.work-top-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.82fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: end;
}

.work-top h1 {
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  letter-spacing: -0.04em;
  text-wrap: balance;
  margin-bottom: 1rem;
}
.work-top h1 .accent { color: var(--teal); }

.work-top .lead { margin-bottom: 0; max-width: 32rem; }

.work-counts {
  list-style: none;
  display: grid;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink-faint);
  border-left: 1px solid var(--line-2);
  padding-left: 1.2rem;
}
.work-counts b { color: var(--ink); font-weight: 500; }
.work-counts .n { color: var(--teal); }

/* --------------------------------------------------------------------------
   Status taxonomy. Green marks a live system and nothing else.
   -------------------------------------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px; height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--ink-faint);
}

.status--live::before {
  background: var(--green);
  box-shadow: 0 0 9px rgba(61, 220, 132, 0.85);
}
.status--live .lit { color: var(--green); }

.status--interactive { color: var(--teal); }
.status--interactive::before {
  background: transparent;
  border: 1.5px solid var(--teal);
  border-radius: 2px;
}

.status--study::before {
  background: transparent;
  border: 1px solid var(--ink-faint);
  border-radius: 1px;
}

/* --------------------------------------------------------------------------
   Filter bar
   -------------------------------------------------------------------------- */

.filterbar {
  position: sticky;
  top: 68px;
  z-index: 30;
  background: rgba(6, 15, 31, 0.86);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0;
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}
.filterbar-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.chips { display: flex; gap: 0.45rem; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-dim);
  background: rgba(122, 162, 194, 0.05);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.42rem 0.9rem;
  cursor: pointer;
  transition: color 0.18s var(--ease-mech), border-color 0.18s var(--ease-mech), background 0.18s var(--ease-mech);
}
.chip:hover { color: var(--ink); border-color: rgba(52, 195, 207, 0.5); }
.chip[aria-pressed="true"] {
  color: #041018;
  background: var(--teal);
  border-color: var(--teal);
}

.filter-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  min-width: 13rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.filter-search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(52, 195, 207, 0.16); }
.filter-search svg { width: 15px; height: 15px; color: var(--ink-faint); flex: none; }
.filter-search input {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--ink);
  background: none;
  border: 0;
  outline: none;
  width: 100%;
  padding: 0.28rem 0;
}
.filter-search input::placeholder { color: var(--ink-faint); }

.result-count {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-faint);
  width: 100%;
}
.result-count b { color: var(--teal); font-weight: 500; }

/* --------------------------------------------------------------------------
   Tier sections
   -------------------------------------------------------------------------- */

.tier { padding: 0 0 clamp(3rem, 7vw, 5.5rem); }
.tier[hidden] { display: none; }

.tier-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  padding-bottom: 1.4rem;
  margin-bottom: clamp(1.8rem, 4vw, 2.8rem);
  border-bottom: 1px solid var(--line-2);
}
.tier-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.tier-head .tier-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ink-faint);
  margin-left: auto;
  max-width: 34rem;
}

/* --------------------------------------------------------------------------
   THE SYSTEM CUTAWAY
   A shipped system with its layers pulled apart: the public surface, the
   operating surface behind it, and what it produces.
   Rest = stacked. In view = separated. No hover dependency (touch parity).
   -------------------------------------------------------------------------- */

.cut {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(1.5rem, 4vw, 3.2rem);
  align-items: center;
  padding: clamp(1.6rem, 3vw, 2.4rem) 0;
}
.cut + .cut { border-top: 1px solid var(--line); margin-top: clamp(1.5rem, 3vw, 2.5rem); }
.cut--flip .cut-body { order: 2; }

.cut-body { min-width: 0; }
.cut-body h3 {
  font-size: clamp(1.5rem, 2.8vw, 2.05rem);
  letter-spacing: -0.03em;
  margin: 0.7rem 0 0.75rem;
}
.cut-outcome {
  color: var(--ink-dim);
  font-size: 1.02rem;
  max-width: 36rem;
  margin-bottom: 1.3rem;
}

/* mono fact docket — key/value, the "spec sheet" voice */
.docket {
  list-style: none;
  border-top: 1px solid var(--line);
  margin-bottom: 1.4rem;
}
.docket li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.docket dt, .docket .k {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}
.docket .v { color: var(--ink-dim); font-size: 0.93rem; line-height: 1.55; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.5rem; }
.tags li {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-dim);
  background: rgba(122, 162, 194, 0.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.24rem 0.6rem;
}

.cut-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn-sm { padding: 0.62rem 1.15rem; font-size: 0.86rem; }

/* --- the stage --- */

.cut-stage {
  position: relative;
  min-width: 0;
  aspect-ratio: 16 / 11;
}

.layers { list-style: none; position: absolute; inset: 0; }

.layer {
  position: absolute;
  transition: transform 0.52s var(--ease-mech), opacity 0.4s var(--ease-mech);
  will-change: transform;
}
.layer .ap {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.55);
}
.layer img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top center;
}
/* The label rides inside its own aperture, bottom-right — the one corner that
   stays visible on every layer no matter how they overlap. */
.layer-label {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  background: rgba(6, 15, 31, 0.86);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.18rem 0.6rem;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.35s var(--ease-mech) 0.22s;
}
.layer-label b { color: var(--teal); font-weight: 400; }

/* Layers sit at their FINAL, fanned-out coordinates. At rest a transform
   collapses them back onto the front layer; opening simply removes it.

   Order matters below: the variant rest-states are declared FIRST and the
   is-open rule LAST at equal specificity, so "open" always wins the tie.
   (Declaring the two-layer variant after is-open silently outranked it and
   the cutaway never opened.) */
.layer[data-i="0"] { width: 54%; left: 0;   top: 30%; z-index: 3; }
.layer[data-i="1"] { width: 49%; left: 26%; top: 15%; z-index: 2; opacity: 0.55; transform: translate3d(-30%, 40%, 0); }
.layer[data-i="2"] { width: 45%; left: 52%; top: 0;   z-index: 1; opacity: 0.32; transform: translate3d(-64%, 88%, 0); }

/* two-layer variant — each layer gets more room */
.cut-stage[data-layers="2"] .layer[data-i="0"] { width: 58%; left: 0;   top: 26%; }
.cut-stage[data-layers="2"] .layer[data-i="1"] { width: 54%; left: 40%; top: 0; transform: translate3d(-46%, 56%, 0); }

/* open — must outrank every rest-state rule above */
.cut-stage.is-open .layer[data-i] { transform: none; opacity: 1; }
.cut-stage.is-open .layer-label { opacity: 1; }

/* --------------------------------------------------------------------------
   Interactive builds — medium density, one screenshot each
   -------------------------------------------------------------------------- */

.builds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4rem; }

.build {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.22s var(--ease-mech), transform 0.22s var(--ease-mech), box-shadow 0.22s var(--ease-mech);
}
.build:hover, .build:focus-within {
  border-color: rgba(52, 195, 207, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.build[hidden] { display: none; }

.build-shot {
  position: relative;
  display: block;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  overflow: hidden;
}
.build-shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s var(--ease-mech);
}
.build:hover .build-shot img { transform: scale(1.022); }

/* the second surface, revealed on hover/focus — never carries essential text */
.build-shot .alt {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transition: opacity 0.4s var(--ease-mech);
}
.build-shot .peek {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
  background: rgba(6, 15, 31, 0.82);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  backdrop-filter: blur(6px);
  transition: color 0.3s var(--ease-mech), border-color 0.3s var(--ease-mech);
}
.build:hover .build-shot .peek, .build:focus-within .build-shot .peek {
  color: var(--teal);
  border-color: rgba(52, 195, 207, 0.5);
}
.build:hover .build-shot .alt, .build:focus-within .build-shot .alt { opacity: 1; }

.build-body { padding: 1.25rem 1.35rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.build-body h3 { font-size: 1.16rem; margin: 0.55rem 0 0.45rem; }
.build-body p { color: var(--ink-dim); font-size: 0.94rem; line-height: 1.62; margin-bottom: 1rem; }
.build-body .tags { margin-bottom: 1rem; }
.build-foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.1rem; }
.build-link {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  color: var(--teal);
}
.build-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.build-link .ext { opacity: 0.7; }
.build-note { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-faint); }

/* an honest, quiet disclosure line under concept work */
.disclose {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--ink-faint);
  border-left: 1px solid var(--line-2);
  padding-left: 0.9rem;
  margin-bottom: 1.6rem;
  max-width: 46rem;
}

/* variant strip — A/B/C directions inside one project */
.variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; }
.variants--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.variant { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); transition: border-color 0.2s ease; }
.variant:hover { border-color: rgba(52, 195, 207, 0.55); }
.variant img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: top center; }
.variant span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-faint);
  padding: 0.45rem 0.6rem;
  border-top: 1px solid var(--line);
}
.variant:hover span { color: var(--teal); }

/* --------------------------------------------------------------------------
   Design studies — denser. These prove range, not outcomes.
   -------------------------------------------------------------------------- */

.studies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }

.study {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.22s var(--ease-mech), transform 0.22s var(--ease-mech);
}
.study:hover { border-color: rgba(52, 195, 207, 0.45); transform: translateY(-3px); }
.study[hidden] { display: none; }
.study img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top center;
  border-bottom: 1px solid var(--line);
}
.study-body { padding: 0.9rem 1rem 1.05rem; display: flex; flex-direction: column; flex: 1; }
.study-tag { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); }
.study-body h3 { font-size: 1rem; margin: 0.3rem 0 0.35rem; }
.study-body p { color: var(--ink-dim); font-size: 0.88rem; line-height: 1.55; }
.study-body .go {
  margin-top: auto;
  padding-top: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  color: var(--teal);
}
.study:hover .go { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Homepage capability cards — each claim carries a link to the thing that
   proves it. A capability with no proof line doesn't belong on the page.
   -------------------------------------------------------------------------- */

.card-proof {
  display: block;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--ink-faint);
}
.card-proof a { color: var(--teal); }
.card-proof a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cards .card { display: flex; flex-direction: column; }
.cards .card p { margin-bottom: 1.1rem; }

/* homepage proof strip — three live systems, compact */
.proof-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.proof-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.22s var(--ease-mech), transform 0.22s var(--ease-mech);
}
.proof-card:hover { border-color: rgba(52, 195, 207, 0.5); transform: translateY(-3px); }
.proof-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: top center;
  border-bottom: 1px solid var(--line);
}
.proof-body { padding: 1rem 1.15rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.proof-body h3 { font-size: 1.02rem; margin: 0.45rem 0 0.35rem; }
.proof-body p { color: var(--ink-dim); font-size: 0.89rem; line-height: 1.55; }
.proof-body .go {
  margin-top: auto; padding-top: 0.85rem;
  font-family: var(--font-mono); font-size: 0.79rem; color: var(--teal);
}
.proof-card:hover .go { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 820px) { .proof-strip { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Capability cross-reference
   -------------------------------------------------------------------------- */

.xref { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.xref-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 1.5rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.xref-row:last-child { border-bottom: 0; }
.xref-need { color: var(--ink); font-size: 0.98rem; }
.xref-proof { font-family: var(--font-mono); font-size: 0.84rem; color: var(--ink-faint); }
.xref-proof a { color: var(--teal); }
.xref-proof a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* empty state for a filter that matches nothing */
.no-results {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}
.no-results button {
  font: inherit;
  color: var(--teal);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Case-study page
   -------------------------------------------------------------------------- */

.cs-top { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.breadcrumb { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint); margin-bottom: 1.6rem; }
.breadcrumb a { color: var(--ink-dim); }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb .sep { color: var(--line-2); margin: 0 0.45rem; }

.cs-top h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  letter-spacing: -0.04em;
  text-wrap: balance;
  margin: 0.9rem 0 1rem;
  max-width: 22ch;
}
.cs-deck { font-size: clamp(1.02rem, 1.5vw, 1.15rem); color: var(--ink-dim); max-width: 44rem; margin-bottom: 1.8rem; }
.cs-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-bottom: 2.5rem; }

.cs-docket {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.cs-docket > div { padding: 1.1rem 1.3rem; border-right: 1px solid var(--line); }
.cs-docket > div:last-child { border-right: 0; }
.cs-docket .k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.4rem;
}
.cs-docket .v { color: var(--ink-dim); font-size: 0.93rem; line-height: 1.5; }

.prose { max-width: 40rem; }
.prose h2 { font-size: clamp(1.5rem, 2.8vw, 2rem); margin-bottom: 1rem; }
.prose h3 { font-size: 1.12rem; margin: 2rem 0 0.6rem; }
.prose p { color: var(--ink-dim); margin-bottom: 1.1rem; }
.prose ul { color: var(--ink-dim); margin: 0 0 1.2rem 0; list-style: none; }
.prose ul li { position: relative; padding-left: 1.3rem; margin-bottom: 0.55rem; line-height: 1.6; }
.prose ul li::before { content: "›"; position: absolute; left: 0; color: var(--teal); font-family: var(--font-mono); }
.prose strong { color: var(--ink); font-weight: 600; }

/* two-journey diagram */
.journeys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.journey { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.4rem 1.5rem 1.5rem; }
.journey h3 { font-size: 1.02rem; margin-bottom: 0.3rem; }
.journey .who { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal); margin-bottom: 1.1rem; }
.journey ol { list-style: none; counter-reset: step; }
.journey li {
  counter-increment: step;
  position: relative;
  padding-left: 2.1rem;
  padding-bottom: 1.05rem;
  color: var(--ink-dim);
  font-size: 0.93rem;
  line-height: 1.5;
}
.journey li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--teal);
}
.journey li::after {
  content: "";
  position: absolute;
  left: 0.42rem; top: 1.25rem; bottom: 0.25rem;
  width: 1px;
  background: var(--line-2);
}
.journey li:last-child { padding-bottom: 0; }
.journey li:last-child::after { display: none; }

/* annotated system tour */
.tour { display: grid; gap: clamp(2rem, 4vw, 3rem); }
.tour-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: clamp(1.2rem, 3vw, 2.4rem);
  align-items: center;
}
.tour-step:nth-child(even) .tour-copy { order: 2; }
.tour-copy .n {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--teal);
}
.tour-copy h3 { font-size: 1.22rem; margin: 0.45rem 0 0.55rem; }
.tour-copy p { color: var(--ink-dim); font-size: 0.96rem; line-height: 1.62; }
.tour-copy .consequence {
  margin-top: 0.9rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.93rem;
}
.tour-shot { border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45); }
.tour-shot img { display: block; width: 100%; height: auto; }

/* "the hard parts" — risk removed */
.hardparts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.hardpart { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1.3rem 1.4rem; }
.hardpart h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.hardpart p { color: var(--ink-dim); font-size: 0.92rem; line-height: 1.58; }
.hardpart .why {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--teal);
}

/* collapsed technical appendix */
.appendix { border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.appendix > summary {
  cursor: pointer;
  padding: 1.1rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--teal);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.appendix > summary::-webkit-details-marker { display: none; }
.appendix > summary::before { content: "+"; color: var(--ink-faint); font-size: 1.1rem; line-height: 1; }
.appendix[open] > summary::before { content: "−"; }
.appendix > summary:hover { color: #58d3dd; }
.appendix-body { padding: 0 1.4rem 1.5rem; border-top: 1px solid var(--line); padding-top: 1.3rem; }
.appendix-body .stack-grid { margin-top: 1rem; }

/* related work */
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.related-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.3rem 1.4rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.related-card:hover { border-color: rgba(52, 195, 207, 0.5); transform: translateY(-3px); }
.related-card h3 { font-size: 1.05rem; margin: 0.5rem 0 0.4rem; }
.related-card p { color: var(--ink-dim); font-size: 0.9rem; line-height: 1.55; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .studies { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .work-top-inner { grid-template-columns: 1fr; gap: 1.8rem; align-items: start; }
  .work-counts { border-left: 0; border-top: 1px solid var(--line-2); padding-left: 0; padding-top: 1.1rem; }
  .builds { grid-template-columns: 1fr; }
  .journeys { grid-template-columns: 1fr; }
  .tour-step { grid-template-columns: 1fr; }
  .tour-step:nth-child(even) .tour-copy { order: 0; }
  .xref-row { grid-template-columns: 1fr; gap: 0.4rem; }
  .filterbar { top: 68px; }

  /* Cutaway becomes a scroll-snap rail. No overlap, no tiny angled shots. */
  .cut { grid-template-columns: 1fr; gap: 1.6rem; }
  .cut--flip .cut-body { order: 0; }
  .cut-stage { aspect-ratio: auto; }
  .layers {
    position: static;
    display: flex;
    gap: 0.85rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.6rem;
    scrollbar-width: thin;
  }
  .layer {
    position: static;
    width: 82%;
    flex: 0 0 82%;
    scroll-snap-align: start;
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }
  .layer-label { opacity: 1; transform: none; transition: none; }
  .cut-trace { display: none; }
}

@media (max-width: 620px) {
  .studies { grid-template-columns: 1fr; }
  .variants, .variants--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-search { margin-left: 0; width: 100%; }
  .tier-head .tier-note { margin-left: 0; }
  .docket li { grid-template-columns: 5.2rem minmax(0, 1fr); gap: 0.7rem; }
  .cs-docket > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .cs-docket > div:last-child { border-bottom: 0; }
  .layer { width: 90%; flex-basis: 90%; }
}

@media (prefers-reduced-motion: reduce) {
  .layer, .layer-label, .build, .build-shot img, .study, .related-card {
    transition: none !important;
  }
  /* ship it already fanned out — there is nothing to reveal */
  .cut-stage .layer[data-i] { transform: none !important; opacity: 1 !important; }
  .cut-stage .layer-label { opacity: 1; }
}
