/* ============================================================
   Portfolio case-study styles
   Loaded after /css/test.css. Uses only test.css tokens:
   --ground-*, --ink, --body, --muted, --teal, --coral,
   --font-display (Newsreader), --font-body (Hanken Grotesk).
   Teal is used for buttons and large text only on light grounds.
   ============================================================ */

/* ---------- Case-study header (fits one screen at 1280px) ---------- */
.cs-head { padding: clamp(26px, 4.5vh, 46px) 0 clamp(28px, 4.5vh, 46px); }
.cs-head .wrap { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.cs-head h1 { font-size: clamp(32px, 3.8vw, 50px); max-width: 17ch; }
.cs-head .for { margin-top: 14px; font-size: 18px; line-height: 1.5; color: var(--body); max-width: 52ch; }
.cs-head .crumbs { font-size: 14px; margin: 0 0 18px; color: var(--muted); }
.cs-head .crumbs a { color: var(--kicker); text-decoration: underline; text-underline-offset: 4px; }
.sum3 { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; max-width: 60ch; }
.sum3 li { display: grid; grid-template-columns: 74px 1fr; gap: 14px; font-size: 16px; line-height: 1.5; padding-top: 12px; border-top: 1px solid var(--line); }
.sum3 b { font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--kicker); font-weight: 600; padding-top: 3px; }
.cs-card { border: 1px solid var(--outline); border-radius: 8px; background: var(--card); padding: 22px 22px 24px; }
.cs-card h2 { font-family: var(--font-body); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--kicker); line-height: 1.3; margin: 0 0 10px; }
.cs-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15.5px; line-height: 1.45; color: var(--body); }
.cs-card ul li { padding-left: 16px; position: relative; }
.cs-card ul li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
.cs-card .tools { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cs-card .tools p { font-size: 14.5px; line-height: 1.55; color: var(--body); }
.cs-card .cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
@media (max-width: 900px) {
  .cs-head .wrap { grid-template-columns: minmax(0, 1fr); }
  .sum3 li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- Section rhythm ---------- */
.cs-sec .wrap > .kicker + h2 { margin-bottom: 20px; }
.cs-sec h2 { max-width: 24ch; }
.cs-sec .lede { max-width: 66ch; }
.cs-sec p { max-width: 68ch; }
.cs-sec p + p { margin-top: 14px; }
.cs-sec h3 { margin: 30px 0 10px; }
.cs-sec ul.plain { margin: 12px 0 0; padding-left: 20px; max-width: 66ch; }
.cs-sec ul.plain li { margin: 7px 0; }
.cs-sec a { text-decoration: underline; text-underline-offset: 4px; }
.cs-sec a.btn { text-decoration: none; }
.cs-sec .note { font-size: 15px; color: var(--muted); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 40px; margin-top: 26px; }
.two > div { min-width: 0; }
@media (max-width: 820px) { .two { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Result labels ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; padding: 2px 8px 2px 7px; border: 1.5px solid var(--strong); border-radius: 3px; color: var(--strong); background: transparent; vertical-align: 1px; white-space: nowrap; }
.tag::before { content: ""; width: 8px; height: 8px; background: var(--strong); flex: none; }
.tag-real::before { border-radius: 0; }
.tag-pilot { border-style: double; border-width: 3px; padding: 0 6px 0 5px; }
.tag-pilot::before { border-radius: 50%; }
.tag-proj { border-style: dashed; }
.tag-proj::before { background: transparent; border: 1.5px solid var(--strong); border-radius: 0; }
.tag-sim { border-style: dotted; border-width: 2px; }
.tag-sim::before { background: transparent; border: 1.5px dotted var(--strong); border-radius: 50%; }

/* ---------- Audience facts ---------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 26px; }
.fact { border: 1px solid var(--line); border-radius: 8px; padding: 18px 18px 20px; background: var(--card); }
.fact h3 { margin: 0 0 8px; font-size: 17px; }
.fact p { font-size: 15.5px; line-height: 1.55; }
@media (max-width: 900px) { .facts { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Root-cause table (cards) ---------- */
.rc { display: grid; gap: 12px; margin-top: 24px; }
.rc-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, 1.6fr); gap: 8px 22px; border: 1px solid var(--line); border-radius: 8px; padding: 14px 18px; background: var(--card); align-items: start; }
.rc-row h3 { margin: 0; font-size: 16px; }
.rc-row .cause { font-size: 15px; }
.rc-row .cause b { font-weight: 600; color: var(--strong); }
.rc-row .fix { font-size: 15px; color: var(--body); }
.rc-row .lab { display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--kicker); margin-bottom: 3px; }
@media (max-width: 900px) { .rc-row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Action map diagram ---------- */
.amap { display: grid; grid-template-columns: minmax(200px, 250px) minmax(0, 1fr); gap: 0 34px; margin-top: 30px; align-items: start; }
.amap-goal { border: 2px solid var(--strong); border-radius: 8px; padding: 18px 18px 20px; background: var(--card); position: sticky; top: 96px; }
.amap-goal .lab, .amap .lab { display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--kicker); margin-bottom: 6px; }
.amap-goal p { font-family: var(--font-display); font-size: 22px; line-height: 1.2; color: var(--strong); max-width: none; }
.amap-goal small { display: block; margin-top: 12px; font-size: 13.5px; line-height: 1.5; color: var(--body); }
.amap-rows { list-style: none; margin: 0; padding: 0 0 0 26px; display: grid; gap: 16px; border-left: 2px solid var(--strong); }
.amap-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 34px; position: relative; }
.amap-row::before { content: ""; position: absolute; left: -26px; top: 26px; width: 26px; border-top: 2px solid var(--strong); }
.amap-cell { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 14px 15px 16px; position: relative; min-width: 0; }
.amap-cell.beh { border: 2px solid var(--strong); }
.amap-cell:not(:last-child)::after { content: "\2192"; position: absolute; right: -28px; top: 14px; font-size: 20px; line-height: 1; color: var(--strong); }
.amap-cell h3 { margin: 0 0 6px; font-size: 16.5px; }
.amap-cell p, .amap-cell li { font-size: 14.5px; line-height: 1.5; color: var(--body); max-width: none; }
.amap-cell ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.amap-cell li { padding-left: 13px; position: relative; }
.amap-cell li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; background: var(--strong); }
@media (max-width: 1000px) {
  .amap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .amap-goal { position: static; margin-bottom: 0; }
  .amap-rows { margin-left: 14px; padding-left: 18px; padding-top: 18px; }
  .amap-row { grid-template-columns: minmax(0, 1fr); gap: 26px 0; }
  .amap-row::before { left: -18px; width: 18px; top: 22px; }
  .amap-cell:not(:last-child)::after { content: "\2193"; right: auto; left: 50%; top: auto; bottom: -25px; }
}

/* ---------- Objectives ---------- */
.obj { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: obj; }
.obj li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 14px 16px; font-size: 16px; line-height: 1.55; }
.obj .id { font-family: var(--font-display); font-size: 17px; letter-spacing: .04em; color: var(--strong); padding-top: 1px; }
.obj b { color: var(--strong); font-weight: 600; }
.obj .beh { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }

/* ---------- Design decisions ---------- */
.decs { display: grid; gap: 18px; margin-top: 26px; }
.dec { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 22px 24px 24px; }
.dec h3 { margin: 0 0 14px; font-size: 21px; font-family: var(--font-display); font-weight: 500; letter-spacing: -.01em; line-height: 1.2; }
.dec dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.dec dt { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--kicker); padding-top: 4px; }
.dec dd { margin: 0; font-size: 16px; line-height: 1.55; }
.dec dd.trade { border-left: 4px solid var(--coral); padding-left: 14px; }
@media (max-width: 640px) { .dec dl { grid-template-columns: minmax(0, 1fr); gap: 2px; } .dec dd { margin-bottom: 10px; } }

/* ---------- v1 vs v2 ---------- */
.shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 26px 0 0; }
.shot { margin: 0; }
.shot img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--outline); background: #fff; }
.shot figcaption { margin-top: 8px; font-size: 13.5px; line-height: 1.45; color: var(--body); }
.shot figcaption b { color: var(--strong); font-weight: 600; }
.shots.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shots.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 30rem; }
.shots.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 20px; }
.shots.three { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 46rem; }
.shots-h { margin: 34px 0 0; font-family: var(--font-body); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--kicker); }
.shots-h + .shots { margin-top: 12px; }
@media (max-width: 1000px) { .shots, .shots.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } .shots.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .shots.wide { grid-template-columns: minmax(0, 1fr); } .shots.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .shots { gap: 12px; } .shot figcaption { font-size: 12.5px; } }
.cmp { margin-top: 34px; border-top: 1px solid var(--line); }
.cmp-head, .cmp-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(0, 1fr); gap: 8px 26px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.cmp-head { padding: 12px 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--kicker); }
.cs-sec .cmp-row .cmp-dim { margin: 0; font-family: var(--font-body); font-size: 15.5px; font-weight: 600; color: var(--strong); line-height: 1.35; }
.cmp-cell { font-size: 15.5px; line-height: 1.5; min-width: 0; }
.cmp-cell .cmp-ver { display: none; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--kicker); margin-bottom: 2px; }
@media (max-width: 760px) {
  .cmp-head { display: none; }
  .cmp-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .cmp-cell .cmp-ver { display: block; }
}
.cmp-cell .tag { margin-left: 6px; }

/* ---------- Artifacts ---------- */
.arts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.arts li { border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.arts h3 { margin: 0; font-size: 17px; }
.arts p { font-size: 15px; line-height: 1.5; max-width: none; }
.arts .dl { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14.5px; font-weight: 600; }
@media (max-width: 760px) { .arts { grid-template-columns: minmax(0, 1fr); } }
details.x { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
details.x > summary { cursor: pointer; padding: 14px 18px; font-weight: 600; font-size: 16px; color: var(--strong); list-style: none; display: flex; align-items: center; gap: 10px; }
details.x > summary::-webkit-details-marker { display: none; }
details.x > summary::after { content: none; }
details.x > summary::before { content: "+"; font-family: var(--font-display); font-size: 22px; line-height: 1; width: 22px; text-align: center; color: var(--strong); }
details.x[open] > summary::before { content: "\2212"; }
details.x .in { padding: 4px 18px 18px; }
details.x .in p, details.x .in li { font-size: 15.5px; }
.arch { margin: 22px auto 0; max-width: 560px; }
.arch svg { display: block; width: 100%; height: auto; }
.arch .box { fill: var(--card); stroke: var(--strong); stroke-width: 1.6; }
.arch .box.soft { stroke-dasharray: 6 5; stroke: var(--muted); }
.arch .gate { fill: none; stroke: var(--strong); stroke-width: 1.6; }
.arch text { fill: var(--strong); font-family: var(--font-body); font-size: 14.5px; }
.arch text.sm { font-size: 12.5px; fill: var(--body); }
.arch text.b { font-weight: 700; }
.arch path.ar { fill: none; stroke: var(--strong); stroke-width: 1.8; }
.arch path.ah { fill: var(--strong); stroke: none; }
pre.code { margin: 14px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: auto; font-size: 13px; line-height: 1.5; color: var(--strong); max-width: 100%; white-space: pre; }

/* ---------- Results ---------- */
.results { list-style: none; margin: 26px 0 0; padding: 0; border-top: 1px solid var(--line); }
.results li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 20px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.results .what { font-size: 16px; line-height: 1.5; color: var(--strong); }
.results .what span { display: block; font-size: 14.5px; color: var(--body); margin-top: 3px; }
@media (max-width: 560px) { .results li { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Callouts ---------- */
.callout { border: 1px solid var(--outline); border-left: 4px solid var(--coral); border-radius: 0 8px 8px 0; padding: 16px 20px 18px; margin-top: 24px; background: var(--card); max-width: 76ch; }
.callout h3 { margin: 0 0 6px; font-size: 17px; }
.callout p { font-size: 15.5px; line-height: 1.55; }
.callout p + p { margin-top: 10px; }
.status-line { font-size: 14px; color: var(--muted); margin-top: 14px; }

/* ---------- Docs pages ---------- */
.doc-head { padding: clamp(36px, 6vh, 60px) 0 clamp(26px, 4vh, 40px); }
.doc-head h1 { font-size: clamp(34px, 4.2vw, 54px); max-width: 20ch; }
.doc-head .lede { margin-top: 14px; }
.doc-head .crumbs { font-size: 14px; margin: 0 0 18px; color: var(--muted); }
.doc-head .crumbs a { color: var(--kicker); text-decoration: underline; text-underline-offset: 4px; }
.doc { max-width: 860px; margin: 0 auto; font-size: 17px; line-height: 1.65; }
.doc h1 { display: none; }
.doc h2 { font-size: clamp(26px, 3vw, 34px); margin: 46px 0 14px; max-width: none; }
.doc h3 { margin: 32px 0 10px; font-size: 19px; }
.doc p { margin: 14px 0; max-width: 72ch; }
.doc ul, .doc ol { margin: 14px 0; padding-left: 24px; max-width: 72ch; }
.doc li { margin: 6px 0; }
.doc a { text-decoration: underline; text-underline-offset: 4px; }
.doc blockquote { margin: 18px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--coral); color: var(--body); max-width: 72ch; }
.doc blockquote p { margin: 10px 0; }
.doc code { overflow-wrap: anywhere; font-size: .9em; background: rgba(13, 26, 42, .07); padding: 1px 5px; border-radius: 3px; }
.doc pre { padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: auto; font-size: 13.5px; line-height: 1.5; }
.doc pre code { background: none; padding: 0; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.doc .tbl { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.doc .tbl:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
.doc table { border-collapse: collapse; width: 100%; min-width: 620px; font-size: 15px; line-height: 1.5; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.doc th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--kicker); font-weight: 700; background: rgba(13, 26, 42, .04); }
.doc tr:last-child td { border-bottom: 0; }
.doc .dl-bar { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0 0 26px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 15px; }
.doc .doc-nav { margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 15px; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}


/* ---------- Skills grid (4 hazards x 3 moves) ---------- */
.skills { width: 100%; border-collapse: separate; border-spacing: 4px; margin-top: 22px; table-layout: fixed; }
.skills caption { text-align: left; padding-bottom: 8px; font-size: 14px; color: var(--body); }
.skills th, .skills td { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; text-align: left; vertical-align: top; font-size: 15px; line-height: 1.45; background: var(--card); color: var(--body); }
.skills thead th { background: transparent; border-color: transparent; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--kicker); padding-bottom: 2px; }
.skills tbody th { width: 92px; font-weight: 600; color: var(--strong); font-size: 16px; }
@media (max-width: 760px) {
  .skills, .skills tbody, .skills tr, .skills th, .skills td { display: block; width: auto; }
  .skills thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .skills tr { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--card); }
  .skills th, .skills td { border: 0; background: transparent; padding: 6px 8px; }
  .skills td::before { content: attr(data-move); display: block; font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--kicker); margin-bottom: 2px; }
}

/* ---------- portfolio site (portfolio.deanahlgren.com): its own header, footer and home page ---------- */
.brand .pf-tag { margin-left: 10px; padding: 3px 9px; border: 1px solid var(--outline); border-radius: 999px; font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--kicker); align-self: center; }
.footer .fh { margin: 0 0 12px; color: #fff; font-family: var(--font-body); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.pf-home h1 { max-width: 20ch; }
.pf-lead { max-width: 60ch; margin-top: 18px; font-size: 19px; line-height: 1.55; color: var(--body); }
.pf-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; }
.pf-card { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(22px, 3vw, 40px); align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: clamp(16px, 2vw, 24px); }
.pf-shot img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.pf-body h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.01em; }
.pf-body h3 a { color: var(--ink); text-decoration: none; }
.pf-body h3 a:hover { text-decoration: underline; text-underline-offset: 5px; }
.pf-body > p { margin: 12px 0 0; color: var(--body); }
.pf-skills { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pf-skills li { font-size: 13px; font-weight: 600; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--outline); color: var(--ink); }
.pf-body .pf-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
@media (max-width: 860px) { .pf-card { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { .brand .pf-tag { display: none; } }

/* visually hidden, still read by screen readers */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
