/* casestudy.css — Project page template (option 6b).
   Restyles the existing cs-* markup used by all six case-study pages.
   Most of the layout comes from CSS alone: display:contents on .cs-text lets the
   eyebrow / h2 / body join the .cs-section grid. Only the hero, the meta row
   and the next-project block need markup changes (see README). */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;600;800&display=swap');

:root {
  --cs-bg: #f3f2f2;
  --cs-ink: #201e1d;
  --cs-rule: color-mix(in srgb, #201e1d 40%, transparent);
  --cs-muted: #605d5d;
  --cs-body2: #444141;
  --cs-accent: #e0198a;
  --cs-accent-100: #fff0f6;
  --cs-accent-600: #d4157e;
  --cs-accent-700: #a8005f;
  --cs-pad: 40px;
  --cs-max: 1280px;
  --cs-nav-h: 66px;
  --cs-gray: grayscale(1) contrast(1.08);
}

body { margin: 0; background: var(--cs-bg); color: var(--cs-ink); font-family: "Archivo", system-ui, sans-serif; counter-reset: ch; }
body > * { max-width: var(--cs-max); margin-left: auto; margin-right: auto; box-sizing: border-box; }
a { color: inherit; } a:hover { color: var(--cs-accent-600); }
:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 2px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.cs-section, .cs-reflection { scroll-margin-top: var(--cs-nav-h); }

/* On load, the page's top-level blocks fade up in sequence, top to bottom. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes csPageFadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
  body > * { animation: csPageFadeUp .9s cubic-bezier(.22,.61,.36,1) both; }
  body > *:nth-child(1) { animation-delay: .05s; }
  body > *:nth-child(2) { animation-delay: .20s; }
  body > *:nth-child(3) { animation-delay: .35s; }
  body > *:nth-child(4) { animation-delay: .50s; }
  body > *:nth-child(5) { animation-delay: .65s; }
  body > *:nth-child(n+6) { animation-delay: .78s; }
}

/* ---------- Nav ---------- */
.top-nav { position: sticky; top: 0; z-index: 5; height: var(--cs-nav-h); display: flex; justify-content: space-between; align-items: center; padding: 0 var(--cs-pad); background: var(--cs-bg); border-bottom: 2px solid var(--cs-rule); }
.top-nav .brand { font-weight: 800; font-size: 17px; white-space: nowrap; text-decoration: none; }
.top-nav-links { display: flex; gap: 32px; font-size: 15px; }
.top-nav-links .nav-link { text-decoration: none; display: inline-block; transition: color .3s ease, transform .2s ease; }
.top-nav-links .nav-link.active { color: var(--cs-accent-600); }
@media (hover: hover) {
  .top-nav-links .nav-link:hover { color: var(--cs-accent-600); transform: translateY(-1px); }
}

/* ---------- Hero: 7:5 split ---------- */
.cs-hero { display: grid; grid-template-columns: minmax(0,7fr) minmax(0,5fr); background: none !important; position: relative; }
.cs-hero .cs-inner { grid-column: 1; grid-row: 1; padding: 56px var(--cs-pad) 40px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.cs-hero-content { display: contents; }
.cs-hero-img-wrap { grid-column: 2; grid-row: 1; position: relative !important; inset: auto !important; width: auto !important; border-left: 2px solid var(--cs-rule); min-height: 720px; }
.cs-hero-img-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1 !important; }
.cs-hero-fade { display: none !important; }
.cs-hero-eyebrow { font-size: 14px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.cs-hero-eyebrow .cs-hero-index { color: var(--cs-accent-700); margin-right: 16px; }
.cs-hero-h { margin: 28px 0 0; font-weight: 800; font-size: 68px; line-height: .96; letter-spacing: -0.035em; text-wrap: balance; }

/* Meta: one row per item (markup: <dl class="cs-meta"><div><dt>Role</dt><dd>Sole Designer</dd></div>…</dl>) */
.cs-meta { margin: 0; border-top: 2px solid var(--cs-ink); }
.cs-meta > div { display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 16px; padding: 12px 0; border-bottom: 2px solid var(--cs-rule); font-size: 16px; }
.cs-meta dt { font-weight: 600; color: var(--cs-muted); }
.cs-meta dd { margin: 0; font-weight: 800; }

/* ---------- In short: skim block directly under the hero ---------- */
.cs-col-label { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.cs-short-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px var(--cs-pad); border-top: 2px solid var(--cs-ink); border-bottom: 2px solid var(--cs-rule); }
.cs-short-bar-label { font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.cs-short-jump { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; }
.cs-short-jump:hover { color: var(--cs-accent-600); }

.cs-short-cols { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.cs-short-col { padding: 28px var(--cs-pad) 36px; display: flex; flex-direction: column; gap: 12px; border-right: 2px solid var(--cs-rule); }
.cs-short-col:last-child { border-right: 0; }
.cs-short-problem { margin: 0; font-weight: 800; font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; }
.cs-did { list-style: none; margin: 0; padding: 0; }
.cs-did li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding: 8px 0; border-bottom: 2px solid var(--cs-rule); font-size: 17px; line-height: 1.4; }
.cs-did li .cs-did-mark { font-weight: 800; color: var(--cs-accent-700); }
.cs-short-team { margin: 0; font-size: 18px; line-height: 1.45; }

/* ---------- Chapters ---------- */
/* row-gap is 0 on purpose: the sticky .cs-h2 spans many rows (grid-row: 2 / span 60)
   so it can stay pinned, and a non-zero row-gap would add a gap to every one of the
   empty spanned rows, leaving a huge blank tail under each chapter. Vertical rhythm
   in the right column comes from the bottom margins below instead. */
.cs-section, .cs-reflection { display: grid; grid-template-columns: minmax(0,4fr) minmax(0,8fr); column-gap: 40px; row-gap: 0; padding: 0 var(--cs-pad) 64px; border-top: 2px solid var(--cs-ink); background: none; align-items: start; }
.cs-reflection .cs-inner, .cs-text, .cs-decision-card { display: contents; }
.cs-section > *, .cs-reflection > *, .cs-text > *, .cs-reflection .cs-inner > * { grid-column: 2; }
/* sections without an eyebrow (e.g. the intro context) */
.cs-section:not(:has(.cs-eyebrow)) { padding-top: 40px; }

/* Header bar: full width, auto-numbered */
.cs-eyebrow { grid-column: 1 / -1 !important; grid-row: 1; display: block; margin: 0 calc(var(--cs-pad) * -1) 16px; padding: 16px var(--cs-pad); border-bottom: 2px solid var(--cs-rule); font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; counter-increment: ch; }
.cs-eyebrow::before { content: counter(ch, decimal-leading-zero) "\00a0\00a0"; color: var(--cs-accent-700); }

/* Chapter takeaway: title + one-line summary, pinned together in the left column.
   Reading only the left column of a page should tell its whole story. */
.cs-pin { grid-column: 1 !important; grid-row: 2 / span 60; position: sticky; top: 90px; align-self: start; display: flex; flex-direction: column; gap: 16px; }
.cs-h2 { margin: 0; font-weight: 800; font-size: 38px; line-height: 1.04; letter-spacing: -0.025em; text-wrap: balance; }
.cs-sum { margin: 0; padding-top: 14px; border-top: 2px solid var(--cs-rule); font-size: 17px; line-height: 1.45; color: var(--cs-body2); text-wrap: pretty; }

.cs-p { margin: 0 0 24px; max-width: 700px; font-size: 19px; line-height: 1.6; text-wrap: pretty; }
.cs-pullquote { margin: 0 0 24px; padding: 20px 0; border-top: 2px solid var(--cs-ink); border-bottom: 2px solid var(--cs-ink); font-weight: 800; font-size: 34px; line-height: 1.1; letter-spacing: -0.02em; font-style: normal; max-width: none !important; }
.cs-caption { margin: 10px 0 24px; font-size: 14px; line-height: 1.45; color: var(--cs-muted); font-style: normal; text-align: center !important; }

/* Images */
.cs-img-wrap { margin: 8px 0 24px; }
.cs-img { display: block; width: 100%; border-radius: 0; }
/* Crop a pillarboxed video (baked-in black side bars) to its real content:
   wrapper takes the content aspect ratio and clips the centered, full-height
   video, so the side bars fall outside. */
.cs-video-crop { position: relative; width: 100%; aspect-ratio: 1638 / 1080; overflow: hidden; }
.cs-video-crop video { position: absolute; top: 0; left: 50%; transform: translateX(-50%); height: 100%; width: auto; max-width: none; display: block; }
.cs-img-2col { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin: 8px 0 24px; }
.cs-img-2col .img-box { position: relative; height: 380px; }
.cs-img-2col .img-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* All images keep their original color on case-study pages (no grayscale,
   no hover-to-color). The .cs-photo class is now a no-op, kept so markup
   doesn't need changing. */

/* Key decisions */
.cs-decision-block { grid-column: 2; display: flex; flex-direction: column; gap: 18px; padding: 24px 0 8px; border-top: 2px solid var(--cs-rule); }
.cs-decision-block .cs-decision-card { display: flex; flex-direction: column; gap: 18px; }
.cs-decision-card > * { grid-column: auto; }
.cs-decision-num { display: inline; font-weight: 800; font-size: 22px; color: var(--cs-accent); }
.cs-decision-title { margin: -8px 0 0; font-weight: 800; font-size: 28px; line-height: 1.1; letter-spacing: -0.02em; }
/* Result line: what the decision changed, before its image */
.cs-result { display: grid; grid-template-columns: 80px 1fr; gap: 16px; align-items: baseline; max-width: 700px; padding: 14px 0; border-top: 2px solid var(--cs-ink); border-bottom: 2px solid var(--cs-ink); }
.cs-result > span:first-child { font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-accent-700); }
.cs-result > span:last-child { font-weight: 800; font-size: 19px; line-height: 1.35; }

/* ---------- The outcome: magenta band inside the In short block ---------- */
.cs-metrics { background: var(--cs-accent-600); color: #fff; padding: 48px var(--cs-pad) 40px; border-top: 2px solid var(--cs-ink); display: flex; flex-direction: column; gap: 32px; }
.cs-metrics-cols { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 40px; }
.cs-metrics-cols > div { padding-top: 20px; border-top: 2px solid #fff; display: flex; flex-direction: column; gap: 14px; }
.cs-metrics-from { font-weight: 600; font-size: 20px; text-decoration: line-through; text-decoration-thickness: 2px; }
.cs-metrics-to { font-weight: 800; font-size: 80px; line-height: .85; letter-spacing: -0.05em; }
.cs-metrics-lbl { font-weight: 800; font-size: 19px; }
.cs-metrics-note { font-size: 16px; line-height: 1.45; }
.cs-metrics-measure { margin: 0; padding-top: 16px; border-top: 2px solid rgba(255,255,255,.5); font-size: 14px; line-height: 1.45; }

/* ---------- Page end: All work (left) + next project (right) ---------- */
.cs-end { display: grid; grid-template-columns: minmax(0,4fr) minmax(0,8fr); min-height: 200px; border-top: 2px solid var(--cs-ink); }
.cs-end-back { display: flex; align-items: center; gap: 8px; padding: 0 var(--cs-pad); border-right: 2px solid var(--cs-rule); font-size: 15px; font-weight: 600; text-decoration: none; }
.cs-end-back svg { display: block; }

.cs-next { display: grid; grid-template-columns: minmax(0,1fr) auto; text-decoration: none; }
@media (hover: hover) { .cs-next:hover { background: var(--cs-accent-100); color: inherit; } }
.cs-next-text { padding: 28px var(--cs-pad); display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.cs-next-head { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -0.02em; }
.cs-next-head svg { display: block; width: 30px; height: 30px; }
.cs-next-name { font-weight: 800; font-size: 22px; line-height: 1.1; letter-spacing: -0.01em; }
.cs-next-co { font-size: 14px; font-weight: 600; color: var(--cs-muted); }
.cs-next-img { width: 260px; border-left: 2px solid var(--cs-rule); }
.cs-next-img img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Reusable text-link hover: magenta + a slight rise (matches the work rows) */
.rise-link { transition: color .3s ease, transform .2s ease; }
@media (hover: hover) { .rise-link:hover { color: var(--cs-accent-600); transform: translateY(-2px); } }

/* ---------- Footer / Contact (shared site footer) ---------- */
.site-footer { border-top: 2px solid var(--cs-ink); scroll-margin-top: var(--cs-nav-h); }
.site-footer-top { display: grid; grid-template-columns: minmax(0,7fr) minmax(0,5fr); gap: 40px; align-items: end; padding: 40px var(--cs-pad) 32px; }
.site-footer-lead { display: flex; flex-direction: column; gap: 8px; }
.site-footer-lead-sm { font-size: 22px; line-height: 1.3; }
.site-footer-lead-lg { font-weight: 800; font-size: 72px; line-height: .95; letter-spacing: -0.035em; }
.site-footer-contact { display: flex; flex-direction: column; gap: 20px; }
.site-footer-cv { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-top: 2px solid var(--cs-ink); border-bottom: 2px solid var(--cs-ink); font-weight: 800; font-size: clamp(22px, 2.6vw, 32px); letter-spacing: -0.02em; overflow-wrap: anywhere; text-decoration: none; }
.site-footer-cv:hover { color: var(--cs-accent-600); }
.site-footer-cv svg { flex: none; }
.site-footer-social { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 24px; }
.site-footer-social a { display: flex; justify-content: flex-start; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; text-decoration: none; }
.site-footer-social a:hover { color: var(--cs-accent-600); }
.site-footer-social svg { flex: none; }
.site-footer-bottom { padding: 20px var(--cs-pad); border-top: 2px solid var(--cs-rule); font-size: 14px; }
.site-footer-bottom span { font-weight: 600; }

/* ---------- Mobile (not designed yet; sensible stack) ---------- */
@media (max-width: 900px) {
  :root { --cs-pad: 20px; }
  .cs-hero { grid-template-columns: 1fr; }
  .cs-hero-img-wrap { grid-column: 1; grid-row: 2; min-height: 320px; border-left: 0; border-top: 2px solid var(--cs-rule); }
  .cs-hero-h { font-size: 40px; }
  .cs-short-cols, .cs-metrics-cols { grid-template-columns: 1fr; }
  .cs-short-col { border-right: 0; border-bottom: 2px solid var(--cs-rule); }
  .cs-short-col:last-child { border-bottom: 0; }
  .cs-section, .cs-reflection { grid-template-columns: 1fr; }
  .cs-section > *, .cs-reflection > *, .cs-text > *, .cs-reflection .cs-inner > *, .cs-decision-block { grid-column: 1; }
  .cs-pin { grid-column: 1 !important; grid-row: auto; position: static; }
  .cs-h2 { font-size: 30px; }
  .cs-img-2col { grid-template-columns: 1fr; }
  .cs-metrics-to { font-size: 56px; }
  .cs-end { grid-template-columns: 1fr; }
  .cs-end-back { border-right: 0; border-bottom: 2px solid var(--cs-rule); padding: 20px var(--cs-pad); }
  .cs-next-head { font-size: 26px; }
  .cs-next-img { width: 120px; }
  .site-footer-top { grid-template-columns: 1fr; }
  .site-footer-lead-lg { font-size: 48px; }
}

/* Phone: drop the hero header image, keep the headline + meta block */
@media (max-width: 600px) {
  .cs-hero-img-wrap { display: none !important; }
}

/* ---------- Legacy pieces reused by the other case studies ---------- */
/* Role bar (3 equal cells) — used by wayfair / search */
.cs-role-bar { border-top: 2px solid var(--cs-ink); background: none; }
.cs-role-bar .cs-inner { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); }
.cs-role-bar .cs-inner > div { padding: 24px var(--cs-pad) 28px; border-right: 2px solid var(--cs-rule); display: flex; flex-direction: column; gap: 8px; }
.cs-role-bar .cs-inner > div:last-child { border-right: 0; }
.cs-role-col-label { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.cs-role-col-val { font-size: 18px; line-height: 1.45; }

/* Impact chapter band (full-width magenta) — used by wayfair */
.cs-impact { background: var(--cs-accent-600); color: #fff; padding: 56px var(--cs-pad) 64px; border-top: 2px solid var(--cs-ink); }
.cs-impact .cs-inner { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 40px; }
.cs-impact .cs-inner > div { padding-top: 20px; border-top: 2px solid #fff; display: flex; flex-direction: column; gap: 14px; }
.cs-impact-num { font-weight: 800; font-size: 72px; line-height: .85; letter-spacing: -0.04em; color: #fff; }
.cs-impact-label { font-size: 17px; line-height: 1.45; }
.cs-impact-label strong { display: block; font-size: 19px; font-weight: 800; margin-bottom: 8px; }

/* CTA button in AI-project heroes */
.cs-cta-btn { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; height: 44px; padding: 0 18px; background: var(--cs-accent); color: #fff; font-weight: 800; font-size: 14px; text-decoration: none; border: 0; }
@media (hover: hover) { .cs-cta-btn:hover { background: var(--cs-accent-600); color: #fff; } }

/* ---------- Bottom CTA / closing strip (shared by the 3 AI projects) ---------- */
.cs-closing-strip { background: #eae9e9; text-align: center; padding: 72px var(--cs-pad) 64px; }
.cs-closing-h { font-size: 1.5rem; font-weight: 800; color: var(--cs-ink); margin: 0 0 20px; }
.cs-cta-row { display: flex; align-items: center; justify-content: center; gap: 36px; flex-wrap: wrap; }
.cs-bottom-qr-group { display: flex; align-items: center; gap: 10px; }
.cs-bottom-qr-group img { width: 84px; height: 84px; border-radius: 8px; flex-shrink: 0; mix-blend-mode: multiply; }
.cs-bottom-qr-label { font-size: 1rem; font-weight: 600; color: var(--cs-accent-600); line-height: 1.3; text-align: right; max-width: 120px; }
.cs-cta-or { font-size: 0.85rem; color: var(--cs-ink); opacity: 0.45; font-style: italic; }
@media (max-width: 768px) { .cs-bottom-qr-group, .cs-cta-or { display: none; } }

/* Lightbox is unstyled in this design; keep its overlay (and its ‹ › arrows) hidden. */
.lb-overlay { display: none; }

/* ---------- Mockup toggle (segmented switch between two screens) ---------- */
.cs-toggle { display: flex; justify-content: center; margin-top: 20px; }
.cs-toggle-btn {
  margin: 0; font: 600 14px/1 "Archivo", system-ui, sans-serif;
  color: var(--cs-ink); background: transparent;
  border: 2px solid var(--cs-ink); border-radius: 0;
  padding: 11px 18px; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.cs-toggle-btn + .cs-toggle-btn { border-left: 0; }
.cs-toggle-btn.is-active { background: var(--cs-ink); color: var(--cs-bg); }
.cs-toggle-btn:not(.is-active):hover { color: var(--cs-accent-600); }
/* Crossfade layer for the swapped mockups. */
.cs-toggle-fade { transition: opacity .45s ease; }
.cs-toggle-fade.is-hidden { opacity: 0; pointer-events: none; }

@media (max-width: 900px) {
  .cs-role-bar .cs-inner, .cs-impact .cs-inner { grid-template-columns: 1fr; }
  .cs-role-bar .cs-inner > div { border-right: 0; border-bottom: 2px solid var(--cs-rule); }
  .cs-impact-num { font-size: 56px; }
}

/* Multi-image galleries (e.g. .cs-pattern-grid) stay compact so a cluster of
   images never exceeds the screen. */
.cs-pattern-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin: 8px 0 24px; }
.cs-pattern-grid figure { margin: 0; }
.cs-pattern-grid img { display: block; width: 100%; height: auto; }
.cs-pattern-grid figcaption { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--cs-muted); }

/* ---------- Live system-prompt box (esmeralda / grooped) ---------- */
.gs-prompt-section { margin-top: 40px; margin-bottom: 8px; }
.gs-prompt-label { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; max-width: 700px; margin-bottom: 12px; }
.gs-prompt-eyebrow { font-size: 14px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-accent-700); }
.gs-prompt-source { font-size: 14px; font-weight: 600; color: var(--cs-muted); text-decoration: none; transition: color .15s; }
.gs-prompt-source:hover { color: var(--cs-accent-600); }
.gs-prompt-box-label { justify-self: start; display: inline-block; margin: 32px 0 0; padding: 6px 12px; background: var(--cs-ink); color: var(--cs-bg); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; }
.gs-prompt-box { box-sizing: border-box; max-width: 700px; max-height: 440px; overflow-y: auto; margin: 0 0 24px; padding: 20px 24px; border: 2px solid var(--cs-ink); background: #eae9e9; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.65; color: var(--cs-body2); -webkit-overflow-scrolling: touch; }
.gs-prompt-box::-webkit-scrollbar { width: 10px; }
.gs-prompt-box::-webkit-scrollbar-track { background: transparent; }
.gs-prompt-box::-webkit-scrollbar-thumb { background: var(--cs-rule); }
.gs-prompt-loading { margin: 0; font-size: 13px; color: var(--cs-muted); }
.gsp-header { font-family: "Archivo", system-ui, sans-serif; font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-accent-700); margin: 22px 0 8px; }
.gsp-header:first-child { margin-top: 0; }
.gsp-step { font-family: "Archivo", system-ui, sans-serif; font-weight: 800; font-size: 12px; color: var(--cs-ink); margin: 16px 0 6px; }
.gsp-bullet { position: relative; margin: 0; padding-left: 16px; white-space: pre-wrap; word-break: break-word; }
.gsp-bullet::before { content: "\2013"; position: absolute; left: 0; color: var(--cs-accent-700); }
.gsp-code { margin: 8px 0; padding: 12px 14px; background: #e1dfdf; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.5; overflow-x: auto; white-space: pre; }
.gsp-line { margin: 0; white-space: pre-wrap; word-break: break-word; }
.gsp-line.gsp-first { margin-top: 10px; }

/* ---------- Scroll nav collapse (project pages) ---------- */
/* On pages whose <nav class="top-nav nav-collapse"> wraps its contents in a
   .top-nav-inner, the nav stays the centered content box while the inner bar
   collapses, across ~one screen of scroll, to the sections' grid-column 1
   (4fr of 4+8 = 33.333% of the content box), anchored to the content's left
   edge. The name then morphs "Roie Shalom" -> "Roiesh", and the pink
   scroll-progress divider only starts once that sequence is finished.
   Driven by nav-collapse.js. Variables on the nav:
     --bar-shrink      (0->1) bar width, happens first
     --name-morph      (0->1) name contraction, happens last
     --scroll-progress (0->1) pink divider, after the sequence */
.top-nav.nav-collapse {
  display: block;
  padding: 0;
  background: none;
  border-bottom: 0;
}
.top-nav.nav-collapse .top-nav-inner {
  position: relative;
  box-sizing: border-box;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--cs-pad);
  background: var(--cs-bg);
  border-bottom: 2px solid var(--cs-rule);
  /* 1 - shrink * (8/12): full content width down to the 4/12 left column */
  width: calc(100% * (1 - var(--bar-shrink, 0) * 0.666667));
  margin-right: auto;
  will-change: width;
}
.top-nav.nav-collapse .top-nav-inner::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px; /* sit on top of the existing 2px border */
  width: calc(var(--scroll-progress, 0) * 100%);
  height: 3px;
  background: var(--cs-accent);
  pointer-events: none;
}
/* Brand morph: " Shalom" leaves over the first half of the morph, "sh"
   arrives over the second half, so the name never reads as a blend.
   Natural widths are measured by nav-collapse.js into --brand-full-w/-sh-w. */
.top-nav.nav-collapse .brand { display: inline-flex; align-items: baseline; overflow: hidden; }
.top-nav.nav-collapse .brand-full,
.top-nav.nav-collapse .brand-sh { display: inline-block; white-space: pre; overflow: hidden; }
.top-nav.nav-collapse .brand-full {
  max-width: calc(var(--brand-full-w, 6em) * max(0, 1 - var(--name-morph, 0) * 2));
  opacity: max(0, 1 - var(--name-morph, 0) * 2);
}
.top-nav.nav-collapse .brand-sh {
  max-width: calc(var(--brand-sh-w, 1.5em) * max(0, (var(--name-morph, 0) - 0.5) * 2));
  opacity: max(0, (var(--name-morph, 0) - 0.5) * 2);
}
/* Below the two-column breakpoint the left column doesn't exist, so keep the
   bar full width and the name intact. */
@media (max-width: 900px) {
  .top-nav.nav-collapse .top-nav-inner { width: 100% !important; }
  .top-nav.nav-collapse .brand-full { max-width: none !important; opacity: 1 !important; }
  .top-nav.nav-collapse .brand-sh { max-width: 0 !important; opacity: 0 !important; }
}
