/* ==========================================================================
   Andrea Salad — portfolio
   Design tokens mirror the v3 design system (see README).
   ========================================================================== */

:root {
  /* Colour */
  --ground:        #f7e8e7;
  --card:          #fffbfb;
  --ink:           #1a1416;
  --body:          #5d4f52;
  --meta:          #6b5c5f;
  --accent:        #7d1f35;
  --accent-tint:   rgba(125, 31, 53, .06);
  --accent-border: rgba(125, 31, 53, .4);
  --rule:          rgba(26, 20, 22, .14);
  --rule-nav:      rgba(26, 20, 22, .12);

  /* Type */
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Fluid type scale */
  --size-h1:         clamp(32px, 5.2vw, 48px);
  --size-h2:         clamp(27px, 3.6vw, 34px);
  --size-work-title: clamp(28px, 4vw,   38px);
  --size-press-title:clamp(25px, 3.2vw, 30px);
  --size-quote:      clamp(21px, 2.4vw, 24px);
  --size-standfirst: clamp(19px, 2vw,   21px);
  --size-body:       19px;

  /* Space */
  --gutter: 56px;
  /* A fixed width, deliberately NOT in ch. `ch` resolves against each element's
     own font-size, so a 66ch measure gave body copy 627px, captions 462px and
     h2s 888px — five different column edges on one page. One pixel value keeps
     every block on the same left and right edge. */
  --measure: 720px;

  /* Radius */
  --r-figure: 4px;
  --r-card:   6px;
  --r-thumb:  10px;
  --r-pill:   999px;

  /* Motion */
  --ease: cubic-bezier(.2, .6, .3, 1);
}

/* --------------------------------------------------------------- reset -- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { color: var(--accent); }
a:hover { color: var(--ink); }

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: pretty;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 12px 18px;
  border: 1px solid var(--accent);
  border-radius: var(--r-pill);
  text-decoration: none;
}
.skip:focus { left: var(--gutter); top: 12px; }

/* ----------------------------------------------------------------- nav -- */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 26px var(--gutter);
  border-bottom: 1px solid var(--rule-nav);
}

.nav__mark {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.nav__links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-family: var(--font-mono);
  font-size: 14px;
}

.nav__links a {
  text-decoration: none;
  color: var(--meta);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav__links a:hover { color: var(--ink); }
/* `aria-current` marks the actual page; `.is-section` only marks the section a
   case study belongs to, so the underline shows without the semantic lie. */
.nav__links a[aria-current="page"],
.nav__links a.is-section {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* -------------------------------------------------------------- shared -- */

.kicker {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 26px;
}
.kicker--sm  { font-size: 13px; letter-spacing: .14em; margin: 0 0 12px; }
.kicker--xs  { font-size: 12px; letter-spacing: .14em; margin: 0 0 12px; display: block; }
.kicker--xxs { font-size: 11px; letter-spacing: .14em; margin: 0 0 5px;  display: block; }

.page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 96px var(--gutter);
}
.page--narrow { max-width: 900px; }

.page-title {
  font-size: var(--size-h1);
  line-height: 1.1;
  letter-spacing: -.015em;
  margin: 0;
  max-width: var(--measure);
}

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

.hero {
  display: grid;
  /* Fluid portrait column: 380px on wide screens, easing down so the headline
     never gets squeezed at tablet widths before the layout stacks at 900px. */
  grid-template-columns: minmax(0, 1fr) clamp(280px, 27vw, 380px);
  gap: 64px;
  align-items: center;
  max-width: 1280px;
  padding: 96px var(--gutter) 72px;
}

.hero h1 {
  font-size: var(--size-h1);
  line-height: 1.1;
  letter-spacing: -.015em;
  margin: 0;
  /* 18ch capped the headline at 432px inside a ~724px column, so longer copy
     ran twelve narrow lines past the bottom of the portrait. 24ch balances
     against it while keeping a display measure. */
  max-width: 24ch;
}
.hero h1 i { font-style: italic; }

.hero__portrait {
  margin: 0;
  width: 100%;
}
.hero__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r-thumb);
}

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

.work {
  max-width: 1280px;
  padding: 0 var(--gutter) 112px;
}

.work__label {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--rule);
}

/* Three across, then two, then one. */
.cards {
  display: grid;
  /* Two up while there are four case studies — a 3-col grid strands the last
     card on its own row. Change back to repeat(3, …) when a fifth returns. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--r-thumb);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition:
    transform .3s var(--ease),
    border-color .3s ease,
    box-shadow .3s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent-border);
  box-shadow: 0 12px 28px rgba(26, 20, 22, .09);
}

.card__media {
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.card__thumb {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  transition: transform .45s var(--ease);
}
.card:hover .card__thumb { transform: scale(1.04); }

.card__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 24px;
  flex: 1;
}

.card__title {
  font-size: clamp(22px, 2vw, 26px);
  line-height: 1.2;
  margin: 0;
  transition: color .25s ease;
}
.card:hover .card__title { color: var(--accent); }

.card__desc {
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--body);
  margin: 0;
}

/* Stand-in tile for a card whose image hasn't been supplied yet. Drop the
   modifier (and this rule) once every card has a real thumbnail. */
.card__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  background:
    linear-gradient(var(--accent-tint) 1px, transparent 1px) 0 0 / 100% 20px,
    linear-gradient(90deg, var(--accent-tint) 1px, transparent 1px) 0 0 / 20px 100%,
    var(--ground);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* An empty slot waiting on a project. Duplicate for more. */
.card--placeholder {
  border-style: dashed;
  background: transparent;
}
.card--placeholder:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--accent-border);
}
.card--placeholder .card__title,
.card--placeholder .card__desc { color: var(--meta); }

/* Entrance: a short stagger, only for viewers who haven't asked for less
   motion (so nobody can get stranded at opacity 0). */
@media (prefers-reduced-motion: no-preference) {
  .card {
    animation: card-in .55s var(--ease) both;
  }
  .card:nth-child(2) { animation-delay: .07s; }
  .card:nth-child(3) { animation-delay: .14s; }
  .card:nth-child(4) { animation-delay: .21s; }
  .card:nth-child(5) { animation-delay: .28s; }
  .card:nth-child(6) { animation-delay: .35s; }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* -------------------------------------------------- case study header -- */

/* The header shares the article's column so the page has a single left and
   right edge from the kicker all the way down to the pagination. */
.study-head {
  padding: 36px 0 22px;
  max-width: var(--measure);
}

.study-head h1 {
  font-size: var(--size-h1);
  line-height: 1.08;
  letter-spacing: -.015em;
  margin: 0;
}

.standfirst {
  font-size: var(--size-body);
  line-height: 1.6;
  color: var(--body);
  margin: 16px 0 0;
}

/* A toolbox line — set in mono, like the site's other meta/tag rows, so it
   reads as a quick-scan list rather than another paragraph of prose. */
.tools-line {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--meta);
  max-width: var(--measure);
  margin: 22px 0 0;
}

/* Auto-fit so a 3-item row (Role / Team / Outcome) and a 4-item row
   (+ Duration / Status) both sit on one line and wrap internally. */
.meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 28px 32px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 17px;
  line-height: 1.5;
}

/* --------------------------------------------------------------- prose -- */

/* The article fills the page column; the reading measure is applied to the
   content itself rather than the container. That keeps body copy exactly where
   it was while letting `--full` figures span the whole column — including the
   ones nested inside a <section>. */
.prose { max-width: var(--measure); padding-top: 22px; }
.prose > *,
.prose > section > * { max-width: var(--measure); }
.prose > section { max-width: var(--measure); }
.prose .figure--full { max-width: var(--measure); }

/* Opening statement, set a step up from body copy. */
.lede {
  max-width: var(--measure);
  padding-bottom: 30px;
  border-bottom: 1px solid var(--rule);
}
.lede p {
  font-size: clamp(19px, 2vw, 22px);
  line-height: 1.6;
  margin: 0 0 18px;
}
.lede p:last-child { margin-bottom: 0; }

.prose section { padding: 36px 0; }

.prose h2 {
  font-size: var(--size-h2);
  line-height: 1.2;
  margin: 0 0 18px;
}

.prose ul {
  margin: 0 0 22px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ------------------------------------------------------------- figures -- */

.figure { margin: 36px 0; }

.figure img,
.figure video {
  width: 100%;
  /* Images get height:auto from the base img rule; <video> does not, so without
     this it keeps the pixel height off its HTML attribute and letterboxes the
     poster inside a box hundreds of pixels too tall. */
  height: auto;
  display: block;
  border: 1px solid var(--rule);
  border-radius: var(--r-figure);
}
.figure--plain img { border: 0; }

/* Both clips are pre-composited onto a 4:3 white stage, so they need no
   special sizing — they share the column with every other figure. */
.figure--phone video {
  background: #fff;
}

/* Windowed viewport for artwork far wider than the column. Focusable so it can
   be scrolled from the keyboard, not just by dragging. */
.scroller {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r-figure);
  background: #fff;
  overscroll-behavior-x: contain;
}
.figure .scroller img {
  height: 520px;
  width: auto;
  max-width: none;
  border: 0;
  border-radius: 0;
}
/* A row of principle tiles that scrolls rather than shrinking to illegibility. */
.tile-row {
  display: flex;
  gap: 12px;
  padding: 12px;
}
.figure .tile-row img {
  flex: none;
  height: 320px;
  width: auto;
  max-width: none;
  border: 0;
  border-radius: 8px;
}

.scroller__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--meta);
  margin: 0 0 8px;
}

.figure figcaption {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--body);
  max-width: var(--measure);
}
.figure figcaption b { color: var(--ink); }

/* Formerly broke out past the text column; now shares it, so media and copy
   sit on the same edges. Keeps its own margin rhythm. */
.figure--full {
  margin: 0 0 36px;
  max-width: var(--measure);
}

.pullquote {
  font-family: var(--font-display);
  font-size: var(--size-quote);
  line-height: 1.4;
  color: var(--accent);
  max-width: var(--measure);
  margin: 36px 0;
}

.callout {
  margin: 40px 0;
  background: var(--accent-tint);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 28px 30px;
}
.callout p {
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 1.65;
  color: var(--body);
}

/* ------------------------------------------- case-study structure blocks -- */

/* Phase strip — hairline grid of numbered stages. The 1px gap over a rule-
   coloured background is what draws the dividers. */
.phases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  overflow: hidden;
  margin: 30px 0 6px;
}
.phases > div { background: var(--ground); padding: 16px 18px; }
.phases .phase__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.phases .phase__body { font-size: 15px; line-height: 1.5; color: var(--body); }

/* Method cards — what we did / what it found. */
.methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 26px 0;
}
.method {
  background: var(--accent-tint);
  border: 1px solid var(--rule);
  border-radius: var(--r-card);
  padding: 20px 22px 22px;
}
.method h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.method p { font-size: 15.5px; line-height: 1.55; color: var(--body); margin: 0 0 12px; }
.method .method__found { color: var(--ink); margin-bottom: 0; }
.method .method__found b {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--meta);
  margin-bottom: 4px;
}

/* Rule rows — a labelled term and its definition. */
.rules { margin: 26px 0 6px; border-top: 1px solid var(--rule); }
.rules__row {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 26px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.rules__key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--meta);
  padding-top: 5px;
}
.rules__val { font-size: 17px; line-height: 1.6; }

/* ------------------------------------------------------------- pagenav -- */

.pagenav {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--rule);
  padding-top: 22px;
}

.pagenav--spaced { margin-top: 48px; }

.pill {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-pill);
  padding: 11px 20px;
  display: inline-block;
  transition: background-color .2s ease, color .2s ease;
}
.pill:hover {
  background: var(--accent);
  color: var(--ground);
}

/* ------------------------------------------------- process cards (swiper) */

/* Reuses the .card component from the homepage's Selected Work grid, laid
   out as a horizontally scrolling, snap-to swiper instead of a grid, and
   sized up since there are only four and each carries more copy. */
.process-cards {
  display: flex;
  gap: 24px;
  margin: 20px 0 12px;
  padding-bottom: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

.process-cards .card {
  flex: 0 0 auto;
  width: min(600px, 84vw);
  scroll-snap-align: start;
}

.process-cards .card__thumb--placeholder { aspect-ratio: 3 / 2; font-size: 13px; }

.process-cards .card__body { padding: 30px 32px 34px; gap: 16px; }

.process-cards .card__title { font-size: clamp(24px, 2.4vw, 30px); }

.process-cards .card__desc { font-size: 17px; line-height: 1.6; }

/* --------------------------------------------------------------- intro -- */

.intro {
  max-width: var(--measure);
  margin-top: 22px;
}
.intro p { font-size: 18px; line-height: 1.6; }

/* Section headings that sit directly in the page column, e.g. "My leadership
   style" below the process cards. Same scale as other on-page h2s. */
.section-title {
  font-size: var(--size-h2);
  line-height: 1.2;
  margin: 0 0 18px;
}

.leadership-list {
  margin: 0 0 22px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.leadership-list li {
  font-size: 18px;
  line-height: 1.6;
}

/* --------------------------------------------------------------- press -- */

.press-intro {
  font-size: var(--size-standfirst);
  line-height: 1.62;
  max-width: var(--measure);
  color: var(--body);
  margin: 28px 0 0;
}

.press-list {
  display: grid;
  margin-top: 56px;
  max-width: var(--measure);
  border-top: 1px solid var(--rule);
}

/* Thumbnails are not yet sourced; rows run full width until they are.
   Restore with: grid-template-columns: 120px 1fr; gap: 36px; */
.press-row {
  display: grid;
  align-items: start;
  padding: 36px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: inherit;
}

.press-row h2 {
  font-size: var(--size-press-title);
  line-height: 1.2;
  margin: 0 0 12px;
  transition: color .2s ease;
}
.press-row:hover h2 { color: var(--accent); }

.press-row p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--body);
  margin: 0;
}

.press-row__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--meta);
  margin-top: 14px;
}

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

.site-footer {
  padding: 36px var(--gutter) 56px;
  border-top: 1px solid var(--rule-nav);
  display: flex;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--meta);
}
.site-footer a {
  color: var(--meta);
  text-decoration: none;
}
.site-footer a:hover { color: var(--ink); }
.site-footer__links { display: flex; gap: 24px; flex-wrap: wrap; }

/* ---------------------------------------------------------- responsive -- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding-top: 64px;
  }
  .hero h1 { max-width: 24ch; }
  .hero__portrait { max-width: 380px; }
  .page { padding-top: 64px; padding-bottom: 72px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Two clean columns rather than an auto-fit row that strands the last item. */
  .meta-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  :root {
    --gutter: 24px;
    --size-body: 18px;
  }

  .nav { padding: 20px var(--gutter); gap: 14px; }
  .nav__links { font-size: 13px; gap: 10px 20px; }

  .cards { grid-template-columns: 1fr; gap: 20px; }
  .work { padding-bottom: 72px; }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .process-cards .card { width: 88vw; }
  .process-cards .card__body { padding: 24px 24px 28px; }

  .phases,
  .methods { grid-template-columns: 1fr; }
  .rules__row { grid-template-columns: 1fr; gap: 6px; }
  .rules__key { padding-top: 0; }

  .figure .scroller img { height: 380px; }
  .figure .tile-row img { height: 260px; }

  .prose section { padding: 28px 0; }
  .figure { margin: 28px 0; }
  .callout { padding: 22px 20px; }
  .pagenav { gap: 12px; }
  .pill { padding: 10px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
