/* =====================================================================
   Case study pages (plantsnap.html, proma.html, galaxy.html)
   Loaded after styles.css — reuses its tokens and .button
   ===================================================================== */
:root {
  --color-accent: #306b4f;
  --color-mint: #f6fcfa;
  --color-mint-strong: #e9f4eb;
  --color-cons: #f57878;
  --wrap: 1165px;
  --side: 16px;
  --nav-h: 86px; /* 38px row + 2 × 24px padding */

  /* Theme (PlantSnap defaults — overridden per case study) */
  --tag-bg: var(--color-mint);
  --band-bg: var(--color-mint);
  --grad-end: var(--color-mint-strong);
  --pcard-bg: var(--color-white);
  --pcard-icon-bg: var(--color-mint-strong);
  --cursor-bg: var(--color-cons);
}
.theme-proma {
  --color-accent: #8d5023;
  --tag-bg: rgba(236, 234, 222, 0.6);
  --band-bg: #f7f7f2;
  --grad-end: rgba(236, 234, 222, 0.6);
  --pcard-bg: rgba(247, 247, 242, 0.5);
  --pcard-icon-bg: rgba(203, 190, 169, 0.25);
  --cursor-bg: #6e7f5b;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.case { overflow-x: clip; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--side));
  margin: 0 auto;
  padding: 0 var(--side);
}

/* ---------- Typography ---------- */
.t-title {
  margin: 0;
  font-size: clamp(40px, 1.6rem + 3.4vw, 72px);
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.025em;
}
.t-sub {
  margin: 0;
  font-size: clamp(22px, 1rem + 1vw, 32px);
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.03em;
}
.t-h2 {
  margin: 0;
  font-size: clamp(32px, 1.4rem + 1.8vw, 48px);
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.03em;
}
.t-h3 {
  margin: 0;
  font-size: clamp(22px, 1.1rem + 0.5vw, 26px);
  font-weight: 600;
  line-height: 1.826;
}
.t-body {
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
}
.t-body > * { margin: 0; }
/* Figma separates paragraphs with an empty line */
.t-body > * + * { margin-top: calc(var(--lh-body) * 1em); }
.t-body ul { padding-left: 1.5em; }
.t-body ul.tight-list { padding-left: 30px; }
.t-body strong, .t-bold { font-weight: 700; }
.accent { color: var(--color-accent); }
.center { text-align: center; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 1204px;
  overflow: hidden;
  background: var(--color-white);
}
.hero__screens {
  position: absolute;
  top: 0;
  right: 0;
  width: 737px;
  height: 100%;
  object-fit: cover;
}
.hero__inner {
  position: relative;
  z-index: 1;
  padding-top: 186px;
}
.hero__logo { display: block; }
.hero__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 804px;
  margin-top: 202px;
}
.hero__titles {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.hero__titles .t-sub { max-width: 621px; }

.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.tag {
  padding: 16px 32px;
  border-radius: 61px;
  background: var(--tag-bg);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* "Carina Lázaro" Figma-style cursor */
.cursor {
  position: absolute;
  left: 402px;
  top: 432px;
  width: 215px;
  height: 99.99px;
  pointer-events: none;
}
.cursor__arrow {
  position: absolute;
  left: 11.65px;
  top: 6.14px;
  width: 43.7px;
  height: 46.5px;
  transform: rotate(-32.07deg) skewX(8.04deg);
}
.cursor__arrow img {
  position: absolute;
  left: -16.33px;
  top: -3.46px;
  width: 76.6327px;
  height: 78.3882px;
  max-width: none;
}
.cursor__label {
  position: absolute;
  left: 51px;
  top: 52.99px;
  width: 164px;
  height: 47px;
  padding: 12px 16px 0;
  border-radius: 8.047px;
  background: var(--cursor-bg);
  color: var(--color-white);
  font-size: 17.168px;
  font-weight: 600;
  line-height: 1.385;
  letter-spacing: 0.035em;
  white-space: nowrap;
}

/* ---------- Sticky section nav ---------- */
.case-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-white);
  padding: 24px var(--side);
  transition: box-shadow 0.25s ease;
}
.case-nav.is-stuck { box-shadow: 1.25px 9px 26.345px rgba(18, 19, 20, 0.12); }

.case-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.731;
  white-space: nowrap;
}
.case-nav__list li + li::before {
  content: "/";
  margin-right: 8px;
}
.case-nav__link {
  display: inline-block;
  color: var(--color-dark);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}
.case-nav__link:hover { border-bottom-color: rgba(245, 120, 120, 0.4); }
.case-nav__link.is-active { border-bottom-color: var(--color-cons); }
.case-nav__link:focus-visible { outline: 2px solid var(--color-dark); outline-offset: 3px; border-radius: 2px; }

/* Sections land just below the sticky nav */
[data-section] { scroll-margin-top: calc(var(--nav-h) - 1px); }

/* ---------- Generic section ---------- */
.sec {
  padding: 80px 0;
  background: var(--color-white);
}
.sec__stack {
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.sec--mint { background: var(--band-bg); }
/* The sticky nav already adds 24px of padding below it */
.case-nav + main > .sec:first-child { padding-top: 56px; }

/* Framed statement (Overview / Reflection) */
.framed {
  max-width: 1178.41px;
  margin: 0 auto;
  border-style: solid;
  border-width: 18px;
  border-image-slice: 18;
  border-image-repeat: stretch;
  padding: 54px clamp(8px, 9vw, 111px);
  text-align: center;
}
/* Each page sets its own frame SVG: style="--frame: url(...)" */
.framed { border-image-source: var(--frame); }
.framed--19 { border-width: 19px; border-image-slice: 19; }
.framed__inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Gradient screens band */
.screens {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px var(--side) 40px;
  background: linear-gradient(to bottom, rgba(246, 250, 254, 0) 5.297%, var(--grad-end) 35.286%);
}
.screens--tight { padding-top: 40px; }
.screens img { width: 100%; height: auto; }
.screens__caption {
  margin: 0;
  text-align: center;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

/* Mint band with floating circular photos (Role / Outcome) */
.band { padding: 80px 0; position: relative; }
.band__inner {
  position: relative;
  padding: 80px var(--side);
  background: var(--band-bg);
}
.band__content {
  position: relative;
  z-index: 1;
  max-width: 1016px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 64px;
}
.band__desc { display: flex; flex-direction: column; gap: 32px; }

.bubble {
  position: absolute;
  width: 276px;
  height: 276px;
  pointer-events: none;
}
.bubble img {
  position: absolute;
  left: -14.13%;
  top: -10.87%;
  width: 128.26%;
  height: 128.26%;
  max-width: none;
}
.bubble--sm { width: 172px; height: 172px; }
.bubble--sm img { left: -22.67%; top: -17.44%; width: 145.35%; height: 145.35%; }

/* Arrow bullet list */
.arrows {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 897px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.arrows li {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.arrows li.mid { align-items: center; }
.arrows__icon {
  flex-shrink: 0;
  width: 39px;
  height: 48px;
}
.arrows__icon img { width: 40.7678px; height: 48px; max-width: none; }

/* Text + image rows */
.rows { display: flex; flex-direction: column; gap: 40px; }
.row {
  display: flex;
  align-items: flex-start;
  gap: 80px;
}
.row--center { align-items: center; }
.row__text {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.row__text--top { align-self: stretch; }
.row__media { flex: 1 1 0; min-width: 0; }
.row__media img { width: 100%; height: auto; }
.row__media--fixed { flex: 0 0 546px; }

/* Principle cards (icon + text) */
.pcards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}
.pcard {
  display: flex;
  gap: 16px;
  background: var(--pcard-bg);
  border-radius: 16px;
  overflow: hidden;
}
.pcard__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: var(--pcard-icon-bg);
}
.pcard__icon img { width: 40px; height: 40px; }
.pcard__text {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 16px 16px 0;
}
.pcard__title { margin: 0; font-size: 20px; font-weight: 500; line-height: normal; }
.pcard__desc { margin: 0; font-size: 16px; font-weight: 400; line-height: 1.481; }

.case-back {
  display: flex;
  justify-content: center;
  padding: 0 var(--side) 80px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .bubble { display: none; }
  .hero__screens { width: 48%; }
  .hero__content { max-width: 56%; }
  .cursor { display: none; }
}

@media (max-width: 1000px) {
  .case-nav__list { font-size: 18px; }
  .row, .row--center { gap: 40px; }
  .row__media--fixed { flex-basis: 45%; }
}

@media (max-width: 820px) {
  :root { --side: 24px; --nav-h: 72px; }

  /* Hero: screens on top, text below */
  .hero { height: auto; }
  .hero__screens {
    position: static;
    display: block;
    width: 100%;
    height: 360px;
    object-position: top;
  }
  .hero__inner { padding-top: 40px; padding-bottom: 56px; }
  .hero__content { max-width: none; margin-top: 40px; gap: 32px; }
  .tag { padding: 12px 24px; }

  /* Nav scrolls sideways */
  .case-nav { padding: 20px 0; }
  .case-nav__list {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0 var(--side);
    font-size: 16px;
    scrollbar-width: none;
  }
  .case-nav__list::-webkit-scrollbar { display: none; }

  .sec { padding: 56px 0; }
  .sec__stack { gap: 32px; }
  .t-body { font-size: 16px; }
  .arrows li, .screens__caption, .tag { font-size: 16px; }
  .arrows li { gap: 16px; }
  .arrows__icon { width: 32px; }
  .arrows__icon img { width: 33.45px; height: 39.38px; }
  .arrows__icon { height: 39.38px; }

  .framed { border-width: 14px; padding: 24px 12px; }
  .framed__inner { gap: 24px; }

  .screens { padding-top: 48px; padding-bottom: 32px; gap: 16px; }

  .band { padding: 40px 0; }
  .band__inner { padding: 56px var(--side); }
  .band__content { gap: 32px; }
  .band__desc { gap: 24px; }

  .row, .row--center { flex-direction: column; align-items: stretch; gap: 24px; }
  .row__text { gap: 16px; }
  .row__media, .row__media--fixed { flex: none; width: 100%; }
  .row .row__media { order: 2; }

  .pcards { grid-template-columns: 1fr; gap: 16px; }

  .case-back { padding-bottom: 40px; }
  .case-back .button { width: 100%; justify-content: center; }
}

/* =====================================================================
   Extra blocks (Proma / Galaxy)
   ===================================================================== */

/* Hero logo given as a bitmap inside a 178×112 slot */
.hero__logo--box {
  width: 178px;
  height: 112px;
  display: flex;
  align-items: center;
}
.hero__logo--box img { width: 100%; height: auto; }

/* Screens band with a framed browser screenshot (clipped at the bottom) */
.screens-frame {
  position: relative;
  height: 758px;
  overflow: hidden;
  background: linear-gradient(to bottom, rgba(246, 250, 254, 0) 5.297%, var(--grad-end) 35.286%);
}
.screens-frame__shot {
  position: absolute;
  left: 50%;
  top: 104px;
  width: min(1241px, calc(100% - 2 * var(--side)));
  aspect-ratio: 1241 / 699;
  transform: translateX(-50%);
  overflow: hidden;
  border-radius: 14.647px;
  box-shadow: 1.144px 21.823px 48.233px 2.298px rgba(18, 19, 20, 0.12);
}
.screens-frame__shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* Gradient band whose artwork bleeds past the edges */
.bleed-band {
  position: relative;
  height: 834.737px;
  background: linear-gradient(to bottom, rgba(246, 250, 254, 0) 5.297%, var(--grad-end) 35.286%);
}
.bleed-band img {
  position: absolute;
  left: calc(50% - 481px);
  top: -161px;
  width: 1494px;
  height: 1096px;
  max-width: none;
  object-fit: contain;
}

/* A fixed slot whose image overflows it (positions from Figma, inline) */
.stage { position: relative; flex-shrink: 0; }
.stage > img { position: absolute; max-width: none; object-fit: cover; }
.stage > img.contain { object-fit: contain; }

/* Plain text cards (no icon) */
.tcards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.tcard {
  padding: 16px;
  border-radius: 16px;
  background: var(--pcard-bg);
}

/* Persona cards with photo */
.personas {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.persona {
  overflow: hidden;
  border-radius: 16px;
  background: var(--color-white);
}
.persona__img { display: block; width: 100%; height: 166px; object-fit: cover; }
.persona .pcard__text { padding: 16px; }

.cols { display: flex; gap: 40px; align-items: flex-start; }
.cols--center { align-items: center; }
.cols > .grow { flex: 1 1 0; min-width: 0; }
.stack-40 { display: flex; flex-direction: column; gap: 40px; }
.stack-24 { display: flex; flex-direction: column; gap: 24px; }
.stack-16 { display: flex; flex-direction: column; gap: 16px; }
.bullets16 { margin: 0; padding-left: 30px; display: flex; flex-direction: column; gap: 16px; }

@media (max-width: 1200px) {
  .stage { width: 100% !important; height: auto !important; }
  .stage > img { position: static; width: 100% !important; height: auto !important; }
  .cols, .cols--center { flex-direction: column; align-items: stretch; }
  .cols > * { flex: none !important; width: 100%; }
  .bleed-band { height: auto; padding: 0 var(--side) 40px; }
  .bleed-band img { position: static; width: 100%; height: auto; }
  .tcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .screens-frame { height: auto; padding: 48px 0 32px; }
  .screens-frame__shot { position: relative; left: auto; top: auto; transform: none; margin: 0 auto; }
  .personas { grid-template-columns: 1fr; gap: 16px; }
  .tcards { gap: 12px; }
  .bullets16 { padding-left: 24px; gap: 12px; }
}
