/* =============================================================
   NERVE — a Playground project, not a Featured Work case study.
   A 72-hour Product Design assignment for Fam, told through the
   portfolio's own editorial shell (variables.css, base.css,
   components.css, project-shell.css). This file adds only what
   is specific to Nerve:

     · the page accent (Nerve's own warm orange)
     · a small set of static, image-like editorial diagrams
       (the brief, the reframe, the research desk, the loop)
       — built in HTML/CSS so they read as native to the page,
       deliberately with NO hover or motion of their own
     · a screen gallery tuned for Nerve's dark app screens
       (the case studies frame light screens; these are dark,
       so they need their own lift off the porcelain)
     · dark "detail" stages, so the app's dark UI chips (the
       hold button, an option card, the tab bar) sit on an
       intentional dark surface instead of floating on linen —
       the same move More KLYMB makes for its onboarding set.

   Everything else — type, spacing, colour, the chapter rhythm —
   comes from the shared portfolio tokens, unchanged.
   ============================================================= */

.pg-project--nerve {
  /* Nerve's identity accent. The app renders its "Nerve." wordmark
     with this exact orange dot on every screen; using it here (the
     eyebrow, the section indices, the hero dot) ties the page to the
     work below it — the same pattern More KLYMB follows with KLYMB's
     crimson. Swap for var(--color-accent) to fall back to the
     portfolio's terracotta. */
  --nerve-accent:  #D4703A;
  --project-accent: var(--nerve-accent);

  /* Nerve's own dark palette, lifted from the app screens (see the
     colour specimen). Used ONLY inside the dark diagram/detail
     stages below, never on the page chrome, which stays porcelain. */
  --nerve-bg:      #17150F; /* app background — warm near-black */
  --nerve-surface: #211E17; /* app surface — cards */
  --nerve-raised:  #2C2820; /* raised surface — chips */
  --nerve-line:    #3A352C; /* hairline on dark */
  --nerve-ink:     #F2EFEA; /* primary text on dark */
  --nerve-dim:     #A39C90; /* secondary text on dark */
  --nerve-glow:    rgba(212, 112, 58, 0.16);
}

/* =============================================================
   HERO — same masthead as every project page; only the accent
   dot on "Nerve." is bespoke. Copy runs two sentences, a touch
   wider than the shell's default measure.
   ============================================================= */
.pg-project--nerve .proj-hero__masthead { max-width: 60ch; }
.pg-project--nerve .proj-hero__oneline  { max-width: 54ch; }

/* Only the full stop takes the accent, matching the app wordmark. */
.nerve-dot { color: var(--project-accent); }

/* A quiet caption reused across the page for any specimen — the
   uppercase label that always sits ABOVE a screen or diagram,
   never inside it. Mirrors More KLYMB's .mk-tag exactly. */
.nerve-cap {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

/* A short line that introduces a chapter's visual, sitting under
   the chapter head. Kept narrow — this page explains less. */
.nerve-note {
  max-width: 52ch;
  color: var(--color-text-secondary);
  font-size: var(--text-md);
}

/* Shared connector arrow for the static diagrams. An inline SVG
   with currentColor — dim by default so the nodes lead, the
   connectors follow. Purely decorative, never interactive. */
.flow-arrow {
  color: var(--color-text-secondary);
  opacity: 0.7;
}
.flow-arrow--down { width: 20px; height: 28px; }
.flow-arrow--right { width: 28px; height: 20px; }

/* =============================================================
   01 · THE ASSIGNMENT — the brief in one clean container, split
   into two plain parts: the challenge as given, then the goal I
   set for myself once I'd read it. Static, no interpretation of
   *why* yet — that argument starts in 02.
   ============================================================= */
.brief {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface-soft);
  padding: clamp(1.75rem, 4vw, 3rem);
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.brief__label {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.brief__label--accent { color: var(--project-accent); }

/* A short underline beneath each label, before its text — the
   "divider" the two blocks share. */
.brief__rule {
  display: block;
  height: 1px;
  width: 2.5rem;
  margin-top: var(--space-3);
  background: var(--color-border-strong);
}

.brief__challenge {
  margin-top: var(--space-4);
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  max-width: 44ch;
}

/* The goal sits below a hairline, echoing the old stat divider —
   the second half of the same container, not a new one. */
.brief__block--goal {
  padding-top: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--color-border);
}
.brief__goal {
  margin-top: var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-md);
  max-width: 52ch;
}

/* =============================================================
   02 · MY PERSPECTIVE — the reframe, drawn. Two columns side by
   side: what the brief asked for, then how I read it. Reads as
   one comparison without scrolling. The one accent node ("Build
   confidence") is the whole argument. Static.
   ============================================================= */
.reframe {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  max-width: 46rem;
  margin-inline: auto;
  text-align: center;
}

.reframe__col {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
}

/* Vertical divider between the two columns. */
.reframe__vsplit {
  width: 1px;
  align-self: stretch;
  background: var(--color-border);
}

@media (max-width: 640px) {
  .reframe { grid-template-columns: 1fr; }
  .reframe__vsplit { display: none; }
}

.reframe__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-secondary);
}
.reframe__label--accent { color: var(--project-accent); }

.reframe__node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85em 1.4em;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  font-family: var(--font-serif);
  font-weight: var(--weight-medium);
  font-size: var(--text-lg);
  line-height: 1.15;
  color: var(--color-text);
}

/* The single most-important node — the reframe itself. */
.reframe__node--accent {
  border-color: var(--project-accent);
  background: color-mix(in srgb, var(--project-accent) 10%, var(--color-bg));
  color: var(--color-text);
}

/* =============================================================
   03 · RESEARCH — lightweight by design. Two inputs side by
   side: what two friends said (verbatim), and what Gemini Deep
   Research was pointed at. No report, no charts — just the
   sources, laid out cleanly.
   ============================================================= */
.research {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.research__col-head {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}

.research__quotes {
  display: grid;
  gap: var(--space-4);
}
.research__quote {
  border-left: 2px solid var(--project-accent);
  padding-left: var(--space-4);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  color: var(--color-text);
}

.research__desk {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-soft);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}
.research__desk-note {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-4);
}
.research__topics {
  display: grid;
  gap: var(--space-2);
}
.research__topics li {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  padding-block: var(--space-1);
  border-bottom: 1px solid var(--color-border);
}
.research__topics li:last-child { border-bottom: 0; }
.research__topics li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--project-accent);
  flex: none;
  transform: translateY(-2px);
}
.research__stat {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}
.research__stat b {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xl);
  color: var(--project-accent);
}
.research__stat span {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

@media (max-width: 720px) {
  .research { grid-template-columns: 1fr; }
}

/* =============================================================
   04 · PRODUCT IDEA — the core loop, drawn as a connected
   vertical flow (matching how the loop is written: one step
   under the next). Left: the six steps. Right: a dark detail
   stage holding the two pieces of the decision UI — the option
   card and the press-and-hold button — where they earn their
   place next to the "no button, just hold" step.
   ============================================================= */
.loop {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.loop__flow {
  display: grid;
  gap: 0;
}

.loop__step {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-4);
  position: relative;
  padding-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
/* the connecting spine — a line dropping from each number to the
   next, drawn behind the numbers, stopping at the last step */
.loop__step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: calc(1.25rem - 0.5px);
  top: 2.5rem;
  bottom: 0;
  width: 1px;
  background: var(--color-border-strong);
}
.loop__step:last-child { padding-bottom: 0; }

.loop__num {
  position: relative;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: var(--color-bg);
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.loop__title {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.2;
  margin-top: 0.35rem;
}
.loop__cap {
  margin-top: var(--space-1);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  max-width: 34ch;
}

@media (max-width: 820px) {
  .loop { grid-template-columns: 1fr; }
}

/* =============================================================
   DARK DETAIL STAGE — shared by the loop aside and a couple of
   moments in Final Designs. Nerve's UI is dark; dropping a dark
   chip straight onto porcelain looks broken, so it gets a small,
   intentional dark panel to live in (warm near-black, a soft
   accent glow, hairline border) — the same idea as More KLYMB's
   onboarding set. Values are Nerve's own app tokens.
   ============================================================= */
.nerve-stage {
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 90% at 50% -10%, var(--nerve-glow), transparent 60%),
    var(--nerve-bg);
  border: 1px solid var(--nerve-line);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  overflow: hidden;
}
/* on the dark stage, the caption flips to the dark palette */
.nerve-stage .nerve-cap { color: var(--nerve-dim); }

.loop__aside {
  display: grid;
  gap: var(--space-5);
  align-content: start;
  justify-items: center;
  text-align: center;
}
.loop__hold {
  width: clamp(9rem, 20vw, 11rem);
  height: auto;
  border-radius: 50%;
}
.loop__option {
  width: 100%;
  max-width: 20rem;
  height: auto;
  border-radius: var(--radius-md);
}
.loop__aside-note {
  color: var(--nerve-dim);
  font-size: var(--text-sm);
  max-width: 30ch;
}
.loop__aside-note b { color: var(--nerve-ink); font-weight: var(--weight-semibold); }

/* =============================================================
   05 · IDEATION — the wireframe sheet, once. Sits in the shell's
   own presentation frame; the sheet is dark, so it reads as one
   object on the light wall.
   ============================================================= */
.wire {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--nerve-bg);
  border-color: var(--nerve-line);
}
.wire img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}

/* =============================================================
   06 · FINAL DESIGNS — the largest section, split into groups.
   Every screen gets ONE treatment (.nerve-screen): a dark app
   screen lifted off the porcelain with a hairline border, a
   soft shadow and clipped corners. A caption always sits above.
   Screens are shown large enough to actually read.
   ============================================================= */
.nerve-group { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.nerve-group:first-of-type { margin-top: clamp(1.5rem, 4vw, 3rem); }

.nerve-group__head {
  max-width: 50ch;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}
.nerve-group__eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--project-accent);
}
.nerve-group__title {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
  font-size: var(--text-xl);
  margin-top: var(--space-2);
}
.nerve-group__lead {
  margin-top: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--text-md);
}

/* The one screen treatment. */
.nerve-screen {
  display: block;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--color-border);
  background: var(--nerve-bg);
  box-shadow: var(--shadow-md);
}
.nerve-screen img {
  display: block;
  width: 100%;
  height: auto;
}
.nerve-figure { display: block; margin: 0; }

/* Masonry gallery — the same language More KLYMB uses: a CSS
   multi-column layout, so screens of different heights (the
   scrollable Home/Profile vs a single view) pack tightly instead
   of forcing a fixed row height. Three columns on desktop keeps
   each screen large enough to read. */
.nerve-gallery {
  columns: 3;
  column-gap: clamp(1.25rem, 3vw, 2rem);
}
.nerve-gallery .nerve-figure {
  break-inside: avoid;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

/* A plain two-up for groups of exactly two tall screens, where a
   three-column masonry would leave an empty column. */
.nerve-grid--two {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

/* Row-major variant — for a set of equal-aspect screens meant to
   be read left-to-right, row by row (the First-Time Experience
   walkthrough), a CSS-columns masonry fills top-to-bottom within
   a column first, which breaks that reading order. A straight
   grid keeps markup order = reading order. */
.nerve-gallery--grid {
  columns: unset;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: clamp(1.25rem, 3vw, 2rem);
}
.nerve-gallery--grid .nerve-figure {
  break-inside: auto;
  margin-bottom: 0;
}

@media (max-width: 900px) {
  .nerve-gallery { columns: 2; }
  .nerve-gallery--grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .nerve-gallery { columns: 1; }
  .nerve-gallery--grid { grid-template-columns: 1fr; }
  .nerve-grid--two { grid-template-columns: 1fr; }
}

/* A dark detail stage carrying UI chips inside a group (the tab
   bar for Daily, the decision pieces for First-Time). */
.nerve-chips {
  margin-top: clamp(1.25rem, 3vw, 2rem);
  display: grid;
  gap: var(--space-4);
  justify-items: center;
  text-align: center;
}
.nerve-chips img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.nerve-chips__note {
  color: var(--nerve-dim);
  font-size: var(--text-sm);
  max-width: 40ch;
}
.nerve-chips__note b { color: var(--nerve-ink); font-weight: var(--weight-semibold); }
/* the tab bar is wide and short — cap it so it doesn't stretch */
.nerve-chips--tabbar img { max-width: 26rem; }

/* PLAYGROUND — the interactive card in four states, shown as a
   strip beside a note. These assets already carry their own dark
   card + orange border, so they need no frame; they line up as a
   progression from cheap money to expensive money. */
.nerve-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(1rem, 2.5vw, 1.75rem);
  align-items: start;
  margin-top: clamp(1.25rem, 3vw, 2rem);
}
.nerve-cards img { width: 100%; height: auto; display: block; }
.nerve-card { display: grid; gap: var(--space-2); }

@media (max-width: 820px) {
  .nerve-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .nerve-cards { grid-template-columns: 1fr; }
}

/* The Playground home screen is very tall; pair it with the note
   in a two-column row so the section doesn't run on forever. */
.nerve-split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.nerve-split__aside { align-self: center; }
.nerve-split__aside p {
  color: var(--color-text-secondary);
  font-size: var(--text-md);
  max-width: 34ch;
}
.nerve-split .nerve-screen { max-width: 22rem; }

@media (max-width: 720px) {
  .nerve-split { grid-template-columns: 1fr; }
  .nerve-split .nerve-screen { max-width: 20rem; }
}

/* Share card — a single portrait concept, shown at a comfortable
   poster size, centred, with room around it. */
.nerve-share {
  margin-top: clamp(1.5rem, 4vw, 2.5rem);
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.nerve-share img {
  width: 100%;
  height: auto;
  max-width: 20rem;
  border-radius: var(--radius-lg);
  display: block;
}
.nerve-share__note p {
  color: var(--color-text-secondary);
  font-size: var(--text-md);
  max-width: 40ch;
}
@media (max-width: 720px) {
  .nerve-share { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .nerve-share__note p { max-width: none; }
}

/* =============================================================
   07 · REFLECTION — two short honest beats, then the name. No
   new claims; straight from the document.
   ============================================================= */
.reflect {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(1.5rem, 4vw, 2.5rem);
}
.reflect__col-head {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--project-accent);
  margin-bottom: var(--space-3);
}
.reflect__col p {
  color: var(--color-text-secondary);
  font-size: var(--text-md);
}

@media (max-width: 720px) {
  .reflect { grid-template-columns: 1fr; gap: var(--space-6); }
}

/* The name, as the closing beat — a wide editorial line. */
.nerve-name {
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-top: clamp(2rem, 4vw, 3rem);
  border-top: 1px solid var(--color-border);
  max-width: 56ch;
}
.nerve-name__title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
}
.nerve-name__title .nerve-dot { color: var(--project-accent); }
.nerve-name__text {
  margin-top: var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-md);
}
