/* =========================================
   Aroshi Amarasinghe — Portfolio
   Forest green palette
   ========================================= */

:root {
  --bg: #fffefc;
  --forest: #2d5d2d;
  --forest-dark: #1e401e;
  --green-light: #b7cfb6;
  --green-lightest: #f4faf4;
  --text: #091008;
  --text-soft: #4d514d;
  --border: rgba(9, 16, 8, 0.1);

  --font-display: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Layout helpers ---------- */

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 254, 252, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover {
  color: var(--forest);
}

.nav-links a.active {
  color: var(--forest-dark);
  border-bottom-color: var(--forest);
}

/* ---------- Hero ---------- */

.hero {
  padding: 120px 0 96px;
  position: relative;
  overflow: hidden;
}

.hero .wrap {
  position: relative;
  z-index: 1;
}

.hero-accent {
  position: absolute;
  top: 20px;
  right: -30px;
  width: 300px;
  z-index: 0;
  pointer-events: none;
}

.hero-accent img {
  width: 100%;
  height: auto;
  opacity: 0.9;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  font-weight: 600;
  line-height: 1.08;
  margin: 0 0 6px;
  color: var(--text);
}

.hero .role {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-weight: 500;
  color: var(--forest);
  margin: 0 0 28px;
}

.hero .tagline {
  font-size: 1.15rem;
  color: var(--text);
  max-width: 640px;
  margin: 0 0 40px;
  font-weight: 500;
}

.scroll-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--forest-dark);
}

.scroll-cta .arrow-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--forest);
  color: var(--forest);
  font-size: 1.1rem;
  animation: bob 2s ease-in-out infinite;
  transition: background 0.2s ease, color 0.2s ease;
}

.scroll-cta:hover .arrow-circle {
  background: var(--forest);
  color: var(--bg);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------- Section headers ---------- */

.section {
  padding: 88px 0;
}

.section-alt {
  background: var(--green-lightest);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 48px;
  gap: 24px;
  flex-wrap: wrap;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  color: var(--text);
  margin: 8px 0 0;
}

.section-head p {
  max-width: 420px;
  color: var(--text-soft);
  font-size: 0.98rem;
  margin: 8px 0 0;
}

/* ---------- Selected work: alternating case studies ---------- */

.case-study-list {
  display: flex;
  flex-direction: column;
}

.case-study {
  display: flex;
  align-items: center;
  gap: 56px;
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.case-study:first-child {
  padding-top: 0;
}

.case-study:last-child {
  border-bottom: none;
}

.case-study.reverse {
  flex-direction: row-reverse;
}

.case-image {
  flex: 1 1 50%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green-lightest) 0%, var(--green-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest-dark);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.case-study:hover .case-image {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(9, 16, 8, 0.1);
}

.case-image span {
  opacity: 0.8;
}

.case-text {
  flex: 1 1 50%;
}

.work-tag {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 12px;
}

.case-text h3 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
}

.case-text p {
  color: var(--text-soft);
  font-size: 1rem;
  max-width: 440px;
  margin: 0 0 22px;
}

.work-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--forest-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.work-link .arrow {
  transition: transform 0.15s ease;
}

.case-study:hover .work-link .arrow {
  transform: translateX(3px);
}

/* ---------- Focus / strengths strip ---------- */

.focus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 28px;
}

.focus-item {
  padding: 28px 24px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.focus-item .num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--forest);
  font-weight: 700;
  margin-bottom: 10px;
}

.focus-item h4 {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}

.focus-item p {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 0;
}

/* ---------- Footer / contact ---------- */

.footer {
  padding: 72px 0 48px;
  background: var(--forest-dark);
  color: var(--green-lightest);
}

.footer h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--bg);
}

.footer p {
  color: var(--green-light);
  max-width: 480px;
  margin: 0 0 32px;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.footer .btn-primary {
  background: var(--green-light);
  color: var(--forest-dark);
}

.footer .btn-primary:hover {
  background: var(--bg);
  transform: translateY(-1px);
}

.footer-bottom {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid rgba(244, 250, 244, 0.15);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
  color: rgba(244, 250, 244, 0.55);
}

/* ---------- Stub pages (About / Work) ---------- */

.stub-hero {
  padding: 140px 0 120px;
  text-align: center;
}

.stub-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text);
  margin: 0 0 16px;
}

.stub-hero p {
  color: var(--text-soft);
  max-width: 480px;
  margin: 0 auto;
}

/* =========================================
   Case Study Template
   ========================================= */

/* ---------- Password gate ---------- */

#password-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 32px;
}

.gate-box {
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.gate-box img {
  height: 44px;
  width: auto;
  margin: 0 auto 28px;
}

.gate-box h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}

.gate-box p {
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0 0 28px;
}

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gate-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--green-lightest);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.gate-input:focus {
  outline: none;
  border-color: var(--forest);
}

.gate-submit {
  border: none;
  cursor: pointer;
  background: var(--forest);
  color: var(--bg);
  font-family: var(--font-body);
}

.gate-submit:hover {
  background: var(--forest-dark);
}

.gate-error {
  color: #a13a3a;
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* ---------- Case study hero ---------- */

.case-hero {
  padding: 64px 0 56px;
  background: var(--bg);
}

.case-hero h1 {
  font-family: var(--font-body);
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.18;
  color: var(--text);
  margin: 0 0 40px;
  max-width: 880px;
}

.case-hero-image {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 40px;
}

.case-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

.case-meta span {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.case-meta p {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0 0 10px;
}

.case-meta .me {
  color: var(--forest);
  font-weight: 500;
}

/* ---------- Table of contents (mobile / tablet, horizontal) ---------- */

.cs-toc {
  position: sticky;
  top: 72px;
  z-index: 40;
  background: rgba(255, 254, 252, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.cs-toc .wrap {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  height: 56px;
  align-items: center;
}

.cs-toc a {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-soft);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.cs-toc a:hover {
  color: var(--forest);
}

/* ---------- Table of contents (desktop, fixed left sidebar) ---------- */

.cs-toc-side {
  display: none;
}

@media (min-width: 1320px) {
  .cs-toc {
    display: none;
  }

  .cs-toc-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: fixed;
    top: 50%;
    left: calc(50% - 736px);
    transform: translateY(-50%);
    z-index: 40;
  }

  .cs-toc-side a {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-soft);
    padding-left: 14px;
    border-left: 2px solid var(--border);
    transition: color 0.2s ease, border-color 0.2s ease;
  }

  .cs-toc-side a:hover {
    color: var(--forest);
  }

  .cs-toc-side a.active {
    color: var(--forest-dark);
    border-left-color: var(--forest);
  }
}

/* ---------- Case study sections ---------- */

.cs-section {
  padding: 88px 0;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 130px;
}

.cs-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 14px;
  display: block;
}

.cs-section h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px;
  max-width: 640px;
}

.cs-section > .wrap > p {
  color: var(--text-soft);
  font-size: 1.05rem;
  max-width: 640px;
  margin: 0 0 40px;
}

.cs-section--full .cs-intuition,
.cs-section--full > .wrap > h2,
.cs-section--full > .wrap > p {
  max-width: none;
}

.cs-intuition {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.4;
  color: var(--forest-dark);
  margin: 0 0 28px;
  max-width: 620px;
}

/* ---------- User Flows: numbered solution list + banner image ---------- */

.cs-list {
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.6;
  max-width: 640px;
  margin: 0 0 40px;
  padding-left: 22px;
}

.cs-list li {
  margin-bottom: 8px;
}

.cs-flow-image {
  aspect-ratio: 4.4 / 1;
  margin-bottom: 16px;
}

.cs-flow-caption {
  color: var(--text-soft);
  font-size: 0.92rem;
  max-width: 640px;
  margin: 0;
}

/* ---------- Research: stat bar ---------- */

.cs-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 32px 0 20px;
}

.cs-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.6rem);
  font-weight: 600;
  color: var(--forest-dark);
  line-height: 1;
  margin-bottom: 8px;
}

.cs-stat span {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.cs-stats-detail {
  font-size: 0.9rem;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0 0 32px;
}

/* ---------- Research: persona headshot strip ---------- */

.cs-people {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  margin: 8px 0 48px;
}

.cs-person {
  width: 120px;
  text-align: center;
}

.cs-person img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 3px solid var(--green-lightest);
}

.cs-person span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.3;
}

/* ---------- Research: click-to-expand thumbnails ---------- */

.cs-thumb-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 16px;
}

.cs-thumb {
  margin: 0;
}

.cs-thumb-trigger {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  background: var(--green-lightest);
  cursor: zoom-in;
}

.cs-thumb-trigger img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cs-thumb-trigger:hover img {
  transform: scale(1.04);
}

.cs-thumb-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--forest-dark);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(9, 16, 8, 0.15);
}

.cs-thumb-caption {
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ---------- Research: lightbox ---------- */

.cs-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 40px;
}

.cs-lightbox.open {
  display: flex;
}

.cs-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 16, 8, 0.82);
}

.cs-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cs-lightbox-content img {
  max-width: 100%;
  max-height: 72vh;
  border-radius: 12px;
  object-fit: contain;
  background: var(--green-lightest);
}

.cs-lightbox-caption {
  margin: 20px 0 0;
  color: var(--bg);
  font-size: 0.98rem;
  max-width: 640px;
  text-align: center;
}

.cs-lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--forest-dark);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cs-lightbox-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--forest-dark);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(9, 16, 8, 0.15);
  transition: background 0.2s ease;
}

.cs-lightbox-arrow:hover {
  background: var(--green-light);
}

.cs-lightbox-arrow.prev {
  left: 24px;
}

.cs-lightbox-arrow.next {
  right: 24px;
}

/* ---------- Research: sub-heading + key insights ---------- */

.cs-subhead {
  margin: 64px 0 28px;
}

.cs-subhead--first {
  margin-top: 32px;
}

.cs-subhead h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 600;
  color: var(--text);
  margin: 6px 0 0;
}

.cs-subhead h3:first-child {
  margin-top: 0;
}

.cs-pain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.cs-pain-item {
  padding: 28px 26px;
  border-radius: 12px;
  background: var(--green-lightest);
  border: 1px solid var(--border);
}

.cs-pain-item .num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--forest);
  margin-bottom: 10px;
}

.cs-pain-item h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
}

.cs-pain-item p {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin: 0;
}

.cs-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.cs-insight-item {
  display: flex;
  flex-direction: column;
  padding: 28px 26px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.cs-insight-image {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  margin-top: 20px;
  padding: 16px;
  font-size: 0.78rem;
}

.cs-insight-item h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 10px;
}

.cs-insight-item p {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin: 0;
}

.cs-people--insight {
  flex: 1;
  align-content: center;
  justify-content: center;
  margin: 20px 0 0;
  gap: 24px;
  padding: 16px;
}

.cs-people--insight .cs-person {
  width: 88px;
}

.cs-people--insight .cs-person img {
  width: 72px;
  height: 72px;
  margin-bottom: 8px;
}

.cs-people--insight .cs-person span {
  font-size: 0.72rem;
}

.cs-person--highlight img {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px var(--forest-dark);
}

.cs-persona {
  padding: 36px;
  border-radius: 16px;
  background: var(--forest);
}

.cs-persona--light {
  background: #E7F0E6;
}

.cs-persona--light .cs-persona-label {
  color: var(--forest-dark);
}

.cs-persona--light.cs-persona h3 {
  color: var(--forest-dark);
}

.cs-persona--light .cs-persona-points h4 {
  color: var(--forest-dark);
}

.cs-persona--light .cs-persona-points p {
  color: var(--text-soft);
}

.cs-persona--top-spaced {
  margin-top: 40px;
}

.cs-persona-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green-light);
  margin-bottom: 10px;
}

.cs-persona h3 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--bg);
  margin: 0 0 24px;
}

.cs-persona-points {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.cs-persona-points h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-lightest);
  margin: 0 0 8px;
}

.cs-persona-points p {
  font-size: 0.92rem;
  color: var(--green-light);
  margin: 0;
}

.cs-row {
  display: flex;
  align-items: center;
  gap: 56px;
}

.cs-row.reverse {
  flex-direction: row-reverse;
}

.cs-row .cs-col-text {
  flex: 1 1 45%;
}

.cs-row .cs-col-image {
  flex: 1 1 55%;
}

.cs-row .cs-col-text h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
}

.cs-row .cs-col-text p {
  color: var(--text-soft);
  font-size: 1rem;
  margin: 0 0 16px;
}

.cs-row .cs-col-text ul {
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
}

.cs-row .cs-col-text li {
  margin-bottom: 8px;
}

.cs-image-box {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green-lightest) 0%, var(--green-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--forest-dark);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px;
}

/* When an image box holds a real image, let it fill the frame edge to edge */
.cs-image-box:has(img) {
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.cs-image-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Lightbox ---------- */

.cs-image-box img,
figure.nc-image img,
.nc-hero-image-full img {
  cursor: zoom-in;
}

/* Compare-slider images are for dragging, not zooming */
.nc-compare img {
  cursor: ew-resize;
  -webkit-user-drag: none;
  user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: rgba(10, 24, 18, 0.85);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-figure {
  margin: 0;
  max-width: 1200px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transform: scale(0.98);
  transition: transform 0.25s ease;
}

.lightbox.is-open .lightbox-figure {
  transform: scale(1);
}

.lightbox-img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: #fff;
  cursor: default;
}

.lightbox-caption {
  margin: 0;
  max-width: 640px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
  text-align: center;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  .lightbox,
  .lightbox-figure {
    transition: none;
  }
}

.cs-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cs-gallery .cs-image-box:first-child {
  grid-column: span 3;
  aspect-ratio: 16 / 7;
}

/* ---------- Next case study ---------- */

.cs-next {
  padding: 0;
}

.cs-next-link {
  display: block;
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-dark) 100%);
  overflow: hidden;
}

.cs-next-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(9, 16, 8, 0.5) 0%, transparent 60%);
}

.cs-next-link .wrap {
  position: relative;
  z-index: 1;
  padding: 56px 32px;
  width: 100%;
}

.cs-next-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-light);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-next-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 600;
  color: var(--bg);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.cs-next-title .arrow {
  transition: transform 0.2s ease;
}

.cs-next-link:hover .cs-next-title .arrow {
  transform: translateX(6px);
}

.cs-next-desc {
  color: var(--green-lightest);
  max-width: 480px;
  margin: 0;
}

/* ---------- Thumb grid variant (2-up) ---------- */

.cs-thumb-grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

/* ---------- Product area blocks ---------- */

.cs-product-block + .cs-product-block {
  margin-top: 64px;
  padding-top: 64px;
  border-top: 1px solid var(--border);
}

/* ---------- Quote cards (paired testimonials) ---------- */

.cs-quote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 28px 0 8px;
}

.cs-quote-card {
  padding: 30px 28px;
  border-radius: 12px;
  background: var(--green-lightest);
  border: 1px solid var(--border);
}

.cs-quote-mark {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--forest);
  margin-bottom: 10px;
}

.cs-quote-card p {
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 12px;
}

.cs-quote-card span {
  font-size: 0.82rem;
  color: var(--text-soft);
}

/* ---------- Inline pull-quote (single, high-emphasis) ---------- */

.cs-quote-inline {
  padding: 40px 44px;
  border-radius: 16px;
  background: var(--forest);
  margin: 32px 0;
}

.cs-quote-inline p {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 500;
  color: var(--bg);
  line-height: 1.4;
  margin: 0;
}

.cs-quote-inline span {
  display: block;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--green-light);
}

/* =========================================
   Narrative case study layout (editorial scroll)
   ========================================= */

.nc-hero {
  padding: 64px 0 0;
}

.nc-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
  margin: 0 0 40px;
}

.nc-hero-copy {
  margin-bottom: 40px;
}

.nc-hero-copy p {
  font-size: 18px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0 0 20px;
}

.nc-hero-copy p:last-child {
  margin-bottom: 0;
}

.nc-hero-specs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 40px;
  padding: 28px 0;
  margin-bottom: 48px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.nc-spec-item {
  flex: 1 1 160px;
}

.nc-spec-item h4 {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--forest);
  margin: 0 0 4px;
}

.nc-spec-item p {
  font-size: 18px;
  color: var(--text-soft);
  line-height: 1.5;
  margin: 0;
}

.nc-hero-image-full img {
  width: 100%;
  border-radius: 14px;
  display: block;
}

/* ---------- Repeating narrative beat ---------- */

.nc-beat {
  padding: 72px 0;
  scroll-margin-top: 130px;
}

.nc-beat .wrap {
  max-width: 1080px;
}

.nc-beat-text {
  max-width: 680px;
  margin: 0 auto 40px;
  text-align: center;
}

.nc-beat-text.nc-align-left {
  margin: 0 0 40px;
  text-align: left;
}

.nc-beat-text.nc-full-width {
  max-width: none;
}

.nc-beat .cs-stats {
  justify-content: center;
}

.nc-beat .cs-stat {
  text-align: center;
}

.nc-image + .focus-grid {
  margin-top: 40px;
}

.nc-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--forest);
  display: block;
  margin-bottom: 14px;
}

.nc-headline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  margin: 0 0 16px;
}

.nc-body {
  font-size: 18px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0;
}

.nc-image img {
  width: 100%;
  border-radius: 14px;
  display: block;
}

/* ---------- Key insights (equal-width 2-column row) ---------- */

.nc-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 56px;
}

.nc-insight-item {
  text-align: left;
}

.nc-insight-item .nc-headline {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  margin-bottom: 14px;
}

.nc-insight-item .nc-body {
  margin-bottom: 24px;
}

/* Key insight images: match boxes to the real screenshot ratios */
.nc-insight-grid .cs-image-box {
  aspect-ratio: 918 / 918;
}

.wrap > .nc-insight-item .cs-image-box {
  aspect-ratio: 1819 / 862;
}

/* ---------- Full-width placeholder image ---------- */

.nc-image-wide {
  aspect-ratio: 21 / 9;
}

/* Solution section: match the wide image to the real screenshot ratio */
#solution .nc-image-wide {
  aspect-ratio: 1819 / 1792;
}

/* Pre-screening section: match boxes to the real screenshot ratios */
#prescreening .nc-image-wide {
  aspect-ratio: 1211 / 784;
}

#prescreening .nc-image-row .cs-image-box {
  aspect-ratio: 918 / 1142;
}

/* Request-similarity section: match the wide image to the real screenshot ratio */
#requests .nc-image-wide {
  aspect-ratio: 1211 / 805;
}

/* ---------- Image split: 2/3 main + 1/3 stacked pair (equal height) ---------- */

.nc-image-split {
  display: grid;
  grid-template-columns: 2.17fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.nc-image-split-main .cs-image-box {
  aspect-ratio: 763 / 618;
}

.nc-image-split-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nc-image-split-stack .cs-image-box {
  flex: 1 1 0;
  aspect-ratio: auto;
}

.nc-image-wide + .nc-image-row {
  margin-top: 24px;
}

/* ---------- Before / after drag comparison slider ---------- */

/* Request-similarity section: match the compare slider to the real screenshot ratio */
#requests .nc-compare {
  aspect-ratio: 2295 / 1621;
}

.nc-compare {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  border-radius: 14px;
  overflow: hidden;
  cursor: ew-resize;
  user-select: none;
}

.nc-compare-layer {
  position: absolute;
  inset: 0;
}

.nc-compare-layer .cs-image-box {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
}

.nc-compare-before {
  clip-path: inset(0 50% 0 0);
}

.nc-compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 0;
  transform: translateX(-50%);
  pointer-events: none;
}

.nc-compare-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--bg);
  transform: translateX(-50%);
}

.nc-compare-handle-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--forest-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(9, 16, 8, 0.2);
  pointer-events: none;
}

.nc-compare + .nc-image-wide {
  margin-top: 24px;
}

.nc-caption {
  text-align: center;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-soft);
  margin: 16px auto 0;
  max-width: 560px;
}

.nc-image-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 8px;
}

/* ---------- Persona headshot grid ---------- */

.nc-persona-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin: 8px 0 36px;
}

.nc-persona-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.nc-persona-grid-item img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--border);
}

.nc-persona-grid-item span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-soft);
}

/* ---------- Editorial pull-quote ---------- */

.nc-quote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.nc-quote {
  max-width: none;
  margin: 0;
  text-align: left;
  padding: 28px;
  background: #E7F0E6;
  border-radius: 16px;
}

.nc-quote p {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 500;
  font-style: italic;
  color: var(--forest-dark);
  line-height: 1.45;
  margin: 0 0 16px;
}

.nc-quote.nc-align-left {
  text-align: left;
  margin: 0 0 24px;
}

.nc-quote.nc-align-right {
  text-align: right;
  margin: 0 0 24px auto;
}

.nc-quote span {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* ---------- Key learnings ---------- */

.nc-learnings {
  max-width: 680px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
}

.nc-learnings li {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.6;
}

.nc-learnings li:last-child {
  border-bottom: 1px solid var(--border);
}

.nc-learnings li .dash {
  flex-shrink: 0;
  color: var(--forest);
  font-weight: 700;
}

/* ---------- Sign-off ---------- */

.nc-signoff {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.nc-signoff p {
  color: var(--text-soft);
  font-size: 1rem;
  margin: 0 0 28px;
}

/* ---------- Responsive (narrative layout) ---------- */

@media (max-width: 780px) {
  .nc-beat {
    padding: 48px 0;
  }

  .nc-image-row,
  .nc-insight-grid,
  .nc-image-split,
  .nc-quote-grid {
    grid-template-columns: 1fr;
  }

  .nc-persona-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .nc-image-split-stack .cs-image-box {
    aspect-ratio: 357 / 300;
    flex: none;
  }

  .nc-hero {
    padding: 40px 0 0;
  }

  .nc-hero-specs {
    flex-direction: column;
    gap: 16px;
  }

  .nc-hero-title {
    max-width: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 780px) {
  .case-study,
  .case-study.reverse,
  .cs-row,
  .cs-row.reverse {
    flex-direction: column;
    align-items: stretch;
    gap: 28px;
  }

  .cs-gallery {
    grid-template-columns: 1fr;
  }

  .cs-gallery .cs-image-box:first-child {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }

  .case-meta {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .cs-pain-grid,
  .cs-insight-grid,
  .cs-persona-points,
  .cs-quote-grid {
    grid-template-columns: 1fr;
  }

  .cs-thumb-grid,
  .cs-thumb-grid--2 {
    grid-template-columns: 1fr;
  }

  .cs-quote-inline {
    padding: 28px 26px;
  }

  .cs-flow-image {
    aspect-ratio: 4 / 3;
  }

  .cs-stats {
    gap: 32px;
  }
}

@media (max-width: 640px) {
  .nav-links {
    gap: 20px;
  }

  .hero {
    padding: 96px 0 64px;
  }

  .hero-accent {
    width: 160px;
    top: 0;
  }

  .section {
    padding: 64px 0;
  }

  .case-hero {
    padding: 40px 0 32px;
  }

  .case-meta {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cs-toc .wrap {
    gap: 20px;
  }

  .cs-lightbox {
    padding: 64px 16px 24px;
  }

  .cs-lightbox-arrow {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .cs-lightbox-arrow.prev {
    left: 10px;
  }

  .cs-lightbox-arrow.next {
    right: 10px;
  }

  .cs-lightbox-close {
    top: 12px;
    right: 12px;
  }
}
