/* ==========================================================================
   Ileana Prince — portfolio
   Design system: warm bone paper, deep forest ink, terracotta accent.
   ========================================================================== */

:root {
  /* Color — light */
  --bone:        #FBF7F0;
  --bone-deep:   #F2EADC;
  --paper:       #FFFFFF;
  --ink:         #16231C;
  --ink-soft:    #38493F;
  --muted:       #414D44;
  --line:        #DFD6C6;
  --forest:      #1E4436;
  --moss:        #4F7A5C;
  --terracotta:  #7A3317;
  --clay:        #E3B294;

  --accent:      var(--terracotta);
  --accent-ink:  #FFFFFF;
  --bg:          var(--bone);
  --bg-alt:      var(--bone-deep);
  --surface:     var(--paper);
  --fg:          var(--ink);
  --fg-soft:      var(--ink-soft);
  --border:      var(--line);

  /* Type */
  /* Helvetica throughout. "Helvetica Neue" first for the wider weight range on
     macOS; Arial is the metric-compatible stand-in on Windows. */
  --font-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --step--1: clamp(0.82rem, 0.79rem + 0.14vw, 0.9rem);
  --step-0:  clamp(1rem, 0.96rem + 0.2vw, 1.12rem);
  --step-1:  clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem);
  --step-2:  clamp(1.5rem, 1.3rem + 1vw, 2.1rem);
  --step-3:  clamp(2rem, 1.6rem + 2vw, 3.2rem);
  --step-4:  clamp(2.6rem, 1.8rem + 4vw, 5.4rem);
  --step-5:  clamp(3.2rem, 1.9rem + 6.4vw, 8rem);

  /* Space + shape */
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --section: clamp(4.5rem, 9vw, 9rem);
  --radius: 4px;
  --radius-lg: 20px;
  --maxw: 1240px;
  --prose: 68ch;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:      #0F1613;
    --bg-alt:  #151E19;
    --surface: #18231D;
    --fg:      #ECE6DA;
    --fg-soft: #C3CDC4;
    --muted:   #A6B4AA;
    --border:  #2A362F;
    --forest:  #7FB395;
    --moss:    #8FBDA0;
    --accent:  #EE9A72;
    --accent-ink: #16231C;
  }
}

:root[data-theme="dark"] {
  --bg:      #0F1613;
  --bg-alt:  #151E19;
  --surface: #18231D;
  --fg:      #ECE6DA;
  --fg-soft: #C3CDC4;
  --muted:   #A6B4AA;
  --border:  #2A362F;
  --forest:  #7FB395;
  --moss:    #8FBDA0;
  --accent:  #EE9A72;
  --accent-ink: #16231C;
}

/* --------------------------------------------------------------- base --- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.022em;
  margin: 0 0 0.5em;
}

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { text-decoration-color: var(--accent); }

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

hr { border: 0; border-top: 1px solid var(--border); margin: var(--section) 0; }

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 0.25em;
  cursor: help;
}

::selection { background: var(--accent); color: var(--accent-ink); }

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

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 100;
  background: var(--fg);
  color: var(--bg);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 0.75rem; }

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

/* ------------------------------------------------------------ layout --- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section); }
.section--tint { background: var(--bg-alt); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  flex-wrap: wrap;
}
.section-head h2 { font-size: var(--step-3); margin: 0; }
.section-head p { color: var(--muted); max-width: 42ch; margin: 0; font-size: var(--step--1); }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  display: block;
}

/* WCAG 1.4.8 (AAA) applies to blocks of running text: line length under 80
   characters, and paragraph spacing at least 1.5x the line spacing. Line
   height is 1.65, so the gap below a paragraph is 2.5em. */
.prose { max-width: var(--prose); }
.prose p { margin-bottom: 2.5em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { margin-bottom: 2.5em; }
.prose h3 { font-size: var(--step-2); margin-top: 2em; }
/* A small label that is still a real heading — the level stays correct for
   screen readers, only the type size changes. */
.prose h3.label {
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.2em 0 0.6em;
}
.prose ul { padding-left: 1.1rem; margin: 0 0 1.4em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.4;
  color: var(--fg-soft);
}
.prose blockquote cite {
  display: block;
  margin-top: 0.8rem;
  font-family: var(--font-sans);
  font-size: var(--step--1);
  font-style: normal;
  color: var(--muted);
}

/* ------------------------------------------------------------ header --- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease);
}
.site-header.is-stuck { border-bottom-color: var(--border); }

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
}

.wordmark {
  min-height: 44px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.wordmark .leaf { width: 20px; height: 20px; color: var(--moss); flex: none; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.2rem); }
.nav a {
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
  color: var(--fg-soft);
  position: relative;
  /* WCAG 2.5.5 (AAA): targets are at least 44x44 CSS px. */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: 0.15rem;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 10px;
  width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
.nav a[aria-current] { color: var(--fg); }

/* Colour-scheme control — WCAG 1.4.8 (AAA) asks that the reader be able to
   choose, not just inherit the OS setting. */
.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-soft);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; grid-area: 1 / 1; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
}

.nav-toggle { display: none; }

@media (max-width: 640px) {
  .nav { gap: 1rem; font-size: 0.9rem; }
  .nav a.nav-hide-sm { display: none; }
}

/* Keep the wordmark on one line without pushing the theme toggle off-screen. */
@media (max-width: 430px) {
  .site-header .wrap { gap: 0.5rem; }
  .wordmark { font-size: 0.92rem; gap: 0.4rem; }
  .wordmark .leaf { width: 17px; height: 17px; }
  .nav { gap: 0.7rem; }
  .nav a { font-size: 0.82rem; }
}

/* -------------------------------------------------------------- hero --- */

.hero {
  position: relative;
  padding-block: clamp(3rem, 8vw, 7rem) clamp(3rem, 7vw, 6rem);
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

.hero h1 {
  font-size: var(--step-5);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 0 0 1.5rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--forest);
}
.hero-lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--fg-soft);
  max-width: 46ch;
  margin-bottom: 2rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.6rem;
  font-size: var(--step--1);
  color: var(--muted);
  margin-bottom: 2.25rem;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 0.5rem; }
.hero-meta span::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--moss);
}

.portrait {
  position: relative;
  border-radius: 200px 200px 12px 12px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: var(--bg-alt);
  box-shadow: 0 30px 70px -40px rgba(20, 35, 28, 0.6);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }

.hero-vine {
  position: absolute;
  top: -40px;
  right: -60px;
  width: min(46vw, 520px);
  color: var(--moss);
  opacity: 0.16;
  pointer-events: none;
  z-index: -1;
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--fg);
  background: var(--fg);
  color: var(--bg);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
              color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--accent); background: transparent; color: var(--accent); }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* --------------------------------------------------------------- work --- */

.work-list { display: grid; gap: clamp(1rem, 2.5vw, 1.75rem); }

.work-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2.25rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease),
              box-shadow 0.4s var(--ease);
}
.work-card:nth-child(even) { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); }
.work-card:nth-child(even) .work-thumb { order: 2; }
.work-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 26px 50px -34px rgba(20, 35, 28, 0.55);
}
@media (max-width: 780px) {
  .work-card, .work-card:nth-child(even) { grid-template-columns: 1fr; }
  .work-card:nth-child(even) .work-thumb { order: 0; }
}

.work-thumb {
  aspect-ratio: 16 / 11;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-alt);
  border: 1px solid var(--border);
}
.work-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 0;
  transition: transform 0.6s var(--ease);
}
/* Slide and full-page artefacts are shown whole rather than cropped —
   a cropped slide just reads as a mistake. */
.work-thumb--fit { padding: clamp(0.6rem, 1.5vw, 1.1rem); background: var(--bg-alt); }
.work-thumb--fit img { object-fit: contain; }
.work-card:hover .work-thumb--fit img { transform: scale(1.015); }
.work-card:hover .work-thumb img { transform: scale(1.03); }

.work-index {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
  display: block;
  margin-bottom: 0.9rem;
}
.work-body h3 { font-size: var(--step-2); margin-bottom: 0.4rem; }
.work-body h3 a { text-decoration: none; }
.work-body h3 a::after { content: ""; position: absolute; inset: 0; }
.work-kicker { color: var(--accent); font-size: var(--step--1); font-weight: 600; margin-bottom: 0.9rem; }
.work-body p { color: var(--fg-soft); font-size: var(--step-0); }

.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.2rem; padding: 0; list-style: none; }
.tags li {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}

.work-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.4rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--accent);
}
.work-more svg { width: 14px; height: 14px; transition: transform 0.3s var(--ease); }
.work-card:hover .work-more svg { transform: translateX(4px); }

/* Shorter pieces — a compact list so the deep case studies keep the visual weight. */
.brief-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1rem;
}
.brief-list a {
  display: grid;
  gap: 0.45rem;
  height: 100%;
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.brief-list a:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}
.brief-title { font-family: var(--font-display); font-size: var(--step-1); letter-spacing: -0.01em; }
.brief-desc { color: var(--fg-soft); font-size: var(--step--1); line-height: 1.55; }
.brief-tags {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ---------------------------------------------------------- approach --- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: clamp(1.25rem, 3vw, 2.5rem);
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: step;
}
.steps li { counter-increment: step; padding-top: 1.4rem; border-top: 2px solid var(--border); }
.steps li::before {
  content: "0" counter(step);
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.steps h3 { font-size: var(--step-1); margin-bottom: 0.4rem; }
.steps p { color: var(--muted); font-size: var(--step--1); }

/* ------------------------------------------------------------- about --- */

.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

.about-portrait {
  border-radius: 12px 12px 160px 160px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--border);
}
.about-portrait img { width: 100%; height: 100%; object-fit: cover; }

.skill-groups { display: grid; gap: 1.6rem; margin-top: 2.5rem; }
.skill-group h3 {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.6rem;
}
.skill-group p { color: var(--fg-soft); font-size: var(--step--1); margin: 0; }

.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.facts li { display: grid; gap: 0.15rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.facts dt, .facts .fact-label {
  font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.facts .fact-value { font-family: var(--font-display); font-size: var(--step-1); }
.facts .fact-note { font-size: var(--step--1); color: var(--muted); }

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

.contact-panel {
  background: var(--forest);
  color: #F6F2E9;
  border-radius: var(--radius-lg);
  padding: clamp(2rem, 6vw, 4.5rem);
  position: relative;
  overflow: hidden;
}
:root[data-theme="dark"] .contact-panel,
:root:not([data-theme="light"]) .contact-panel { color: #0F1613; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .contact-panel { color: #F6F2E9; }
}
.contact-panel h2 { font-size: var(--step-4); max-width: 14ch; margin-bottom: 1rem; }
.contact-panel p { max-width: 46ch; }
.contact-panel .btn { background: currentColor; border-color: currentColor; color: var(--forest); }
.contact-panel .btn:hover { background: var(--clay); border-color: var(--clay); color: #16231C; }
.contact-panel .btn--ghost { background: transparent; color: currentColor; border-color: currentColor; }
.contact-panel .btn--ghost:hover { background: transparent; color: currentColor; border-color: currentColor; }
.contact-vine {
  position: absolute;
  right: -80px; bottom: -100px;
  width: min(40vw, 380px);
  opacity: 0.14;
  pointer-events: none;
}

/* ------------------------------------------------------------ footer --- */

.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 2.5rem 3rem;
  font-size: var(--step--1);
  color: var(--muted);
}
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: center; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 0.5rem 1.4rem; flex-wrap: wrap; }
.footer-links a { min-height: 44px; display: inline-flex; align-items: center; }

/* ------------------------------------------------------- case studies --- */

/* Breadcrumb — WCAG 2.4.8 (AAA), so a reader always knows where they are. */
.breadcrumb { margin-bottom: 1.5rem; }
.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  font-size: var(--step--1);
  color: var(--muted);
}
.breadcrumb li { display: flex; align-items: center; gap: 0.5rem; }
.breadcrumb li + li::before { content: "/"; color: var(--border); }
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb [aria-current] { color: var(--fg); }

.case-hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3.5rem); }
.case-hero h1 {
  font-size: var(--step-4);
  max-width: 18ch;
  margin-bottom: 1rem;
}
.case-hero .lede {
  font-size: var(--step-1);
  color: var(--fg-soft);
  max-width: 54ch;
  line-height: 1.5;
}

/* Every source image here is portrait — phone screens and portrait slide
   documents. So the cover shrinks to fit its image rather than stretching a
   narrow screenshot across a full-width band: bounded height, never upscaled. */
.case-cover {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto clamp(2rem, 5vw, 4rem);
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.case-cover img {
  max-height: 560px;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem 2rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.case-meta dt {
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 0.35rem;
}
.case-meta dd { margin: 0; font-size: var(--step--1); color: var(--fg); line-height: 1.5; }

.case-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
}
@media (min-width: 1000px) {
  .case-layout { grid-template-columns: 210px minmax(0, 1fr); }
}

.case-toc { position: sticky; top: 100px; align-self: start; font-size: var(--step--1); }
.case-toc h2 {
  font-family: var(--font-sans);
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 0.9rem;
}
.case-toc ol { list-style: none; margin: 0; padding: 0; display: grid; }
.case-toc a {
  text-decoration: none;
  color: var(--muted);
  min-height: 44px;
  display: flex;
  align-items: center;
  padding-block: 0.2rem;
}
.case-toc a:hover, .case-toc a.is-active { color: var(--accent); }
@media (max-width: 999px) { .case-toc { display: none; } }

.case-section { margin-bottom: clamp(3rem, 7vw, 5.5rem); scroll-margin-top: 100px; }
.case-section > h2 {
  font-size: var(--step-3);
  margin-bottom: 1.2rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}

.callouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}
.callouts li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.1rem 1.25rem;
  font-size: var(--step--1);
}
.callouts strong { display: block; font-size: var(--step-0); margin-bottom: 0.3rem; font-family: var(--font-display); }
.callouts span { color: var(--muted); }

.personas { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.25rem; margin: 2rem 0; }
.persona {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.4rem;
}
.persona h3 { font-family: var(--font-display); font-size: var(--step-1); text-transform: none; letter-spacing: -0.01em; color: var(--fg); margin: 0 0 0.2rem; }
.persona .persona-role { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 0.8rem; }
.persona p { font-size: var(--step--1); color: var(--fg-soft); }
.persona dl { margin: 0.9rem 0 0; font-size: var(--step--1); }
.persona dt { font-weight: 700; color: var(--muted); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.7rem; }
.persona dd { margin: 0.15rem 0 0; color: var(--fg-soft); }

/* Galleries */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1rem;
  margin: 2rem 0;
}
.gallery--tall { grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); }
.gallery figure { margin: 0; }
.gallery button.shot {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
  cursor: zoom-in;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
/* Tall galleries hold phone screens, so the box is portrait. Either way the
   image is contained, never cropped — this is design work, not decoration. */
.gallery--tall button.shot { aspect-ratio: 3 / 4; }
.gallery button.shot:hover { transform: translateY(-3px); border-color: var(--accent); }
/* Explicit width and height with object-fit does the letterboxing reliably;
   percentage max-height against an aspect-ratio box does not resolve in every
   engine, which let portrait shots overflow their container. */
.gallery img {
  width: 100%;
  height: 100%;
  /* Grid items default to min-height:auto, which lets a tall image push past
     its track. Zeroing the minimums is what actually holds the box. */
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  border-radius: 4px;
}
.gallery figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.55rem; line-height: 1.45; }

.figure-wide { margin: 2.5rem 0; }
.figure-wide img {
  width: auto;
  max-width: 100%;
  max-height: 70vh;
  margin-inline: auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.figure-wide figcaption { font-size: var(--step--1); color: var(--muted); margin-top: 0.7rem; }

/* Lightbox */
/* `display: grid` would override the UA's `dialog:not([open]) { display: none }`,
   so the open state has to carry the layout. */
.lightbox:not([open]) { display: none; }

.lightbox[open] {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 20, 16, 0.94);
  display: grid;
  place-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  border: 0;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
}
.lightbox::backdrop { background: rgba(12, 20, 16, 0.94); }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 8px; object-fit: contain; }
.lightbox figcaption { color: #D8D2C6; font-size: var(--step--1); margin-top: 1rem; text-align: center; max-width: 60ch; }
.lightbox-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: #F6F2E9;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.12); }

/* Next / prev project */
.case-next {
  border-top: 1px solid var(--border);
  padding-top: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.case-next a { text-decoration: none; }
.case-next .next-label { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 0.4rem; }
.case-next .next-title { font-family: var(--font-display); font-size: var(--step-2); }
.case-next .next-title:hover { color: var(--accent); }

.link-list { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }

/* --------------------------------------------------------- utilities --- */

/* Content is visible by default; only the JS-enabled document hides it to animate
   it back in. Without scripting — or if the observer never fires — nothing is lost. */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.is-visible { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }

/* Colours are transitioned, and a var()-driven colour can hold its old value
   through a theme swap — which left buttons unreadable for a moment. Kill
   transitions for the frame in which the theme changes. */
:root.theme-changing *,
:root.theme-changing *::before,
:root.theme-changing *::after {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .site-footer, .case-toc, .contact-panel, .hero-vine { display: none; }
  body { background: #fff; color: #000; }
}
