/* treysonwelch.com case-study group styles (Results, AI Software and the four case pages).
   Loads after /assets/site.css and only adds components; it never restyles the shared system. */

/* current section in the primary nav */
.nav a[aria-current] { color: var(--ink); background: var(--bg-2); }

/* ---------- Case header ---------- */
.case-head { padding: 40px 0 0; }
.back {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  text-decoration: none; padding: 6px 10px 6px 8px; margin-left: -8px; border-radius: 8px; transition: background .2s, color .2s;
}
.back svg { width: 14px; height: 14px; transform: scaleX(-1); transition: transform .3s var(--ease); }
.back:hover { background: var(--bg-2); color: var(--ink); }
.back:hover svg { transform: scaleX(-1) translateX(3px); }
.case-head h1 {
  margin-top: 28px; font-size: clamp(2.5rem, 5vw, 4.25rem); line-height: 1.02; font-weight: 600;
  letter-spacing: -0.036em; max-width: 16ch;
}
.ch-row { margin-top: 26px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.ch-sum { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.ch-row .kind { margin-top: 0 !important; }

/* ---------- Facts strip: the window-sticker spec label, laid flat ---------- */
.facts {
  margin-top: 44px; background: #fff; padding: 6px; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(22,38,74,0.06), 0 22px 44px -26px rgba(15,27,54,0.45);
}
.facts-in { border: 1px solid var(--navy); border-radius: 1px; }
.f-head { background: var(--navy); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 6px 16px; flex-wrap: wrap; padding: 10px 16px 9px; }
.f-head b { font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em; }
.f-head span { font-family: var(--mono); font-size: 12.5px; color: #D6DBE6; }
.f-row { margin: 0; display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(var(--n, 3), minmax(0, 1fr)); }
.f-row > div { padding: 12px 16px 14px; min-width: 0; }
.f-row > div + div { border-left: 1px solid var(--line); }
.f-row dt { font-size: 12.5px; color: var(--ink-3); }
.f-row dd { margin: 4px 0 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; text-wrap: balance; }

/* ---------- Case sections: a label rail beside the content ---------- */
.case-sec { padding: 96px 0 0; }
.case-sec.band { background: var(--paper); padding: 96px 0; margin-top: 96px; }
.case-sec.band + .case-sec { padding-top: 96px; }
.case-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px 56px; padding-top: 22px; border-top: 1px solid var(--line); }
.band .case-row { border-top-color: #D9D4C7; }
.rail { font-size: 14.5px; font-weight: 600; color: var(--ink-2); letter-spacing: -0.005em; }
.case-sec h2 { font-size: clamp(1.85rem, 3vw, 2.6rem); line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; max-width: 24ch; }
.case-body > p { margin-top: 20px; font-size: 18px; line-height: 1.65; color: var(--ink-2); max-width: 66ch; }
.case-body > h2 + p { margin-top: 22px; }

/* callouts: plain paper panels, no side stripe */
.callout { margin-top: 28px; background: var(--paper); border-radius: var(--r); padding: 22px 26px 24px; max-width: 74ch; }
.callout .c-t { font-size: 15px; font-weight: 600; color: var(--ink); }
.callout p { margin-top: 8px; font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.case-body > .callout:first-child { margin-top: 0; }

/* feature checklist with a drawn check */
.checks { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-top: 1px solid var(--line-2); font-size: 16px; line-height: 1.55; color: var(--ink-2); }
.checks svg { width: 16px; height: 16px; margin-top: 4px; color: var(--navy); }

/* ---------- Screenshot frames ---------- */
.shots { display: grid; gap: 64px; }
.frame { margin: 0; }
.frame-img {
  display: block; position: relative; background: #fff; border-radius: var(--r); padding: 28px;
  box-shadow: 0 0 0 1px rgba(22,38,74,0.08), 0 18px 40px -30px rgba(15,27,54,0.35); overflow: hidden; text-decoration: none;
  cursor: zoom-in;
}
.frame-img img {
  width: 100%; border-radius: 8px; background: var(--wash);
  box-shadow: 0 0 0 1px rgba(22,38,74,0.06), 0 1px 2px rgba(15,27,54,0.10), 0 12px 30px -12px rgba(15,27,54,0.28);
  transition: transform .7s var(--ease);
}
.frame.tall .frame-img { padding-bottom: 0; }
.frame.tall .frame-img img { max-height: 760px; object-fit: cover; object-position: top center; border-radius: 8px 8px 0 0; }
.frame.tall .frame-img::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 120px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 92%);
}
.frame-img:hover img { transform: translateY(-4px); }
.full {
  position: absolute; right: 16px; bottom: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: 8px; background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600;
  box-shadow: 0 0 0 1px rgba(22,38,74,0.12), 0 6px 16px -6px rgba(15,27,54,0.35); transition: background .2s;
}
.full svg { width: 13px; height: 13px; }
.frame-img:hover .full { background: var(--wash); }
.frame figcaption { margin-top: 16px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); max-width: 78ch; }
.case-head .frame { margin-top: 40px; }

/* full-size viewer */
.lb {
  margin: 0; padding: 64px 24px 40px; border: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(15,27,54,0.94); overflow: auto; cursor: zoom-out;
}
.lb::backdrop { background: rgba(15,27,54,0.6); }
.lb img { width: 100%; max-width: 1400px; margin: 0 auto; border-radius: 8px; }
.lb-x {
  position: fixed; top: 14px; right: 16px; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border-radius: 9px; border: 1px solid rgba(245,242,234,0.3); background: rgba(15,27,54,0.6); color: var(--on-navy);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.lb-x svg { width: 12px; height: 12px; }
.lb-x:hover { background: var(--navy); }

/* ---------- Outcome ---------- */
.ledger { margin: 32px 0 0; border-top: 1px solid var(--navy); max-width: 820px; }
.ledger > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 8px 32px; padding: 18px 0 17px; border-bottom: 1px solid var(--line); }
.ledger dt { font-size: 16px; color: var(--ink-2); }
.ledger dd { margin: 0; font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-weight: 600; letter-spacing: -0.028em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ledger > div.lead dd { font-size: clamp(2rem, 3.6vw, 2.9rem); }
.status { margin-top: 32px; background: var(--paper); border-radius: var(--r); padding: 22px 26px 24px; max-width: 820px; }
.badge {
  display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--navy); color: #fff; font-size: 12.5px; font-weight: 600;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.badge.wip { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.badge.wip::before { background: transparent; border: 1.5px solid var(--navy); }
.status p { margin-top: 12px; font-size: 16.5px; line-height: 1.65; color: var(--ink-2); max-width: 72ch; }
.status strong { color: var(--ink); font-weight: 600; }

/* ---------- Next and previous ---------- */
.case-nav { margin-top: 112px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cn { display: flex; flex-direction: column; gap: 6px; padding: 28px 0 30px; text-decoration: none; }
.cn + .cn { border-left: 1px solid var(--line); padding-left: 32px; align-items: flex-end; text-align: right; }
.cn-dir { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.cn-dir svg { width: 14px; height: 14px; transition: transform .3s var(--ease); }
.cn.prev .cn-dir svg { transform: scaleX(-1); }
.cn-t { font-size: clamp(1.3rem, 2vw, 1.6rem); font-weight: 600; letter-spacing: -0.022em; line-height: 1.2; }
.cn:hover .cn-t { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--cherry); }
.cn.next:hover .cn-dir svg { transform: translateX(3px); }
.cn.prev:hover .cn-dir svg { transform: scaleX(-1) translateX(3px); }

/* ---------- Booking band ---------- */
.cta-band { margin-top: 112px; background: var(--navy); color: var(--on-navy); padding: 88px 0; }
.cta-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 72px; align-items: center; }
.cta-band h2 { font-size: clamp(2rem, 3.8vw, 3.2rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 600; max-width: 14ch; }
.cta-band p { font-size: 18px; line-height: 1.55; color: var(--on-navy-2); max-width: 46ch; }
.cta-actions { margin-top: 26px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.cta-actions .mail { font-size: 15.5px; color: var(--on-navy-2); }
.cta-actions .mail a { color: var(--on-navy); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: rgba(245,242,234,0.4); }
.cta-actions .mail a:hover { text-decoration-color: var(--cherry); }
.cta-band + .foot { border-top: 1px solid var(--on-navy-line); }
.on-dark :focus-visible { outline-color: #F5F2EA; }

/* ---------- Listing pages ---------- */
.list-head { padding: 40px 0 0; }
.list-head h1 { margin-top: 28px; font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1.02; font-weight: 600; letter-spacing: -0.038em; max-width: 15ch; }
.list-head .back + h1 { margin-top: 24px; }
.list-head > .wrap > h1:first-child { margin-top: 24px; }
.list-sum { margin-top: 22px; font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 56ch; }
.listing { padding-top: 72px; }
.cases { list-style: none; margin: 0; padding: 0; }
.cases > li + li { border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px 56px; align-items: center; padding: 40px 0; text-decoration: none; }
.cases > li:first-child .item { padding-top: 8px; }
.thumb { display: block; margin: 0; aspect-ratio: 16 / 10; background: var(--paper); border-radius: var(--r); padding: 28px 28px 0; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top left; border-radius: 8px 8px 0 0; box-shadow: 0 1px 2px rgba(15,27,54,0.10), 0 12px 30px -12px rgba(15,27,54,0.28); transition: transform .7s var(--ease); }
.item h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; }
.item p { margin-top: 12px; font-size: 17px; color: var(--ink-2); max-width: 48ch; }
.item .kind span { background: transparent; }
.item .tlink { margin-top: 22px; }
.item:hover .thumb img { transform: translateY(-6px); }
.item:hover h2 { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; text-decoration-color: var(--cherry); }
.listing .case-row { padding-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .case-row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .f-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .f-row > div:first-child { grid-column: 1 / -1; }
  .f-row > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .f-row > div:nth-child(n+3):nth-child(odd) { border-left: 1px solid var(--line); }
  .f-row > div:nth-child(2):last-child { grid-column: 1 / -1; }
  .item { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .cta-grid { grid-template-columns: minmax(0, 1fr); align-items: start; }
}
@media (max-width: 720px) {
  .case-head, .list-head { padding-top: 28px; }
  .case-head h1 { margin-top: 20px; font-size: clamp(2.3rem, 10.4vw, 3.2rem); letter-spacing: -0.035em; }
  .list-head h1 { font-size: clamp(2.45rem, 11.4vw, 3.4rem); letter-spacing: -0.04em; }
  .ch-sum, .list-sum { font-size: 17.5px; }
  .facts { margin-top: 32px; }
  .f-head { padding: 10px 14px 9px; }
  .f-row { grid-template-columns: minmax(0, 1fr); }
  .f-row > div { padding: 11px 14px 12px; }
  .f-row > div:nth-child(n) { border-left: 0; grid-column: auto; }
  .f-row > div + div { border-top: 1px solid var(--line); }
  .case-sec { padding-top: 72px; }
  .case-sec.band { margin-top: 72px; padding: 72px 0; }
  .case-sec.band + .case-sec { padding-top: 72px; }
  .case-body > p { font-size: 17px; }
  .checks { grid-template-columns: minmax(0, 1fr); }
  .callout, .status { padding: 18px 18px 20px; }
  .shots { gap: 48px; }
  .frame-img { padding: 14px; }
  .frame.tall .frame-img img { max-height: 520px; }
  .frame.tall .frame-img::after { height: 90px; }
  .full { right: 10px; bottom: 10px; height: 30px; font-size: 13px; }
  .frame figcaption { font-size: 15px; }
  .ledger > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ledger dd { order: -1; text-align: left; white-space: normal; }
  .case-nav { margin-top: 80px; grid-template-columns: minmax(0, 1fr); }
  .cn { padding: 22px 0 24px; }
  .cn + .cn { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .cta-band { margin-top: 80px; padding: 64px 0; }
  .listing { padding-top: 48px; }
  .item { padding: 32px 0; }
  .thumb { padding: 18px 18px 0; }
  .lb { padding: 60px 12px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .frame-img:hover img, .item:hover .thumb img { transform: none; }
}
