/* ============================================================
   Editorial case-study theme — warm paper, one accent, type-led
   Inspired by long-scroll editorial case studies.
   Scoped to pages that link this stylesheet + use .ed markup.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --paper:    #F4F1EA;
  --paper-2:  #ECE8DF;
  --paper-3:  #E3DED2;
  --ink:      #1B1916;
  --ink-2:    #57534B;
  --ink-3:    #908A7E;
  --line:     #DAD4C8;
  --line-2:   #C8C1B2;
  --accent:   #B0532B;   /* deep clay — the one reserved accent */
  --accent-2: #8A4523;
  --accent-soft: #B0532B14;

  --serif: 'Newsreader', Georgia, serif;
  --sans:  'Hanken Grotesk', system-ui, sans-serif;

  --maxw: 1180px;
  --textw: 720px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.ed {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.ed ::selection { background: var(--accent-soft); }

.ed h1, .ed h2, .ed h3, .ed h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.08;
  text-wrap: balance;
}

.ed p { text-wrap: pretty; }
.ed a { color: inherit; }

.ed :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------- layout primitives ---------- */

.ed-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 40px; }
.ed-text { max-width: var(--textw); }

.ed-skip {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600;
  text-decoration: none; border-radius: 0 0 8px 8px; padding: 10px 18px;
  transition: top 0.15s;
}
.ed-skip:focus { top: 0; }

/* ---------- nav ---------- */

.ed-nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.ed-nav .ed-wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 70px; gap: 24px;
}
.ed-brand {
  font-family: var(--serif); font-size: 19px; font-weight: 600;
  text-decoration: none; letter-spacing: -0.01em;
}
.ed-brand span { color: var(--ink-3); font-size: 13px; font-weight: 400; margin-left: 6px; letter-spacing: 0.04em; }
.ed-navlinks { display: flex; align-items: center; gap: 30px; }
.ed-navlinks a {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-2); text-decoration: none; transition: color 0.15s;
}
.ed-navlinks a:hover, .ed-navlinks a[aria-current="page"] { color: var(--accent); }

/* ---------- eyebrow / section numbering ---------- */

.ed-eyebrow {
  font-family: var(--sans);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  color: var(--accent);
}
.ed-eyebrow.muted { color: var(--ink-3); }

.ed-secnum {
  font-family: var(--sans);
  font-size: 13px; font-weight: 600; letter-spacing: 0.1em;
  color: var(--ink-3);
  display: inline-block; margin-bottom: 14px;
}

/* ---------- hero ---------- */

.ed-hero { padding: 56px 0 0; }
.ed-hero .crumb {
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 40px;
}
.ed-hero .crumb a { color: var(--ink-3); text-decoration: none; }
.ed-hero .crumb a:hover { color: var(--accent); }

.ed-hero h1 {
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02; max-width: 16ch; margin-bottom: 28px;
}
.ed-hero .frame-q {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  font-size: clamp(20px, 2.4vw, 28px); color: var(--ink-2);
  max-width: 30ch; line-height: 1.35;
}
.ed-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.ed-tag {
  font-size: 13px; font-weight: 500; color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 16px;
}

.ed-hero-img { margin-top: 56px; }

/* full-bleed image band */
.ed-bleed {
  width: 100vw; position: relative; left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
}
.ed-bleed image-slot, .ed-figure image-slot { display: block; width: 100%; }

.ed-figure { margin: 0; }
.ed-figure figcaption,
.ed-cap {
  font-size: 13px; color: var(--ink-3); margin-top: 12px; line-height: 1.5;
}
.ed-cap em, .ed-figure figcaption em { font-style: italic; }

/* ---------- meta block ---------- */

.ed-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 32px 28px;
  padding: 56px 0; border-top: 1px solid var(--line); margin-top: 64px;
}
.ed-meta .m-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--ink-3); margin-bottom: 10px;
}
.ed-meta .m-value { font-size: 16px; color: var(--ink); line-height: 1.5; }
.ed-meta .m-value span { display: block; color: var(--ink-2); font-size: 15px; }

/* ---------- about block ---------- */

.ed-about { padding: 80px 0; border-top: 1px solid var(--line); }
.ed-about .lede {
  font-family: var(--serif); font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.4; max-width: 24ch;
}
.ed-about .body { color: var(--ink-2); font-size: 18px; max-width: var(--textw); }
.ed-about .body strong { color: var(--ink); font-weight: 600; }
.ed-about .body p + p { margin-top: 18px; }
.ed-about-grid { display: grid; grid-template-columns: minmax(0,5fr) minmax(0,7fr); gap: 56px; }

/* ---------- section ---------- */

.ed-section { padding: 80px 0; border-top: 1px solid var(--line); }
.ed-section.tight { padding: 56px 0; }
.ed-section-head { margin-bottom: 40px; }
.ed-section-head h2 { font-size: clamp(30px, 4vw, 48px); max-width: 18ch; }
.ed-section-head h2 em { font-style: italic; color: var(--accent); }

.ed-section p { color: var(--ink-2); }
.ed-section p + p { margin-top: 18px; }
.ed-section .ed-text p strong { color: var(--ink); font-weight: 600; }
.ed-section .ed-text p em { font-style: italic; color: var(--ink); }

.ed-statement {
  font-family: var(--serif); font-size: clamp(24px, 3vw, 36px);
  line-height: 1.25; color: var(--ink); max-width: 22ch;
  margin: 8px 0 28px;
}
.ed-statement em { font-style: italic; color: var(--accent); }

/* ---------- big-number traction ---------- */

.ed-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 48px; margin-top: 16px;
}
.ed-stat .s-num {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(56px, 8vw, 96px); line-height: 0.95;
  letter-spacing: -0.02em; color: var(--ink);
}
.ed-stat .s-num .unit { color: var(--accent); }
.ed-stat .s-desc { font-size: 15px; color: var(--ink-2); margin-top: 14px; max-width: 26ch; }

/* ---------- pull quote ---------- */

.ed-quote {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(24px, 3.2vw, 38px); line-height: 1.3;
  color: var(--ink); max-width: 20ch; margin: 16px 0;
}
.ed-quote-attr {
  font-family: var(--sans); font-style: normal; font-size: 14px;
  color: var(--ink-3); margin-top: 18px; letter-spacing: 0.02em;
}

/* inline research participant quote */
.ed-pquote {
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
  padding: 32px 0; margin: 36px 0;
}
.ed-pquote .t {
  font-family: var(--serif); font-style: italic; font-size: clamp(20px,2.4vw,26px);
  line-height: 1.35; color: var(--ink); max-width: 28ch;
}
.ed-pquote .a { font-size: 14px; color: var(--ink-3); margin-top: 14px; }

/* ---------- numbered challenge / list items ---------- */

.ed-numlist { display: grid; gap: 0; margin-top: 16px; }
.ed-numlist .item {
  display: grid; grid-template-columns: 64px minmax(0,1fr);
  gap: 24px; padding: 28px 0; border-top: 1px solid var(--line);
  align-items: start;
}
.ed-numlist .item:last-child { border-bottom: 1px solid var(--line); }
.ed-numlist .n {
  font-family: var(--serif); font-size: 26px; color: var(--accent); line-height: 1;
}
.ed-numlist .it-title { font-family: var(--serif); font-size: 22px; color: var(--ink); margin-bottom: 6px; }
.ed-numlist .it-body { font-size: 16px; color: var(--ink-2); }
.ed-numlist .it-body strong { color: var(--ink); font-weight: 600; }

/* ---------- sub-spine (roman numeral) ---------- */

.ed-sub { padding-top: 56px; }
.ed-sub-label {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--accent);
  margin-bottom: 18px;
}
.ed-sub h3 { font-size: clamp(24px, 3vw, 34px); max-width: 20ch; margin-bottom: 16px; }

/* ---------- question cluster (Transparency / Control / …) ---------- */

.ed-questions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 36px 40px; margin: 24px 0; }
.ed-q h4 { font-size: 22px; margin-bottom: 8px; }
.ed-q p { font-size: 16px; color: var(--ink-2); }

/* ---------- 2-up / persona grids ---------- */

.ed-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ed-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.ed-grid-2 image-slot, .ed-grid-3 image-slot { display: block; width: 100%; }

/* ---------- compare (before/after) ---------- */

.ed-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 16px; }
.ed-compare .col {
  border: 1px solid var(--line); border-radius: 12px; padding: 26px 28px; background: var(--paper-2);
}
.ed-compare .col.after { border-color: var(--accent); background: var(--accent-soft); }
.ed-compare .c-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-3); margin-bottom: 14px;
}
.ed-compare .col.after .c-label { color: var(--accent); }
.ed-compare ul { list-style: none; display: grid; gap: 10px; }
.ed-compare li { font-size: 15px; color: var(--ink-2); padding-left: 18px; position: relative; }
.ed-compare li::before { content: "—"; position: absolute; left: 0; color: var(--ink-3); }

/* ---------- table ---------- */

.ed-table-wrap { overflow-x: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; }
.ed-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
.ed-table th, .ed-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ed-table thead th {
  font-family: var(--sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3); font-weight: 600; background: var(--paper-2);
}
.ed-table tbody tr:last-child td { border-bottom: none; }
.ed-table td { color: var(--ink-2); }
.ed-table .td-decision { color: var(--accent); font-weight: 600; }

/* ---------- note band / callout ---------- */

.ed-note {
  font-size: 15px; color: var(--ink-2); background: var(--paper-2);
  border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0;
  padding: 18px 22px; margin-top: 24px;
}

.ed-flag {
  display: inline-block; font-family: var(--sans); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
  border: 1px solid var(--accent); border-radius: 999px; padding: 3px 10px; margin-right: 10px;
}

/* ---------- flow ---------- */

.ed-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0; }
.ed-flow .node {
  font-family: var(--serif); font-size: 18px; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 22px; background: var(--paper-2);
}
.ed-flow .arrow { color: var(--accent); font-size: 18px; }

/* ---------- roadmap ---------- */

.ed-road { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
.ed-road .stage { border-top: 2px solid var(--line-2); padding-top: 16px; }
.ed-road .stage:first-child { border-top-color: var(--accent); }
.ed-road .phase { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.ed-road .r-title { font-family: var(--serif); font-size: 18px; margin-bottom: 6px; }
.ed-road .r-desc { font-size: 14px; color: var(--ink-2); }

/* ---------- bullet list ---------- */

.ed-bullets { list-style: none; display: grid; gap: 12px; margin-top: 18px; max-width: var(--textw); }
.ed-bullets li { font-size: 17px; color: var(--ink-2); padding-left: 26px; position: relative; }
.ed-bullets li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

/* ---------- threshold panel (illustrative UI) ---------- */

.ed-panel { border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; margin-top: 22px; background: #fff; }
.ed-panel .p-head { display: flex; justify-content: space-between; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.ed-panel .p-title { font-family: var(--serif); font-size: 19px; }
.ed-panel .p-meta { font-size: 13px; color: var(--ink-3); }
.ed-panel .p-summary { display: flex; flex-wrap: wrap; gap: 28px; padding: 18px 24px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.ed-panel .p-summary b { font-family: var(--serif); font-size: 22px; color: var(--ink); margin-right: 6px; }
.ed-panel .ed-table-wrap { border: none; border-radius: 0; margin: 0; }
.ed-panel .ed-table { min-width: 520px; }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; }
.st .st-ico { width: 16px; height: 16px; display: inline-grid; place-items: center; border-radius: 50%; font-size: 10px; font-weight: 700; }
.st-spec { color: var(--accent-2); } .st-spec .st-ico { background: var(--accent-soft); color: var(--accent); }
.st-due { color: #9a6a1f; } .st-due .st-ico { background: #9a6a1f1a; color: #9a6a1f; }
.st-default { color: var(--ink-2); } .st-default .st-ico { background: var(--paper-3); color: var(--ink-2); }
.st-none, .st-na { color: var(--ink-3); } .st-none .st-ico, .st-na .st-ico { background: var(--paper-3); color: var(--ink-3); }
.ed-panel .p-attn { padding: 18px 24px; border-top: 1px solid var(--line); }
.ed-panel .p-attn .a-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); font-weight: 600; margin-bottom: 10px; }
.ed-panel .p-attn ul { list-style: none; display: grid; gap: 6px; }
.ed-panel .p-attn li { font-size: 14px; color: var(--ink); }
.ed-panel .p-attn li span { color: var(--ink-3); }
.st-legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px 24px; border-top: 1px solid var(--line); }

/* ---------- disclosure ---------- */

.ed-disc { border: 1px solid var(--line); border-radius: 10px; padding: 4px 20px; }
.ed-disc + .ed-disc { margin-top: 12px; }
.ed-disc summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 14px 0; list-style: none; }
.ed-disc summary::-webkit-details-marker { display: none; }
.ed-disc summary::before { content: "+ "; color: var(--accent); }
.ed-disc[open] summary::before { content: "– "; }
.ed-disc .d-body { padding: 0 0 16px; font-size: 15px; color: var(--ink-2); }
.ed-disc .d-body p + p { margin-top: 10px; }

/* ---------- pager + footer ---------- */

.ed-pager { border-top: 1px solid var(--line); padding: 48px 0; }
.ed-pager .ed-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ed-pager a { text-decoration: none; display: grid; gap: 6px; }
.ed-pager a.next { text-align: right; }
.ed-pager .dir { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); }
.ed-pager .ttl { font-family: var(--serif); font-size: 22px; color: var(--ink); transition: color 0.15s; }
.ed-pager a:hover .ttl { color: var(--accent); }

.ed-footer { border-top: 1px solid var(--line); padding: 40px 0 64px; }
.ed-footer .ed-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.ed-footer a { font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2); text-decoration: none; }
.ed-footer a:hover { color: var(--accent); }
.ed-footer .f-meta { display: flex; gap: 22px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-3); }

/* ---------- responsive ---------- */

@media (max-width: 880px) {
  .ed-wrap { padding: 0 24px; }
  .ed-about-grid { grid-template-columns: 1fr; gap: 32px; }
  .ed-compare, .ed-grid-2, .ed-grid-3, .ed-road, .ed-questions { grid-template-columns: 1fr; }
  .ed-numlist .item { grid-template-columns: 44px minmax(0,1fr); gap: 16px; }
  .ed-pager .ed-wrap { grid-template-columns: 1fr; }
  .ed-pager a.next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
