/* Shared case-study presentation. The site's .container owns every content edge. */
.case-study {
  --case-space: clamp(64px, 6vw, 112px);
  --case-gap: clamp(32px, 4vw, 64px);
  --case-rule: #555555;
  --case-muted: #b5b5b5;
  --proof-navy: #19354b;
  --proof-teal: #148d88;
  font-family: var(--font-primary);
  color: var(--text-primary);
  padding-bottom: 0;
}
body.s9-light .case-study {
  --case-rule: #b0b0b0;
  --case-muted: #525252;
}
.case-study [hidden] { display: none !important; }
.case-study img { display: block; width: 100%; max-width: 100%; }
.case-study figure { margin: 0; }
.case-study h1, .case-study h2, .case-study h3 { font-family: var(--font-primary); }
.case-study h2 {
  margin: 0;
  font-size: clamp(27px, 2.52vw, 37.8px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.035em;
}
.case-study h3 {
  margin: 0;
  font-size: clamp(17.1px, 1.35vw, 20.7px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.02em;
}
.case-hero {
  --case-hero-space: clamp(80px, 7vw, 128px);
  padding-block: calc(70px + var(--case-hero-space)) var(--case-hero-space);
}
.case-hero-row { display: grid; grid-template-columns: 1fr 1fr; align-items: end; gap: var(--case-gap); }
.case-kicker { margin: 0 0 18px; color: var(--case-muted); font-size: 13.5px; line-height: 1.4; }
.case-study h1 {
  margin: 0;
  font-size: clamp(64px, 7vw, 108px);
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.065em;
  overflow-wrap: anywhere;
}
.case-lead {
  max-width: 28ch;
  margin: 0;
  font-size: clamp(19.8px, 1.8vw, 27px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -.025em;
}
.case-tags { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 24px; color: var(--case-muted); font-size: 11.7px; line-height: 1.5; }
.case-cover { height: 60vh; height: 60svh; overflow: hidden; border-radius: 10px; background: #d9e4e4; }
.case-cover > img { height: 100%; object-fit: cover; object-position: 50% 57%; }

/* The navigation is opaque and sits immediately below the visible site header. */
.case-project-nav {
  position: sticky;
  top: var(--case-nav-top, 70px);
  z-index: 99;
  color: var(--text-primary);
  background: var(--surface-page);
  box-shadow: none;
  transition: top 250ms ease;
}
.case-nav-track {
  display: flex;
  align-items: stretch;
  gap: clamp(24px, 3vw, 48px);
  min-height: 62px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--case-rule);
}
.case-nav-track::-webkit-scrollbar { display: none; }
.case-nav-track a {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding-block: 18px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--case-muted);
  font-size: 12.6px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.case-nav-track a:hover, .case-nav-track a[aria-current="location"] { color: var(--text-primary); border-bottom-color: var(--text-primary); }
.case-project-nav :focus-visible { outline-color: var(--border-strong); outline-offset: -4px; }
.case-section { scroll-margin-top: 150px; }
.case-section-inner { padding-block: var(--case-space); border-bottom: 1px solid var(--case-rule); }
.case-narrative {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  align-items: start;
  gap: clamp(48px, 6vw, 112px);
}
.case-narrative > *, .case-gallery > *, .case-identity > * { min-width: 0; }
.case-copy { max-width: 72ch; color: var(--case-muted); font-size: clamp(15.3px, 1.03vw, 17.1px); line-height: 1.75; }
.case-copy p { margin: 0; }
.case-copy p + p { margin-top: 24px; }
.case-copy .case-opening { color: var(--text-primary); font-size: clamp(18px, 1.44vw, 22.5px); line-height: 1.5; letter-spacing: -.015em; }
.case-meta { display: grid; gap: 20px; margin-top: 40px; max-width: 330px; }
.case-meta > div { display: grid; grid-template-columns: 86px 1fr; gap: 16px; font-size: 12.6px; line-height: 1.55; }
.case-meta dt { color: var(--case-muted); }
.case-meta dd { margin: 0; color: var(--text-primary); }
.case-principles { list-style: none; padding: 0; margin: 32px 0 0; }
.case-principles li { padding-block: 26px; border-top: 1px solid var(--case-rule); }
.case-principles li:last-child { padding-bottom: 0; }
.case-principles h3 { color: var(--text-primary); margin-bottom: 10px; }
.case-principles p { font-size: inherit; }
.case-visual { margin-top: var(--case-gap) !important; }
.case-study figcaption {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin-top: 16px;
  color: var(--case-muted);
  font-size: 11.7px;
  line-height: 1.55;
}
.case-study figcaption strong { color: var(--text-primary); font-weight: 500; }
.case-mockup-stage {
  padding: clamp(24px, 5.2vw, 84px);
  overflow: hidden;
  border-radius: 5px;
  background: #d9e8e5;
}
.case-browser {
  overflow: hidden;
  border: 1px solid #c1cdce;
  border-radius: 9px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(25, 53, 75, .16);
}
.case-browser-toolbar {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 8px 64px;
  border-bottom: 1px solid #e3e8e8;
  color: #566268;
  background: #f5f8f7;
  font-size: 9.9px;
}
.case-browser-dots { display: flex; gap: 5px; position: absolute; left: 14px; }
.case-browser-dots i { width: 6px; height: 6px; border-radius: 50%; background: #bac6c5; }
.case-browser-viewport { overflow: hidden; background: #ffffff; }
.case-browser-viewport > img { height: auto; margin-top: -2.4%; }
.case-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: var(--case-gap); }
.case-square { aspect-ratio: 1; overflow: hidden; border-radius: 5px; background: #e9efef; }
.case-square > img { height: 100%; object-fit: cover; }
.case-detail { position: relative; background: #eef3f5; border: 1px solid #d8e1e4; }
.case-detail > img { position: absolute; width: 200%; max-width: none; height: auto; left: -6%; top: -12%; object-fit: initial; }
.case-detail--comparison > img { width: 300%; left: -140%; top: -94%; }
.case-identity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: var(--case-gap); }
.case-wordmarks { display: grid; grid-template-columns: 1fr 1fr; min-height: clamp(180px, 22vw, 330px); overflow: hidden; border-radius: 5px; }
.case-wordmarks > div { display: grid; place-items: center; min-width: 0; }
.case-wordmarks > div:first-child { color: #19354b; background: #edf3f4; }
.case-wordmarks > div:last-child { color: #ffffff; background: #19354b; }
.case-wordmarks span { font-size: clamp(27px, 3.6vw, 57.6px); font-weight: 600; letter-spacing: -.065em; }
.case-palette { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: clamp(180px, 22vw, 330px); overflow: hidden; border-radius: 5px; }
.case-palette > div { display: flex; flex-direction: column; justify-content: flex-end; padding: 16px 12px; font-size: 9.9px; line-height: 1.6; }
.case-palette strong { font-size: 10.8px; font-weight: 500; }
.case-palette > div:nth-child(1) { background: #19354b; color: #ffffff; }
.case-palette > div:nth-child(2) { background: #667d8c; color: #080808; }
.case-palette > div:nth-child(3) { background: #dce6ec; color: #19354b; }
.case-palette > div:nth-child(4) { background: #148d88; color: #080808; }
.case-outcomes .case-section-inner { padding-block: calc(var(--case-space) * 1.5); border-bottom: 0; }
.case-outcomes-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--case-gap); border: 1px solid var(--case-rule); }
.case-outcome { padding: clamp(24px, 2.5vw, 40px); }
.case-outcome + .case-outcome { border-left: 1px solid var(--case-rule); }
.case-study .case-outcome h3 { margin-bottom: 16px; font-size: clamp(48px, 5.4vw, 80px) !important; font-weight: 400; line-height: 1; letter-spacing: -.04em; }
.case-outcome p { margin: 0; color: var(--case-muted); font-size: 14.4px; line-height: 1.7; }
.case-outcome-note { margin: 20px 0 0; color: var(--case-muted); font-size: 11.7px; line-height: 1.55; }
.case-return { display: inline-flex; margin-top: var(--case-gap); align-items: center; gap: 14px; font-size: 14.4px; text-decoration: underline; text-underline-offset: 6px; }
.case-return:hover { text-decoration-thickness: 2px; }
.case-coming { padding-block: var(--case-space); }
.case-coming-inner { border-top: 1px solid var(--case-rule); padding-top: var(--case-space); }
.case-coming p { max-width: 60ch; margin-block: 24px; color: var(--case-muted); font-size: 16.2px; line-height: 1.7; }
@media (max-width: 1194px) {
  .case-narrative { grid-template-columns: minmax(0, .62fr) minmax(0, 1.38fr); gap: 48px; }
  .case-meta > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 834px) {
  .case-study { --case-space: 64px; --case-gap: 32px; }
  .case-narrative { grid-template-columns: minmax(0, .6fr) minmax(0, 1.4fr); gap: 32px; }
  .case-hero-row { gap: 32px; }
  .case-meta { margin-top: 28px; }
  .case-gallery, .case-identity { gap: 16px; }
  .case-outcome { padding: 24px 20px; }
  .case-palette > div { padding: 12px 8px; font-size: 9px; }
  .case-palette strong { font-size: 9px; }
}
@media (max-width: 767px) {
  .case-study { --case-space: 56px; --case-gap: 28px; }
  .case-study .container { padding-inline: 16px; }
  .case-hero {
    --case-hero-space: 64px;
    padding-block: calc(62px + var(--case-hero-space)) var(--case-hero-space);
  }
  .case-hero-row, .case-narrative { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .case-study h1 { font-size: clamp(60px, 16vw, 88px); }
  .case-study h2 { font-size: 28.8px; }
  .case-lead { font-size: 20.7px; max-width: 30ch; }
  .case-kicker { margin-bottom: 14px; }
  .case-tags { margin-top: 18px; font-size: 10.8px; }
  .case-cover > img { object-position: 65% 55%; }
  .case-nav-track { min-height: 54px; gap: 24px; }
  .case-nav-track a { padding-block: 16px; font-size: 11.7px; }
  .case-section { scroll-margin-top: 132px; }
  .case-copy { font-size: 15.3px; line-height: 1.75; }
  .case-copy .case-opening { font-size: 18.9px; }
  .case-copy p + p { margin-top: 20px; }
  .case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: none; margin-top: 24px; }
  .case-meta > div { font-size: 11.7px; }
  .case-meta > div:last-child { grid-column: 1 / -1; }
  .case-principles { margin-top: 24px; }
  .case-principles li { padding-block: 24px; }
  .case-mockup-stage { padding: 18px 12px; }
  .case-browser { border-radius: 5px; box-shadow: 0 8px 20px rgba(25, 53, 75, .12); }
  .case-browser-toolbar { min-height: 26px; padding: 6px 40px; font-size: 7.2px; }
  .case-browser-dots { left: 9px; gap: 3px; }
  .case-browser-dots i { width: 4px; height: 4px; }
  .case-gallery, .case-identity { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .case-gallery--details { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .case-study figcaption { margin-top: 12px; font-size: 10.8px; }
  .case-gallery--details figcaption { font-size: 9.9px; }
  .case-wordmarks, .case-palette { min-height: 220px; }
  .case-wordmarks span { font-size: clamp(32.4px, 9vw, 48.6px); }
  .case-palette > div { padding: 16px 10px; font-size: 9px; }
  .case-palette strong { font-size: 9.9px; }
  .case-outcomes-grid { grid-template-columns: minmax(0, 1fr); }
  .case-outcome + .case-outcome { border-left: 0; border-top: 1px solid var(--case-rule); }
  .case-outcome { padding: 26px; }
  .case-outcome p { font-size: 14.4px; }
}
@media (prefers-reduced-motion: reduce) {
  .case-project-nav { transition: none; }
}
