:root {
  --bg: #0b0d10;
  --bg-raised: #12151a;
  --bg-card: #151920;
  --line: #23282f;
  --ink: #eef0f2;
  --ink-soft: #a9b0ba;
  --ink-faint: #6b7280;
  --accent: #6ee7b7;
  --accent-ink: #06120c;

  --parking-accent: #f4622a;
  --parking-ink: #171310;
  --parking-surface: #1c1815;
  --parking-concrete: #edeae3;
  --parking-concrete-line: #c9c2b8;

  --dog-cream: #f4e9d8;
  --dog-terracotta: #c7684b;
  --dog-sage: #7c8b6f;
  --dog-ink: #221d17;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --maxw: 1080px;
}

/* Per-case-study theming: retint the whole page toward that app's own
   design system (not just the accent) so it reads as "that app's colors",
   not the neutral site theme with a highlight color swapped in. */
body.theme-parking {
  --bg: #15110d;
  --bg-raised: #1d1712;
  --bg-card: #221b15;
  --line: #362b1f;
  --ink: #f2ece2;
  --ink-soft: #c7bcac;
  --ink-faint: #948877;
}
body.theme-dogschedule {
  --bg: #1c130d;
  --bg-raised: #251a11;
  --bg-card: #2b1f15;
  --line: #3f2c1c;
  --ink: #f7ecd9;
  --ink-soft: #ddc7a4;
  --ink-faint: #ab9372;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; color: var(--ink-soft); }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.nav-brand span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; font-size: 0.92rem; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
  border-bottom: 1px solid var(--line);
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent);
}
.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  max-width: 16ch;
}
.hero .lede {
  font-size: 1.1rem;
  max-width: 58ch;
  color: var(--ink-soft);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
  align-items: center;
}
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9rem;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-faint); }
.pill {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--bg-raised);
}

/* ---------- Section ---------- */
.section { padding: 72px 0; }
.section-head { margin-bottom: 36px; max-width: 62ch; }
.section-head .eyebrow { margin-bottom: 10px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); }

/* ---------- Project cards (home) ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 24px;
}
.project-card {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--bg-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: var(--ink-faint); }
.project-banner {
  height: 168px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 18px 22px;
  background-size: cover;
  background-position: center;
}
.project-banner.parking {
  background: radial-gradient(120% 140% at 15% 0%, #2a2019 0%, #171310 55%), repeating-linear-gradient(135deg, rgba(244,98,42,0.07) 0 2px, transparent 2px 22px);
}
.project-banner.dogschedule {
  background: radial-gradient(120% 140% at 85% 0%, #33291d 0%, #221d17 55%);
}
.project-banner .role-tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 600;
}
.project-banner.parking .role-tag { background: var(--parking-accent); color: #1a0f08; }
.project-banner.dogschedule .role-tag { background: var(--dog-terracotta); color: #241209; }

.project-body { padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.project-body h3 { font-size: 1.3rem; }
.project-body .tagline { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }
.tech-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tech-chip {
  font-size: 0.72rem;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.card-cta {
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-cta .arrow { transition: transform 0.15s ease; }
.project-card:hover .card-cta .arrow { transform: translateX(4px); }

/* ---------- About / footer ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 720px) { .about-grid { grid-template-columns: 1fr; } }
.stat-list { display: grid; gap: 16px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px 18px; background: var(--bg-card); }
.stat b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; color: var(--accent); }
.stat span { font-size: 0.85rem; color: var(--ink-soft); }

footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 48px;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
footer a:hover { color: var(--ink-soft); }
.footer-links { display: flex; gap: 16px; }

/* ---------- Case study pages ---------- */
.case-hero {
  padding: 56px 0 48px;
  border-bottom: 1px solid var(--line);
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 24px;
}
.back-link:hover { color: var(--ink); }
.case-hero h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.case-hero .lede { font-size: 1.05rem; max-width: 62ch; }

.case-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.case-meta-grid .k { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-faint); margin-bottom: 6px; }
.case-meta-grid .v { font-size: 0.95rem; color: var(--ink); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.feature-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--bg-card);
}
.feature-card h4 { font-size: 1rem; margin-bottom: 6px; }
.feature-card p { font-size: 0.9rem; margin: 0; }
.feature-card .icon { font-size: 1.4rem; margin-bottom: 10px; display: block; }

.diagram-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  padding: 28px;
  overflow-x: auto;
}
.diagram-card svg { display: block; margin: 0 auto; }
.diagram-caption { font-size: 0.85rem; color: var(--ink-faint); margin-top: 16px; text-align: center; }

/* ---------- Illustration ("how it works", in the app's own design system) ---------- */
.illustration-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  align-items: center;
}
@media (max-width: 760px) { .illustration-row { grid-template-columns: 1fr; } }
.illustration-card {
  border-radius: var(--radius-lg);
  padding: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
}
.illustration-card.parking {
  background: var(--parking-concrete);
  background-image:
    radial-gradient(circle, rgba(23,19,16,0.08) 1px, transparent 1px);
  background-size: 14px 14px;
}
.illustration-card.dogschedule { background: var(--dog-cream); }
.illustration-card img { max-width: 280px; width: 100%; }
.illustration-card svg { max-width: 100%; height: auto; }
.illustration-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.illustration-copy p { font-size: 0.95rem; }

.screens-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.screens-table th, .screens-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.screens-table th { color: var(--ink-faint); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.screens-table td { color: var(--ink-soft); }
.screens-table code { color: var(--ink); font-size: 0.85em; }

.notes-list { display: grid; gap: 16px; }
.note-item {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 16px;
}
.note-item.parking { border-left-color: var(--parking-accent); }
.note-item.dogschedule { border-left-color: var(--dog-terracotta); }
.note-item h4 { font-size: 0.95rem; margin-bottom: 4px; }
.note-item p { font-size: 0.9rem; margin: 0; }

.swatch-row { display: flex; gap: 14px; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--ink-soft); }
.swatch i { width: 22px; height: 22px; border-radius: 6px; display: inline-block; border: 1px solid rgba(255,255,255,0.1); }

.role-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 640px) { .role-split { grid-template-columns: 1fr; } }
.role-col {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--bg-card);
}
.role-col h4 { font-size: 0.95rem; margin-bottom: 10px; }
.role-col ol { margin: 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.88rem; }
.role-col li { margin-bottom: 6px; }

.code-note {
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--bg-raised);
}
.code-note b { color: var(--ink); }

.case-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  background: var(--bg-card);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
}
.btn:hover { opacity: 0.9; }

@media (max-width: 600px) {
  .hero { padding: 64px 0 40px; }
  .section { padding: 48px 0; }
  .nav-links { gap: 16px; }
}
