/* =============================================================
   Gabriel Reis e Silva — Portfolio Site · Dark Theme
   ============================================================= */

:root {
  /* --- Palette --- */
  --bg:            #0b0f1a;   /* base */
  --bg-alt:        #10172a;   /* section variation */
  --bg-card:       #161e34;   /* elevated surface */
  --bg-deep:       #06080f;   /* footer, deepest */

  --rule:          #24314c;
  --rule-strong:   #2e3d5c;

  --text:          #ecf1fa;   /* primary */
  --text-body:     #bec8dc;   /* body */
  --muted:         #7b8598;   /* labels, meta */

  --accent:        #5aa8ff;   /* links, highlights */
  --accent-hi:     #8bc2ff;   /* hover */
  --accent-soft:   rgba(90, 168, 255, 0.10);
  --accent-border: rgba(90, 168, 255, 0.35);

  --warn:          #f5b23e;
  --warn-soft:     rgba(245, 178, 62, 0.10);
  --negative:      #ff6b6b;

  /* --- Type & layout --- */
  --font-sans:  "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif Pro", "Georgia", serif;
  --font-mono:  "JetBrains Mono", "Fira Code", "Consolas", monospace;
  --wrap:        1120px;
  --wrap-narrow: 820px;
  --radius:      6px;
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 12px 32px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, video { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
a:hover { color: var(--accent-hi); border-bottom-color: currentColor; }

h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
p { color: var(--text-body); }

/* ---------- Layout wrappers ---------- */
.wrap        { max-width: var(--wrap);        margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 24px; }

/* ---------- Top nav ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.site-nav .brand {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.5px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15.5px;
}
.site-nav .brand::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(90, 168, 255, 0.55);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.site-nav .brand:hover::before {
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(90, 168, 255, 0.85);
}
.site-nav .brand-full  { display: inline; }
.site-nav .brand-short { display: none; font-weight: 700; letter-spacing: 1.5px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.site-nav a {
  position: relative;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  padding: 10px 14px 12px;
  border: none;
  transition: color 0.18s ease;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 6px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.site-nav a:hover {
  color: var(--text);
}
.site-nav a:hover::after {
  transform: scaleX(1);
}
.site-nav a.active {
  color: var(--text);
}
.site-nav a.active::after {
  transform: scaleX(1);
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  background:
    radial-gradient(1200px 400px at 25% -10%, rgba(90, 168, 255, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  border-bottom: 1px solid var(--rule);
}
.hero .wrap { max-width: var(--wrap-narrow); }
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 16px;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(36px, 5.5vw, 56px);
  margin: 0 0 20px;
  color: var(--text);
}
.hero h1 .accent { color: var(--accent); }
.hero .lede {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 32px;
  line-height: 1.55;
}
.hero .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14.5px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--bg);
  transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}
.btn:hover {
  background: var(--accent-hi);
  border-color: var(--accent-hi);
  color: var(--bg);
  border-bottom-color: var(--accent-hi);
  box-shadow: 0 0 24px rgba(90, 168, 255, 0.35);
}
.btn.ghost {
  background: transparent;
  color: var(--accent);
}
.btn-lg { padding: 14px 26px; font-size: 15.5px; }
.hero-cta { margin: 22px 0 0; }
.hero-cta .btn { box-shadow: 0 0 32px rgba(90, 168, 255, 0.28); }
.hero-cta .btn:hover { box-shadow: 0 0 40px rgba(90, 168, 255, 0.5); }
.btn.ghost:hover {
  background: var(--accent-soft);
  color: var(--accent-hi);
  box-shadow: none;
}

/* ---------- Sections ---------- */
section.block {
  padding: 72px 0;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
section.block.alt { background: var(--bg-alt); }
.block .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 600;
}
.block h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin: 0 0 8px;
  font-weight: 600;
}
.block .section-title {
  font-size: clamp(24px, 3vw, 32px);
  margin: 0 0 40px;
  color: var(--text);
}
.block .section-lede {
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 40px;
  font-size: 16px;
}
.block .section-title + .section-lede {
  margin-top: -32px;
}

/* ---------- Case study cards (landing "Selected projects") ---------- */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}
.case-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  color: var(--text);
  border-bottom: 1px solid var(--rule);
}
.case-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-border);
  color: var(--text);
}
.case-card .thumb {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 30% 30%, rgba(139, 194, 255, 0.20), transparent 55%),
    linear-gradient(135deg, #234b7a 0%, #0c1524 100%);
  position: relative;
  overflow: hidden;
}
.case-card .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 300ms ease;
}
.case-card:hover .thumb img { transform: scale(1.03); }
.case-card .thumb .tag {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(11, 15, 26, 0.55);
  color: var(--accent-hi);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  border: 1px solid var(--accent-border);
  z-index: 2;
}
.case-card .thumb .glyph {
  position: absolute;
  right: -8%;
  bottom: -12%;
  width: 65%;
  height: auto;
  opacity: 0.22;
  color: var(--accent-hi);
  pointer-events: none;
}
.case-card .thumb .glyph line,
.case-card .thumb .glyph circle,
.case-card .thumb .glyph path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.case-card .thumb .glyph rect { fill: currentColor; stroke: none; }
.case-card .thumb .glyph.reticle circle       { stroke-width: 2; }
.case-card .thumb .glyph.reticle circle.dot   { fill: currentColor; }

.case-card .card-body { padding: 20px 22px 22px; }
.case-card h3 {
  font-size: 19px;
  margin: 0 0 6px;
  color: var(--text);
}
.case-card .meta {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 10px;
}
.case-card .card-body p {
  font-size: 14.5px;
  margin: 0 0 12px;
  color: var(--text-body);
}
.case-card .arrow {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Earlier work strip ---------- */
.earlier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.earlier-item {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 18px 20px;
  color: var(--text);
  border-bottom: 1px solid var(--rule);
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
  display: block;
  text-decoration: none;
}
.earlier-item:hover {
  border-color: var(--accent-border);
  background: #1a2340;
  transform: translateY(-1px);
  color: var(--text);
}
.earlier-item .year {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 6px;
}
.earlier-item h4 {
  font-size: 15.5px;
  margin: 0 0 4px;
  color: var(--text);
}
.earlier-item p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

/* ---------- About page components ---------- */
.about-strip {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-strip .about-copy p { font-size: 16px; color: var(--text-body); margin: 0 0 14px; }
.about-strip .about-copy em { color: var(--text); font-style: italic; }
.about-strip .about-side dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 18px;
  font-size: 14px;
}
.about-strip dt { color: var(--muted); font-weight: 600; }
.about-strip dd { margin: 0; color: var(--text-body); }

/* Portrait + intro (image left, text right) */
.portrait-strip {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 56px;
  align-items: start;
}
.portrait-strip .portrait {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--rule);
}
.portrait-strip .portrait img { display: block; width: 100%; height: auto; }
.portrait-strip .portrait-copy p {
  font-size: 17px;
  color: var(--text-body);
  margin: 0 0 16px;
  max-width: 62ch;
}
.portrait-strip .portrait-copy p:first-child { font-size: 19px; color: var(--text); }
.portrait-strip .portrait-copy em { color: var(--text); font-style: italic; }

/* Résumé role list */
.role-list { display: grid; gap: 24px; margin: 24px 0 0; }
.role {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding: 24px 0;
  border-top: 1px solid var(--rule);
}
.role:first-child { border-top: 1px solid var(--rule-strong); }
.role .role-meta .years {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 8px;
}
.role .role-meta .company {
  font-size: 14px;
  color: var(--text);
  font-weight: 700;
  margin: 0 0 4px;
}
.role .role-meta .location {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 12px;
}
.role .role-meta .titles {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--muted);
  display: grid;
  gap: 2px;
}
.role .role-body h3 {
  font-size: 20px;
  margin: 0 0 6px;
  color: var(--text);
}
.role .role-body .stack {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
  font-family: var(--font-mono);
}
.role .role-body ul {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.6;
  display: grid;
  gap: 6px;
}
.role .role-body ul strong { color: var(--text); font-weight: 600; }

/* Education + Skills */
.edu-skills {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 56px;
  align-items: start;
}
.edu-list { display: grid; gap: 20px; }
.edu-item .degree { font-size: 16px; color: var(--text); font-weight: 600; margin: 0 0 2px; }
.edu-item .school { font-size: 14px; color: var(--text-body); margin: 0 0 2px; }
.edu-item .years  { font-size: 12px; color: var(--muted); margin: 0; text-transform: uppercase; letter-spacing: 1.4px; }

.skills-grid {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 12px 20px;
  align-items: baseline;
  margin: 0;
}
.skills-grid dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 700;
  padding-top: 6px;
}
.skills-grid dd { margin: 0; }
.skills-grid dd .tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.skills-grid dd .tag {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-body);
  background: var(--bg-card);
  white-space: nowrap;
}
.skills-grid dd .tag.accent {
  border-color: var(--accent-border);
  color: var(--accent-hi);
  background: var(--accent-soft);
}

.resume-block, .contact-block {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}
.resume-block p, .contact-block p { color: var(--text-body); font-size: 16px; margin: 0 0 12px; }
.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 16px;
}
.contact-list li { display: flex; gap: 12px; align-items: baseline; }
.contact-list .k {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 600;
  min-width: 90px;
}

/* ---------- Case study article ---------- */
.cs-hero {
  padding: 72px 0 40px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
}
.cs-hero .wrap { max-width: var(--wrap-narrow); }
.cs-hero .crumb {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 0 12px;
}
.cs-hero .crumb a { color: var(--muted); border: none; }
.cs-hero .crumb a:hover { color: var(--accent); }
.cs-hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 12px;
}
.cs-hero .subtitle {
  font-size: 18px;
  color: var(--text-body);
  margin: 0 0 24px;
  max-width: 62ch;
}
.cs-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 24px;
  padding: 16px 0 0;
  border-top: 1px solid var(--rule);
  font-size: 13.5px;
}
.cs-meta .k {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  margin: 0 0 2px;
}
.cs-meta .v { margin: 0 0 8px; color: var(--text-body); }

.cs-body { padding: 56px 0 72px; }
.cs-body .wrap { max-width: var(--wrap-narrow); }

/* Project pages are media-heavy, not text-heavy, so let them use more of the
   viewport on desktop while still constraining prose to a readable measure.
   Gallery keeps 2 columns so each image gets more room. */
.cs-body:has(.project-title) .wrap { max-width: var(--wrap); }
.cs-body:has(.project-title) .wrap > p:not(.client):not(.media-caption) {
  max-width: 68ch;
}

.cs-body h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin: 40px 0 6px;
  font-weight: 600;
}
.cs-body h3 { font-size: 24px; margin: 0 0 18px; }
.cs-body p  { font-size: 16.5px; margin: 0 0 16px; color: var(--text-body); }
.cs-body ul { padding-left: 20px; margin: 0 0 16px; }
.cs-body li { margin: 0 0 8px; font-size: 16.5px; color: var(--text-body); }
.cs-body strong { color: var(--text); }
.cs-body em { color: var(--text); font-style: italic; }

.cs-body figure {
  margin: 32px 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
.cs-body figure .placeholder {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(90, 168, 255, 0.05) 12px 24px);
}
.cs-body figcaption {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  background: var(--bg-alt);
}

/* Numbers callout */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}
.result-card {
  padding: 22px 20px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
}
.result-card.negative { border-top-color: var(--negative); }
.result-card .value {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}
.result-card.negative .value { color: var(--negative); }
.result-card .label {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
  font-weight: 500;
}

/* Callout / note */
.callout {
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
  font-size: 15px;
  color: var(--text-body);
}
.callout strong { color: var(--text); }
.callout.warn {
  border-left-color: var(--warn);
  background: var(--warn-soft);
}
.callout .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--warn);
  margin-right: 8px;
}

/* Code snippet */
.cs-body pre {
  background: var(--bg-deep);
  color: #e6edf3;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 24px 0;
}
.cs-body code {
  font-family: var(--font-mono);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.92em;
}
.cs-body pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ---- Lightbox affordance for case-study figures ---- */
.cs-evidence.is-lightbox-target,
.breakdown-step.is-lightbox-target,
.cs-refresh-proof.is-lightbox-target {
  cursor: zoom-in;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.cs-evidence.is-lightbox-target:hover,
.breakdown-step.is-lightbox-target:hover,
.cs-refresh-proof.is-lightbox-target:hover {
  border-color: var(--accent);
}
.cs-evidence.is-lightbox-target img,
.breakdown-step.is-lightbox-target img,
.cs-refresh-proof.is-lightbox-target img {
  transition: transform 0.25s ease;
}
.cs-evidence.is-lightbox-target:hover img,
.breakdown-step.is-lightbox-target:hover img,
.cs-refresh-proof.is-lightbox-target:hover img {
  transform: scale(1.01);
}

/* Related links */
.cs-related {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 14.5px;
}
.cs-related a { font-weight: 600; }


/* =============================================================
   Case study v2 — TL;DR block + scannable detail sections
   ============================================================= */

/* ---- The TL;DR band (hero + results + at-a-glance in one visual zone) ---- */
.cs-tldr {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 48px;
}
.cs-tldr .cs-hero {
  background: transparent;
  border-bottom: none;
  padding-bottom: 32px;
}
.cs-tldr .cs-lede {
  font-size: 20px;
  line-height: 1.5;
  color: var(--text);
  max-width: 62ch;
  margin: 0 0 28px;
  font-weight: 500;
}
.cs-tldr-inner {
  max-width: var(--wrap-narrow);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.cs-tldr-inner .result-grid { margin: 0; }
.cs-tldr-glance {
  margin: 32px 0 0;
}
.cs-tldr-glance h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin: 0 0 14px;
  font-weight: 600;
}
.cs-tldr-glance ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.cs-tldr-glance li {
  position: relative;
  padding: 6px 0 6px 28px;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--text);
}
.cs-tldr-glance li::before {
  content: "→";
  position: absolute;
  left: 0;
  top: 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
}

/* Divider label between TL;DR and detail */
.cs-details-marker {
  max-width: var(--wrap-narrow);
  margin: 0 auto;
  padding: 40px var(--gutter) 0;
  text-align: center;
}
.cs-details-marker span {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--muted);
  font-weight: 600;
}
.cs-details-marker span::before,
.cs-details-marker span::after {
  content: "";
  width: 48px;
  height: 1px;
  background: var(--rule);
}

/* ---- Pull-quote / callout used inside the problem section ---- */
.cs-quote {
  margin: 24px 0;
  padding: 20px 24px 20px 30px;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(90,168,255,0.06), transparent 80%);
  font-style: italic;
}

/* ---- Constraint grid ---- */
.constraint-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
}
.constraint-card {
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--muted);
  border-radius: var(--radius);
}
.constraint-card h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text);
  margin: 0 0 8px;
  font-weight: 700;
}
.constraint-card p {
  font-size: 14.5px;
  color: var(--text-body);
  margin: 0;
  line-height: 1.5;
}

/* ---- The "key idea" statement block ---- */
.cs-big-idea {
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 24px 0 12px;
}
.cs-big-idea h3 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  max-width: 28ch;
  margin: 0 0 16px;
}
.cs-big-idea p {
  font-size: 16.5px;
  color: var(--text-body);
  max-width: 60ch;
  margin: 0;
  line-height: 1.6;
}

/* ---- Breakdown sequence (progressive-zoom figures) ---- */
.breakdown-sequence {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin: 24px 0 8px;
}
.breakdown-step {
  margin: 0;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.breakdown-step .step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.breakdown-step .step-label span {
  padding: 4px 10px;
  background: rgba(90, 168, 255, 0.14);
  color: var(--accent);
  border-radius: 999px;
  letter-spacing: 1.5px;
  font-size: 10.5px;
}
.breakdown-step img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  background: #1a1d24;
}
.breakdown-step figcaption {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--text-body);
  line-height: 1.55;
}

/* ---- FC 25 refresh proof figure ---- */
.cs-refresh-proof,
.cs-evidence {
  margin: 28px 0 8px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-align: center;
}
.cs-refresh-proof img,
.cs-evidence img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
}
.cs-refresh-proof figcaption,
.cs-evidence figcaption {
  margin: 16px auto 0;
  font-size: 14px;
  color: var(--text-body);
  max-width: 60ch;
  line-height: 1.55;
}
.cs-evidence video {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 4px);
  background: #000;
}

/* ---- Side-by-side graph + output pairs (PIP effect breakdowns) ---- */
.cs-evidence-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin: 28px 0 8px;
}
.cs-evidence-pair .cs-evidence {
  margin: 0;
}

/* ---- Performance bullet list (used in PIP case study) ---- */
.cs-perf-list {
  margin: 12px 0 24px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  list-style: none;
}
.cs-perf-list li {
  padding: 6px 0;
  font-size: 15px;
  line-height: 1.55;
}
.cs-perf-list li + li {
  border-top: 1px solid var(--rule);
}
.cs-perf-list code {
  padding: 2px 6px;
  background: rgba(90, 168, 255, 0.10);
  border-radius: 3px;
  font-size: 13px;
}

/* ---- Production-highlight cards (2×2 grid) ---- */.highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
}
.highlight-card {
  padding: 20px 22px 20px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}
.highlight-card .tag {
  align-self: flex-start;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  background: rgba(90, 168, 255, 0.12);
  border-radius: 999px;
  margin: 0 0 12px;
}
.highlight-card h4 {
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.35;
}
.highlight-card p {
  font-size: 14.5px;
  color: var(--text-body);
  margin: 0;
  line-height: 1.55;
}

/* ---- Related project strip (linked back at bottom) ---- */
.cs-related-projects {
  margin: 48px 0 0;
  padding: 32px 0 8px;
  border-top: 1px solid var(--rule);
}
.cs-related-projects h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--accent);
  margin: 0 0 16px;
  font-weight: 600;
}
.cs-related-projects .links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cs-related-projects .links a {
  padding: 10px 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--bg-card);
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.cs-related-projects .links a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 32px 0 40px;
  background: var(--bg-deep);
  color: var(--muted);
  font-size: 14px;
  border-top: 1px solid var(--rule);
}
.site-footer a { color: var(--text-body); border-bottom-color: transparent; }
.site-footer a:hover { color: var(--accent); border-bottom-color: currentColor; }
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  align-items: center;
}
.site-footer .foot-brand { color: var(--text); font-weight: 700; margin: 0 0 2px; font-size: 14.5px; }
.site-footer .foot-tag   { margin: 0; font-size: 13px; }
.site-footer .foot-right { text-align: right; }
.site-footer .foot-copy  { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.site-footer .foot-note {
  flex: 0 0 100%;
  width: 100%;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}
.site-footer .foot-note span { display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .resume-block, .contact-block { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 720px) {
  .about-strip { grid-template-columns: 1fr; gap: 24px; }
  .portrait-strip { grid-template-columns: 1fr; gap: 28px; }
  .portrait-strip .portrait { max-width: 320px; }
  .role { grid-template-columns: 1fr; gap: 16px; padding: 20px 0; }
  .edu-skills { grid-template-columns: 1fr; gap: 32px; }
  .site-nav ul { gap: 18px; }
  .hero { padding: 64px 0 48px; }
  section.block { padding: 56px 0; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; }
  .site-footer .foot-right { text-align: left; }
}
@media (max-width: 640px) {
  .site-nav .wrap { height: 56px; padding: 0 16px; }
  .site-nav .brand-full  { display: none; }
  .site-nav .brand-short { display: inline; font-size: 15px; color: var(--text); }
  .site-nav ul { gap: 2px; }
  .site-nav a  { font-size: 11px; letter-spacing: 1.4px; padding: 8px 10px 10px; white-space: nowrap; }
  .site-nav a::after { left: 10px; right: 10px; }
}
@media (max-width: 400px) {
  .site-nav ul { gap: 0; }
  .site-nav a  { font-size: 10.5px; letter-spacing: 1.2px; padding: 8px 8px 10px; }
  .site-nav a::after { left: 8px; right: 8px; }
}


/* =============================================================
   Vince-style visual project pages (added in hybrid pivot)
   ============================================================= */

/* Big hero image at top of a project page */
.project-hero {
  margin: 0 0 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  aspect-ratio: 16 / 9;
  position: relative;
}
.project-hero img,
.project-hero video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-caption {
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  margin: 0 0 40px;
  letter-spacing: 0.02em;
}

/* Thumbnail strip: 5-up on desktop, 2-up on mobile */
.thumb-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 8px 0 40px;
}
.thumb-strip a {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  transition: border-color 160ms ease, transform 160ms ease;
}
.thumb-strip a:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}
.thumb-strip img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@media (max-width: 720px) {
  .thumb-strip { grid-template-columns: repeat(2, 1fr); }
}

/* Meta table at bottom of a project page — Description / For / Tech / Links */
.meta-table {
  border-top: 1px solid var(--rule);
  margin: 32px 0 0;
}
.meta-table dl {
  margin: 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
}
.meta-table dt,
.meta-table dd {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}
.meta-table dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}
.meta-table dd {
  color: var(--text-body);
  font-size: 15px;
}
.meta-table dd a { color: var(--accent); border-bottom: 1px solid transparent; }
.meta-table dd a:hover { border-bottom-color: var(--accent-hi); }
.meta-table dd ul { margin: 0; padding-left: 18px; }
.meta-table dd ul li { padding: 3px 0; }
@media (max-width: 720px) {
  .meta-table dl { grid-template-columns: 1fr; gap: 0; }
  .meta-table dt { padding-bottom: 4px; border-bottom: 0; }
  .meta-table dd { padding-top: 4px; }
}

/* Compact intro line: title + client + one-sentence caption */
.project-title {
  text-align: center;
  margin: 0 0 12px;
}
.project-title h1 {
  font-size: 40px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}
.project-title .client {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Deep-dive link block ("Want the technical story?") */
.deep-dive {
  margin: 32px 0;
  padding: 20px 22px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
}
.deep-dive p { margin: 0; color: var(--text-body); }
.deep-dive a { font-weight: 600; }

/* =============================================================
   Visual home grid (Vince-style 2-column landscape cards)
   ============================================================= */
.visual-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 32px 0 0;
}
@media (max-width: 720px) {
  .visual-grid { grid-template-columns: 1fr; gap: 18px; }
}
.visual-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}
.visual-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-2px);
}
.visual-card .cover {
  aspect-ratio: 16 / 9;
  background: #0d1220;
  overflow: hidden;
}
.visual-card .cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}
.visual-card:hover .cover img { transform: scale(1.02); }
.visual-card .label {
  padding: 16px 20px 18px;
}
.visual-card .label h3 {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--text);
}
.visual-card .label .client {
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
}

/* Compact variant, used on the Projects index so Tools/Installations flow at
   3 cards per row instead of 2. Home page keeps the 2-col layout. */
.visual-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* Placeholder cover, used when a project has no cover image yet.
   Renders as a dark gradient with the project name and a small badge. */
.visual-card .cover.cover--placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background:
    radial-gradient(circle at 30% 20%, rgba(90, 168, 255, 0.10), transparent 55%),
    linear-gradient(135deg, #0d1220 0%, #17203b 100%);
  position: relative;
}
.visual-card .cover.cover--placeholder::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(90, 168, 255, 0.14);
  border-radius: 3px;
  pointer-events: none;
}
.visual-card .cover.cover--placeholder .cover-title {
  color: var(--text);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.4px;
  text-align: center;
  line-height: 1.15;
  position: relative;
  z-index: 1;
  max-width: 90%;
}
.visual-card .cover.cover--placeholder .cover-badge {
  color: var(--accent);
  font-size: 10.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-weight: 500;
  position: relative;
  z-index: 1;
}
.visual-card:hover .cover.cover--placeholder::after {
  border-color: rgba(90, 168, 255, 0.30);
}


/* =============================================================
   Project gallery (masonry via CSS columns)
   ============================================================= */
.gallery {
  columns: 2;
  column-gap: 20px;
  margin: 40px 0;
}
.gallery-item {
  break-inside: avoid;
  margin: 0 0 20px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease;
}
.gallery-item:hover {
  border-color: var(--accent-border);
  transform: translateY(-1px);
}
.gallery-item img,
.gallery-item video {
  display: block;
  width: 100%;
  height: auto;
  background: #0a0f1a;
}
@media (max-width: 720px) {
  .gallery { columns: 1; }
}


/* =============================================================
   Lightbox
   ============================================================= */
.gallery-item { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 15, 0.95);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 60px 80px;
}
.lightbox.open { display: flex; }

.lightbox-stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-stage img,
.lightbox-stage video {
  max-width: min(92vw, 1800px);
  max-height: 88vh;
  display: block;
  border-radius: 6px;
  background: #000;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(20, 26, 44, 0.6);
  border: 1px solid var(--rule);
  color: var(--text);
  cursor: pointer;
  border-radius: 999px;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(90, 168, 255, 0.15);
  border-color: var(--accent-border);
}

.lightbox-close {
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 28px;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 32px;
  font-weight: 300;
}
.lightbox-nav:hover { transform: translateY(-50%) scale(1.05); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(20, 26, 44, 0.6);
  border: 1px solid var(--rule);
  padding: 6px 14px;
  border-radius: 999px;
}

@media (max-width: 720px) {
  .lightbox { padding: 60px 12px; }
  .lightbox-close { top: 14px; right: 14px; width: 40px; height: 40px; font-size: 24px; }
  .lightbox-nav { width: 44px; height: 44px; font-size: 26px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
