/* ─────────────────────────────────────────
   CASE STUDY SYSTEM — shared across projects
   Matches homepage: paper, ink, one accent.
   Each page overrides --accent in its own :root.
───────────────────────────────────────── */
:root {
  --paper:      #FAF7F1;
  --paper-2:    #F2EEE5;
  --ink:        #16150F;
  --ink-2:      #5B584D;
  --ink-3:      #8E8A7D;
  --accent:     #2B3FF2;
  --accent-dim: color-mix(in srgb, var(--accent) 9%, transparent);
  --line:       rgba(22,21,15,0.13);
  --f-sans:     'Archivo', -apple-system, sans-serif;
  --f-mono:     'Spline Sans Mono', ui-monospace, monospace;
  --disp:       'wdth' 120, 'wght' 740;
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
  --pad:        clamp(20px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.mono {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.wrap { max-width: 1020px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* NAV */
.cs-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.cs-nav.scrolled {
  background: rgba(250,247,241,0.9);
  backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.cs-nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-top: 16px; padding-bottom: 16px;
  max-width: 1020px; margin: 0 auto;
  padding-left: var(--pad); padding-right: var(--pad);
}
.nav-logo {
  font-family: 'Dancing Script', cursive;
  font-weight: 700; font-size: 27px; line-height: 1;
}
.nav-logo em { font-style: normal; color: var(--accent); }
.cs-nav-title { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.cs-nav-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--ink-2);
  transition: color 0.2s, gap 0.2s;
}
.cs-nav-back:hover { color: var(--accent); gap: 12px; }

/* HERO */
.cs-hero { padding-top: clamp(120px, 18vh, 180px); padding-bottom: 24px; }
.cs-chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.05em;
  padding: 7px 14px; border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  margin-bottom: 26px;
}
.cs-hero h1 {
  font-size: clamp(38px, 6.2vw, 76px);
  font-variation-settings: var(--disp);
  line-height: 1.02; letter-spacing: -0.025em;
  margin-bottom: 26px; max-width: 15em;
}
.cs-hero h1 .hl { color: var(--accent); font-style: italic; }
.cs-lede {
  font-size: 19px; color: var(--ink-2);
  max-width: 620px; line-height: 1.65;
}

/* META STRIP */
.cs-meta {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px; margin-top: 52px;
  border-top: 1px solid var(--ink);
  padding-top: 22px;
}
.cs-meta div .mono { display: block; margin-bottom: 6px; }
.cs-meta div p { font-size: 15px; line-height: 1.5; }

/* SECTIONS */
.cs-section { padding-top: clamp(64px, 9vw, 110px); }
.cs-section:last-of-type { padding-bottom: clamp(64px, 9vw, 110px); }
.sec-label {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 34px;
}
.sec-label h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-variation-settings: var(--disp);
  letter-spacing: -0.02em; line-height: 1.05;
}

/* PROSE */
.prose { max-width: 660px; }
.prose p { margin-bottom: 1.25em; color: var(--ink-2); }
.prose p strong { color: var(--ink); font-weight: 600; }
.prose p:last-child { margin-bottom: 0; }
.prose .lead { font-size: 20px; color: var(--ink); font-variation-settings: 'wdth' 106, 'wght' 460; line-height: 1.55; }

/* PULL QUOTE */
.pull {
  border-left: 3px solid var(--accent);
  padding: 6px 0 6px 26px;
  margin: 40px 0;
  font-size: clamp(21px, 2.6vw, 28px);
  font-variation-settings: 'wdth' 108, 'wght' 520;
  line-height: 1.4; letter-spacing: -0.01em;
  max-width: 680px;
}
.pull .hl { color: var(--accent); }

/* STAT GRID */
.stat-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; margin: 40px 0;
}
.stat-cell { background: var(--paper); padding: 24px 22px; }
.stat-cell strong {
  display: block; font-size: clamp(28px, 3.4vw, 42px);
  font-variation-settings: var(--disp); letter-spacing: -0.02em;
  line-height: 1.1; margin-bottom: 6px;
  color: var(--accent);
}
.stat-cell span { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; display: block; }

/* CALLOUT */
.callout {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
  margin: 40px 0;
  max-width: 680px;
}
.callout .mono { display: block; margin-bottom: 10px; color: var(--accent); }
.callout p { color: var(--ink-2); }
.callout p strong { color: var(--ink); }

/* FIGURES */
.fig { margin: 44px 0; }
.fig img {
  border-radius: 14px;
  border: 1px solid var(--line);
}
.fig figcaption {
  font-family: var(--f-mono); font-size: 12px;
  letter-spacing: 0.04em; color: var(--ink-3);
  margin-top: 12px;
}
.fig-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 44px 0; align-items: center; }
.fig-row .fig { margin: 0; }
.fig-row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* NUMBERED LIST (decisions, steps) */
.steps { max-width: 680px; margin: 40px 0; }
.step {
  display: grid; grid-template-columns: 52px 1fr; gap: 18px;
  padding: 22px 0; border-bottom: 1px solid var(--line);
}
.step:last-child { border-bottom: 0; }
.step-num { font-family: var(--f-mono); font-size: 13px; color: var(--accent); padding-top: 4px; }
.step h3 { font-size: 18px; font-variation-settings: 'wdth' 110, 'wght' 620; margin-bottom: 6px; }
.step p { font-size: 15.5px; color: var(--ink-2); }

/* NEXT PROJECT FOOTER */
.cs-next {
  border-top: 1px solid var(--ink);
  margin-top: clamp(64px, 9vw, 110px);
}
.cs-next-inner {
  max-width: 1020px; margin: 0 auto;
  padding: clamp(48px, 7vw, 80px) var(--pad);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
}
.cs-next a.next-link { display: block; }
.cs-next .mono { display: block; margin-bottom: 12px; }
.cs-next h2 {
  font-size: clamp(32px, 5vw, 60px);
  font-variation-settings: var(--disp);
  letter-spacing: -0.025em; line-height: 1;
  transition: color 0.2s;
}
.cs-next a.next-link:hover h2 { color: var(--accent); }
.cs-next .next-arrow { font-size: clamp(28px, 4vw, 44px); color: var(--ink-3); transition: transform 0.25s var(--ease), color 0.2s; }
.cs-next a.next-link:hover ~ .next-arrow, .cs-next a.next-link:hover .next-arrow { transform: translateX(8px); color: var(--accent); }
.cs-footer {
  border-top: 1px solid var(--line); padding: 26px 0;
}
.cs-footer-inner {
  max-width: 1020px; margin: 0 auto;
  padding-left: var(--pad); padding-right: var(--pad);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-3);
}
.cs-footer-inner a:hover { color: var(--accent); }

/* LOADER SHELL (glyph styles live per page) */
.pldr {
  position: fixed; inset: 0; z-index: 999; background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  transition: opacity 0.45s ease, visibility 0.45s;
}
.pldr.done { opacity: 0; visibility: hidden; }
.pldr-title {
  font-size: 26px;
  font-variation-settings: 'wdth' 115, 'wght' 680;
  letter-spacing: -0.01em;
}
.pldr-status {
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}

/* REVEAL */
.rv { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  .pldr { transition: none; }
}

/* RESPONSIVE */
@media (max-width: 820px) {
  .cs-meta { grid-template-columns: 1fr 1fr; }
  .fig-row, .fig-row-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .cs-nav-title { display: none; }
}
@media (max-width: 520px) {
  .cs-meta { grid-template-columns: 1fr; gap: 16px; }
  .step { grid-template-columns: 36px 1fr; }
  .cs-next-inner { flex-direction: column; align-items: flex-start; }
}

/* ─────────────────────────────────────────
   EXTENDED COMPONENTS — full-process content
───────────────────────────────────────── */

/* Problem / Solution duo */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 40px 0; }
.duo-card { border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; background: var(--paper); }
.duo-card .mono { display: block; margin-bottom: 12px; color: var(--accent); }
.duo-card p { color: var(--ink-2); font-size: 15.5px; }
.duo-card.dark { background: var(--ink); border-color: var(--ink); }
.duo-card.dark p { color: rgba(250,247,241,0.8); }
.duo-card.dark .mono { color: var(--paper); opacity: 0.7; }

/* HMW callout */
.hmw {
  border: 1.5px solid var(--accent); border-radius: 16px;
  background: var(--accent-dim);
  padding: 30px 32px; margin: 40px 0; max-width: 720px;
}
.hmw .mono { display: block; margin-bottom: 12px; color: var(--accent); }
.hmw p {
  font-size: clamp(19px, 2.2vw, 24px);
  font-variation-settings: 'wdth' 108, 'wght' 520;
  line-height: 1.45; letter-spacing: -0.01em;
}

/* Role / feature card grid */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 40px 0; }
.card-grid-2 { grid-template-columns: 1fr 1fr; }
.gcard { border: 1px solid var(--line); border-radius: 14px; padding: 22px; background: var(--paper); }
.gcard .g-ico { font-size: 22px; display: block; margin-bottom: 12px; }
.gcard h3 { font-size: 16px; font-variation-settings: 'wdth' 110, 'wght' 640; margin-bottom: 7px; }
.gcard p { font-size: 14px; color: var(--ink-2); line-height: 1.55; }

/* Personas */
.persona-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 40px 0; }
.persona { border: 1px solid var(--line); border-radius: 18px; padding: 28px; background: var(--paper-2); }
.p-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.p-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--paper); box-shadow: 0 2px 10px rgba(22,21,15,0.12); }
.p-avatar-emoji { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-dim); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.p-head h3 { font-size: 19px; font-variation-settings: 'wdth' 112, 'wght' 660; }
.p-head .mono { display: block; margin-top: 4px; }
.persona > p { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; margin-bottom: 18px; }
.persona > p em { color: var(--ink); }
.p-block { margin-bottom: 16px; }
.p-block:last-child { margin-bottom: 0; }
.p-block .mono { display: block; margin-bottom: 8px; color: var(--accent); }
.p-block ul { list-style: none; }
.p-block li { font-size: 14px; color: var(--ink-2); line-height: 1.5; padding: 5px 0 5px 18px; position: relative; }
.p-block li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.p-quote { font-style: italic; color: var(--ink); font-size: 15px; border-left: 2.5px solid var(--accent); padding-left: 14px; margin-bottom: 18px; }

/* Flow steps with tag */
.step .step-tag {
  display: inline-block; margin-top: 10px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent);
}

/* Design system specimens */
.swatch-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 36px 0; }
.swatch { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.swatch-color { height: 68px; }
.swatch-info { padding: 10px 12px; background: var(--paper); }
.swatch-info strong { display: block; font-size: 12.5px; font-weight: 600; }
.swatch-info span { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); }
.type-row { display: grid; grid-template-columns: 160px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.type-row:last-child { border-bottom: 0; }
.type-row .mono { padding-top: 4px; }
.type-sample { font-size: 24px; line-height: 1.3; }

/* Status / checklist cards */
.status-card { border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; background: var(--paper); }
.status-card h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-variation-settings: 'wdth' 110, 'wght' 640; margin-bottom: 14px; }
.status-card h3 .s-dot { width: 9px; height: 9px; border-radius: 50%; background: #1E9E5A; }
.status-card h3 .s-dot.amber { background: #E8A013; }
.status-card ul { list-style: none; }
.status-card li { font-size: 14px; color: var(--ink-2); line-height: 1.5; padding: 6px 0 6px 20px; position: relative; }
.status-card li::before { content: "·"; position: absolute; left: 6px; color: var(--accent); font-weight: 700; }

/* Achievement banner */
.banner {
  border: 1.5px solid var(--accent); border-radius: 20px;
  background: var(--accent-dim);
  padding: clamp(28px, 5vw, 48px); margin: 40px 0;
  text-align: center;
}
.banner .b-emoji { font-size: 40px; display: block; margin-bottom: 12px; }
.banner h3 { font-size: clamp(26px, 3.6vw, 40px); font-variation-settings: var(--disp); letter-spacing: -0.02em; margin-bottom: 12px; }
.banner h3 em { color: var(--accent); }
.banner > p { color: var(--ink-2); max-width: 560px; margin: 0 auto 24px; }
.banner-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 28px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); }
.banner-meta strong { color: var(--ink); font-weight: 500; }

/* Team grid */
.team-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 36px 0; }
.team-cell { border: 1px solid var(--line); border-radius: 14px; padding: 20px 16px; text-align: center; background: var(--paper); }
.team-cell.me { border-color: var(--accent); background: var(--accent-dim); }
.team-cell .t-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-size: 20px; margin: 0 auto 10px; }
.team-cell strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.team-cell span { font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }

/* Tables */
.tbl { width: 100%; border-collapse: collapse; margin: 36px 0; font-size: 14px; }
.tbl th { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--ink-3); text-align: left; padding: 12px 14px; border-bottom: 1.5px solid var(--ink); }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; line-height: 1.5; }
.tbl td:first-child { color: var(--ink); font-weight: 600; }
.tbl tr.total td { border-top: 1.5px solid var(--ink); color: var(--ink); font-weight: 600; }

/* SWOT */
.swot { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 40px 0; }
.swot-card { border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; background: var(--paper); }
.swot-card h3 { font-size: 15px; font-variation-settings: 'wdth' 110, 'wght' 640; margin-bottom: 12px; }
.swot-card ul { list-style: none; }
.swot-card li { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; padding: 5px 0 5px 18px; position: relative; }
.swot-card li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }

/* Journey map */
.journey { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 40px 0; }
.j-cell { background: var(--paper); padding: 20px 16px; }
.j-cell .mono { display: block; margin-bottom: 8px; color: var(--accent); }
.j-cell p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.j-cell em { display: block; font-style: italic; color: var(--ink); font-size: 13.5px; margin-top: 8px; }
.j-cell .j-mood { display: block; font-size: 18px; margin-top: 8px; }

/* Quote list (user feedback) */
.quote-list { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 36px 0; }
.q-card { border-left: 2.5px solid var(--accent); background: var(--paper-2); border-radius: 0 14px 14px 0; padding: 18px 22px; font-size: 14.5px; font-style: italic; color: var(--ink-2); line-height: 1.6; }

@media (max-width: 820px) {
  .duo, .persona-grid, .card-grid, .swot, .quote-list { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .swatch-grid { grid-template-columns: repeat(3, 1fr); }
  .team-grid { grid-template-columns: 1fr 1fr; }
  .journey { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr; }
  .swatch-grid { grid-template-columns: 1fr 1fr; }
}

/* Phone-screenshot figures: consistent, constrained sizing */
.fig-phone img { max-height: 540px; width: auto; max-width: 100%; margin: 0 auto; }
.fig-lg img { max-height: 640px; }

/* Typographic avatars (replacing emoji) */
.p-avatar-emoji.txt, .t-avatar.txt {
  font-family: var(--f-sans);
  font-variation-settings: 'wdth' 115, 'wght' 700;
  color: var(--accent);
  background: var(--accent-dim);
}
.p-avatar-emoji.txt { font-size: 26px; }
.t-avatar.txt { font-size: 13px; letter-spacing: 0.02em; }

/* ─────────────────────────────────────────
   VISUAL RICHNESS — typographic & motion details
───────────────────────────────────────── */

/* Auto-numbered cards (skips cards that already carry a mono label) */
.card-grid { counter-reset: gc; }
.gcard { position: relative; transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s; overflow: hidden; }
.gcard::before {
  counter-increment: gc;
  content: counter(gc, decimal-leading-zero);
  display: block;
  font-family: var(--f-mono); font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 12px;
}
.gcard:has(> .mono)::before { display: none; }

/* Accent bar draws across card top on hover */
.gcard::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2.5px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.gcard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, transparent); box-shadow: 0 10px 30px rgba(22,21,15,0.07); }
.gcard:hover::after { transform: scaleX(1); }

/* Ghost section numerals */
body { counter-reset: sec; }
.cs-section { counter-increment: sec; position: relative; }
.cs-section > .sec-label { position: relative; }
.cs-section > .sec-label::before {
  content: counter(sec, decimal-leading-zero);
  position: absolute; right: -8px; bottom: -14px;
  font-size: clamp(80px, 12vw, 150px);
  font-variation-settings: var(--disp);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--accent) 22%, transparent);
  pointer-events: none;
  z-index: 0;
}
.sec-label h2, .sec-label .mono { position: relative; z-index: 1; }

/* Editorial quote marks */
.q-card { position: relative; padding-top: 34px; }
.q-card::before {
  content: "“";
  position: absolute; top: 2px; left: 16px;
  font-family: Georgia, serif;
  font-size: 54px; line-height: 1;
  color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* Living stats */
.stat-cell { transition: background 0.3s; }
.stat-cell:hover { background: var(--accent-dim); }

/* Personas & team cells get a hover response too */
.persona { border-top: 3px solid var(--accent); transition: transform 0.3s var(--ease), box-shadow 0.3s; }
.persona:hover { transform: translateY(-3px); box-shadow: 0 12px 34px rgba(22,21,15,0.08); }
.team-cell { transition: transform 0.3s var(--ease), border-color 0.3s; }
.team-cell:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* Steps: number pops on hover */
.step { transition: background 0.25s; }
.step:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.step:hover .step-num { font-weight: 700; }

/* Journey cells */
.j-cell { transition: background 0.3s; }
.j-cell:hover { background: var(--accent-dim); }

@media (prefers-reduced-motion: reduce) {
  .gcard, .persona, .team-cell, .gcard::after { transition: none; }
  .gcard:hover, .persona:hover, .team-cell:hover { transform: none; }
}
