/* =====================================================
   Mason Canfield Portfolio — portfolio.css
   Dynamic light theme — clean but alive
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;600&display=swap');

/* ── CSS Variables ────────────────────────────────── */
:root {
  --ink:         #0f1117;
  --ink-mid:     #2d3142;
  --ink-soft:    #5a5f7a;
  --ink-muted:   #9399b2;

  --paper:       #fafafa;
  --paper-warm:  #f5f3ef;
  --paper-card:  #ffffff;

  --blue:        #1842c4;
  --blue-light:  #e8edfb;
  --blue-mid:    #b8c6f0;
  --blue-dark:   #0e2d8f;

  --green:       #1a7a4a;
  --green-light: #e3f5ec;
  --amber:       #b85a00;
  --amber-light: #fdf0e3;
  --red:         #b81c1c;
  --red-light:   #fce8e8;

  --border:      #e0e3ed;
  --border-soft: #eff0f5;

  --radius:      8px;
  --radius-lg:   14px;

  --shadow-xs:   0 1px 3px rgba(15,17,23,0.06);
  --shadow-sm:   0 2px 8px rgba(15,17,23,0.08), 0 1px 2px rgba(15,17,23,0.04);
  --shadow-md:   0 4px 16px rgba(15,17,23,0.10), 0 2px 4px rgba(15,17,23,0.06);
  --shadow-hover:0 8px 28px rgba(24,66,196,0.14), 0 2px 8px rgba(15,17,23,0.08);

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --max-width:   1100px;
  --prose-width: 780px;
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-mid);
  background: var(--paper);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 28px 96px;
}

/* ── Typography ───────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; margin-bottom: 10px; }
h2 { font-size: 1.4rem; font-weight: 700; margin-top: 52px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
h3 { font-size: 1.1rem; font-weight: 600; margin-top: 28px; margin-bottom: 8px; }

p { margin: 14px 0; }
ul, ol { margin: 12px 0 12px 24px; }
li { margin-bottom: 6px; line-height: 1.65; }
strong { color: var(--ink); font-weight: 600; }

a { color: var(--blue); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--blue-dark); text-decoration: underline; }

em {
  display: block;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.87rem;
  font-style: italic;
  margin: 6px 0 24px;
  font-family: var(--font-body);
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 52px 0;
}

img {
  display: block;
  margin: 24px auto 8px;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

code {
  font-family: var(--font-mono);
  font-size: 0.83em;
  background: var(--blue-light);
  color: var(--blue-dark);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--blue-mid);
}

pre.log, pre code {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: #111827;
  color: #d1d5db;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  line-height: 1.65;
  border: 1px solid #1f2937;
}

/* ── Site Nav ─────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  margin: 0 -28px 0;
  padding: 0 28px;
}

.site-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-nav-brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.site-nav-links {
  display: flex;
  gap: 4px;
}

.site-nav-links a {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 5px 12px;
  border-radius: 6px;
  letter-spacing: 0.01em;
  transition: background 0.15s, color 0.15s;
}

.site-nav-links a:hover,
.site-nav-links a.active {
  background: var(--blue-light);
  color: var(--blue);
  text-decoration: none;
}

/* ── Page Wrapper ─────────────────────────────────── */
.page-wrapper {
  max-width: var(--prose-width);
  margin: 0 auto;
  padding-top: 44px;
}

.page-wrapper-wide {
  padding-top: 44px;
}

/* ── Hero ─────────────────────────────────────────── */
.page-hero {
  text-align: center;
  padding: 56px 0 40px;
  position: relative;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: -28px; right: -28px; bottom: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(24,66,196,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.page-hero img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--blue-mid);
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(24,66,196,0.18);
}

.page-hero h1 {
  margin-bottom: 6px;
}

.page-hero .subtitle {
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 500;
  line-height: 1.9;
  font-style: normal;
  display: block;
  margin: 0;
  padding-bottom: 4px;
  overflow: visible;
}

/* ── CTA Buttons ──────────────────────────────────── */
.cta-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  padding: 10px 24px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.18s;
  display: inline-block;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(24,66,196,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue-mid);
}
.btn-outline:hover {
  background: var(--blue-light);
  border-color: var(--blue);
  text-decoration: none;
  color: var(--blue);
  transform: translateY(-1px);
}

/* ── Section Title ────────────────────────────────── */
.section-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  text-align: center;
  margin: 56px 0 22px;
  position: relative;
}

.section-title::before,
.section-title::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 1px;
  background: var(--blue-mid);
  vertical-align: middle;
  margin: 0 12px;
}

/* ── Cards Grid ───────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-mid));
  opacity: 0;
  transition: opacity 0.22s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--blue-mid);
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1rem;
}

/* ── Mini Project (Home) ──────────────────────────── */
.mini-project {
  border-left: 3px solid var(--blue-mid);
  padding: 12px 0 12px 18px;
  margin: 14px 0;
  transition: border-color 0.15s;
}

.mini-project strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.mini-project:hover {
  border-left-color: var(--blue);
}

/* ── Projects Grid ────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 52px;
}

.project-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
  position: relative;
}

.project-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--blue-mid);
}

.project-card.featured {
  border: 2px solid var(--blue);
  background: linear-gradient(135deg, var(--blue-light) 0%, #f0f4fd 100%);
  padding-top: 30px;
}

.project-card.featured::before {
  content: "★ Featured";
  position: absolute;
  top: 0; left: 14px;
  background: var(--blue);
  color: #fff;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 0 0 6px 6px;
  text-transform: uppercase;
}

.project-card h3 {
  font-size: 1.05rem;
  margin-top: 0;
  margin-bottom: 10px;
}

.status-note {
  font-style: italic;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin-top: 8px;
  font-family: var(--font-display);
}

.view-link {
  display: inline-block;
  margin-top: 16px;
  font-weight: 700;
  font-size: 0.87rem;
  color: var(--blue);
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

/* ── Tags ─────────────────────────────────────────── */
.tags { margin: 8px 0 10px; }

.tag {
  display: inline-block;
  background: #edf0fa;
  color: #2a3d8f;
  padding: 3px 9px;
  margin: 3px 3px 3px 0;
  font-size: 0.76rem;
  font-family: var(--font-display);
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid #ccd3f0;
  letter-spacing: 0.01em;
}

/* ── Back Link ────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 28px;
  padding: 6px 12px 6px 8px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}

.back-link::before { content: '←'; }

.back-link:hover {
  background: var(--blue-light);
  color: var(--blue);
  text-decoration: none;
}

/* ── Project Header ───────────────────────────────── */
.project-header {
  padding: 28px 0 24px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 36px;
}

.project-header h1 {
  margin-bottom: 6px;
}

.project-subtitle {
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  margin: 0;
  line-height: 1.7;
  font-style: normal;
}

/* ── Info / Status Boxes ──────────────────────────── */
.info-box {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 22px 0;
  font-size: 0.92rem;
}

.info-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 5px;
}

.status-box {
  background: var(--amber-light);
  border: 1px solid #f0c080;
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 22px 0;
  font-size: 0.92rem;
}

.status-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 5px;
}

/* ── Data / Results Boxes ─────────────────────────── */
.box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  background: var(--paper-card);
  margin: 20px 0;
  box-shadow: var(--shadow-xs);
}

.box-green {
  background: var(--green-light);
  border: 1px solid #a3dbbe;
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 20px 0;
}

.box-yellow {
  background: var(--amber-light);
  border: 1px solid #f0c080;
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 20px 0;
}

.box-blue {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 20px 0;
}

/* ── Metric Cards ─────────────────────────────────── */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
  margin: 24px 0;
}

.metric-card {
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  text-align: center;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.metric-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-mid));
}

.metric-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.metric-card .value {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--blue);
  line-height: 1.1;
  margin-bottom: 5px;
  letter-spacing: -0.02em;
}

.metric-card .label {
  font-size: 0.78rem;
  color: var(--ink-muted);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

/* ── Tables ───────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.91rem;
  font-family: var(--font-display);
  box-shadow: var(--shadow-xs);
  border-radius: var(--radius);
  overflow: hidden;
}

th {
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--ink-mid);
}

tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #f8f9fc; }
tr:hover td { background: var(--blue-light); }

.highlight td {
  background: var(--amber-light) !important;
  font-weight: 600;
}

/* ── Changelog / Timeline ─────────────────────────── */
.changelog {
  border-left: 3px solid var(--blue-mid);
  padding-left: 20px;
  margin: 20px 0;
}

.changelog-item {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.changelog-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.changelog-item .tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}

.tag-fix     { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.tag-new     { background: var(--green-light); color: #166534; border: 1px solid #a3dbbe; }
.tag-update  { background: var(--blue-light); color: var(--blue-dark); border: 1px solid var(--blue-mid); }
.tag-pending { background: #f3f4f6; color: #4b5563; border: 1px solid #d1d5db; }

/* ── Sensitivity Bars ─────────────────────────────── */
.sensitivity-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.sensitivity-bar .bar-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.88rem;
  width: 130px;
  flex-shrink: 0;
  color: var(--ink);
}

.sensitivity-bar .bar-track {
  flex: 1;
  background: var(--border);
  border-radius: 4px;
  height: 16px;
  overflow: hidden;
}

.sensitivity-bar .bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.sensitivity-bar .bar-pct {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  width: 55px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Image Grid ───────────────────────────────────── */
.image-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}

.image-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: var(--paper-card);
  text-align: center;
  box-shadow: var(--shadow-xs);
}

.image-box img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 0 auto 8px;
  border: none;
}

.caption {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-style: italic;
  display: block;
  margin-top: 5px;
}

/* ── Compare Grid ─────────────────────────────────── */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 22px 0;
}

.compare img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0;
}

.compare em {
  text-align: left;
  margin-top: 6px;
}

.compare-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 22px 0;
}

.compare-3 img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0;
}

/* ── Gallery ──────────────────────────────────────── */
.gallery, #gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.gallery-item { text-align: center; }

.gallery-item img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 0 0 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-item img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.gallery-item em {
  text-align: left;
  font-size: 0.83rem;
}

/* ── Fig Solo ─────────────────────────────────────── */
.fig-solo {
  text-align: center;
  margin: 28px 0;
}

.fig-solo img {
  max-width: 100%;
  border-radius: var(--radius-lg);
  margin: 0 auto 8px;
}

/* ── Video ────────────────────────────────────────── */
.video-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin: 20px 0;
}

.video-wrap video { width: 100%; display: block; }

.video-wrap em {
  display: block;
  text-align: center;
  padding: 8px 0 12px;
  font-size: 0.87rem;
  color: var(--ink-muted);
  background: var(--paper-warm);
}

/* ── Placeholder ──────────────────────────────────── */
.placeholder {
  background: var(--paper-warm);
  border: 2px dashed var(--border);
  color: var(--ink-muted);
  text-align: center;
  padding: 48px 20px;
  margin: 20px auto 8px;
  font-style: italic;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
}

.img-full {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin: 24px auto 8px;
  display: block;
}

.img-caption {
  display: block;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
  font-style: italic;
  margin-bottom: 24px;
}

/* ── Timeline (Simulink) ──────────────────────────── */
.timeline {
  border-left: 3px solid var(--blue-mid);
  padding-left: 24px;
  margin: 28px 0;
}

.timeline-item {
  position: relative;
  padding: 10px 0 14px 12px;
  margin-bottom: 4px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--blue-mid);
}

.timeline-item.timeline-current::before {
  background: var(--blue);
  border-color: var(--blue);
}

.timeline-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 4px;
}

/* ── Version Bar (Simulink) ───────────────────────── */
.version-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 32px 0;
}

.version-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.version-bar button {
  flex: 1;
  padding: 10px 16px;
  background: var(--paper-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--ink-soft);
}

.version-bar button:hover {
  background: var(--blue-light);
  border-color: var(--blue);
  color: var(--blue);
}

.version-bar button.active,
.version-bar button.current {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

iframe {
  display: none;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: 16px;
  min-height: 600px;
}

/* ── Ghost Result (V9 Comparison) ────────────────── */
.ghost-result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid #2d3748;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 22px 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.ghost-result .ghost-col { padding: 18px 22px; }
.ghost-result .ghost-col-a { background: #1a1a0f; border-right: 1px solid #2d3748; }
.ghost-result .ghost-col-b { background: #0f1820; }

.ghost-result .ghost-label {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2d3748;
  font-family: var(--font-display);
}

.ghost-result .ghost-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: #94a3b8;
}

.ghost-result .ghost-val {
  font-weight: 700;
  color: #e2e8f0;
}

.ghost-result .ghost-winner {
  grid-column: 1 / -1;
  background: #1e2533;
  padding: 12px 22px;
  border-top: 1px solid #2d3748;
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  font-family: var(--font-body);
}

/* ── Zone Legend ──────────────────────────────────── */
.zone-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.zone-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-family: var(--font-display);
}

.swatch {
  width: 28px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-block;
}

/* ── Comp Table ───────────────────────────────────── */
.comp-table th { background: var(--ink); }
.comp-table .highlight td {
  background: var(--amber-light) !important;
  font-weight: 700;
}

/* ── Download Button ──────────────────────────────── */
.download-btn {
  display: inline-block;
  background: var(--blue);
  color: white;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  transition: background 0.15s, transform 0.15s;
  letter-spacing: 0.01em;
}

.download-btn:hover {
  background: var(--blue-dark);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ── Tools Box ────────────────────────────────────── */
.tools-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  background: var(--paper-card);
  margin: 18px 0;
  box-shadow: var(--shadow-xs);
}

.tools-box p { margin: 5px 0; }

/* ── Footer Nav ───────────────────────────────────── */
.footer-nav {
  text-align: center;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.footer-nav a {
  margin: 0 14px;
  color: var(--ink-soft);
  transition: color 0.15s;
}

.footer-nav a:hover {
  color: var(--blue);
  text-decoration: none;
}

/* ── Pre / Log blocks ─────────────────────────────── */
pre.log {
  background: #111827;
  color: #d1d5db;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  font-size: 0.82rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre;
  margin: 20px 0;
  border: 1px solid #1f2937;
}

pre.log .hi   { color: #34d399; font-weight: 700; }
pre.log .sec  { color: #60a5fa; font-weight: 700; }
pre.log .val  { color: #fbbf24; }
pre.log .warn { color: #f87171; font-weight: 700; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 720px) {
  body { padding: 0 16px 72px; }
  h1 { font-size: 1.75rem; }
  .site-nav { margin: 0 -16px; padding: 0 16px; }
  .compare, .compare-3, .image-grid { grid-template-columns: 1fr; }
  .projects-grid, .card-grid { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .ghost-result { grid-template-columns: 1fr; }
  .ghost-result .ghost-winner { grid-column: 1; }
  .sensitivity-bar { flex-wrap: wrap; }
  .sensitivity-bar .bar-track { flex: 1 0 100%; order: 3; }
  .site-nav-brand { font-size: 0.9rem; }
  .site-nav-links a { padding: 4px 8px; font-size: 0.78rem; }
}
