/* Case page layout, modelled on clay.global/work/discover */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

.wrap { padding-inline: max(var(--gutter), calc((100% - var(--content-max)) / 2)); }
.subtle { color: var(--fg-subtle); }
.signal { color: var(--signal); }

/* Tone bands: paper carries evidence, graphite carries narrative */
.band-dark {
  --bg: var(--graphite);
  --fg: var(--paper);
  --fg-subtle: rgb(250 250 247 / 0.6);
  --fg-weak: rgb(250 250 247 / 0.2);
  --panel: #1a2233;   /* graphite lifted 6% toward white */
  background: var(--bg);
  color: var(--fg);
}
:root { --panel: var(--stone); }

/* Nav */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding-block: 24px;
}
.nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; font-weight: 500; }
.nav a { text-decoration: none; }
.nav a[aria-current="page"] { color: var(--fg); }
.nav li a:not([aria-current]) { color: var(--fg-subtle); }
.nav li a {
  padding-bottom: 10px;
  background: linear-gradient(currentColor, currentColor) no-repeat left bottom / 0 1px;
  transition: background-size 400ms cubic-bezier(.2,.7,.2,1), color 200ms;
}
.nav li a:hover { color: var(--fg); background-size: 100% 1px; }
@media (max-width: 767px) { .nav ul li:not(.keep) { display: none; } }

/* Opener: title and lead only, then the hero image (Clay order) */
.opener { padding-block: calc(var(--space-section) * 0.5) calc(var(--space-section) * 0.4); }
.opener .t-title + .t-lead { margin-top: var(--gap-title-lead); max-width: var(--measure-lead); }

.hero { aspect-ratio: 16 / 9; overflow: hidden; background: var(--graphite); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { .hero { aspect-ratio: 4 / 5; } .hero img { object-position: 50% 50%; } }

/* Intro: body left, facts right (Clay puts its service list at x=1057 of 1440) */
.intro {
  display: grid;
  gap: 40px;
  padding-block: calc(var(--space-section) * 0.6) var(--space-section);
}
.intro .t-body + .t-body { margin-top: 1em; }
.intro .t-body { max-width: var(--measure-body); }
@media (min-width: 768px) {
  .intro { grid-template-columns: minmax(0, 1fr) 240px; gap: 48px; }
}
@media (min-width: 1250px) {
  .intro { grid-template-columns: minmax(0, 1fr) 308px; gap: 72px; }
}
.facts { margin: 0; display: grid; gap: 24px; align-content: start; }
.facts div { display: grid; gap: 4px; }
.facts dt { order: 2; }
.facts dd { margin: 0; order: 1; font-family: var(--font-sans); font-weight: var(--weight-strong); }

/* Sections */
.section { padding-bottom: var(--space-section); }
.section-head .t-headline { max-width: var(--measure-head); }
.section-head .t-body { max-width: var(--measure-body); margin-top: var(--gap-head-body); }
.section-head .t-body + .t-body { margin-top: 1em; }
.media { margin-top: calc(var(--gap-head-body) * 1.2); }
.band-dark.section { padding-top: var(--space-section); }

/* Panel holds screens on a tonal ground */
.panel {
  background: var(--panel);
  padding: clamp(24px, 6vw, 96px);
  display: grid;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  justify-items: center;
  overflow: hidden;
}
.panel-2 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .panel-2 { grid-template-columns: 1fr 1fr; }
  .panel-wide-left { grid-template-columns: 2.2fr 1fr; }
}
.grid-2 { display: grid; gap: clamp(16px, 3vw, 40px); margin-top: clamp(16px, 3vw, 40px); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* Plain silhouette frames: no camera cutout, buttons or bezel detail */
.device {
  width: min(100%, 340px);
  border: 8px solid #26272b;
  border-radius: 44px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 40px 80px -40px rgb(0 0 0 / 0.5);
}
.screen { border-radius: 12px; overflow: hidden; box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.45); }
.crop { border-radius: 24px; overflow: hidden; }

figcaption { margin-top: 16px; }
.media > figcaption, .panel + figcaption { padding-inline: 0; }

/* Ordered principles and findings */
.points { list-style: none; margin: var(--gap-head-body) 0 0; padding: 0; max-width: 40rem; }
.points li {
  display: grid;
  grid-template-columns: 3em 1fr;
  gap: 8px;
  padding-block: 20px;
  border-top: 1px solid var(--fg-weak);
}
.points li:last-child { border-bottom: 1px solid var(--fg-weak); }
.points .t-small { display: block; margin-top: 4px; }

/* Metrics */
.metrics {
  display: grid;
  gap: 40px;
  margin: var(--gap-head-body) 0 0;
}
@media (min-width: 768px) { .metrics { grid-template-columns: repeat(2, max-content); column-gap: clamp(40px, 8vw, 120px); } }
.metrics dt { max-width: 22rem; }
.metrics dd { white-space: nowrap; }
.metrics div { display: grid; gap: 8px; align-content: start; }
.metrics dd { margin: 0; order: 1; }
.metrics dt { order: 2; }
.metric-note { margin-top: 24px; }

/* Journey diagram (rebuilt from deck slide 05) */
.journey {
  display: grid;
  gap: 16px;
  width: 100%;
  counter-reset: step;
}
.journey .boundary {
  border: 1.5px dashed var(--signal);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 16px;
}
.journey .boundary > .t-meta { color: var(--signal); }
.journey .row { display: grid; gap: 16px; }
.step {
  border: 1px solid var(--fg-weak);
  border-radius: 12px;
  padding: 16px 20px 20px;
  background: var(--bg);
}
.step .t-small { display: block; margin-bottom: 8px; }
.step.side { border-style: dashed; background: transparent; }
@media (min-width: 1250px) {
  .journey { grid-template-columns: 1fr 2.15fr 1fr; align-items: start; }
  .journey .row { grid-template-columns: 1fr 1fr; }
  .journey > .step { margin-top: calc(16px + 1.2em + 16px); }
}

/* Timeline strip */
.timeline { list-style: none; margin: var(--gap-head-body) 0 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; gap: 6px; padding: 20px 0; border-top: 1px solid var(--fg-weak); position: relative; }
@media (min-width: 768px) {
  .timeline { grid-template-columns: repeat(4, 1fr); }
  .timeline li { padding: 24px 24px 0 0; border-top: 2px solid var(--fg); }
  .timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--signal); }
}

/* Calls to action shown as type, not mocked-up UI */
.ctas { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; width: min(100%, 560px); }
.ctas li { padding: 18px 0; border-top: 1px solid var(--fg-weak); }
.ctas li:last-child { border-bottom: 1px solid var(--fg-weak); }
.ctas li::before { content: "→ "; color: var(--fg-subtle); }

/* Annotation on the balance card */
.callout-wrap { display: grid; justify-items: center; gap: 0; }
.callout { color: var(--fg); padding-bottom: 12px; position: relative; }
.callout::after { content: ""; display: block; width: 1px; height: 40px; background: var(--signal); margin: 12px auto 0; }

/* Hand-over to the in-person deck */
.ask { padding-block: var(--space-section); border-top: 1px solid var(--fg-weak); }
.ask ol { list-style: none; margin: var(--gap-head-body) 0 0; padding: 0; display: grid; gap: 24px; }
@media (min-width: 1250px) { .ask ol { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.ask li { border-top: 1px solid var(--fg-weak); padding-top: 20px; }
.ask li .t-meta { display: block; margin-bottom: 12px; }

/* Next case */
.next { display: block; text-decoration: none; padding-block: var(--space-section); }
.next .t-title { margin-top: 12px; }
.next:hover .t-title, .next:focus-visible .t-title { text-decoration: underline; text-underline-offset: 0.12em; text-decoration-thickness: 2px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-block: 32px;
  border-top: 1px solid var(--fg-weak);
}

:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }

/* Motion: a short rise on entry, off under reduced motion */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms cubic-bezier(.2,.7,.2,1), transform 700ms cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .nav li a { transition: none; }
}

