/* Shared across case-study pages: sticky rail layout, section rhythm, content-authoring
   building blocks (headings, media placeholders). Page-specific components (e.g. a
   timeline, stat cards) stay inline in that page's own <style> block. */

.back-link {
  display: inline-block;
  font-size: var(--text-caption);
  color: var(--text-muted);
  text-decoration: none;
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
}
.back-link:hover { color: var(--accent-text); }

.content-grid {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-7);
}

.rail {
  position: sticky;
  top: calc(var(--header-height) + var(--space-5));
  align-self: start;
  display: flex;
  flex-direction: column;
  height: fit-content;
  border-left: 1px solid var(--ink-1-a12);
}
.rail-link {
  display: block;
  padding: var(--space-2) 0;
  font-size: var(--text-caption);
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  padding-left: var(--space-3);
  margin-left: -1px;
  transition: color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}
.rail-link:hover { color: var(--accent-text); }
.rail-link.active {
  color: var(--accent-text);
  border-left-color: var(--accent);
}

main {
  min-width: 0;
  padding: 0 0 200px;
  display: flex;
  flex-direction: column;
  gap: 112px;
}

section { display: flex; flex-direction: column; gap: 20px; }
section#overview { gap: var(--space-4); }

.eyebrow {
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
}
h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2rem, 3vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink-1);
}
h2 {
  font-size: calc(1.5rem + 2px);
  font-weight: 500;
  margin: 0;
  color: var(--ink-1);
}
/* section titles in the serif; sub-titles (h3) and sub-sub-titles (h4) stay in the sans */
main > section > h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.4;
  margin: 0;
  color: var(--ink-1);
}
/* sub-sub heading: same look as the card titles (e.g. Reduced cognitive load) */
h4 {
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.35;
  margin: 0;
  color: var(--ink-1);
}
p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  margin: 0;
  color: var(--text-muted);
}
.lede { line-height: 1.7; }
strong { font-weight: 700; }  /* the site resets all weights to 400, so bold needs to be set explicitly */
.callout { color: var(--accent-text); font-weight: 500; }
.placeholder-copy { color: var(--text-muted); font-style: italic; }

blockquote {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent);
}
blockquote p { color: var(--accent-text); font-size: calc(var(--text-base) - 2px); }

/* media placeholders — swap the inner <img>/<video> in when real assets are ready */
.media {
  border: 1px solid var(--border-subtle);
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  background: var(--ink-1-a08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.media::before {
  content: attr(data-label);
  font-size: var(--text-label);
  color: var(--text-muted);
  text-align: center;
  padding: 0 var(--space-3);
}
.media img, .media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}
.media.hero { aspect-ratio: 16/10; }

/* unconstrained media: no cropping, no forced aspect-ratio — renders at its own proportions */
.media-natural {
  border: 1px solid var(--border-subtle);
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

/* tinted panel around a screenshot or recording */
.media-frame {
  background: #EBF2FA;
  padding: 40px;
  border-radius: var(--radius-md);
}
@media (max-width: 560px) {
  .media-frame { padding: 20px; }
}

/* two screens side by side in one tinted frame */
.media-frame-pair {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
/* each item takes width in proportion to its aspect ratio (--ar), so both end up the same height */
.media-frame-pair > * {
  flex: var(--ar, 1) 1 0;
  min-width: 0;
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
@media (max-width: 720px) {
  .media-frame-pair { flex-direction: column; }
  .media-frame-pair > * { flex: none; }
}

/* simple data table: label-style header, hairline row dividers */
.table-scroll { overflow-x: auto; }
.rules-table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  text-align: left;
}
.rules-table th {
  padding: 0 var(--space-4) var(--space-2) 0;
  font-size: var(--text-label);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--ink-1-a12);
}
.rules-table td {
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  vertical-align: top;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  border-bottom: 1px solid var(--ink-1-a12);
}
.rules-table th:nth-child(1), .rules-table td:nth-child(1) { width: 26%; }
.rules-table th:nth-child(3), .rules-table td:nth-child(3) { width: 24%; padding-right: 0; }
.rules-table td:nth-child(1) { color: var(--ink-1); }

/* founder quote: same look as the quotes in the home page's community section */
.quote-card { display: flex; flex-direction: column; gap: var(--space-3); }
.quote-card p {
  font-style: italic;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
}
.person-name { font-size: var(--text-caption); font-weight: 400; color: var(--accent-text); }
.person-name a { color: inherit; text-decoration: none; }
.person-name a:hover, .person-name a:focus-visible { text-decoration: underline; }

/* trimmed media: shaves baked-in edges off a screen recording.
   Set --w/--h to the video's pixel size and --t/--r/--b/--l to the pixels to cut from each side. */
.media-trim {
  border: 1px solid var(--border-subtle);
  --w: 2598; --h: 1752; --t: 12; --r: 12; --b: 12; --l: 12;
  --cw: calc(var(--w) - var(--l) - var(--r));
  --ch: calc(var(--h) - var(--t) - var(--b));
  position: relative;
  width: 100%;
  aspect-ratio: calc(var(--cw) / var(--ch));
  border-radius: var(--radius-md);
  overflow: hidden;
}
.media-trim video {
  position: absolute;
  left: calc(var(--l) / var(--cw) * -100%);
  top: calc(var(--t) / var(--ch) * -100%);
  width: calc(var(--w) / var(--cw) * 100%);
  height: calc(var(--h) / var(--ch) * 100%);
  display: block;
}

/* cropped media: fills a fixed frame, centered, zoomed in to cut surrounding chrome */
.media-crop {
  border: 1px solid var(--border-subtle);
  position: relative;
  width: 100%;
  aspect-ratio: 2.07 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.media-crop video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}
.two-col-wide-right { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}

.list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list li { font-size: var(--text-base); line-height: 1.7; color: var(--text-muted); }  /* same size, colour and line height as the paragraphs */
.list-body li { color: var(--text-muted); }

/* role / product meta */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--ink-1-a12);
}
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label {
  font-size: var(--text-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.meta-value { font-size: var(--text-caption); color: var(--text-body); }

/* outcome stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-4);
  border: 1px solid var(--ink-1-a12);
  border-radius: var(--radius-md);
}
.stat-number {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--accent-text);
}
/* outcome card headings in blue (FoundersBrew, SCM) */
#outcome .point h3, #outcome .stat h3, #outcome .option-card h3,
#outcomes .stat h3 { color: var(--accent-text); font-weight: 400; }
.stat-label { font-size: var(--text-base); font-weight: 500; color: var(--ink-1); }
.stat-detail { font-size: var(--text-caption); color: var(--text-muted); }

/* journey chain */
.journey {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.journey-step {
  font-size: var(--text-caption);
  font-weight: 500;
  color: var(--ink-1);
  background: var(--ink-1-a08);
  padding: 6px 14px;
  border-radius: 999px;
}
.journey-arrow { color: var(--text-muted); font-size: var(--text-caption); }

/* numbered step list */
.step-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-2);
}
.step {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}
.step-num {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--accent-text);
  font-weight: 300;
}
.step h3 { margin: 0 0 4px; }
.step p { margin: 0; }

/* plain row of short points: no cards or dividers, wraps on narrow screens */
.point-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4) var(--space-5);
}
.point-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.point-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.point { display: flex; flex-direction: column; gap: var(--space-2); }
.point h3 { font-size: var(--text-base); line-height: 1.35; }
.point p { font-size: var(--text-base); line-height: var(--leading-relaxed); }

/* option / principle / state cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-5);
  margin-top: var(--space-2);
}
.option-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--ink-1-a12);
  border-radius: var(--radius-md);
}
.option-num {
  font-size: var(--text-label);
  color: var(--accent-text);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.option-card p { font-size: var(--text-base); color: var(--text-body); }

/* plain highlight list */
.plain-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.plain-list .item { font-size: var(--text-base); line-height: var(--leading-relaxed); color: var(--text-body); }
.plain-list .item strong { color: var(--ink-1); }

/* takeaways / before-after change log */
.takeaway {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--ink-1-a12);
}
.takeaway:first-child { border-top: none; padding-top: 0; }

@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .rail {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    border-left: none;
    border-bottom: 1px solid var(--ink-1-a12);
    gap: var(--space-1);
  }
  .rail-link {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: var(--space-2) 12px;
    white-space: nowrap;
  }
  .rail-link.active { border-left-color: transparent; border-bottom-color: var(--accent); }
  .two-col, .three-col, .two-col-wide-right { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid, .card-grid { grid-template-columns: 1fr; }
  .point-row, .point-row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .meta-grid { grid-template-columns: 1fr; }
  .point-row, .point-row-2, .point-row-3 { grid-template-columns: 1fr; }
}

/* three-column classification: a short title and description per column, no cards or dividers */
.classify { margin-top: var(--space-5); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-6); }
.classify-head { display: flex; flex-direction: column; gap: var(--space-2); }
.classify-head h3 { margin: 0 !important; font-size: var(--text-base); line-height: 1.35; }
.classify-head p { margin: 0; }
@media (max-width: 900px) { .classify { gap: var(--space-4); } }@media (max-width: 520px) { .classify { grid-template-columns: 1fr; gap: var(--space-5); } }

/* image slider: slides sit inside one tinted frame, with dot controls underneath (same dots as the home page testimonials) */
.media-slider .media-frame { display: block; }
.slider-viewport { overflow: hidden; }
.slider-track { display: flex; transition: transform 600ms var(--ease-standard); }
.slider-track > img { flex: 0 0 100%; min-width: 0; }
.slider-dots { display: flex; justify-content: center; gap: var(--space-2); margin-top: var(--space-4); }
.slider-dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px;
  background: var(--ink-1-a12); cursor: pointer;
  transition: width var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard);
}
.slider-dot[aria-current="true"] { width: 24px; background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .slider-track { transition: none; } }

/* line icons: outlined only, one stroke width everywhere on the site */
.icon { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.classify-head .icon { color: var(--accent-text); margin-bottom: var(--space-1); }
.classify-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }  /* three across at most, a fourth drops to a second line */
@media (max-width: 900px) { .classify-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .classify-4 { grid-template-columns: 1fr; } }

/* takeaway headings: regular weight */
#reflection .point h3 { font-weight: 400; }

/* multi-column cards (outcomes, takeaways, "why" rows, option cards): one very faint blue tint, no outline */
.point, .classify-row, .stat, .option-card {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  border: 0;
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.point p, .classify-head p, .stat p, .option-card p { font-size: calc(var(--text-base) - 2px); line-height: 1.5; }
.classify-source { color: var(--accent-text); font-size: var(--text-caption) !important; margin-top: var(--space-2) !important; }
.stat h3 { font-size: var(--text-base); line-height: 1.35; }
.stat { gap: var(--space-2); }
/* headings inside the tinted cards are regular weight */
.point h3, .stat h3, .option-card h3, .classify-head h3 { font-weight: 400; }

/* a sub-heading sits close to the card layout it introduces (the section gap is 20px, so pull the cards up to leave about 16px) */
h3 + .classify, h4 + .classify,
h3 + .point-row, h4 + .point-row,
h3 + .card-grid, h4 + .card-grid,
h3 + .stat-grid, h4 + .stat-grid { margin-top: -4px; }

/* Urja problem section: more room above each group heading (Accessibility, Visual hierarchy) */
#audit h4 { margin-top: var(--space-6); }

/* a sub-heading straight after a section title sits close to it, like body text does (overrides inline top margins) */
main > section > h2 + h3, main > section > h2 + h4 { margin-top: 0 !important; }

/* two screens one below the other on the blue frame, with a small blue arrow between them */
.media-flow { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.media-flow .media-natural { width: 100%; }
.media-flow .flow-arrow { width: 28px; height: 28px; color: var(--accent-text); flex: none; }
