/* ==========================================================================
   Stéphanie Pereira Mota — portfolio
   Monde visuel : la fiche d'hôtel (folio) qui devient fiche produit.
   ========================================================================== */

:root {
  color-scheme: light;
  --ground: #f4ece0;
  --paper: #fbf7f0;
  --sand: #e9d8c1;
  --rule: #d6c2a8;
  --ink: #2a1b14;
  --ink-2: #5b463a;
  --ink-3: #7a6354;
  --terra: #a8451e;
  --terra-deep: #8a3615;
  --band: #a8451e;
  --on-band: #fcf2e6;
  --on-band-2: #f3d9c4;
  --walnut: #4a3427;
  --shadow: 0 1px 2px rgb(42 27 20 / 0.06), 0 12px 32px -12px rgb(42 27 20 / 0.22);
  --focus: #a8451e;

  --font-display: "Gloock", "Georgia", serif;
  --font-body: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;

  --step--1: clamp(0.84rem, 0.81rem + 0.14vw, 0.92rem);
  --step-0: clamp(1.02rem, 0.98rem + 0.2vw, 1.13rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2: clamp(1.5rem, 1.32rem + 0.9vw, 2.1rem);
  --step-3: clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4: clamp(2.7rem, 1.9rem + 4.2vw, 5.6rem);

  --gutter: clamp(1rem, 0.6rem + 2vw, 2.5rem);
  --max: 76rem;
  --radius: 6px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #1c1410;
    --paper: #271c16;
    --sand: #33251d;
    --rule: #4a382c;
    --ink: #f4e8da;
    --ink-2: #d2bfac;
    --ink-3: #ad9682;
    --terra: #eb9468;
    --terra-deep: #f2ad88;
    --band: #8e3816;
    --on-band: #fcf0e3;
    --on-band-2: #f1cfb6;
    --walnut: #b49a86;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 36px -14px rgb(0 0 0 / 0.6);
    --focus: #eb9468;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #1c1410;
  --paper: #271c16;
  --sand: #33251d;
  --rule: #4a382c;
  --ink: #f4e8da;
  --ink-2: #d2bfac;
  --ink-3: #ad9682;
  --terra: #eb9468;
  --terra-deep: #f2ad88;
  --band: #8e3816;
  --on-band: #fcf0e3;
  --on-band-2: #f1cfb6;
  --walnut: #b49a86;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 16px 36px -14px rgb(0 0 0 / 0.6);
  --focus: #eb9468;
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--terra); color: var(--on-band); }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; }
p { margin: 0; text-wrap: pretty; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:not(.btn):hover { color: var(--terra); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 50;
  background: var(--ink); color: var(--ground); padding: 0.6rem 1rem; border-radius: var(--radius);
  text-decoration: none;
}
.skip:focus { top: 0.75rem; }

.icon { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Scrollbar themed from the palette */
html { scrollbar-color: var(--rule) var(--ground); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-out);
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }

.brand {
  font-family: var(--font-display); font-size: 1.25rem; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: baseline; gap: 0.5rem;
}
.brand span { color: var(--terra); }
.brand { white-space: nowrap; }
@media (max-width: 420px) {
  .brand { font-size: 1rem; gap: 0.3rem; }
  .menu-button { padding-inline: 0.6rem; }
  .menu-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lang-toggle { margin-left: 0.25rem; }
}

.nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-links { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: inline-block; padding: 0.55rem 0.8rem; text-decoration: none; color: var(--ink-2);
  font-size: var(--step--1); font-weight: 500; letter-spacing: 0.01em; border-radius: var(--radius);
}
.nav-links a:hover { color: var(--ink); background: var(--sand); }

.lang-toggle {
  margin-left: 0.5rem; display: inline-flex; align-items: center; gap: 0.1rem;
  border: 1px solid var(--rule); border-radius: 999px; padding: 0.2rem; background: var(--paper);
  font: 600 0.78rem/1 var(--font-body); letter-spacing: 0.06em;
}
.lang-toggle button {
  appearance: none; border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  padding: 0.45rem 0.65rem; border-radius: 999px; font: inherit; letter-spacing: inherit; min-height: 2rem;
}
.lang-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.lang-toggle button:not([aria-pressed="true"]):hover { color: var(--ink); }

.menu-button {
  display: none; appearance: none; border: 1px solid var(--rule); background: var(--paper); color: var(--ink);
  border-radius: var(--radius); padding: 0.5rem 0.75rem; font: 500 var(--step--1) var(--font-body); cursor: pointer;
  align-items: center; gap: 0.4rem; min-height: 2.5rem;
}

@media (max-width: 760px) {
  .menu-button { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    background: var(--ground); border-bottom: 1px solid var(--rule); padding: 0.5rem var(--gutter) 1rem;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { display: block; padding: 0.8rem 0; font-size: var(--step-0); border-radius: 0; border-bottom: 1px solid var(--rule); }
  .nav-links a:hover { background: transparent; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem; text-decoration: none;
  font: 600 var(--step-0)/1 var(--font-body); padding: 0.95rem 1.35rem; border-radius: var(--radius);
  min-height: 3rem; transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.btn-primary { background: var(--terra); color: var(--on-band); }
.btn-primary:hover { background: var(--terra-deep); color: var(--on-band); }
.btn-ghost { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--ground); }
.btn:active { transform: translateY(1px); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #2a1206; }
  :root:not([data-theme="light"]) .btn-primary:hover { color: #2a1206; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 2rem + 4vw, 6rem) clamp(3rem, 2rem + 5vw, 7rem); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 1fr); gap: clamp(2rem, 1rem + 4vw, 5rem); align-items: center; }
.hero h1 { font-size: var(--step-4); letter-spacing: -0.02em; }
.hero h1 .surname { display: block; color: var(--terra); }
.hero-role { margin-top: 1.25rem; font-size: var(--step-1); font-weight: 600; letter-spacing: 0.005em; }
.hero-lead { margin-top: 1rem; max-width: 36rem; font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); }
.hero-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero-where { margin-top: 1.5rem; font-size: var(--step--1); color: var(--ink-3); display: flex; gap: 0.5rem; align-items: center; }

/* Folio card: the hotel guest folio */
.folio {
  background: var(--paper); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem 1.5rem 1.25rem; position: relative;
  border-top: 6px solid var(--terra);
}
.folio-head { display: flex; align-items: center; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--rule); }
.folio-photo { width: 5.5rem; height: 5.5rem; border-radius: 50%; object-fit: cover; object-position: 50% 15%; background: #e9d8c1; flex: none; }
.folio-name { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.15; }
.folio-sub { font-size: var(--step--1); color: var(--ink-3); margin-top: 0.15rem; }

.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li {
  display: flex; align-items: baseline; gap: 0.5rem; padding: 0.7rem 0;
  font-size: var(--step--1); border-bottom: 1px dashed var(--rule);
}
.ledger li:last-child { border-bottom: 0; }
.ledger .lbl { color: var(--ink-2); }
.ledger .dots { flex: 1; min-width: 1rem; border-bottom: 1px dotted var(--ink-3); transform: translateY(-0.3em); opacity: 0.6; }
.ledger .val { font-weight: 700; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; color: var(--ink); }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .folio { max-width: 26rem; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(4rem, 3rem + 5vw, 8rem); }
.section-head { max-width: 44rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3.5rem); }
.section-head p { margin-top: 1.1rem; color: var(--ink-2); font-size: var(--step-1); line-height: 1.55; }

/* ---------- Register (timeline) ---------- */
.register { list-style: none; margin: 0; padding: 0; position: relative; --progress: 0; }
.register::before,
.register::after {
  content: ""; position: absolute; top: 0.6rem; bottom: 0.6rem; left: calc(var(--tag-col) + 1.5rem); width: 2px; border-radius: 2px;
}
.register { --tag-col: 9.5rem; }
.register::before { background: var(--rule); }
.register::after {
  background: linear-gradient(to bottom, var(--walnut) 0%, var(--walnut) 52%, var(--ink-3) 70%, var(--terra) 86%, var(--terra) 100%);
  transform-origin: top; transform: scaleY(var(--progress));
}
@media (prefers-reduced-motion: reduce) { .register::after { transform: none; } }

.entry {
  display: grid; grid-template-columns: var(--tag-col) 3rem minmax(0, 1fr); align-items: start;
  padding-block: 1.4rem;
}
.entry + .entry { border-top: 1px solid color-mix(in srgb, var(--rule) 60%, transparent); }

/* Key tag: the hotel key fob carrying the year — rounded head with a punched
   hole and a split ring, tapering to a squarer tail */
.keytag {
  justify-self: start; position: relative; display: inline-flex; align-items: center;
  margin-left: 0.7rem;
  padding: 0.5rem 0.8rem 0.5rem 1.75rem;
  border-radius: 1.4rem 0.4rem 0.4rem 1.4rem / 50% 0.4rem 0.4rem 50%;
  font: 700 0.82rem/1.2 var(--font-body); letter-spacing: 0.02em; font-variant-numeric: tabular-nums;
  background: var(--walnut); color: var(--ground); white-space: nowrap;
  box-shadow: 0 1px 1px rgb(42 27 20 / 0.12), 0 4px 10px -6px rgb(42 27 20 / 0.45);
}
.keytag::before {
  content: ""; position: absolute; left: 0.55rem; top: 50%; width: 0.6rem; height: 0.6rem; margin-top: -0.3rem;
  border-radius: 50%; background: var(--ground); box-shadow: inset 0 1px 2px rgb(42 27 20 / 0.35);
}
.keytag::after {
  content: ""; position: absolute; left: -0.62rem; top: 50%; width: 1.1rem; height: 1.1rem; margin-top: -0.55rem;
  border-radius: 50%; border: 2px solid var(--ink-3); border-right-color: transparent; transform: rotate(-35deg);
}
.entry[data-kind="transition"] .keytag { background: var(--ink-3); }
.entry[data-kind="product"] .keytag { background: var(--terra); color: var(--on-band); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .entry[data-kind="product"] .keytag { color: #2a1206; }
  :root:not([data-theme="light"]) .keytag { color: #1c1410; }
}

.entry .node {
  width: 0.85rem; height: 0.85rem; border-radius: 50%; margin-top: 0.4rem; justify-self: center;
  background: var(--ground); box-shadow: inset 0 0 0 2px var(--walnut); position: relative; z-index: 1;
}
.entry[data-kind="product"] .node { background: var(--terra); box-shadow: 0 0 0 4px color-mix(in srgb, var(--terra) 22%, transparent); }

.entry-body { max-width: 44rem; }
.entry-role { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.25; }
.entry-job { margin-top: 0.4rem; font-weight: 600; color: var(--ink); }
.entry-place { margin-top: 0.15rem; font-weight: 600; color: var(--ink-2); font-size: var(--step--1); letter-spacing: 0.01em; }
.entry-place .note { font-weight: 400; color: var(--ink-3); }
.entry-points { margin: 0.75rem 0 0; padding-left: 1.1rem; color: var(--ink-2); }
.entry-points li + li { margin-top: 0.3rem; }
.entry-points li::marker { color: var(--terra); }

.register-legend { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1.5rem; font-size: var(--step--1); color: var(--ink-2); }
.register-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.register-legend i { width: 1.6rem; height: 0.7rem; border-radius: 999px; background: var(--walnut); display: inline-block; }
.register-legend i.t { background: var(--ink-3); }
.register-legend i.p { background: var(--terra); }

@media (max-width: 640px) {
  .register { --tag-col: 0rem; }
  .register::before, .register::after { left: 0.4rem; }
  .entry { grid-template-columns: 1.6rem minmax(0, 1fr); }
  .entry .node { grid-column: 1; grid-row: 1; justify-self: start; }
  .entry .keytag { grid-column: 2; grid-row: 1; margin-bottom: 0.7rem; margin-left: 1.2rem; }
  .entry-body { grid-column: 2; grid-row: 2; }
}

/* ---------- Bridge (drenched terracotta) ---------- */
.band { background: var(--band); color: var(--on-band); }
.band ::selection { background: var(--on-band); color: var(--band); }
.band a { color: var(--on-band); }
.band :focus-visible { outline-color: var(--on-band); }
.bridge h2 { max-width: 22ch; }
.bridge-list { list-style: none; margin: clamp(2rem, 1.5rem + 2vw, 3.5rem) 0 0; padding: 0; max-width: 62rem; }
/* Each row is a folio line: origin ……… product skill, the leader running
   from the origin to the skill heading on its first baseline */
.bridge-item { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: 0.75rem; }
.bridge-item .bridge-row { display: contents; }
.bridge-item .bridge-row .dots { display: none; }
.bridge-item .bridge-from {
  grid-column: 1; grid-row: 1 / span 2; align-self: start; margin-top: 0.55em;
  display: flex; align-items: flex-end; gap: 0.5rem; line-height: 1.3;
}
.bridge-item .bridge-from::after {
  content: ""; flex: 1 0 1.25rem; min-width: 1.25rem; margin-bottom: 0.3em;
  border-bottom: 1px dotted color-mix(in srgb, var(--on-band) 60%, transparent);
}
.bridge-item .bridge-to { grid-column: 2; }
.bridge-item .bridge-text { grid-column: 2; }
@media (max-width: 759px) {
  .bridge-item .bridge-from { font-size: var(--step--1); }
}
@media (min-width: 760px) {
  .bridge-item { grid-template-columns: 17rem minmax(0, 1fr); column-gap: 1rem; }
}
.bridge-item { padding-block: 1.6rem; border-top: 1px solid color-mix(in srgb, var(--on-band) 35%, transparent); }
.bridge-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 0.6rem; font-family: var(--font-body); font-weight: 400; line-height: 1.2; }
.bridge-from { font-size: var(--step-0); font-weight: 600; color: var(--on-band-2); }
.bridge-row .dots { flex: 1 1 2rem; min-width: 2rem; border-bottom: 1px dotted color-mix(in srgb, var(--on-band) 55%, transparent); transform: translateY(-0.3em); }
.bridge-to { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.12; color: var(--on-band); }
.bridge-text { margin-top: 0.75rem; color: var(--on-band-2); max-width: 32rem; }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(1.5rem, 1rem + 2vw, 3rem); }
.skill-col h3 { padding-bottom: 0.9rem; border-bottom: 2px solid var(--ink); }
.skill-col ul { list-style: none; margin: 0; padding: 0; }
.skill-col li { padding: 0.8rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.skills-extra { margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(1.5rem, 1rem + 2vw, 3rem); }
.skills-extra h3 { margin-bottom: 1rem; }
.tools { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.tools li { padding: 0.45rem 0.85rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); font-weight: 500; font-size: var(--step--1); }
@media (max-width: 900px) { .skills-grid, .skills-extra { grid-template-columns: 1fr; } }

/* ---------- Projects ---------- */
.projects-section { background: var(--paper); border-block: 1px solid var(--rule); }
.project {
  display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1.5rem, 1rem + 3vw, 4rem); align-items: center;
}
.project-media {
  display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--sand);
  aspect-ratio: 16 / 9.5;
}
.project-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: transform 0.8s var(--ease-out); }
.project:hover .project-media img { transform: scale(1.025); }
@media (prefers-reduced-motion: reduce) { .project:hover .project-media img { transform: none; } }
.project-year { font-family: var(--font-body); font-weight: 700; color: var(--terra); font-variant-numeric: tabular-nums; font-size: var(--step-0); letter-spacing: 0; white-space: nowrap; }
.project h3 { font-size: clamp(1.8rem, 1rem + 3vw, 3.2rem); margin-top: 0.4rem; overflow-wrap: anywhere; }
.project-tagline { margin-top: 0.6rem; font-size: var(--step-1); line-height: 1.4; }
.project-summary { margin-top: 1rem; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 1.25rem 0 0; padding: 0; }
.tags li { font-size: 0.8rem; font-weight: 600; padding: 0.3rem 0.65rem; border-radius: 999px; background: var(--sand); color: var(--ink-2); }
.project .btn { margin-top: 1.75rem; }
.projects-next { margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); padding-top: 1.5rem; border-top: 1px dashed var(--rule); color: var(--ink-3); }
.project + .project { margin-top: clamp(3rem, 2rem + 4vw, 6rem); }
@media (max-width: 860px) { .project { grid-template-columns: 1fr; } }

/* ---------- Education ---------- */
.edu-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.edu-item { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem 2rem; padding: 1.3rem 0; border-bottom: 1px solid var(--rule); }
.edu-years { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--terra); }
.edu-title { font-family: var(--font-display); font-size: var(--step-1); line-height: 1.25; }
.edu-school { margin-top: 0.25rem; color: var(--ink-2); font-weight: 600; font-size: var(--step--1); }
.edu-note { margin-top: 0.4rem; color: var(--ink-2); }
.certs { margin-top: 2.5rem; }
.certs h3 { margin-bottom: 0.5rem; }
.certs .ledger { max-width: 36rem; }
@media (max-width: 640px) { .edu-item { grid-template-columns: 1fr; gap: 0.3rem; } }

/* ---------- Contact close ---------- */
.contact h2 { font-size: var(--step-4); max-width: 14ch; }
.contact-lead { margin-top: 1.25rem; font-size: var(--step-1); max-width: 34rem; color: var(--on-band-2); line-height: 1.5; }
.contact-actions { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.band .btn-primary { background: var(--on-band); color: var(--band); }
.band .btn-primary:hover { background: #fff; color: var(--band); }
.band .btn-ghost { color: var(--on-band); box-shadow: inset 0 0 0 1px var(--on-band); }
.band .btn-ghost:hover { background: var(--on-band); color: var(--band); }
.contact-mail { margin-top: 1.5rem; font-size: var(--step--1); color: var(--on-band-2); overflow-wrap: anywhere; }

.site-footer { padding-block: 2rem; font-size: var(--step--1); color: var(--ink-3); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem; }

/* ==========================================================================
   Case study page
   ========================================================================== */
.case-hero { padding-block: clamp(2rem, 1.5rem + 3vw, 4.5rem) clamp(2rem, 1.5rem + 2vw, 3rem); }
.back-link { display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: var(--step--1); padding: 0.4rem 0; }
.back-link:hover { color: var(--terra); }
.case-hero h1 { font-size: clamp(2.1rem, 0.9rem + 6vw, 5.6rem); margin-top: 1.5rem; overflow-wrap: anywhere; letter-spacing: -0.02em; }
.case-tagline { margin-top: 1rem; font-size: var(--step-2); font-family: var(--font-display); line-height: 1.2; max-width: 30ch; color: var(--terra); }
.case-context { margin-top: 1.1rem; color: var(--ink-2); max-width: 40rem; }

.case-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 1fr); gap: clamp(1.5rem, 1rem + 3vw, 4rem); align-items: start; }
.case-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--sand); }
.case-cover img { width: 100%; }
.case-top .folio { position: sticky; top: 5.5rem; }
.folio h2 { font-size: var(--step-1); padding-bottom: 0.75rem; border-bottom: 1px solid var(--rule); }
@media (max-width: 900px) {
  .case-top { grid-template-columns: 1fr; }
  .case-top .folio { position: static; }
}

.case-intro { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 1rem + 4vw, 5rem); }
.case-intro h2 { font-size: var(--step-2); margin-bottom: 1.25rem; }
.prose p + p { margin-top: 1rem; }
.prose { color: var(--ink-2); max-width: 38rem; }
.solution-list { list-style: none; margin: 0; padding: 0; }
.solution-list li { padding: 1.1rem 0; border-top: 1px solid var(--rule); }
.solution-list li:first-child { border-top: 2px solid var(--ink); }
.solution-list h3 { margin-bottom: 0.4rem; }
.solution-list p { color: var(--ink-2); }
@media (max-width: 860px) { .case-intro { grid-template-columns: 1fr; } }

.chapter { padding-block: clamp(3rem, 2rem + 4vw, 6rem); border-top: 1px solid var(--rule); }
.chapter-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: clamp(1.5rem, 1rem + 3vw, 4rem); margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.chapter-head h2 { font-size: var(--step-3); }
.chapter-title { display: flex; align-items: flex-start; gap: 1rem; }
.chapter-title .keytag { flex: none; margin-top: 0.55rem; }
.chapter-head .keytag { background: var(--terra); color: var(--on-band); }
@media (max-width: 860px) { .chapter-head { grid-template-columns: 1fr; } }

.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1rem, 0.75rem + 1.5vw, 2rem); }
.media-grid > .is-wide { grid-column: 1 / -1; }
@media (max-width: 700px) { .media-grid { grid-template-columns: 1fr; } }

.shot { margin: 0; }
.shot a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--paper); }
.shot img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; background: #fff; transition: transform 0.6s var(--ease-out); }
.shot a:hover img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { .shot a:hover img { transform: none; } }
.shot figcaption, .video figcaption { margin-top: 0.7rem; font-size: var(--step--1); color: var(--ink-2); }

/* Video: poster first, YouTube only on click */
.video { margin: 0; }
.video-frame {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--ink);
  box-shadow: var(--shadow);
}
.video-frame img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.video-play {
  position: absolute; inset: 0; width: 100%; appearance: none; border: 0; padding: 0; cursor: pointer;
  background: linear-gradient(to top, rgb(28 20 16 / 0.72), rgb(28 20 16 / 0.05) 60%);
  color: #fcf2e6; display: flex; align-items: flex-end; justify-content: flex-start; text-align: left;
}
.video-play .pill {
  margin: 1rem; display: inline-flex; align-items: center; gap: 0.6rem;
  background: #a8451e; color: #fcf2e6; padding: 0.7rem 1.1rem 0.7rem 0.85rem; border-radius: 999px;
  font: 600 var(--step--1)/1 var(--font-body); transition: transform 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}
.video-play:hover .pill { background: #8a3615; transform: translateY(-2px); }
.video-play .icon { fill: currentColor; stroke: none; }
.video-play:focus-visible { outline-offset: -4px; outline-color: #fcf2e6; }
.video-soon {
  position: absolute; inset: 0; display: flex; align-items: flex-end;
  background: linear-gradient(to top, rgb(28 20 16 / 0.78), rgb(28 20 16 / 0.15) 60%);
}
.video-soon span {
  margin: 1rem; padding: 0.55rem 0.9rem; border-radius: 999px; background: rgb(252 242 230 / 0.92); color: #2a1b14;
  font: 600 0.82rem/1 var(--font-body); display: inline-flex; gap: 0.5rem; align-items: center;
}
.video-meta { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.video-meta .dur { font-variant-numeric: tabular-nums; color: var(--ink-3); white-space: nowrap; }
.video-note { font-size: 0.8rem; color: var(--ink-3); margin-top: 0.2rem; }

.decisions { list-style: none; counter-reset: d; margin: 0; padding: 0; max-width: 52rem; }
.decisions li { counter-increment: d; display: grid; grid-template-columns: 3rem minmax(0, 1fr); padding: 1.2rem 0; border-top: 1px solid var(--rule); font-size: var(--step-1); line-height: 1.45; }
.decisions li::before { content: counter(d); font-family: var(--font-display); color: var(--terra); font-size: var(--step-2); line-height: 1; }

.status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.5rem, 1rem + 3vw, 4rem); }
.status h3 { padding-bottom: 0.8rem; border-bottom: 2px solid var(--ink); }
.status ul { list-style: none; margin: 0; padding: 0; }
.status li { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.8rem 0; border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.status li .icon { margin-top: 0.2rem; color: var(--terra); }
.status .planned li .icon { color: var(--ink-3); }
@media (max-width: 700px) { .status { grid-template-columns: 1fr; } }

.stack-ledger { max-width: 44rem; }
.stack-ledger li { font-size: var(--step-0); }
.stack-ledger .lbl { font-weight: 700; color: var(--ink); }
.stack-ledger .val { font-weight: 400; color: var(--ink-2); white-space: normal; text-align: right; }

.not-found { padding-block: 6rem; }

/* ---------- Lightbox: images open in a window over the page ---------- */
a[data-lightbox] { cursor: zoom-in; }
.case-cover { margin: 0; }
.case-cover a { display: block; }
html.has-lightbox { overflow: hidden; }
.lightbox {
  border: 0; padding: 0; margin: auto; background: transparent; color: #fcf2e6;
  width: min(100vw - 2rem, 92rem); max-width: none; max-height: calc(100dvh - 2rem); overflow: visible;
}
.lightbox::backdrop { background: rgb(28 20 16 / 0.86); }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.lightbox-figure img {
  max-width: 100%; max-height: calc(100dvh - 8rem); width: auto; height: auto;
  border-radius: var(--radius); background: #fff; box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.6);
}
.lightbox-figure figcaption { font-size: var(--step--1); color: #f3d9c4; text-align: center; max-width: 60ch; }
.lightbox-close {
  position: fixed; top: 1rem; right: 1rem; display: inline-flex; align-items: center; gap: 0.45rem;
  appearance: none; border: 0; cursor: pointer; min-height: 2.75rem; padding: 0.6rem 1rem 0.6rem 0.8rem;
  border-radius: 999px; background: #fcf2e6; color: #2a1b14; font: 600 var(--step--1)/1 var(--font-body);
  box-shadow: 0 4px 14px -6px rgb(0 0 0 / 0.5); transition: background-color 0.2s var(--ease-out);
}
.lightbox-close:hover { background: #fff; }
.lightbox-close:focus-visible { outline: 2px solid #fcf2e6; outline-offset: 3px; }
.lightbox[open] { animation: lightbox-in 0.35s var(--ease-out); }
.lightbox[open]::backdrop { animation: lightbox-fade 0.35s var(--ease-out); }
@keyframes lightbox-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .lightbox[open], .lightbox[open]::backdrop { animation: none; }
}
