/* Case study pages — extends ../styles.css (same fonts, colours, corner nav, floating shapes) */

:root {
  --ink: #ffffff;
  --muted: #a3a7b3;
  --line: rgba(255, 255, 255, .16);
  --accent: #ffd300;
  --paper: #1d1f25;
  --surface: #262933;
}

/* The home page locks scrolling; case pages need to scroll */
html, body.case {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.case { background: var(--paper); }


.case-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 120px 96px 160px;
}

.case-content a { color: inherit; }

.crumb {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 2rem;
  text-align: left;
  max-width: none;
}
.crumb a { text-decoration: none; transition: opacity .3s ease; }
.crumb a:hover { opacity: .7; }

.case-content h1 {
  text-align: left;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.1;
  max-width: 18ch;
  margin-bottom: 1.25rem;
}

.case-content p {
  text-align: left;
  max-width: 68ch;
  font-size: 1.05rem;
  line-height: 1.65;
  margin-bottom: 1rem;
}

.tags {
  color: var(--accent);
  font-size: 1rem !important;
  margin-bottom: 3rem !important;
}

/* Key facts row (like the experience grid on About) */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--ink);
  margin-bottom: 3rem;
}
.facts dt {
  font-family: var(--f-menu); font-weight: 500;
  font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
}
.facts dd { font-size: .95rem; color: var(--ink); line-height: 1.45; }

/* Images */
figure { margin: 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  cursor: zoom-in;
  background: var(--surface);
}
figcaption {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .6rem;
}
.hero { margin-bottom: 5rem; }
.hero img { border: 0; background: none; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem 2rem;
  margin: 2.5rem 0 0;
}
.gallery.one { grid-template-columns: 1fr; }
.gallery.three { grid-template-columns: repeat(3, 1fr); }

.gallery.four { grid-template-columns: repeat(4, 1fr); }
.gallery.five { grid-template-columns: repeat(5, 1fr); }
.gallery.six { grid-template-columns: repeat(6, 1fr); }
.gallery.tall img { border: 0; background: none; }

/* Grey stage for screenshots / phones */
.stage {
  background: var(--surface);
  padding: 2.5rem;
  margin: 2.5rem 0 0;
}
.stage .gallery { margin: 0; }
.stage figure img { border: 0; background: none; box-shadow: 0 6px 24px rgba(0,0,0,.35); }
.stage figcaption { color: var(--muted); }
.stage.bare figure img { box-shadow: none; }

.stage.dark { background: #141519; }
.stage.dark figcaption { color: #9a9a9a; }
.stage.dark figure img { box-shadow: none; }

/* Colour swatches */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1.2rem; margin: 1.2rem 0 2rem; }
.swatches div { font-size: .85rem; line-height: 1.4; }
.swatches i { display: block; height: 56px; margin-bottom: .5rem; border: 1px solid var(--line); }
.swatches small { color: var(--muted); display: block; }

/* Simple data table */
.datatable { width: 100%; border-collapse: collapse; font-size: .95rem; margin: 1rem 0 2rem; max-width: 68ch; }
.datatable td, .datatable th { text-align: left; padding: .6rem 1rem .6rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.datatable th { font-weight: 600; border-bottom-color: var(--ink); }
.datatable td:nth-child(2) { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Text + visual side by side */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin: 1.5rem 0;
}
.split.illu { grid-template-columns: 1.4fr 1fr; }
.split figure img, .illustration img { border: 0; background: none; cursor: default; }
.illustration { max-width: 320px; }

/* Process strip: Discovery → Framing → Iterate */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 1.5rem 0 1rem;
  border-top: 1px solid var(--ink);
}
.steps > div { padding: 1.2rem 1.5rem 0 0; }
.steps > div + div { padding-left: 1.5rem; border-left: 1px solid var(--line); }
.steps h3 { margin: 0 0 .5rem; }
.steps h3 span { color: var(--accent); margin-right: .4rem; }
.steps p { font-size: .95rem !important; }
.steps ul { list-style: none; font-size: .9rem; color: var(--muted); line-height: 1.6; }

/* Timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin: 1.5rem 0;
}
.timeline > div { border-top: 2px solid var(--ink); padding: 1.2rem 1.5rem 0 0; position: relative; }
.timeline > div::before {
  content: ""; position: absolute; top: -7px; left: 0;
  width: 12px; height: 12px; background: var(--accent); transform: rotate(45deg);
}
.timeline .kicker { margin-top: .4rem; }
.timeline .who { font-size: .9rem; color: var(--muted); margin-top: .8rem; }

/* Big numbers */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; margin: 1.5rem 0 0; }
.stats b { display: block; font-size: clamp(2rem, 4vw, 3rem); font-weight: 400; color: var(--accent); line-height: 1; margin-bottom: .4rem; }
.stats span { font-size: .9rem; }

/* Sections: label column + body column */
.block {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 3.5rem 0;
  border-top: 1px solid var(--line);
}
.block > h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin: 0;
  position: sticky;
  top: 40px;
  align-self: start;
}
.block > .body > *:first-child { margin-top: 0; }
.block > .body, .split > * { min-width: 0; }
@media (max-width: 768px) {
  .datatable { display: block; overflow-x: auto; }
  .datatable td:nth-child(2) { white-space: normal; }
}
.block h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 2rem 0 .6rem;
}

.lead {
  font-size: clamp(1.2rem, 2.2vw, 1.5rem) !important;
  line-height: 1.45 !important;
  max-width: 40ch !important;
}

ul.list {
  list-style: none;
  max-width: 68ch;
  margin: 0 0 1rem;
}
ul.list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: .45rem;
  line-height: 1.6;
}
ul.list li::before {
  content: "";
  position: absolute;
  left: 0; top: .62em;
  width: 7px; height: 7px;
  background: var(--accent);
  transform: rotate(45deg);
}

/* Multi-column card grids */
.cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 2.5rem;
  margin: 1.5rem 0;
}
.cols.three { grid-template-columns: repeat(3, 1fr); }
.cols > div h3 { margin-top: 0; }
.cols > div p, .cols > div li { font-size: .98rem; }

.kicker {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  margin-bottom: .5rem;
}

/* Quotes */
blockquote {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.45;
  margin: 0 0 .5rem;
  max-width: 40ch;
}
blockquote + cite {
  display: block;
  font-style: normal;
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
blockquote.red { color: var(--accent); }

/* Personas */
.persona dl {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: .3rem 1rem;
  font-size: .95rem;
  margin-bottom: 1rem;
}
.persona dt { color: var(--muted); }

/* Insight status */
.insights { list-style: none; display: grid; gap: .6rem; max-width: 68ch; }
.insights li {
  padding: .8rem 1rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
  line-height: 1.5;
}
.insights li span {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .2rem;
}
.insights .ok { border-left-color: #40e86f; }
.insights .ok span { color: #40e86f; }
.insights .part { border-left-color: #e08a00; }
.insights .part span { color: #f0a020; }
.insights .no { border-left-color: #e8405e; }
.insights .no span { color: #e8405e; }

/* Challenges table */
.challenges { width: 100%; border-collapse: collapse; font-size: .95rem; }
.challenges th {
  text-align: left;
  font-weight: 600;
  padding: 0 1rem .8rem 0;
  border-bottom: 1px solid var(--ink);
  width: 33.33%;
}
.challenges th:first-child { color: var(--accent); }
.challenges td {
  vertical-align: top;
  padding: 1.1rem 1.2rem 1.1rem 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.55;
}

/* Outcomes */
.outcomes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.5rem;
}
.outcomes h3 { margin: 0 0 .5rem; }
.outcomes h3::before { content: "# "; color: var(--accent); }

/* Vision statement */
.vision { display: grid; grid-template-columns: 90px 1fr; gap: .7rem 1.2rem; max-width: 60ch; }
.vision dt { color: var(--accent); font-size: .95rem; }
.vision dd { font-size: 1.05rem; line-height: 1.5; }

/* Next / prev */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--ink);
  padding-top: 2rem;
  margin-top: 2rem;
}
.pager a { text-decoration: none; max-width: 45%; transition: opacity .3s ease; }
.pager a:hover { opacity: .7; }
.pager small { display: block; color: var(--muted); font-size: .85rem; margin-bottom: .3rem; }
.pager .next { text-align: right; margin-left: auto; }

/* Work index */
.work-list { list-style: none; border-top: 1px solid var(--ink); }
.work-list li { border-bottom: 1px solid var(--line); }
.work-list a {
  display: grid;
  grid-template-columns: 60px 1fr 280px;
  gap: 2rem;
  align-items: center;
  padding: 1.8rem 0;
  text-decoration: none;
  transition: opacity .3s ease;
}
.work-list a:hover { opacity: .7; }
.work-list a:hover .t { color: var(--accent); }
.work-list .n { color: var(--muted); font-size: .95rem; }
.work-list .t { font-size: clamp(1.15rem, 2.2vw, 1.6rem); line-height: 1.25; transition: color .3s ease; }
.work-list .c { font-size: .95rem; }
.work-list .c small { display: block; color: var(--accent); }
.work-list img { width: 100%; display: block; }

.nda { font-size: .85rem !important; color: var(--muted); margin-top: 3rem; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20,21,25,.97);
  display: none;
  align-items: center; justify-content: center;
  padding: 40px;
  z-index: 500;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox .close {
  position: absolute; top: 30px; right: 40px;
  font-size: 1rem; background: none; border: 0; cursor: pointer; color: var(--ink);
}

@media (max-width: 1024px) {
  .case-content { padding: 100px 64px 140px; }
  .block { grid-template-columns: 1fr; gap: 1.2rem; }
  .block > h2 { position: static; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .cols.three { grid-template-columns: 1fr 1fr; }
  .work-list a { grid-template-columns: 50px 1fr; }
  .work-list a .c { grid-column: 2; }
  .gallery.five, .gallery.six { grid-template-columns: repeat(3, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .split, .split.illu, .steps, .timeline { grid-template-columns: 1fr; }
  .steps > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); margin-top: 1rem; }
  .timeline > div + div { margin-top: 2rem; }
  .gallery.four, .gallery.five, .gallery.six { grid-template-columns: repeat(2, 1fr); }
  .stage { padding: 1.2rem; }
  .illustration { max-width: 220px; }
}

@media (max-width: 768px) {
  .case-content { padding: 96px 20px 110px; }
  .gallery, .gallery.three, .cols, .cols.three, .outcomes { grid-template-columns: 1fr; }
  .challenges thead { display: none; }
  .challenges, .challenges tbody, .challenges tr, .challenges td { display: block; width: 100%; }
  .challenges tr { border-bottom: 1px solid var(--ink); padding: 1rem 0; }
  .challenges td { border: 0; padding: .4rem 0; }
  .challenges td::before {
    content: attr(data-label);
    display: block; font-weight: 600; font-size: .8rem;
    text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  }
  .challenges td:first-child::before { color: var(--accent); }
  .vision { grid-template-columns: 1fr; gap: .1rem; }
  .vision dd { margin-bottom: .6rem; }
  .persona dl { grid-template-columns: 1fr; }
  .persona dt { margin-top: .4rem; }
}

@media (max-width: 480px) {
  .case-content { padding: 96px 16px 100px; }
  .facts { grid-template-columns: 1fr; gap: 1rem; }
  .pager { flex-direction: column; }
  .pager a, .pager .next { max-width: none; text-align: left; margin-left: 0; }
}

/* Long scrolling screenshots: show the top, full image in the lightbox */
.stage .gallery:not(.five):not(.six) figure img { max-height: 620px; object-fit: cover; object-position: top; }

/* Site typography on case pages */
.case-content h1 { font-family: var(--f-bold); font-weight: 700; }
.block > h2 { font-family: var(--f-bold); font-weight: 700; font-size: 1.05rem; letter-spacing: .03em; }
.lead, blockquote, .stats b, .vision dd, .work-list .t, .pager a { font-family: var(--f-head); }
.case-content p, .case-content li, .case-content td, .case-content dd { font-size: .95rem; }
.lead { font-size: clamp(1.25rem, 2.2vw, 1.55rem) !important; }
.case-content a { color: var(--accent); }
.pager a { color: var(--ink); }
.pager a:hover { color: var(--accent); opacity: 1; }
.crumb a { color: var(--muted); }
.challenges th { color: var(--ink); }
.swatches i { border-color: var(--line); }
.lightbox .close { color: var(--ink); font-family: var(--f-menu); }

/* Three key facts instead of four: spread them across the row on wide screens */
@media (min-width: 1025px) {
  .facts:has(> div:nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
}

/* Four-step strips (tokens, CSA improvements) */
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) { .steps.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .steps.four > div:nth-child(3) { border-left: 0; padding-left: 0; } }
@media (max-width: 768px) { .steps.four { grid-template-columns: 1fr; } .steps.four > div { border-left: 0; padding-left: 0; } }

/* Phone screenshots: one consistent rounded-corner shape, also when cropped */
.gallery.phones figure { container-type: inline-size; }
.gallery.phones figure img { border: 0; border-radius: 18px; border-radius: 13.5cqw; }

/* Section tags: mono, sentence case, slightly smaller */
.block > h2 { font-family: var(--f-body); font-weight: 400; font-size: .85rem; letter-spacing: 0; text-transform: none; line-height: 1.5; }

/* Persona header: name, then role */
.persona-name { font-family: var(--f-bold); font-weight: 700; font-size: 1.6rem !important; line-height: 1.15 !important; color: var(--ink); margin: 0 0 .3rem !important; }
.persona-role { font-family: var(--f-body); font-size: .85rem !important; line-height: 1.4 !important; color: var(--accent); margin: 0 0 1rem !important; }

.steps p { overflow-wrap: anywhere; }

/* Closing line of a section ("And more to come"), with a short rule above */
.more-to-come { margin-top: 3rem; }
.more-to-come::before { content: ""; display: block; width: 2.5rem; height: 1px; background: var(--text); margin-bottom: 1rem; }

/* Token levels explained (design system case) */
.token-levels > div { display: flex; flex-direction: column; gap: .7rem; }
.token-levels em { font-style: normal; color: var(--link); }
.token-ex { display: flex; flex-wrap: wrap; gap: .4rem; }
.token-ex code { font-family: var(--f-body); font-size: .78rem; background: var(--surface); border: 1px solid var(--line); padding: .2rem .45rem; overflow-wrap: anywhere; }
