/* ═══════════════════════════════════════════════════════════════════════════
   CASE STUDY - case-study.css
   Shared layout for all case study pages. Theme-neutral: each project supplies
   its own palette via a <project>.css sheet (orbiq.css, fortywinks.css) that
   overrides the variables below, scoped to a .case-study-body--<project> class.
   ═══════════════════════════════════════════════════════════════════════════ */

.case-study-body {
  /* Neutral slate defaults — overridden per project (see orbiq.css / fortywinks.css) */
  --cs-hero-bg: linear-gradient(180deg, #2b2b33 0%, #1f1f26 55%, #18181e 100%);
  --cs-hero-border: #34343d;
  --cs-footer-bg: #18181e;
  --cs-accent: #6b6b7a;          /* primary accent (quotes, active dots) */
  --cs-title-accent: #9a9ab0;    /* highlighted word in the hero title */
  --cs-num-color: #6b6b7a;       /* section numbers (00, 01 …) */
  --cs-dark-card: #26262e;       /* dark cards (problem, reflect) */

  background: #f0ede8;
  color: #1a1a1a;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.case-study-body a { color: inherit; }
.cs-back-mobile    { display: none; }

/* Tags in the content sections (light bg) */
.cs-main .tag--violet { background: #ede9f8; color: #5b4da0; }
.cs-main .tag--pink   { background: #fde8f0; color: #b03070; }
.cs-main .tag--purple { background: #ebe8f5; color: #6040b0; }
.cs-main .tag--orange { background: #fff0e0; color: #b06000; }

/* Extra tag colours used on case pages */
.tag--green { border-color: #4caf7d; }
.tag--blue  { border-color: #5b9bd5; }


/* ─── Nav: wordmark left, links right ─────────────────────────────────────── */
.case-study-body .nav {
  justify-content: space-between;
  align-items: center;
  transition: background 0.3s ease, color 0.3s ease;
}

.nav-brand {
  font-family: 'Jersey25', sans-serif;
  font-size: 1.35rem;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: color 0.3s ease;
}

/* Default state - light text/logo for contrast over the dark hero.
   Scoped to `.case-study-body .nav` so it beats `.case-study-body a { color: inherit }`. */
.case-study-body .nav .nav-links a,
.case-study-body .nav .nav-brand {
  color: #fff;
  transition: color 0.3s ease;
}

/* Brighter accents so the wordmark reads on the dark hero */
.nav-brand .accent-mc { color: #5fbf77; }
.nav-brand .accent-n  { color: #e8cc4a; }
.nav--light .nav-brand .accent-mc { color: #2e6e3c; }
.nav--light .nav-brand .accent-n  { color: #b8941e; }

/* When scrolled into the light content area, swap to dark text */
.case-study-body .nav.nav--light {
  background: rgba(240, 237, 232, 0.88);
}

.case-study-body .nav.nav--light .nav-links a,
.case-study-body .nav.nav--light .nav-brand {
  color: #1a1a1a;
}

/* Hamburger bars + dropdown divider go dark on the light (scrolled) nav */
.case-study-body .nav.nav--light .nav-toggle { color: #1a1a1a; }
.case-study-body .nav.nav--light .nav-links { border-top-color: rgba(0,0,0,0.15); }

/* Work submenu: on the light (scrolled) nav, the desktop dropdown card flips to
   light so its now-dark text stays legible. Mobile keeps the inline transparent list. */
@media (min-width: 821px) {
  .case-study-body .nav.nav--light .nav-sub {
    background: rgba(240, 237, 232, 0.97);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  }
  .case-study-body .nav.nav--light .nav-sub a:hover {
    background: rgba(0, 0, 0, 0.06);
  }
}

/* ─── Hero ─────────────────────────────────────────────────────────────────── */
.cs-hero-bg {
  background: var(--cs-hero-bg);
  position: relative;
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-bottom: 3px solid var(--cs-hero-border);
}

.cs-hero-content {
  position: relative;
  z-index: 5;
  /* top padding clears the fixed nav (≈5.5rem tall incl. margin) */
  padding: 8.5rem 6vw 4.5rem;
  max-width: 760px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cs-title {
  font-size: clamp(2rem, 5.2vw, 3.6rem);
  color: #f3f0e8;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-shadow: 0 3px 8px rgba(0,0,0,0.4);
  margin-bottom: 0.25rem;
}

.cs-title-accent {
  font-family: 'Jersey25', sans-serif;
  font-weight: 400;
  /* pixel font reads smaller - bump it to match the surrounding text */
  font-size: 1.18em;
  letter-spacing: 0.02em;
  color: var(--cs-title-accent);
}

/* Descriptor line beneath the project name - smaller, lighter, not bold */
.cs-subtitle {
  font-size: 2em;
  font-weight: 400;
  color: #fff;
  line-height: 1.2;
  letter-spacing: 0.01em;
  margin-bottom: 1.1rem;
}

.cs-hero-desc {
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  color: rgba(255,255,255,0.7);
  line-height: 1.65;
  max-width: 560px;
  margin-bottom: 1.4rem;
}

.cs-hero-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Tags on the dark hero - outline style, matching home page exactly */
.cs-hero-bg .tag { background: transparent; }

/* Hero sprite - bottom right of the dark hero */
.cs-hero-sprite {
  position: absolute;
  bottom: 1rem;
  right: 6vw;
  width: clamp(140px, 18vw, 260px);
  z-index: 4;
}


/* ─── Main layout ────────────────────────────────────────────────────────── */
.cs-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem clamp(1.5rem, 5vw, 4rem) 6rem;
}

/* ─── Section layout ─────────────────────────────────────────────────────── */
.cs-section {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0 3rem;
  padding: 3rem 0;
  border-top: 1px solid rgba(0,0,0,0.1);
}

.cs-section-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 0.15rem;
}

.cs-section-num {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cs-num-color);
  font-family: 'Segoe UI', monospace;
}

.cs-section-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #666;
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cs-section-body {
  min-width: 0;
}

.cs-section-heading {
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.6rem;
  line-height: 1.25;
}

.cs-section-intro {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1.75rem;
  max-width: 680px;
  line-height: 1.65;
}

.cs-body-text {
  font-size: 1rem;
  color: #444;
  line-height: 1.7;
  max-width: 720px;
  margin-bottom: 1.5rem;
}

.cs-subheading {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 1.75rem 0 0.6rem;
}

/* ─── Overview cards ─────────────────────────────────────────────────────── */
.cs-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.cs-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
}

.cs-card-icon {
  font-size: 1.2rem;
  margin-bottom: 0.4rem;
}

.cs-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 0.35rem;
}

.cs-card p {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.5;
}

/* Constraints / note bar */
.cs-constraints {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 0.9rem 1.25rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.55;
}

.cs-constraints-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: #b06000;
}

/* Tan note card (Forty Winks "additional findings" / reflection note) */
.cs-note {
  background: #e8dfc8;
  border: 1px solid #d8cba8;
  border-radius: 10px;
  padding: 1rem 1.3rem;
  font-size: 0.95rem;
  color: #5a4a28;
  line-height: 1.6;
  margin: 1.5rem 0;
}

/* ─── Process timeline ───────────────────────────────────────────────────── */
.cs-process {
  display: flex;
  align-items: center;
  background: #e7e3db;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  padding: 0.9rem 1.5rem;
  gap: 0;
  margin: 0 0 2rem;
}

.cs-process-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  text-decoration: none;
  transition: transform 0.15s;
}

.cs-process-step:hover { transform: translateY(-1px); }

.cs-process-step span {
  font-size: 0.72rem;
  color: #5e5e5e;
  white-space: nowrap;
  font-weight: 500;
  transition: color 0.15s;
}

.cs-process-step:hover span { color: var(--cs-accent); }

.cs-process-step--active span {
  color: #1a1a1a;
  font-weight: 700;
}

.cs-process-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(0,0,0,0.14);
  border: 2px solid rgba(0,0,0,0.18);
  transition: background 0.15s, border-color 0.15s;
}

.cs-process-step:hover .cs-process-dot { border-color: var(--cs-accent); }

.cs-process-step--active .cs-process-dot {
  background: var(--cs-accent);
  border-color: var(--cs-title-accent);
}

.cs-process-line {
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.12);
  margin-bottom: 1.2rem;
  min-width: 20px;
}

/* ─── Research pain/finding cards ────────────────────────────────────────── */
.cs-pain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}

.cs-pain-card {
  border-radius: 8px;
  padding: 1rem 1.1rem;
}

.cs-pain-card--purple {
  background: #ede9f8;
  border: 1px solid #d4cdf0;
}

.cs-pain-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #3a2a70;
  margin-bottom: 0.25rem;
}

.cs-pain-card p {
  font-size: 0.95rem;
  color: #5a4a90;
}

/* Finding cards - white with accent left border (Forty Winks research) */
.cs-finding-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-left: 4px solid var(--cs-accent);
  border-radius: 8px;
  padding: 1rem 1.2rem;
}

.cs-finding-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 0.3rem;
}

.cs-finding-card p {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.55;
}

/* ─── Problem / Solution ─────────────────────────────────────────────────── */
.cs-problem-solution {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.cs-problem, .cs-solution {
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
}

.cs-problem {
  background: var(--cs-dark-card);
  color: #e8e4f5;
}

.cs-solution {
  background: var(--cs-dark-card);
  color: #e8e4f5;
}

.cs-ps-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 0.65rem;
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.cs-ps-label--problem {
  background: rgba(220,60,60,0.25);
  color: #ff9090;
}

.cs-ps-label--solution {
  background: rgba(60,180,120,0.25);
  color: #80e8b8;
}

.cs-problem p, .cs-solution p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ─── Image grids ────────────────────────────────────────────────────────── */
.cs-image-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}

.cs-image-grid img {
  border-radius: 8px;
  width: 100%;
  height: auto;
  /* fit the whole screenshot in the thumbnail rather than cropping it */
  object-fit: contain;
  align-self: start;
  cursor: zoom-in;
  transition: transform 0.18s, box-shadow 0.18s;
  background: #e0ddd8;
}

.cs-image-grid img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

/* Full-width single image (user flows, journey maps) */
.cs-image-wide {
  margin: 0 0 1rem;
}

.cs-image-wide img {
  border-radius: 8px;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  transition: transform 0.18s, box-shadow 0.18s;
  background: #e0ddd8;
}

.cs-image-wide img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.cs-image-wide figcaption {
  font-size: 0.78rem;
  color: #777;
  margin-top: 0.4rem;
  font-weight: 500;
}

/* ─── Design grid (2-col with captions) ──────────────────────────────────── */
.cs-design-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem 1rem;
}

/* Single figure - centre it and cap its width rather than leaving it in column 1 */
.cs-design-grid--single {
  grid-template-columns: minmax(0, 420px);
  justify-content: center;
}

.cs-design-fig {
  margin: 0;
}

.cs-design-fig img {
  border-radius: 8px;
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  object-position: top;
  cursor: zoom-in;
  transition: transform 0.18s, box-shadow 0.18s;
  background: #1a1a2e;
}

/* Tall variant - portrait screenshots (full pages, mobile flows) */
.cs-design-fig--tall img {
  aspect-ratio: 4/5;
}

.cs-design-fig img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.cs-design-fig figcaption {
  font-size: 0.78rem;
  color: #777;
  margin-top: 0.4rem;
  font-weight: 500;
}

/* ─── Insights ───────────────────────────────────────────────────────────── */
.cs-insights {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.cs-insight {
  display: flex;
  gap: 1rem;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.07);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  align-items: flex-start;
}

.cs-insight-num {
  background: #f0ede8;
  border: 1px solid #ddd;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #666;
  flex-shrink: 0;
}

.cs-insight p {
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
}

/* ─── Quote ──────────────────────────────────────────────────────────────── */
.cs-quote {
  border-left: 3px solid var(--cs-accent);
  background: #fff;
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.4rem;
  margin: 0 0 1.5rem;
  font-style: italic;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ─── Reflect cards ──────────────────────────────────────────────────────── */
.cs-reflect-cards {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cs-reflect-card {
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.cs-reflect-card--dark {
  background: var(--cs-dark-card);
  color: #f3f0e8
}

/* ─── Footer band - dark band with deer sprite + Back link ───────────────── */
.cs-footer {
  background: var(--cs-footer-bg);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 3rem clamp(1.5rem, 5vw, 4rem) 2.25rem;
  gap: 1rem;
}

.cs-footer .sprite {
  width: clamp(44px, 5vw, 68px);
  image-rendering: pixelated;
}

.case-study-body .cs-footer-back {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 1.1rem;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 8px;
  transition: background 0.15s;
}

.cs-footer-back:hover { background: rgba(255,255,255,0.12); }

/* ─── Modal ──────────────────────────────────────────────────────────────── */
.cs-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.88);
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.cs-modal.is-open {
  display: flex;
}

.cs-modal-img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transform-origin: 0 0;
  cursor: zoom-in;
}

.cs-modal-img.is-zoomed { cursor: grab; }
.cs-modal-img.is-zoomed:active { cursor: grabbing; }

.cs-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 1rem;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.cs-modal-close:hover {
  background: rgba(255,255,255,0.22);
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .cs-section {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .cs-section-label {
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
  }

  .nav-links { gap: 1.5rem; }
  .cs-back-mobile { display: block; font-size: 0.85rem; color: #666; margin-bottom: 1rem; }

  /* Extra bottom padding leaves room for the larger hero sprite below the text */
  .cs-hero-content { padding: 7.5rem 6vw 10rem; }

  .cs-cards-grid { grid-template-columns: 1fr; }
  .cs-pain-grid  { grid-template-columns: 1fr; }
  .cs-problem-solution { grid-template-columns: 1fr; }
  .cs-image-grid { grid-template-columns: 1fr; }
  .cs-design-grid { grid-template-columns: 1fr; }

  /* Hero sprite stays prominent on mobile rather than shrinking */
  .cs-hero-sprite { width: clamp(150px, 38vw, 210px); right: 5vw; }

  .cs-process {
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  .cs-process-line { display: none; }

  /* Larger, more legible type on small screens */
  .cs-title        { font-size: clamp(2.5rem, 11vw, 3.4rem); }
  .cs-hero-desc    { font-size: 1.05rem; }
  .cs-section-heading { font-size: 1.4rem; }
  .cs-section-intro,
  .cs-body-text    { font-size: 1.05rem; }
  .cs-subheading   { font-size: 1.15rem; }
  .cs-card p,
  .cs-pain-card h4,
  .cs-finding-card h4,
  .cs-problem p,
  .cs-solution p,
  .cs-insight p,
  .cs-quote,
  .cs-reflect-card,
  .cs-note          { font-size: 1rem; }
  .cs-pain-card p,
  .cs-finding-card p { font-size: 0.95rem; }
  .cs-design-fig figcaption,
  .cs-image-wide figcaption { font-size: 0.9rem; }
}
