/* ═══════════════════════════════════════════
   Case study — long-form article layout.
   Requires tokens.css + base.css loaded first.
   Covers every class used by the 12 case-study pages.
   ═══════════════════════════════════════════ */

/* nav position (fixed) is inherited from base.css — shared across all pages */
nav .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 1.3rem; padding-bottom: 1.3rem; }
nav .nav-right { display: flex; align-items: center; gap: 1.4rem; }

body { line-height: 1.7; }

/* ── Hero ── */
header.hero { padding: clamp(7rem, 8vw + 4rem, 9rem) 0 1.5rem; }
h1 { font-family: 'Playfair Display', serif; font-weight: 400; font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 1.4rem; }
.lede { font-size: clamp(1.05rem, 2.2vw, 1.2rem); color: var(--text); max-width: 60ch; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; margin-top: 1.8rem; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* ── Metrics ── */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2.5rem 0; }
.metrics.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 560px) { .metrics, .metrics.two { grid-template-columns: 1fr; } }
.metric-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.3rem 1.4rem; }
.metric-card .num { font-family: 'Playfair Display', serif; font-size: 1.9rem; line-height: 1; }
.metric-card .cap { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }

/* ── Body rhythm ── */
section { padding: 1.5rem 0; }
h2 { font-family: 'Playfair Display', serif; font-weight: 400; font-size: clamp(1.4rem, 3.5vw, 1.9rem); letter-spacing: -0.01em; margin: 2.2rem 0 0.9rem; }
h3 { font-size: 1.02rem; font-weight: 500; margin: 1.6rem 0 0.4rem; }
p { margin-bottom: 1rem; color: var(--text-soft); }
ul { margin: 0.5rem 0 1rem 1.4rem; color: var(--text-soft); }
ul li { margin-bottom: 0.3rem; }
.hr { height: 1px; background: var(--border); margin: 2.5rem 0; border: 0; }

/* ── Figures ── */
.fig { margin: 1.8rem 0; }
.fig .frame { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); box-shadow: var(--shadow-sm); }
.fig img { width: 100%; height: auto; display: block; }
.fig figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.7rem; padding-left: 0.1rem; }
.fig-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin: 1.8rem 0; align-items: start; }
.fig-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.4rem 0; }
@media (max-width: 600px) { .fig-pair, .fig-grid { grid-template-columns: 1fr; } }
.tag { display: inline-block; font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.18rem 0.55rem; border-radius: 999px; margin-bottom: 0.55rem; }
.tag.before { background: var(--tag-before-bg); color: var(--tag-before-fg); }
.tag.after  { background: var(--tag-after-bg);  color: var(--tag-after-fg); }
.cap-line { font-size: 0.8rem; color: var(--muted); margin-top: -0.4rem; }

/* ── Problem cards ── */
.problems { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.4rem 0; }
@media (max-width: 560px) { .problems { grid-template-columns: 1fr; } }
.problem { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 1.2rem 1.3rem; }
.problem .t { font-weight: 500; font-size: 0.95rem; margin-bottom: 0.4rem; }
.problem .d { font-size: 0.86rem; color: var(--muted); }

/* ── Three-column notes ── */
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin: 1.2rem 0; }
@media (max-width: 560px) { .cols { grid-template-columns: 1fr; } }
.cols .col .t { font-weight: 500; font-size: 0.9rem; margin-bottom: 0.3rem; }
.cols .col .d { font-size: 0.85rem; color: var(--muted); }

/* ── Callout body uses soft text on case studies ── */
.callout { font-size: 0.92rem; color: var(--text-soft); margin: 1.6rem 0; }

/* ── Next case study (matches home work-list item) ── */
.next-cs { margin-top: 1rem; }
.next-cs .eyebrow { margin-bottom: 1rem; }
.next-work { display: block; text-decoration: none; color: inherit; padding: 2rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); position: relative; }
@media (pointer: fine) { .next-work { cursor: none; } }
.next-work > * { position: relative; z-index: 1; }
.next-work::before {
  content: ''; position: absolute; inset: 0.55rem -1.4rem; z-index: 0;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 14px; opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.next-work:hover::before { opacity: 1; }
.next-work .work-top { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.next-work .work-title { font-family: 'Playfair Display', serif; font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 400; letter-spacing: -0.01em; line-height: 1.25; }
.next-work .work-title .arrow { display: inline-block; margin-left: 0.4rem; opacity: 0; transform: translateX(-6px); transition: opacity 0.35s ease, transform 0.35s ease; font-style: normal; }
.next-work:hover .work-title .arrow { opacity: 0.55; transform: translateX(0); }
.next-work .work-role { flex-shrink: 0; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; padding-top: 0.4rem; }
.next-work .work-desc { font-size: 0.92rem; color: var(--muted); margin-top: 0.7rem; max-width: 60ch; }
@media (max-width: 600px) {
  .next-work .work-top { flex-direction: column; gap: 0.45rem; }
  .next-work .work-role { order: -1; padding-top: 0; }
}
.next-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.4rem; padding-bottom: 0.5rem; }
.next-foot a { font-size: 0.8rem; color: var(--muted); text-decoration: none; transition: color 0.3s ease; }
@media (pointer: fine) { .next-foot a { cursor: none; } }
.next-foot a:hover { color: var(--text); }
