/* ══════════════════════════════════════════════════════════════
   CASE STUDY — editorial reading layout.
   Consumes tokens from css/theme.css. Defines only the reading
   surface: one centered column, quiet meta, generous rhythm.
   No decorative rules, chips, numbered section heads, or TOC.
══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  font-feature-settings: "ss01", "ss02", "cv11";
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color .4s ease, color .4s ease;
}
a { color: inherit; text-decoration: none; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }

.wrap {
  max-width: var(--col-max);
  margin: 0 auto;
  padding: 0 var(--col-gutter);
}

/* ══════════════════════════════════════════════════════════════
   NAV — mirrors the main site nav
══════════════════════════════════════════════════════════════ */
.cs-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.cs-nav.scrolled { border-bottom-color: var(--rule-soft); }
.cs-nav-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cs-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-60);
  letter-spacing: 0.02em;
  transition: color .15s ease;
  white-space: nowrap;
}
.cs-btn-short { display: none; }
.cs-back:hover { color: var(--ink); }
.cs-back svg { transition: transform .25s ease; }
.cs-back:hover svg { transform: translateX(-3px); }
.cs-nav-right { display: flex; align-items: center; gap: 12px; }
.cs-nav-right .btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  height: 36px; padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--bg);
  transition: transform .2s ease;
  white-space: nowrap;
}
.cs-nav-right .btn:hover { transform: translateY(-1px); }

/* Theme toggle — identical to main site's */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-60);
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
  position: relative;
}
.theme-toggle:hover { color: var(--ink); background: color-mix(in oklab, var(--ink) 5%, transparent); border-color: var(--ink-20); }
.theme-toggle .theme-icon { position: absolute; transition: opacity .3s ease, transform .4s cubic-bezier(0.22, 1, 0.36, 1); }
body[data-theme="paper"] .theme-icon--sun  { opacity: 1; transform: rotate(0) scale(1); }
body[data-theme="paper"] .theme-icon--moon { opacity: 0; transform: rotate(-60deg) scale(0.5); }
body[data-theme="ink"]   .theme-icon--sun  { opacity: 0; transform: rotate(60deg) scale(0.5); }
body[data-theme="ink"]   .theme-icon--moon { opacity: 1; transform: rotate(0) scale(1); }
body[data-theme="graphite"] .theme-icon--sun  { opacity: 1; transform: rotate(0) scale(1); }
body[data-theme="graphite"] .theme-icon--moon { opacity: 0; transform: rotate(-60deg) scale(0.5); }

/* ══════════════════════════════════════════════════════════════
   READING COLUMN
══════════════════════════════════════════════════════════════ */
.cs-article {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(56px, 9vh, 112px) 0 clamp(72px, 12vh, 144px);
  hyphens: auto;
  -webkit-hyphens: auto;
  hyphenate-limit-chars: 6 3 3;
}
/* Titles and subtitles should never hyphenate */
.cs-title, .cs-subtitle, .cs-section h2, .cs-next-title, .cs-eyebrow {
  hyphens: manual;
  -webkit-hyphens: manual;
}

.cs-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-60);
  margin-bottom: 32px;
}

/* Client logo inline in the title — cap-height matched to the display
   type so "Resolutions for [logo]" reads as a single phrase. Source is
   black on transparent; dark themes invert it to white. */
.cs-title-logo {
  display: inline-block;
  height: 0.82em;
  width: auto;
  vertical-align: baseline;
  transform: translateY(0.08em);
  opacity: 0.92;
}
body[data-theme="ink"] .cs-title-logo {
  filter: invert(1) brightness(1.1);
}

.cs-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(40px, 5.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 28px;
  text-wrap: pretty;
}

.cs-title em {
  font-family: inherit;
  font-style: normal;
  font-weight: 300;
  color: var(--ink-60);
  letter-spacing: inherit;
}

.cs-subtitle {
  font-family: var(--sans);
  font-size: clamp(18px, 1.5vw, 20px);
  line-height: 1.45;
  color: var(--ink-60);
  letter-spacing: -0.012em;
  margin-bottom: 48px;
  text-wrap: pretty;
}

/* Byline — prose-form project credits. Small italic serif, subdued
   color. Sits as the hero's closing band; its bottom rule separates
   hero from body. NYT-style dateline rhythm. */
.cs-byline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-60);
  letter-spacing: -0.005em;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 80px;
  text-wrap: pretty;
}
.cs-subtitle em { color: var(--ink-80); }

.cs-meta {
  padding-bottom: 56px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cs-meta-row {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--ink-60);
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 0 10px;
  line-height: 1.6;
}
.cs-meta-row--quiet { color: var(--ink-40); font-size: 11px; }
.cs-meta-row span + span::before {
  content: '·';
  margin-right: 10px;
  color: var(--ink-20);
}

/* ── BODY SECTIONS ── */
.cs-section { margin-bottom: 80px; }
.cs-section:last-of-type { margin-bottom: 0; }

.cs-section h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(22px, 1.9vw, 26px);
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 32px;
  text-wrap: pretty;
}
.cs-section h2 em {
  font-family: inherit;
  font-style: normal;
  font-weight: inherit;
}

/* Lead headline — one step up. Used on the major groupings
   (Context, Design) to create hierarchy against sub-sections. */
.cs-section h2.cs-h2--lead {
  font-size: clamp(30px, 2.8vw, 40px);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 36px;
}


.cs-section p {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-80);
  letter-spacing: -0.005em;
  margin-bottom: 24px;
  text-wrap: pretty;
}
.cs-section p:last-child { margin-bottom: 0; }
.cs-section p em { color: var(--ink); }
.cs-section p strong { color: var(--ink); font-weight: 500; }

/* Disclaimer — quiet aside in body sections, used to flag meta-context
   like "this is a redesign". Sans, slightly smaller than body. */
.cs-disclaimer {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-60);
  letter-spacing: -0.005em;
  margin-top: 16px;
  text-wrap: pretty;
}

/* Lists — same type rhythm as body paragraphs. Used for structured
   case-study sections (context, goals, highlights). */
.cs-section ol,
.cs-section ul {
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink-80);
  letter-spacing: -0.005em;
  margin: 0 0 24px;
  padding-left: 28px;
}
.cs-section ol:last-child,
.cs-section ul:last-child { margin-bottom: 0; }
.cs-section li { margin-bottom: 10px; padding-left: 4px; }
.cs-section li:last-child { margin-bottom: 0; }
.cs-section li strong { color: var(--ink); font-weight: 500; }
.cs-section li ul,
.cs-section li ol {
  margin-top: 10px;
  margin-bottom: 0;
  color: var(--ink-60);
}
.cs-section li ul li,
.cs-section li ol li { margin-bottom: 6px; }

/* ── FIGURE ── images constrained to column by default ── */
.cs-figure {
  margin: 64px 0;
}
.cs-figure img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--rad);
  background: var(--bg-sunk);
  cursor: zoom-in;
  transition: opacity .2s ease;
}
.cs-figure img:hover { opacity: 0.92; }
.cs-figure figcaption {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-40);
  line-height: 1.5;
}

/* Note — accent-ruled annotation that follows a figure, calling out
   a design decision tied to the image above. Smaller than body, sits
   close to its figure so the pair reads as a unit. */
.cs-note {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-60);
  letter-spacing: -0.005em;
  padding-left: 16px;
  border-left: 2px solid var(--accent);
  margin: -40px 0 64px;
  text-wrap: pretty;
}
.cs-note strong { color: var(--ink); font-weight: 500; }
.cs-note + .cs-figure { margin-top: 0; }

/* Note label — bold inline prefix that flags a highlight. Inherits
   the note's font and color; weight is the only differentiator. */
.cs-note-mark {
  font-weight: 500;
  color: var(--ink);
  margin-right: 6px;
}

/* opt-in wider variant — 160px each side beyond the column */
.cs-figure--wide {
  margin-left: clamp(-160px, -12vw, 0px);
  margin-right: clamp(-160px, -12vw, 0px);
}
@media (max-width: 900px) {
  .cs-figure--wide { margin-left: 0; margin-right: 0; }
}

/* ══════════════════════════════════════════════════════════════
   NEXT — simple link out, no chrome
══════════════════════════════════════════════════════════════ */
.cs-next {
  margin-top: 128px;
  padding-top: 64px;
  border-top: 1px solid var(--rule-soft);
}
.cs-next-label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-40);
  margin-bottom: 24px;
}
.cs-next-link {
  display: inline-flex;
  align-items: baseline;
  gap: 16px;
  color: var(--ink);
  transition: color .25s ease;
}
.cs-next-link:hover { color: var(--accent); }
.cs-next-title {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(28px, 3.2vw, 40px);
  letter-spacing: -0.025em;
  line-height: 1;
}
.cs-next-arrow {
  display: inline-flex;
  transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1);
}
.cs-next-link:hover .cs-next-arrow { transform: translateX(6px); }

/* Coming-soon variant — non-navigating. No hover colour shift; replaces
   the arrow with an accent-tinted pill matching the work card. */
.cs-next-link--soon { color: var(--ink-60); cursor: default; }
.cs-next-link--soon:hover { color: var(--ink-60); }
.cs-next-soon {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 12%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1;
}

/* ══════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════ */
.cs-footer {
  border-top: 1px solid var(--rule-soft);
  padding: 32px 0 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-40);
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in oklab, var(--bg) 92%, #000 50%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 56px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-img {
  max-width: min(1600px, 95vw);
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--rad);
  box-shadow: 0 40px 120px rgba(0,0,0,0.5);
  transform: scale(0.98);
  transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1);
}
.lightbox.is-open .lightbox-img { transform: scale(1); }
.lightbox-close {
  position: absolute;
  top: 24px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  color: var(--ink-60);
  display: grid; place-items: center;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease;
}
.lightbox-close:hover { color: var(--ink); border-color: var(--ink-20); }
.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%; transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-40);
  letter-spacing: 0.06em;
  max-width: min(720px, 90vw);
  text-align: center;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE
══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  /* Nav */
  .cs-nav-inner { gap: 12px; height: 56px; }
  .cs-back-ext { display: none; }
  .cs-nav-right { gap: 8px; }
  .cs-nav-right .btn {
    font-size: 12px; padding: 0 14px; height: 34px;
  }
  .cs-btn-long { display: none; }
  .cs-btn-short { display: inline; }
  .theme-toggle { width: 34px; height: 34px; }

  /* Article rhythm — downshift one step on the scale */
  .cs-article { padding: 40px 0 80px; }
  .cs-eyebrow { margin-bottom: 24px; }
  .cs-title {
    font-size: clamp(36px, 10vw, 44px);
    margin-bottom: 24px;
  }
  .cs-subtitle {
    margin-bottom: 32px;
  }
  .cs-byline {
    font-size: 15px;
    padding-bottom: 40px;
    margin-bottom: 56px;
  }

  /* Sections + figures */
  .cs-section { margin-bottom: 56px; }
  .cs-section h2 { margin-bottom: 24px; }
  .cs-figure { margin: 40px 0; }
  .cs-next { margin-top: 80px; padding-top: 48px; }
}

/* ══════════════════════════════════════════════════════════════
   ENTRANCE — mirrors the main site's hero rise/fadeup
══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {
  .cs-eyebrow,
  .cs-title,
  .cs-subtitle,
  .cs-byline {
    opacity: 0;
    transform: translateY(12px);
    animation: rise .6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  .cs-eyebrow  { animation-delay: .04s; }
  .cs-title    { animation-delay: .14s; }
  .cs-subtitle { animation-delay: .24s; }
  .cs-byline   { animation-delay: .32s; }

  /* Scroll-revealed elements start hidden; JS adds .is-in when
     they enter the viewport. Mirrors the main site's pattern. */
  .cs-reveal {
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity .45s cubic-bezier(0.22, 1, 0.36, 1),
      transform .45s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .cs-reveal.is-in {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeup {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

