:root {
  --navy: #0f172a;
  --navy-soft: #16213e;
  --accent: #14b8a6;
  --accent-soft: #5eead4;
  --ink: #0f172a;
  --ink-soft: #475569;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.12);
  --max-width: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e2e8f0;
    --ink-soft: #94a3b8;
    --bg: #0b1220;
    --bg-alt: #0f1830;
    --border: #1e293b;
    --shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #04211d;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0; }

a { color: inherit; }

ul { margin: 0; padding: 0; }

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  color: #04211d;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  transition: color 0.15s ease;
}

.site-nav a:hover, .site-nav a.active { color: #fff; }

.nav-cta {
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 16px;
  border-radius: 999px;
}
.nav-cta:hover { border-color: var(--accent); color: var(--accent-soft) !important; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

/* HERO */
.hero {
  background: radial-gradient(circle at 20% -10%, #143a35 0%, var(--navy) 45%), var(--navy);
  color: #fff;
  padding: 96px 0 72px;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero-text { flex: 1; min-width: 0; }

.hero-photo {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(135deg, var(--accent) 0%, rgba(20,184,166,0) 60%);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--navy);
}

.eyebrow {
  color: var(--accent-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 800;
  max-width: 18ch;
  letter-spacing: -0.02em;
}

.hero-lede {
  max-width: 62ch;
  font-size: 1.15rem;
  color: rgba(255,255,255,0.78);
  margin-top: 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #04211d;
}
.btn-primary:hover { opacity: 0.92; }

.btn-ghost {
  border-color: rgba(255,255,255,0.28);
  color: #fff;
}
.btn-ghost:hover { border-color: var(--accent); }

/* STATS */
.stats {
  background: var(--navy-soft);
  border-top: 1px solid rgba(255,255,255,0.06);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 40px 24px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.stat-num {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--accent-soft);
  font-family: 'JetBrains Mono', monospace;
}

.stat-prefix {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  margin-right: 2px;
}

.stat-label {
  color: rgba(255,255,255,0.65);
  font-size: 13px;
}

/* SECTIONS */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.section-lede {
  color: var(--ink-soft);
  max-width: 62ch;
  font-size: 1.05rem;
  margin-bottom: 44px;
}

.mini-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ABOUT */
.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}

.about-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}

.about-card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.about-card p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* TIMELINE / EXPERIENCE */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 36px;
}

.job {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 32px;
  box-shadow: var(--shadow);
}

.job-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.job-head h3 { font-size: 1.2rem; font-weight: 700; }
.job-org { color: var(--accent); font-weight: 600; margin: 4px 0 0; font-size: 14.5px; }

.job-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.job-date {
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
}

.job-tag {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.job-blurb {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin: 0 0 16px;
}

.job ul {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-left: 20px;
}

.job li { font-size: 14.5px; color: var(--ink); }
.job li::marker { color: var(--accent); }

.job-compact { background: var(--bg-alt); box-shadow: none; }
.earlier-list li { color: var(--ink-soft); }
.earlier-list strong { color: var(--ink); }

/* PILLARS */
.pillar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 20px;
}

.pillar {
  border-left: 2px solid var(--border);
  padding-left: 20px;
}

.pillar-num {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 10px;
}

.pillar h3 { font-size: 1.05rem; margin-bottom: 8px; }
.pillar p { color: var(--ink-soft); font-size: 14.5px; margin: 0; }

/* WORK GRID */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.work-card {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.work-card img,
.work-card video {
  width: 100%;
  height: 260px;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.card-media {
  position: relative;
}

.card-media img,
.card-media video {
  display: none;
}
.card-media img.active,
.card-media video.active {
  display: block;
}

.card-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-nav:hover { background: rgba(15, 23, 42, 0.8); }
.card-nav.prev { left: 8px; }
.card-nav.next { right: 8px; }

.card-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 5px;
}
.card-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
}
.card-dots span.active { background: #fff; }

.work-card figcaption { padding: 18px 20px 22px; }
.work-card h4 { font-size: 1rem; margin-bottom: 8px; }
.work-card p { color: var(--ink-soft); font-size: 13.5px; margin: 0; }

/* QUOTES */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.quote {
  margin: 0;
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 28px;
  border-left: 3px solid var(--accent);
}

.quote p {
  font-size: 15px;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 14px;
}

.quote footer {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
  font-style: normal;
}

/* SKILLS */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  margin-top: 20px;
}

.skill-group h3 {
  font-size: 0.95rem;
  margin-bottom: 16px;
  color: var(--ink);
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }

.tag-list li {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

/* EDUCATION / MORE */
.about-more-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
.about-more-grid p { color: var(--ink-soft); }

/* CONTACT */
.contact-section {
  background: var(--navy);
  color: #fff;
}
.contact-section .section-title { color: #fff; }
.contact-section .section-lede { color: rgba(255,255,255,0.7); }
.contact-inner { text-align: center; }
.contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

/* FOOTER */
.site-footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.55);
  font-size: 13px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  padding: 22px 24px;
}

/* REVEAL ANIMATION */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* PROJECT PAGE (e.g. car-project.html) */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 24px;
}
.back-link:hover { text-decoration: underline; }

.page-hero {
  background: radial-gradient(circle at 20% -10%, #143a35 0%, var(--navy) 45%), var(--navy);
  color: #fff;
  padding: 64px 0 56px;
}
.page-hero .eyebrow { margin-bottom: 14px; }
.page-hero h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 20ch;
}
.page-hero p {
  max-width: 62ch;
  font-size: 1.05rem;
  color: rgba(255,255,255,0.78);
  margin-top: 18px;
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 20px;
}
.project-gallery figure {
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.project-gallery img {
  width: 100%;
  height: 360px;
  object-fit: contain;
  display: block;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
.project-gallery figcaption { padding: 16px 20px; }
.project-gallery h4 { font-size: 0.95rem; margin-bottom: 4px; }
.project-gallery p { color: var(--ink-soft); font-size: 13.5px; margin: 0; }

@media (max-width: 760px) {
  .project-gallery { grid-template-columns: 1fr; }
  .project-gallery img { height: 240px; }
}

/* RESPONSIVE */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: repeat(2, 1fr); }
  .pillar-grid { grid-template-columns: repeat(2, 1fr); }
  .work-grid { grid-template-columns: repeat(2, 1fr); }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .site-nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px 28px;
    gap: 18px;
    display: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .nav-cta { align-self: flex-start; }

  .about-grid, .quote-grid, .about-more-grid { grid-template-columns: 1fr; }
  .work-grid { grid-template-columns: 1fr; }
  .job { padding: 24px 20px; }
  .section { padding: 64px 0; }
  .hero { padding: 72px 0 56px; }
  .hero-inner { flex-direction: column-reverse; text-align: center; }
  .hero-actions { justify-content: center; }
  .hero-photo { width: 160px; height: 160px; }
}

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