/* ===================================================================
   Rachel J. Merriman — Portfolio
   Global stylesheet
   -------------------------------------------------------------------
   Load order:
     1. Tokens        design variables (:root)
     2. Reset/base    normalize + element defaults
     3. Layout        nav, footer
     4. Components    case study, portfolio, palette, carousel
     5. Responsive    breakpoints (900px, 600px)
   =================================================================== */

/* ====================================================================
   1. DESIGN TOKENS
   ==================================================================== */

:root {
  /* Surfaces */
  --bg:             #F0EBE3;
  --bg-surface:     #E6DDD8;
  --bg-blue:        #1E23BC;
  --bg-blue-dark:   #0F2480;

  /* Text */
  --text:           #3D2B22;
  --text-mid:       #5C4A42;
  --text-on-blue:   #E8E2F5;

  /* Accent */
  --ember:          #A83E18;
  --ember-light:    #E68A50;

  /* Quilt patch tints */
  --patch-ivory:    #F2E8D9;
  --patch-blush:    #EDD9DC;
  --patch-sage:     #DDE3CE;
  --patch-lavender: #E6E0EA;
  --patch-plum:     #EDD9E2;

  /* Rules — three weights, lightest to strongest */
  --rule-soft:      rgba(92,74,66,0.16);   /* incidental dividers, borders */
  --rule:           rgba(92,74,66,0.28);   /* default rule */
  --rule-strong:    rgba(92,74,66,0.42);   /* section breaks */
  --rule-blue:      rgba(232,226,245,0.15);

  /* Layout */
  --measure:        860px;   /* shared case study column width */
}

/* ====================================================================
   2. RESET & BASE
   ==================================================================== */

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

html {
  scroll-behavior: smooth;
  /* Fixed nav is ~74px tall; keep anchor targets clear of it. */
  scroll-padding-top: 6rem;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
}

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

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

/* ====================================================================
   3. NAVIGATION
   ==================================================================== */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2.5rem;
  background: var(--bg-blue);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-logo {
  width: 34px;
  height: 34px;
  border-radius: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.nav-wordmark {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text-on-blue);
}

.nav-links {
  display: flex;
  gap: 2.2rem;
  list-style: none;
}

.nav-links a {
  font-family: 'DM Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(232,226,245,0.82);
  transition: color 0.18s;
}

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

.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 20px;
  flex-direction: column;
  justify-content: space-between;
}

.nav-menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-on-blue);
  border-radius: 1px;
}

.nav-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-blue-dark);
  z-index: 190;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
}

.nav-mobile.open { display: flex; }

.nav-mobile a {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 2.5rem;
  color: var(--text-on-blue);
  transition: color 0.2s;
}

.nav-mobile a:hover { color: var(--ember-light); }

.nav-mobile-close {
  position: absolute;
  top: 1.5rem; right: 2rem;
  background: none; border: none;
  color: rgba(232,226,245,0.6);
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ====================================================================
   4. CASE STUDY — header & hero
   ==================================================================== */

/* Shared centered column — every top-level case study block sits on
   the same left/right edge. */
.cs-back,
.cs-header,
.cs-meta,
.cs-body,
.cs-nav-footer {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}

.cs-back {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-mid);
  padding: 6rem 2.5rem 0;
  transition: color 0.2s;
}

.cs-back:hover { color: var(--ember); }

.cs-back::before { content: '← '; }

.cs-header {
  padding: 2.5rem 2.5rem 4rem;
}

.cs-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.5rem;
}

.cs-subtitle {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: var(--text-mid);
  line-height: 1.5;
  max-width: 60ch;
}

.cs-meta {
  display: flex;
  gap: 3rem;
  padding: 2rem 2.5rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.cs-meta-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mid);
  opacity: 0.7;
  margin-bottom: 0.35rem;
}

.cs-meta-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 400;
}

/* The hero sits outside .cs-body, so it has to reproduce that column by
   hand: --measure minus .cs-body's own 2.5rem side padding. Keeps the hero
   flush with every figure further down the page. */
.cs-hero-img {
  width: min(calc(var(--measure) - 5rem), calc(100% - 5rem));
  margin: 2.5rem auto 0;
  border-radius: 6px;
  border: 1px solid var(--rule-soft);
  overflow: hidden;
}

.cs-hero-img + .cs-img-caption {
  width: min(calc(var(--measure) - 5rem), calc(100% - 5rem));
  margin: 0.75rem auto 0;
  text-align: left;
}

.cs-scroll-box + .cs-img-caption {
  text-align: center;
  margin-top: 0.75rem;
}

.cs-hero-scroll-wrap {
  /* max-height, not height: at narrow widths the image scales down shorter
     than the window and a fixed height leaves dead space beneath it.
     overflow-y: auto so the scrollbar gutter only appears when it's needed. */
  max-height: 540px;
  overflow-y: auto;
  cursor: ns-resize;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.cs-hero-scroll-wrap::-webkit-scrollbar { width: 6px; }

.cs-hero-scroll-wrap::-webkit-scrollbar-track { background: transparent; }

.cs-hero-scroll-wrap::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.cs-hero-scroll-wrap img {
  width: 100%;
  height: auto;
  display: block;
}

.cs-scroll-figure {
  width: 100%;
  margin: 2rem 0 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  overflow: hidden;
}

.cs-scroll-figure .cs-hero-scroll-wrap { max-height: 540px; }

.cs-scroll-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(to top, rgba(255,255,255,0.7), transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 0.5rem;
  pointer-events: none;
  transition: opacity 0.3s;
}

.cs-scroll-hint span {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mid);
  opacity: 0.6;
}

/* ====================================================================
   4b. CASE STUDY — body & typography
   ==================================================================== */

.cs-body {
  padding: 5rem 2.5rem;
}

/* Section headings carry the divider that previously sat on the
   eyebrow label, so sections stay visually separated. */
.cs-h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-top: 3.5rem;
  padding-top: 3.5rem;
  border-top: 1px solid var(--rule-strong);
  margin-bottom: 1.2rem;
}

/* The opening heading of a case study needs no divider above it.
   Scoped with .cs-body--first so continuation blocks (a case study
   split across several .cs-body wrappers) keep their dividers. */
.cs-body--first > .cs-h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.cs-p {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 1.2rem;
  max-width: 72ch;   /* keep prose readable inside the wider column */
}

.cs-p strong { color: var(--text); font-weight: 500; }

.cs-h3 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-top: 2.75rem;
  margin-bottom: 1.2rem;
}

.cs-list {
  list-style: none;
  max-width: 62ch;
  margin: 0 0 2rem;
}

.cs-list li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.75rem;
  color: var(--text-mid);
  line-height: 1.7;
}

.cs-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  background: var(--ember);
  transform: rotate(45deg);
}

/* ====================================================================
   4c. CASE STUDY — media
   ==================================================================== */

.cs-img {
  width: 100%;
  border-radius: 4px;
  margin: 2rem 0 0.75rem;
  background: var(--bg-surface);
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: rgba(42,31,26,0.3);
  overflow: hidden;
}

.cs-img img { width: 100%; height: 100%; object-fit: cover; }

.cs-img--tall {
  aspect-ratio: unset;
  height: auto;
}

.cs-img--natural {
  aspect-ratio: unset;
  height: auto;
  background: transparent;
}

/* White space around screenshots that shouldn't bleed to the edge —
   e.g. text-heavy instruction images. */
.cs-img--padded {
  aspect-ratio: unset;
  height: auto;
  background: var(--bg-surface);
  padding: 2rem;
}

.cs-img--padded img {
  height: auto;
  object-fit: contain;
  border-radius: 2px;
}

.cs-img--tall img {
  height: auto;
  object-fit: unset;
}

.cs-img-caption {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-mid);
  opacity: 0.6;
  margin-bottom: 2rem;
}

/* When body copy resumes after a caption, the caption's trailing 2rem
   is too much — fall back to the normal paragraph rhythm. */
.cs-img-caption + .cs-p {
  margin-top: -0.8rem;
}

/* A case study split across consecutive .cs-body blocks would otherwise
   stack 80px of bottom padding against the next block's heading rule.
   Collapse the seam so the divider keeps the normal section rhythm. */
.cs-body + .cs-body {
  padding-top: 0;
}

.cs-body:has(+ .cs-body) {
  padding-bottom: 0;
}

/* Last element in a body block shouldn't add its own trailing margin. */
.cs-body > :last-child {
  margin-bottom: 0;
}

.cs-body-img {
  width: 100%;
  margin: 2rem 0 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--rule);
  overflow: hidden;
}

/* Wide figure: lets a diagram break out of the case study text column.
   Must be a SIBLING of .cs-body, not a child — .cs-body caps at
   var(--measure), so a nested element can never exceed it. */
.cs-figure-wide {
  width: min(1200px, calc(100vw - 3rem));
  margin: 0 auto 4rem;
  padding: 0;
}

/* The figure sits BETWEEN two .cs-body blocks, so the `.cs-body + .cs-body`
   padding collapse above can't reach it. Collapse the seam explicitly, and let
   the following .cs-h2's own rule + padding set the section rhythm. */
.cs-body:has(+ .cs-figure-wide) {
  padding-bottom: 2.5rem;
}

.cs-figure-wide + .cs-body {
  padding-top: 0;
}

/* Caption tracks the figure's left edge but keeps a readable measure —
   a caption set across the full 1200px runs to ~180 characters. */
.cs-figure-wide .cs-img-caption {
  margin-top: 0.75rem;
  max-width: var(--measure);
}

.cs-before-after {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.cs-before-after-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
  opacity: 0.6;
  margin-bottom: 0.5rem;
}

.cs-before-after .cs-img { margin: 0; aspect-ratio: unset; height: auto; }

.cs-scroll-box {
  border-radius: 6px;
  border: 1px solid var(--rule);
  box-shadow: 0 4px 20px rgba(42,31,26,0.08);
  overflow: hidden;
  margin: 0;
}

.cs-scroll-wrap {
  max-height: 460px;
  overflow-y: auto;
  cursor: ns-resize;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.cs-scroll-wrap::-webkit-scrollbar { width: 6px; }

.cs-scroll-wrap::-webkit-scrollbar-track { background: transparent; }

.cs-scroll-wrap::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 3px; }

.cs-scroll-wrap img { width: 100%; height: auto; display: block; }

/* ====================================================================
   4d. CASE STUDY — callouts, insights, pager
   ==================================================================== */

.cs-callout {
  border-left: 3px solid var(--ember);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2.5rem 0;
}

.cs-callout p {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text);
  line-height: 1.55;
}

.cs-insights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}

.cs-insight {
  background: var(--patch-lavender);
  border-radius: 4px;
  padding: 1.5rem;
}

.cs-insight-heading {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.cs-insight p {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.6;
}

.cs-nav-footer {
  border-top: 1px solid var(--rule);
  padding: 3rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cs-nav-link {
  display: flex; flex-direction: column; gap: 0.4rem; cursor: pointer; transition: color 0.2s;
}

.cs-nav-link:hover .cs-nav-project { color: var(--ember); }

.cs-nav-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
  opacity: 0.6;
}

.cs-nav-project {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  transition: color 0.2s;
}

.cs-nav-link--next { text-align: right; }

/* ====================================================================
   5. PALETTE / SWATCHES
   ==================================================================== */

.palette-section { margin: 2.5rem 0; }

.palette-group { margin-bottom: 2rem; }

.palette-group-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.75rem;
  display: block;
}

.palette-swatches { display: flex; flex-wrap: wrap; gap: 1rem; }

.swatch { display: flex; flex-direction: column; gap: 0.4rem; width: 80px; }

.swatch-color {
  width: 80px; height: 64px; border-radius: 6px; border: 1px solid rgba(0,0,0,0.08); box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.swatch-name {
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem; font-weight: 500; color: var(--text); line-height: 1.3;
}

.swatch-hex {
  font-family: 'DM Mono', monospace; font-size: 0.62rem; color: var(--text-mid); letter-spacing: 0.04em;
}

.swatch--wide { width: 100px; }

.swatch--wide .swatch-color { width: 100px; }

.palette-breakout {
  padding: 0 2.5rem 3.5rem;
  max-width: 760px;
}

/* ====================================================================
   6. CAROUSEL
   ==================================================================== */

.cs-carousel {
  position: relative;
  margin: 2rem 0 0.75rem;
  /* Gutters so the arrows sit beside the image, not on top of it. */
  padding: 0 3.25rem;
}

.cs-carousel-viewport {
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid var(--rule-soft);
}

.cs-carousel-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: transform;
}

.cs-carousel-slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  background: var(--bg-surface);
}

.cs-carousel-media {
  width: 100%;
  aspect-ratio: 16/10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: rgba(92,74,66,0.55);
}

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

.cs-carousel-media--contain {
  padding: 1.75rem 2rem;
  box-sizing: border-box;
  background: #fff;
}

.cs-carousel-media--contain img { object-fit: contain; }

.cs-carousel--wide .cs-carousel-media {
  aspect-ratio: 1800 / 533;
  background: #fff;
}

.cs-carousel--wide .cs-carousel-media img { object-fit: contain; }

.cs-carousel-caption {
  font-family: 'DM Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--text-mid);
  opacity: 0.7;
  text-align: center;
  padding: 0.7rem 1rem 0.9rem;
}

.cs-carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--bg);
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, opacity 0.2s;
  z-index: 2;
}

.cs-carousel-btn:hover { background: var(--bg-surface); }

.cs-carousel-btn:disabled { opacity: 0.3; cursor: default; }

.cs-carousel-btn--prev { left: 0; }

.cs-carousel-btn--next { right: 0; }

.cs-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.cs-carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: var(--rule);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.cs-carousel-dot[aria-selected="true"] {
  background: var(--ember);
  transform: scale(1.25);
}

/* ====================================================================
   7. HOME — sections, work quilt, about, studio
   ==================================================================== */

/* Shared centered column for home page sections, so they sit on the
   same left/right edge as each other. Wider than --measure because
   these sections carry image grids rather than prose. */
#work,
#studio,
#about {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

#work { padding: 5rem 2.5rem; }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
}

.section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-mid);
}

.section-count {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-mid);
  opacity: 0.5;
}

.work-quilt {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

/* Cards are wrapped in .fade-up, so the wrapper is the grid item.
   It must pass the stretched height down to the card. */
.work-quilt > * {
  display: flex;
  flex-direction: column;
}

.work-quilt > * > .work-card {
  flex: 1;
}

.work-card {
  display: flex;
  flex-direction: column;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.25s ease;
  min-height: 280px;
}

/* Gated to pointer devices: on touch, a tap latches :hover and the
   card keeps its hover state long after you've scrolled past. */
@media (hover: hover) {
  .work-card.patch--lavender:hover, .work-card:hover { background: #D9CDE4; }
}

/* Inset preview thumbnail: the screen floats inside the patch colour
   with a margin, so the card reads as a framed screen. */
.work-card-media {
  margin: 1.4rem 1.4rem 0;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 2 / 1;
  background: var(--bg-surface);
  border: 1px solid var(--rule-soft);
}

.work-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* Subtle zoom on the image only — the frame stays put, no shadow.
   A long ease-out makes the movement read as a slow drift rather
   than a snap. */
@media (hover: hover) {
  .work-card:hover .work-card-media img {
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .work-card-media img { transition: none; }
  .work-card:hover .work-card-media img { transform: none; }
}

.work-card-body {
  padding: 2rem 2.2rem 2.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;   /* fill the stretched card so the CTA can sit at its base */
}

.work-card-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-top: 0.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.work-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

@media (hover: hover) {
  .work-card:hover .work-card-title { color: var(--ember); }
}

.work-card-desc {
  font-size: 0.87rem;
  color: var(--text-mid);
  line-height: 1.65;
}

.work-card-cta {
  margin-top: auto;   /* pin CTA to card bottom */
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 1rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ember);
  transition: gap 0.2s;
}

.work-card-cta::after { content: '→'; }

@media (hover: hover) {
  .work-card:hover .work-card-cta { gap: 0.7rem; }
}

.patch--lavender { background: var(--patch-lavender); }

.patch--blush { background: var(--patch-blush); }

.patch--sage { background: var(--patch-sage); }

.patch--ivory { background: var(--patch-ivory); }

.patch--plum { background: var(--patch-plum); }

#about { padding: 9rem 2.5rem 6rem; }

.about-inner {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 4.5rem;
  align-items: start;
}

.about-photo-wrap {
  position: relative;
  position: sticky;
  top: 6rem;
}

.about-photo-wrap img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 25%;
  display: block;
  border-radius: 6px;
}

.about-content .section-label {
  color: var(--text-mid);
  margin-bottom: 1.8rem;
  display: block;
}

.about-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  font-weight: 400;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 1.8rem;
}

.about-heading em { font-style: italic; }

.about-heading-accent {
  color: var(--ember);
  font-style: italic;
}

.about-body {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 1.1rem;
}

.about-quote {
  margin: 2.5rem 0;
  padding: 0.25rem 0 0.25rem 1.75rem;
  border-left: 3px solid var(--ember);
}

.about-quote p {
  font-size: 1.35rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--text);
  margin: 0 0 0.9rem 0;
}

.about-quote cite {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-style: normal;
  color: var(--ember);
}

.about-link-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  margin-top: 2.5rem;
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
  border-bottom: 1px solid rgba(168,62,24,0.35);
  padding-bottom: 0.25rem;
  transition: border-color 0.2s;
}

.about-link:hover { border-color: var(--ember); }

.about-cv-link::after { content: ' ↓'; }

.about-link--external::after { content: ' ↗'; }

#studio { padding: 5rem 2.5rem; }

/* Two-column: prose left, scattered photo cluster right. */
.studio-inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 4.5rem;
  align-items: start;
}

.studio-intro {
  font-size: 1rem;
  color: var(--text-mid);
  line-height: 1.85;
  margin-bottom: 1.1rem;
}

.studio-intro:last-of-type { margin-bottom: 0; }

/* Scattered cluster: 2-col grid where each tile is nudged off the
/* Cluster proportions follow a golden-ratio split (1.618 : 1) for the
   columns, with the lead image at a 3:4 portrait crop. Row heights are
   derived so the two squares stack to exactly the lead's height. */
.studio-grid {
  display: grid;
  grid-template-columns: 1.618fr 1fr;
  grid-template-rows: auto auto;
  gap: 1.25rem;
  align-items: start;
}

.studio-tile {
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(42,31,26,0.10);
}

.studio-tile img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }

/* Lead image: sculpture, tall 3:4 portrait, spans both rows.
   Width is driven by the column; height follows from the ratio, so it
   can never overflow into the neighbouring column. */
.studio-tile:nth-child(1) {
  grid-column: 1;
  grid-row: 1 / span 2;
  aspect-ratio: 3/4;
  width: 100%;
}

/* Supporting pair: cup then flat lay, both square — a deliberate
   ratio contrast against the 3:4 lead. */
.studio-tile:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
  aspect-ratio: 1/1;
}

.studio-tile:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
  aspect-ratio: 1/1;
}

/* Step the supporting column down so the cluster's top edge isn't
   flat. Applied to both tiles equally, so the gap between them stays
   identical to the column gap. */
.studio-tile:nth-child(2),
.studio-tile:nth-child(3) {
  transform: translateY(2.5rem);
}

/* ====================================================================
   8. FOOTER
   ==================================================================== */

footer {
  padding: 0.85rem 2.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-blue-dark);
  border-top: 1px solid var(--rule-blue);
}

.footer-copy {
  font-family: 'DM Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--text-on-blue);
  opacity: 0.55;
}

/* ====================================================================
   9. MOTION
   ==================================================================== */

@media (prefers-reduced-motion: no-preference) {
  .fade-up {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }
  .fade-up.visible { opacity: 1; transform: none; }
  .fade-up:nth-child(2) { transition-delay: 0.08s; }
  .fade-up:nth-child(3) { transition-delay: 0.16s; }
  .fade-up:nth-child(4) { transition-delay: 0.24s; }
}

/* ====================================================================
   10. RESPONSIVE
   ==================================================================== */

@media (max-width: 900px) {
  /* Nav */
  .nav-links { display: none; }
  .nav-menu-btn { display: flex; }

  /* Case study */
  .cs-body { padding: 3rem 1.5rem; }
  .cs-hero-img,
  .cs-hero-img + .cs-img-caption {
    width: min(calc(var(--measure) - 3rem), calc(100% - 3rem));
  }
  .cs-before-after { grid-template-columns: 1fr; }
  .cs-insights { grid-template-columns: 1fr; }
  .cs-meta { gap: 1.5rem; padding: 1.5rem; }
  .cs-header { padding: 2rem 1.5rem 3rem; }
  .cs-nav-footer { padding: 2.5rem 1.5rem; }

  /* Home */
  .work-quilt { grid-template-columns: 1fr; }

  /* Single column: at ~300px the frame is too narrow to absorb a 2:1
     crop — a wide screenshot loses both edges. Let the frame take the
     image's own ratio so the whole screen shows, uncropped and
     unletterboxed. The inset, border, and radius are unaffected. */
  .work-card-media {
    aspect-ratio: auto;
  }

  .work-card-media img {
    height: auto;
    object-fit: contain;
  }
  #about { padding: 7rem 1.5rem 4rem; }
  .about-inner { grid-template-columns: 1fr; gap: 2.5rem; }

  /* Single column: the photo sits above the text, so sticky would pin
     it while the copy scrolled underneath. Scroll the section as one. */
  .about-photo-wrap {
    position: static;
    top: auto;
    max-width: 300px;
  }

  /* A 3:4 portrait fills most of a phone screen — crop squarer, and
     shift the focal point down so the frame shows more face, less
     forehead and sky. */
  .about-photo-wrap img {
    aspect-ratio: 4 / 3;
    object-position: 50% 40%;
  }
  .studio-inner { grid-template-columns: 1fr; gap: 2.5rem; }
  .studio-intro:last-of-type { margin-bottom: 1.1rem; }
  /* Single column: lead image on top, the two squares side by side
     beneath it. Explicit rows are needed because the desktop rules
     assign tiles 2 and 3 to rows 1 and 2, which would otherwise push
     the lead image to the bottom. */
  .studio-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .studio-tile:nth-child(1) {
    grid-column: 1 / -1;
    grid-row: 1;
    aspect-ratio: 16/10;
    width: 100%;
    height: auto;
  }

  .studio-tile:nth-child(2) {
    grid-column: 1;
    grid-row: 2;
  }

  .studio-tile:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  /* Reset the desktop stagger — it offsets tiles into the lead image. */
  .studio-tile:nth-child(2),
  .studio-tile:nth-child(3) {
    transform: none;
  }
}

@media (max-width: 600px) {
  nav { padding: 1rem 1.5rem; }
  footer { padding: 0.75rem 1.5rem; }

  /* Case study */
  .cs-nav-footer { flex-direction: column; gap: 2rem; align-items: flex-start; }
  .cs-nav-link--next { text-align: left; }
  .cs-carousel-btn { width: 2rem; height: 2rem; font-size: 1.1rem; }

  /* Home */
  #work, #studio { padding: 4rem 1.5rem; }
}
