:root {
  --bg: #0a0e14;
  --bg-alt: #0d1220;
  --surface: #111827;
  --surface-2: #161f30;
  --border: #232d40;
  --text: #e6ebf2;
  --text-dim: #9aa7bb;
  --text-faint: #7c8ba6;
  --accent: #3ddc97;
  --accent-2: #4f9dff;
  --accent-ink: #3ddc97;
  --accent-2-ink: #4f9dff;
  --accent-soft: rgba(61, 220, 151, 0.12);
  --radius: 14px;
  --max-width: 1120px;
  --shadow: 0 20px 50px -20px rgba(0,0,0,0.5);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f4f6fa;
  --bg-alt: #eceff5;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --border: #dde3ed;
  --text: #121826;
  --text-dim: #4b5568;
  --text-faint: #5c6579;
  --accent-ink: #067a4c;
  --accent-2-ink: #1a56c4;
  --accent-soft: rgba(6, 122, 76, 0.10);
  --shadow: 0 20px 50px -20px rgba(20,30,50,0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* Accessibility: skip link + focus states */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  background: var(--accent);
  color: #08160f;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1000;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text);
}

p { margin: 0; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; }

.mono { font-family: 'JetBrains Mono', monospace; }

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

.accent-text { color: var(--accent-ink); }

/* Background grid decoration */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(61, 220, 151, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 220, 151, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 100%);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(10, 14, 20, 0.75);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
:root[data-theme="light"] .site-header {
  background: rgba(244, 246, 250, 0.8);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
}
.logo-text .dot { color: var(--accent-ink); }

.main-nav {
  display: flex;
  gap: 28px;
}
.main-nav a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.2s ease;
}
.main-nav a:hover { color: var(--text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.lang-toggle .lang-opt { transition: color 0.2s ease; padding: 2px; }
.lang-toggle .lang-opt.active { color: var(--accent-ink); font-weight: 700; }
.lang-sep { color: var(--border); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-faint);
  flex-shrink: 0;
}
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Hero */
.hero {
  padding: 110px 0 90px;
  position: relative;
}

.hero-inner { max-width: 780px; }

.eyebrow {
  color: var(--accent-ink);
  font-size: 0.85rem;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin-bottom: 24px;
}

.hero-lead {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 620px;
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--accent);
  color: #08160f;
}
.btn-primary:hover { background: #4fe8a8; }

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
}
.btn-ghost:hover { border-color: var(--accent); }

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--accent-2-ink);
  font-size: 1.05rem;
}
.stat-label {
  color: var(--text-faint);
  font-size: 0.82rem;
}

/* Sections */
.section {
  padding: 90px 0;
  border-top: 1px solid var(--border);
}
.section-alt { background: var(--bg-alt); }

.section-tag {
  color: var(--accent-ink);
  font-size: 0.82rem;
  margin-bottom: 14px;
}

.section h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  margin-bottom: 36px;
  max-width: 640px;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 56px;
}
.about-text {
  color: var(--text-dim);
  font-size: 1rem;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.pillar-icon { font-size: 1.6rem; display: block; margin-bottom: 14px; }
.pillar h3 { font-size: 1.05rem; margin-bottom: 10px; }
.pillar p { color: var(--text-faint); font-size: 0.92rem; }

/* Cards / services */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.3s ease;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.card-icon {
  font-size: 1.7rem;
  margin-bottom: 16px;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  border-radius: 10px;
}
.card h3 { font-size: 1.05rem; margin-bottom: 10px; }
.card p { color: var(--text-faint); font-size: 0.92rem; }

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 44px 28px;
}
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -37px;
  top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  transition: background-color 0.3s ease;
}

.timeline-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.timeline-head h3 { font-size: 1.15rem; }
.timeline-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--accent-2-ink);
}
.timeline-company {
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.timeline-company .mono {
  color: var(--text-faint);
  font-weight: 400;
  font-size: 0.85rem;
}

.timeline-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-bottom: 18px;
}
.timeline-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.94rem;
}
.timeline-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-text {
  color: var(--text-dim);
  font-size: 0.94rem;
}

.tags { display: flex; gap: 10px; flex-wrap: wrap; }
.tag {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.3s ease;
}
.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
}
.project-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.project-head h3 { font-size: 1.1rem; }
.project-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--accent-2-ink);
  white-space: nowrap;
}
.project-text {
  color: var(--text-dim);
  font-size: 0.94rem;
  margin-bottom: 16px;
}
.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}
.project-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.92rem;
}
.project-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.project-card .tags { margin-top: auto; }

/* Stack */
.stack-groups {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.stack-group h3 {
  color: var(--text-faint);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  font-weight: 600;
}
.badges { display: flex; flex-wrap: wrap; gap: 10px; }
.badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  transition: border-color 0.2s ease, background-color 0.3s ease;
}
.badge:hover { border-color: var(--accent-2); }

/* Contact */
.contact-section { text-align: left; }
.contact-lead {
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 40px;
  font-size: 1rem;
}
.contact-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  min-width: 280px;
  transition: border-color 0.2s ease, transform 0.2s ease, background-color 0.3s ease;
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.contact-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  border-radius: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-ink);
}
.contact-card strong { display: block; font-size: 0.85rem; color: var(--text-faint); font-weight: 600; }
.contact-value { font-size: 1rem; font-weight: 600; color: var(--text); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-faint);
  font-size: 0.85rem;
}
.footer-inner .mono { color: var(--accent-ink); }
.footer-inner a,
.footer-link-btn {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer-link-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

/* Cookie consent banner */
.cookie-banner {
  display: none;
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  max-width: 620px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow);
  z-index: 500;
}
.cookie-banner.visible { display: block; }
.cookie-banner p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.cookie-banner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.cookie-banner .btn {
  padding: 10px 20px;
  font-size: 0.88rem;
}

/* Legal page */
.legal .section-tag { margin-bottom: 8px; }
.legal h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  margin-bottom: 8px;
}
.legal-updated {
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-bottom: 40px;
}
.legal h2 {
  font-size: 1.25rem;
  margin-top: 40px;
  margin-bottom: 14px;
}
.legal h2:first-of-type { margin-top: 0; }
.legal h3 {
  font-size: 1rem;
  margin-top: 22px;
  margin-bottom: 8px;
}
.legal p {
  color: var(--text-dim);
  font-size: 0.96rem;
  margin-bottom: 14px;
  max-width: 720px;
}
.legal ul {
  list-style: disc;
  padding-left: 22px;
  margin-bottom: 14px;
  max-width: 720px;
}
.legal li {
  color: var(--text-dim);
  font-size: 0.96rem;
  margin-bottom: 8px;
}
.legal a {
  color: var(--accent-2-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal code.mono {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}
.legal-back { margin-top: 24px; }

/* 404 page */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 100px 0;
}
.error-code {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(4rem, 14vw, 7.5rem);
  font-weight: 700;
  color: var(--accent-ink);
  line-height: 1;
  margin-bottom: 20px;
}
.error-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 16px;
}
.error-text {
  color: var(--text-dim);
  max-width: 520px;
  margin-bottom: 32px;
}

/* Responsive */
@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
    gap: 18px;
    transform: translateY(-150%);
    transition: transform 0.25s ease;
  }
  .main-nav.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .hero { padding: 80px 0 60px; }
}

@media (max-width: 600px) {
  .header-inner { height: 64px; }
  .hero-stats { gap: 26px; }
  .contact-card { min-width: 100%; }
}
