/* ============================================================
   CASE-STUDY PAGE TEMPLATE
   Loaded after tokens.css + style.css, so nav, buttons, chips, quote and stack chips are the same
   components as on the home page. Only what is specific to a case-study page lives here.
   To make a new case study: copy gymdesk/index.html to <project>/index.html and edit the content.
   ============================================================ */

/* ---------- header ---------- */
.case-head {
  padding-top: calc(var(--nav-h) + var(--space-8));
  padding-bottom: var(--head-gap);
}
.case-back {
  display: flex; width: fit-content; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-7);
  transition: color var(--dur-fast), gap var(--dur-base) var(--ease-out);
}
.case-back:hover { color: var(--accent); gap: var(--space-3); }

.case-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(48px, 10vw, 150px);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-transform: uppercase;
}
.case-lede {
  max-width: 640px;
  margin-top: var(--space-6);
  color: var(--ink-dim);
  font-size: clamp(17px, 1.5vw, 21px);
}

/* facts at a glance: status, type, who uses it … (add Role / Timeline when known) */
/* cell borders overlap by 1px (negative margin) so they read as single hairlines, and an empty
   slot in the last row stays the page colour instead of showing a grey block */
.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: var(--space-8);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.case-meta > div {
  padding: var(--space-5);
  margin: 0 -1px -1px 0;
  border: solid var(--line-soft);
  border-width: 0 1px 1px 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3);
}
.case-meta dt { color: var(--accent); font-size: var(--fs-micro); }
.case-meta dd { color: var(--ink); font-size: 15px; line-height: 1.5; }

/* ---------- hero visual (an illustration until real screenshots exist) ---------- */
.case-visual { padding-bottom: var(--head-gap); }
.case-visual__frame {
  display: grid; place-items: center;
  aspect-ratio: 16 / 8;
  padding: clamp(24px, 4vw, 64px);
  background:
    radial-gradient(ellipse at 50% 120%, var(--accent-wash), transparent 60%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.case-visual__frame svg { width: min(560px, 100%); height: auto; max-height: 100%; }

/* screenshots / video: shown instead of the illustration once they exist */
.case-shots { display: grid; gap: var(--space-5); }
.case-shots img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }

/* ---------- proof numbers ---------- */
.case-proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border-block: 1px solid var(--line);
}
.case-proof > div {
  padding-block: var(--space-7);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.case-proof > div + div { padding-left: var(--space-7); border-left: 1px solid var(--line-soft); }
.case-proof b {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(56px, 8vw, 120px);
  line-height: 1;
  color: var(--accent);
}

/* ---------- Problem / Before / What I built / Result ---------- */
.case-section {
  display: grid;
  grid-template-columns: minmax(140px, 0.32fr) minmax(0, 1fr);
  gap: var(--space-7);
  padding-block: var(--space-8);
  border-top: 1px solid var(--line-soft);
}
.case-section:first-of-type { border-top: 0; }
.case-section__label {
  align-self: start;
  position: sticky; top: calc(var(--nav-h) + var(--space-5));
  color: var(--accent);
}
.case-section h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(28px, 3.4vw, 48px);
  line-height: 1.1;
  margin-bottom: var(--space-5);
}
.case-section p { max-width: 640px; color: var(--ink-dim); }
.case-list { list-style: none; display: grid; gap: var(--space-4); max-width: 640px; }
.case-list li { position: relative; padding-left: 20px; color: var(--ink-dim); }
.case-list li::before {
  content: ""; position: absolute; left: 0; top: 0.8em;
  width: 9px; height: 1px; background: var(--accent);
}
.case-list strong { color: var(--ink); font-weight: 500; }

/* ---------- quote + stack ---------- */
.case-quote-wrap { padding-block: var(--space-8); border-top: 1px solid var(--line-soft); }
.case-quote-wrap .project__quote blockquote { font-size: clamp(26px, 3.4vw, 48px); line-height: 1.2; }
.case-quote-wrap .project__quote { max-width: 900px; padding-left: var(--space-5); }

.case-stack { padding-block: 0 var(--section-pad); }
.case-stack .section__label { margin-bottom: var(--space-4); }
.case-stack .project__stack { max-width: none; }

/* ---------- closing call to action ---------- */
.case-cta { background: var(--bg-soft); border-top: 1px solid var(--line-soft); padding-block: var(--section-pad) var(--space-9); }
.case-cta__text {
  max-width: 820px;
  margin-bottom: var(--space-7);
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(22px, 2.8vw, 38px);
  line-height: 1.25;
  word-spacing: var(--ws-display);
}

@media (max-width: 820px) {
  .case-section { grid-template-columns: 1fr; gap: var(--space-4); padding-block: var(--space-7); }
  .case-section__label { position: static; }
  .case-visual__frame { aspect-ratio: 4 / 3; }
  .case-proof > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line-soft); }
  .case-proof > div { padding-block: var(--space-6); }
  .case-cta .contact__actions .btn--big { width: 100%; justify-content: center; }
}
