/* Case studies: the narrative (Lucy, 2026-11-26). The layout is copied from aaronjames.design's case studies, as
   measured there at 1440 x 900 and 390 x 844; the colours, fonts, header and footer are the site's own.

     full-screen hero: the project's cover behind the title, one pill button
     → Overview (label | paragraph over two columns, then My role / Tools / Year)
     → Problems (lead line, optional picture, three numbered columns)
     → Opportunity: one huge "How might …?" line, its key words lit
     → Goals (lead line, three columns: old word greyed → new word)
     → process sections: heading, a lead line across the column, then its pictures, full width and stacked;
       phone screens and thumbnails three across
     → Results (a statement per row, a big number on the right only for a real outcome)
     → What I learned (three columns) → Credits (label | text) → Next project

   Reference measures at 1440: column 1156 px in a three-column grid (347 px columns, 56 px gaps); title and question
   82 px / 1.3; section headings 33 px / 1.8; lead lines 25 px / 2.2; column text 21 px / 2.2; 144 px between sections;
   58 px between words and pictures. Phone type is kept at 16 px or more for reading. Prefix nr-. */

.nr {
  --nr-text: #ced6fc;          /* the case-study reading colour (case-spreads.css --cx-text) */
  --nr-dim: #8b95d6;
  --nr-quiet: rgba(246, 250, 255, .3);   /* the old goal word, as greyed in the reference */
  --nr-rule: rgba(160, 200, 255, .10);
  --nr-gap: clamp(72px, 10vw, 144px);    /* between sections */
  --nr-near: clamp(24px, 4vw, 58px);     /* between words and their pictures, and between pictures */
  --nr-g: clamp(16px, 3.9vw, 56px);      /* grid gutter */
  --nr-col: min(1156px, calc(100% - 2 * clamp(24px, 8vw, 142px)));
  display: block; position: relative; z-index: 2;
  color: var(--nr-text); font: 400 clamp(16px, 1.43vw, 20.6px)/2.2 var(--font-body);
}
.nr *, .nr *::before, .nr *::after { box-sizing: border-box; }
.nr h1, .nr h2, .nr h3, .nr p, .nr figure, .nr dl, .nr dd, .nr ol, .nr ul { margin: 0; }
.nr ol, .nr ul { padding: 0; list-style: none; }
.nr img, .nr video { display: block; width: 100%; height: auto; }
.nr :focus-visible { outline: 2px solid var(--fg-accent); outline-offset: 3px; }
.nr a { color: var(--fg-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.nr-col { width: var(--nr-col); margin-inline: auto; }
.nr-sec { margin-top: var(--nr-gap); }
.nr [id] { scroll-margin-top: 96px; }   /* in-page links land below the fixed site header */

/* ── hero: the cover fills the first screen behind the title (the site header floats over it) ── */
.nr-hero { position: relative; display: grid; align-content: center; min-height: 100vh; min-height: 100svh; padding-block: 96px 64px; overflow: hidden; }
.nr-hero-bg { position: absolute; inset: 0; z-index: 0; }
.nr .nr-hero-bg img, .nr .nr-hero-bg video { width: 100%; height: 100%; object-fit: cover; }
.nr-hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5, 7, 16, .74) 0%, rgba(5, 7, 16, .78) 72%, var(--void) 100%); }
.nr-hero .nr-col { position: relative; z-index: 1; }
.nr-title { max-width: 1100px; font: 600 clamp(39px, 5.71vw, 82px)/1.3 var(--font-display); letter-spacing: -.01em; color: var(--fg1); text-wrap: balance; }
.nr .nr-go { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: clamp(20px, 2.5vw, 36px); padding: 12px 36px 10px 33px; border-radius: 60px; background: var(--void); color: var(--fg1); font: 500 clamp(16px, 1.71vw, 24.7px)/1.4 var(--font-body); text-decoration: none; }
.nr .nr-go:hover, .nr .nr-go:focus-visible { color: var(--fg-accent); }
.nr .nr-proof { max-width: 640px; margin-top: clamp(14px, 1.6vw, 22px); font: 400 clamp(15px, 1.3vw, 19px)/1.6 var(--font-body); color: var(--fg1); text-shadow: 0 1px 12px rgba(5, 7, 16, .9); }   /* one real result in the first screen (Lucy, 2026-11-28) */
.nr .nr-proof strong { font-weight: 700; }
.nr-media.nr-2.nr-phones { max-width: 480px; margin-inline: auto; }   /* a before/after pair of phone screens stays together */
.nr .nr-go-2 { margin-left: 12px; background: transparent; box-shadow: inset 0 0 0 1px rgba(246, 250, 255, .4); }   /* a second, quieter pill beside the main one */

/* ── section heading, and the lead line under it ── */
.nr-h { font: 600 clamp(23px, 2.29vw, 33px)/1.8 var(--font-display); letter-spacing: -.005em; color: var(--fg1); text-wrap: balance; }
.nr .nr-lead { font: 500 clamp(17px, 1.71vw, 24.7px)/2.2 var(--font-body); color: var(--fg1); }

/* ── overview: the label in the first column, the paragraph over the other two, the facts under it ── */
.nr-over { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--nr-g); }
.nr-over > .nr-h { grid-column: 1; }
.nr-over > .nr-lead, .nr-over > .nr-facts { grid-column: 2 / span 2; }
.nr .nr-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: var(--nr-near); }
.nr-facts dt { font: 700 clamp(15px, 1.14vw, 16.5px)/1.8 var(--font-body); color: var(--fg1); }
.nr-facts dd { font: 400 clamp(14px, 1vw, 14.4px)/2.2 var(--font-body); color: var(--fg1); }

/* ── three across: problems, goals, lessons ── */
.nr .nr-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--nr-g); margin-top: var(--nr-near); }
.nr-three h3 { font: 500 clamp(17px, 1.71vw, 24.7px)/1.8 var(--font-body); color: var(--fg1); }
.nr-three p { color: var(--fg1); }
.nr-was { color: var(--nr-quiet); }
.nr-to { color: var(--fg1); margin-inline: .3em; }

/* ── opportunity: the label, then one huge question, its key words lit ── */
.nr-hmw { margin-top: var(--nr-near); font: 600 clamp(39px, 5.71vw, 82px)/1.3 var(--font-display); letter-spacing: -.01em; color: var(--fg1); text-wrap: balance; }
.nr-hmw mark { background: var(--accent); color: var(--accent-on); padding: 0 .04em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ── pictures, always after the words: full width and stacked; small screens three across ── */
.nr-media { margin-top: var(--nr-near); display: grid; gap: var(--nr-near); }
.nr-media figure { min-width: 0; }
.nr-media img, .nr-media video { background: var(--navy); }
.nr-media figcaption { margin-top: 10px; font: 400 14px/1.6 var(--font-body); color: var(--nr-dim); }
.nr-media.nr-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--nr-near) var(--nr-g); align-items: start; }
.nr-media.nr-grid3.nr-grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }   /* four phone screens in one row */
.nr-pixel { image-rendering: pixelated; }
/* Portfolio Pet: two pictures side by side (a wide one beside a tall one, same height), and a five-frame storyboard */
.nr-media.nr-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--nr-g); align-items: start; }
.nr-media.nr-2.nr-wt { grid-template-columns: minmax(0, 2.17fr) minmax(0, 1fr); }
.nr .nr-board { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--nr-g); margin-top: var(--nr-near); }
.nr-board img { aspect-ratio: 3 / 2; object-fit: cover; }
/* two pictures of different shapes at one height, uncropped: each grows by its own width / height (--r) */
.nr-media.nr-match { display: flex; gap: var(--nr-g); align-items: flex-start; }
.nr-match > figure { flex: var(--r, 1) 1 0; }

/* ── results: a statement per row; a big number on the right only beside a real outcome ── */
.nr-results { margin-top: var(--nr-near); display: grid; gap: clamp(40px, 6vw, 88px); }
.nr-result { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--nr-g); }
.nr-result h3 { font: 600 clamp(23px, 2.29vw, 33px)/1.8 var(--font-display); color: var(--fg1); }
.nr .nr-result p { font: 500 clamp(17px, 1.71vw, 24.7px)/2.2 var(--font-body); color: var(--fg1); }
.nr .nr-result .nr-num { min-width: 220px; text-align: center; font: 600 clamp(48px, 5.71vw, 82px)/1.3 var(--font-display); color: var(--fg1); }
.nr .nr-num small { display: block; font: 400 clamp(13px, 1vw, 14.4px)/2.2 var(--font-body); color: var(--fg1); }

/* ── credits: the label in the first column, the text over the other two ── */
.nr-credit { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--nr-g); margin-top: var(--nr-gap); }
.nr-credit > .nr-h { grid-column: 1; }
.nr-credit > p { grid-column: 2 / span 2; color: var(--fg1); }

/* ── the end: the next project ── */
.nr-next { margin-top: var(--nr-gap); padding-bottom: var(--nr-gap); }
.nr-next-k { font: 500 clamp(14px, 1vw, 16px)/1.8 var(--font-body); color: var(--fg3); }
.nr-next-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font: 600 clamp(28px, 3.4vw, 49px)/1.3 var(--font-display); color: var(--fg1) !important; text-decoration: none !important; }
.nr-next-link:hover, .nr-next-link:focus-visible { color: var(--fg-accent) !important; }
.nr .nr-next p { color: var(--fg1); }

@media (max-width: 760px) {
  .nr-hero { padding-block: 88px 48px; }
  .nr-over, .nr-credit { grid-template-columns: 1fr; }
  .nr-over > .nr-lead, .nr-over > .nr-facts, .nr-credit > p { grid-column: 1; }
  .nr-over > .nr-lead, .nr-credit > p { margin-top: 8px; }
  .nr .nr-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr .nr-three { grid-template-columns: 1fr; gap: 28px; }
  .nr-media.nr-grid3 { grid-template-columns: 1fr; }
  .nr-media.nr-grid3.nr-phones, .nr-media.nr-grid3.nr-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr-media.nr-2, .nr-media.nr-2.nr-wt { grid-template-columns: 1fr; }
  .nr-media.nr-2.nr-phones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr .nr-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nr-result { grid-template-columns: 1fr; }
  .nr .nr-result .nr-num { min-width: 0; text-align: left; }
  /* a wide picture beside a phone screen: stacked, the screen at half width, so it stays readable */
  .nr-media.nr-match.nr-stack { flex-wrap: wrap; }
  .nr-match.nr-stack > figure { flex: 1 1 100%; }
  .nr-match.nr-stack > figure.nr-tall { flex: 0 1 50%; }
}

/* Compact (Lucy, 2026-11-28: "i love b design, but its a lot of scrolling"). Same look, about a third less scroll:
   a shorter hero, tighter type and gaps, and a section's pictures side by side instead of stacked. */
.nr { --nr-gap: clamp(56px, 6.5vw, 96px); --nr-near: clamp(20px, 2.6vw, 36px); line-height: 1.75; }
.nr-hero { min-height: 72vh; min-height: 72svh; }
.nr-h { line-height: 1.4; }
.nr .nr-lead, .nr .nr-result p { line-height: 1.6; }
.nr-facts dt, .nr-facts dd { line-height: 1.6; }
.nr-three h3 { line-height: 1.5; }
.nr-results { gap: clamp(28px, 3.5vw, 48px); }
@media (min-width: 761px) {
  .nr-media:not(.nr-grid3):not(.nr-2):not(.nr-match):has(> figure + figure) { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .nr-media:not(.nr-grid3):not(.nr-2):not(.nr-match):has(> figure:nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nr-media:not(.nr-grid3):not(.nr-2):not(.nr-match):has(> figure:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 761px) {
  /* tall phone screens and single big pictures are held to the screen's height, at their own shape, centred */
  .nr-media.nr-phones img { width: auto; max-width: 100%; max-height: 58vh; margin-inline: auto; }
  .nr-media:not(.nr-grid3):not(.nr-2):not(.nr-match) > figure:only-child > img,
  .nr-media > figure > video { width: auto; max-width: 100%; max-height: 66vh; margin-inline: auto; }
  .nr-media.nr-phones figcaption, .nr-media > figure:only-child figcaption { text-align: center; }
}

/* The hero is the whole first screen again, and its words come in after the page opens (Lucy, 2026-11-28: "make the
   hero ... take up most of screen and text gets animated in first, i dont like how u can read overview when u js load
   on"). The cover settles from a slight zoom; the title rises out of a mask, then the button. CSS only, once. */
.nr-hero { min-height: 100vh; min-height: 100svh; }
@keyframes nr-hero-bg { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes nr-hero-in { from { opacity: 0; transform: translateY(28px); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0 0 -20% 0); } }
@keyframes nr-hero-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .nr-hero-bg { animation: nr-hero-bg 1.6s cubic-bezier(.2, .7, .2, 1) both; }
  .nr-hero .nr-title { animation: nr-hero-in 1s cubic-bezier(.2, .7, .2, 1) .25s both; }
  .nr-hero .nr-go { animation: nr-hero-fade .7s cubic-bezier(.2, .7, .2, 1) .8s both; }
  .nr-hero .nr-go-2 { animation-delay: .9s; }
  .nr-hero .nr-col > :not(.nr-title):not(.nr-go) { animation: nr-hero-fade .7s cubic-bezier(.2, .7, .2, 1) .6s both; }
}

/* Four problems and goals: two by two (rep.tools). */
.nr .nr-three.nr-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .nr .nr-three.nr-four { grid-template-columns: 1fr; } }

/* a paragraph beside its marked-up picture, so a narrow picture fills the column */
.nr .nr-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--nr-g); align-items: center; }
.nr .nr-side > .nr-media { margin-top: 0; }
@media (max-width: 760px) { .nr .nr-side { grid-template-columns: 1fr; } }

/* A light, busy cover (Chance AI: three bright phones and the cover's own printed title under the nav) left the white
   title hard to read (audit, 2026-12-03). Crop the printed title off the top and darken the side the words sit on. */
.nr-hero-busy .nr-hero-bg img { transform: scale(1.24); transform-origin: 50% 100%; }
.nr-hero-busy .nr-hero-bg::after { background: linear-gradient(90deg, rgba(5, 7, 16, .95) 0%, rgba(5, 7, 16, .88) 48%, rgba(5, 7, 16, .66) 100%), linear-gradient(180deg, transparent 72%, var(--void) 100%); }
