@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@600;700;800&family=Instrument+Sans:wght@400;500;600&family=Caveat:wght@500;600&display=swap");
/* case-study.css — shared editorial system for the story-style case studies
   (MoodMode, Apple Reminders, STC Hub). Pair with motion.css + motion.js.
   Each page sets --project, --project-soft, --project-deep on <body>. */

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

:root {
  --paper: #F1F0EC;
  --paper-2: #E8E6E0;
  --surface: #FFFFFF;
  --line: #DAD8D1;
  --ink: #151515;
  --muted: #5C5B57;
  --subtle: #8C8A84;
  --accent: #2D3EB8;
  --project: var(--accent);
  --project-soft: #E3E6F7;
  --project-deep: #151A3D;
  --serif: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --display: "Manrope", ui-sans-serif, system-ui, sans-serif;
  --hand: "Caveat", "Comic Sans MS", cursive;
  --sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --measure: 660px;
  --radius: 10px;
}

html { scroll-behavior: smooth; }
body { font-family: var(--sans); background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; }
::selection { background: var(--project); color: #fff; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--paper); padding: 10px 16px; z-index: 500; }
.skip-link:focus { left: 16px; top: 16px; }
:focus-visible { outline: 2px solid var(--project); outline-offset: 3px; border-radius: 3px; }

.wrap { width: min(1180px, calc(100% - 96px)); margin: 0 auto; }
.narrow { max-width: var(--measure); }
.eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--subtle); }
.eyebrow.c { color: var(--project); }

/* ── NAV ── */
nav.topnav { position: fixed; inset: 0 0 auto 0; z-index: 100; display: flex; align-items: center; justify-content: space-between; padding: 18px 56px; transition: background .4s, border-color .4s, transform .5s var(--ease); border-bottom: 1px solid transparent; }
nav.topnav.solid { background: rgba(241,240,236,.9); backdrop-filter: blur(14px); border-bottom-color: var(--line); }
nav.topnav.hide { transform: translateY(-100%); }
.nav-logo { font-family: var(--serif); font-size: 34px; font-weight: 700; text-decoration: none; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: 34px; list-style: none; }
.nav-links a { font-size: 14px; text-decoration: none; opacity: .72; transition: opacity .2s; }
.nav-links a:hover { opacity: 1; }
.nav-resume { opacity: 1 !important; border: 1px solid var(--ink); padding: 8px 18px; border-radius: 999px; font-size: 13px !important; display: inline-block; }

/* ── HERO ── */
.hero { position: relative; padding: 150px 0 0; overflow: hidden; }
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 44px; }
.back { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.back:hover { color: var(--ink); }
.hero h1 { font-family: var(--serif); font-weight: normal; font-size: clamp(44px, 7vw, 104px); line-height: .98; letter-spacing: -0.035em; max-width: 1060px; }
.hero h1 em { color: var(--project); }
.hero-lede { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; margin-top: 48px; align-items: end; }
.hero-lede p { font-family: var(--serif); font-size: clamp(19px, 1.7vw, 23px); line-height: 1.5; color: var(--muted); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line); }
.facts div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--subtle); }
.facts dd { font-size: 14px; line-height: 1.45; margin-top: 2px; }
.hero-media { margin-top: 72px; border-radius: 14px; overflow: hidden; background: var(--paper-2); position: relative; }
.hero-media img { width: 100%; }
.disclaimer { font-size: 12px; color: var(--subtle); margin-top: 12px; }

/* ── TL;DR ── */
.tldr { margin-top: 96px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.tldr > div { padding: 26px 28px 30px 0; }
.tldr > div + div { padding-left: 28px; border-left: 1px solid var(--line); }
.tldr h2 { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--project); font-weight: 600; margin-bottom: 10px; font-family: var(--sans); }
.tldr p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.tldr p strong { color: var(--ink); font-weight: 600; }

/* ── CHAPTER NAV ── */
.chapter-nav { position: sticky; top: 0; z-index: 90; margin-top: 100px; background: rgba(241,240,236,.92); backdrop-filter: blur(12px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chapter-nav ol { list-style: none; display: flex; width: min(1180px, calc(100% - 96px)); margin: 0 auto; overflow-x: auto; scrollbar-width: none; }
.chapter-nav li { flex: 1; min-width: max-content; }
.chapter-nav a { position: relative; display: flex; gap: 10px; align-items: baseline; padding: 16px 20px 16px 0; font-size: 13px; text-decoration: none; color: var(--subtle); transition: color .25s; }
.chapter-nav a span { font-size: 10px; letter-spacing: .14em; color: var(--project); }
.chapter-nav a::after { content: ''; position: absolute; left: 0; right: 20px; bottom: -1px; height: 2px; background: var(--project); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
.chapter-nav a.active, .chapter-nav a:hover { color: var(--ink); }

/* ── CHAPTERS ── */
.chapter { padding: 150px 0 40px; scroll-margin-top: 40px; position: relative; }
.chapter-head { display: grid; grid-template-columns: 220px 1fr; gap: 40px; margin-bottom: 96px; align-items: start; }
.chapter-num { font-family: var(--serif); font-size: clamp(90px, 12vw, 170px); line-height: .8; color: transparent; -webkit-text-stroke: 1px var(--project); opacity: .55; }
.chapter-head .eyebrow { margin-bottom: 18px; }
.chapter-title { font-family: var(--serif); font-weight: normal; font-size: clamp(36px, 5vw, 68px); line-height: 1.02; letter-spacing: -0.025em; }
.chapter-title em { color: var(--project); }

.block { margin-bottom: 120px; }
.block-head { display: grid; grid-template-columns: 220px 1fr; gap: 40px; }
.block-head > .eyebrow { padding-top: 10px; }
.block h3 { font-family: var(--serif); font-weight: normal; font-size: clamp(26px, 2.8vw, 38px); line-height: 1.18; letter-spacing: -0.01em; margin-bottom: 20px; max-width: 820px; }
.block p { color: var(--muted); max-width: var(--measure); font-size: 17px; }
.block p + p { margin-top: 16px; }
.block p strong { color: var(--ink); font-weight: 600; }
.indent { margin-left: 260px; }

.pull { font-family: var(--serif); font-size: clamp(28px, 3.6vw, 50px); line-height: 1.18; letter-spacing: -0.015em; max-width: 1000px; margin: 0 0 140px; }
.pull::before { content: '“'; display: block; font-size: 1.8em; line-height: .6; color: var(--project); margin-bottom: 12px; }
.pull cite { display: block; font-family: var(--sans); font-style: normal; font-size: 13px; color: var(--subtle); margin-top: 22px; letter-spacing: .04em; }

/* card grids */
.cards { display: grid; gap: 18px; margin-top: 44px; }
.cards.c2 { grid-template-columns: repeat(2, 1fr); }
.cards.c3 { grid-template-columns: repeat(3, 1fr); }
.cards.c4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; position: relative; overflow: hidden; }
.card .num { font-family: var(--serif); font-size: 15px; color: var(--project); margin-bottom: 40px; display: block; }
.card h4 { font-family: var(--serif); font-weight: normal; font-size: 22px; line-height: 1.25; margin-bottom: 10px; }
.card p { font-size: 14.5px; color: var(--muted); line-height: 1.65; }
.card::after { content: ''; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--project); transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease); }
.card:hover::after { transform: scaleX(1); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); border-top: 1px solid var(--line); margin-top: 40px; }
.stat { padding: 34px 28px 34px 0; border-bottom: 1px solid var(--line); }
.stat + .stat { padding-left: 28px; border-left: 1px solid var(--line); }
.stat-val { font-family: var(--serif); font-size: clamp(52px, 6vw, 88px); line-height: .95; letter-spacing: -0.03em; color: var(--project); font-variant-numeric: tabular-nums; }
.stat-lbl { font-size: 14px; color: var(--muted); margin-top: 14px; max-width: 260px; line-height: 1.5; }

/* dark band */
.band { background: var(--project-deep); color: #F6F1E9; padding: 140px 0; position: relative; overflow: hidden; }
.band .eyebrow { color: color-mix(in srgb, #fff 55%, var(--project)); }
.band h2, .band h3 { color: #fff; }
.band p { color: rgba(255,255,255,.62); }
.band .stat { border-color: rgba(255,255,255,.12); }
.band .stat + .stat { border-color: rgba(255,255,255,.12); }
.band .stats { border-color: rgba(255,255,255,.2); }
.band .stat-val { color: #fff; }
.band .stat-lbl { color: rgba(255,255,255,.55); }
.band .pull { color: #fff; }

/* figures */
.fig { margin-top: 48px; }
.frame { border-radius: 14px; overflow: hidden; background: var(--project-soft); position: relative; }
.frame img { width: 100%; }
.fig figcaption { font-size: 13px; color: var(--subtle); margin-top: 14px; display: flex; gap: 10px; }
.fig figcaption::before { content: '↳'; color: var(--project); }

/* ── SCROLLYTELLING ── */
.story { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; margin-top: 40px; }
.story-stage { position: sticky; top: 90px; height: calc(100vh - 140px); min-height: 520px; display: flex; align-items: center; justify-content: center; }
.story-frames { position: relative; width: min(340px, 100%); aspect-ratio: 398 / 856; }
.story-frames > * { position: absolute; inset: 0; opacity: 0; transform: translateY(30px) scale(.96); transition: opacity .6s var(--ease), transform .8s var(--ease); }
.story-frames > .on { opacity: 1; transform: none; }
.story-steps { padding: 18vh 0 30vh; }
.story-step { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; opacity: .25; transition: opacity .5s; }
.story-step.on { opacity: 1; }
.story-step .eyebrow { margin-bottom: 12px; }
.story-step h4 { font-family: var(--serif); font-weight: normal; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; margin-bottom: 14px; }
.story-step p { color: var(--muted); font-size: 16.5px; max-width: 460px; }
.story-step .inline-shot { display: none; }

/* phone frame used for screens */
.phone { border-radius: 38px; padding: 9px; background: #121212; box-shadow: 0 40px 80px -30px rgba(40,20,10,.45), 0 0 0 1px rgba(0,0,0,.4); }
.phone img, .phone .screen { border-radius: 30px; width: 100%; height: 100%; object-fit: cover; display: block; overflow: hidden; }

/* tabs */
.tabs { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; background: var(--paper-2); position: relative; }
.tabs button { position: relative; z-index: 1; padding: 10px 20px; border-radius: 999px; font-size: 14px; color: var(--muted); transition: color .3s; cursor: pointer; }
.tabs button[aria-selected="true"] { color: #fff; }
.tabs .pill { position: absolute; z-index: 0; top: 5px; bottom: 5px; border-radius: 999px; background: var(--project); transition: left .5s var(--ease), width .5s var(--ease); }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; cursor: pointer; transition: background .25s, color .25s, border-color .25s; background: var(--surface); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .ct { opacity: .5; margin-left: 6px; font-size: 11px; }

/* timeline */
.timeline { display: grid; grid-template-columns: repeat(var(--n, 5), 1fr); gap: 0; margin-top: 52px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 0; right: 0; top: 7px; height: 1px; background: var(--line); }
.timeline .tl-line { position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: var(--project); }
.timeline > div { padding-right: 24px; position: relative; }
.timeline .dot { width: 15px; height: 15px; border-radius: 50%; background: var(--paper); border: 2px solid var(--project); margin-bottom: 26px; position: relative; z-index: 1; }
.timeline h5 { font-family: var(--serif); font-weight: normal; font-size: 19px; margin-bottom: 6px; }
.timeline p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }
.timeline .k { font-size: 11px; letter-spacing: .16em; color: var(--project); text-transform: uppercase; margin-bottom: 4px; display: block; }

/* lists */
.ticks { list-style: none; margin-top: 24px; }
.ticks li { padding: 14px 0 14px 34px; border-bottom: 1px solid var(--line); position: relative; color: var(--muted); font-size: 15.5px; }
.ticks li::before { content: '→'; position: absolute; left: 0; color: var(--project); }

/* ── EXPLORE MORE ── */
.more { padding: 150px 0 120px; }
.more-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 44px; gap: 24px; }
.more h2 { font-family: var(--serif); font-weight: normal; font-size: clamp(40px, 5vw, 72px); letter-spacing: -0.03em; line-height: 1; }
.more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.more-card { text-decoration: none; display: block; }
.more-img { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--paper-2); margin-bottom: 18px; }
.more-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.more-card:hover .more-img img { transform: scale(1.06); }
.more-tag { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); margin-bottom: 6px; }
.more-title { font-family: var(--serif); font-size: 21px; line-height: 1.3; transition: color .3s; }
.more-card:hover .more-title { color: var(--accent); }

footer.cs-footer { background: var(--ink); color: rgba(255,255,255,.45); padding: 34px 56px; display: flex; justify-content: space-between; font-size: 12px; gap: 16px; }
footer.cs-footer a { color: inherit; text-decoration: none; }
footer.cs-footer a:hover { color: #fff; }

/* ── RESPONSIVE ── */
@media (max-width: 1000px) {
  nav.topnav { padding: 16px 28px; }
  .wrap, .chapter-nav ol { width: calc(100% - 56px); }
  .hero-lede, .chapter-head, .block-head { grid-template-columns: 1fr; gap: 24px; }
  .chapter-num { font-size: 90px; }
  .indent { margin-left: 0; }
  .tldr { grid-template-columns: 1fr 1fr; }
  .tldr > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .cards.c3, .cards.c4 { grid-template-columns: 1fr 1fr; }
  .more-grid { grid-template-columns: 1fr 1fr; }
  .story { grid-template-columns: 1fr; gap: 0; }
  .story-stage { display: none; }
  .story-steps { padding: 0; }
  .story-step { min-height: 0; opacity: 1; padding: 36px 0; border-top: 1px solid var(--line); }
  .story-step .inline-shot { display: block; width: min(260px, 70%); margin-top: 24px; }
  .timeline { grid-template-columns: 1fr 1fr; row-gap: 40px; }
}
@media (max-width: 640px) {
  nav.topnav { padding: 14px 20px; }
  .nav-links { gap: 16px; }
  .nav-links li:nth-child(3) { display: none; }
  .wrap, .chapter-nav ol { width: calc(100% - 40px); }
  .hero { padding-top: 120px; }
  .tldr, .cards.c2, .cards.c3, .cards.c4, .more-grid, .stats { grid-template-columns: 1fr; }
  .tldr > div + div, .stat + .stat { padding-left: 0; border-left: 0; }
  .chapter { padding-top: 100px; }
  .block { margin-bottom: 88px; }
  .timeline { grid-template-columns: 1fr; }
  .more-head { flex-direction: column; align-items: start; }
  footer.cs-footer { flex-direction: column; padding: 28px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .story-frames > * { transition: none; }
  .more-img img, .card::after { transition: none; }
}

/* eyebrow labels keep their size inside text blocks */
p.eyebrow, .block p.eyebrow, .story-step p.eyebrow, .band p.eyebrow { font-size: 11px; line-height: 1.6; max-width: none; color: var(--subtle); }
p.eyebrow.c, .block p.eyebrow.c, .story-step p.eyebrow.c { color: var(--project); }
.band p.eyebrow { color: color-mix(in srgb, #fff 55%, var(--project)); }
.chapter-nav { transition: top .5s var(--ease); }
body.nav-shown .chapter-nav { top: 75px; }
@media (max-width: 640px) { body.nav-shown .chapter-nav { top: 66px; } }


/* ═══ Landing-page design system (Manrope + Instrument Sans, off-white, one accent) ═══ */
body { font-size: 17px; line-height: 1.6; }
.nav-logo { font-family: Georgia, serif; }
.nav-links a { font-weight: 500; opacity: .8; }
.nav-resume { border-radius: 10px; border-width: 1.5px; font-weight: 600; }
.hero h1, .chapter-title, .more h2 { font-weight: 800; letter-spacing: -0.035em; }
.hero h1 { font-size: clamp(44px, 6.4vw, 92px); line-height: 1.0; }
.chapter-title { font-size: clamp(36px, 4.8vw, 66px); line-height: 1.02; }
.hero h1 em, .chapter-title em, .block h3 em, .pull em { font-style: normal; }
.hero-lede p { font-family: var(--sans); font-size: clamp(18px, 1.5vw, 21px); line-height: 1.55; }
.chapter-num { font-weight: 800; letter-spacing: -0.04em; }
.block h3, .story-step h4 { font-weight: 700; letter-spacing: -0.025em; }
.pull { font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.card { border-radius: 16px; }
.card .num { font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.card h4, .timeline h5, .more-title { font-weight: 700; letter-spacing: -0.02em; }
.stat-val { font-weight: 800; letter-spacing: -0.04em; }
.tldr { border-top-width: 1.5px; }
.more-img { border-radius: 16px; }
.more-card:hover .more-title { color: var(--project); }
footer.cs-footer { background: var(--paper); color: var(--subtle); border-top: 1px solid var(--line); font-size: 14px; }
footer.cs-footer a:hover { color: var(--ink); }
.band .chapter-num { -webkit-text-stroke-width: 1px; }
.tabs button { font-weight: 600; }
body { --m-accent: var(--project); }
