:root {
  --bg: #0a0e1a;
  --bg-alt: #0d1325;
  --surface: #111a2e;
  --surface-2: #16213a;
  --border: #1d2940;
  --border-strong: #2a3a5a;
  --text: #e8ecf5;
  --text-muted: #8a96b0;
  --text-dim: #5d6a86;
  --accent: #60a5fa;
  --accent-strong: #93c5fd;
  --accent-dim: rgba(96, 165, 250, 0.12);
  --mono-accent: #5eead4;
  --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, 0.55);

  --font-sans: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, monospace;

  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-strong); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

/* ───────── Header ───────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  background: rgba(10, 14, 26, 0.78);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand-mono {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--accent-dim);
  color: var(--accent-strong);
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 6px;
  padding: 4px 8px;
  letter-spacing: 0.02em;
}
.brand-name { font-size: 15px; }
.site-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}
.site-nav a {
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
}
.site-nav a:hover { color: var(--text); }
.nav-cta {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 8px 16px;
  color: var(--text) !important;
  background: var(--surface);
}
.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
}

/* ───────── Hero ───────── */
.hero {
  padding: 96px 0 120px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(900px 500px at 80% 0%, rgba(96, 165, 250, 0.10), transparent 60%),
    radial-gradient(700px 400px at 0% 90%, rgba(94, 234, 212, 0.06), transparent 60%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mono-accent);
  letter-spacing: 0.02em;
  margin: 0 0 24px;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 700;
  margin: 0 0 24px;
  background: linear-gradient(180deg, #ffffff 0%, #b8c5da 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.lede {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 580px;
  margin: 0 0 32px;
  line-height: 1.6;
}
.hero-cta {
  display: flex;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: var(--accent);
  color: #0a1228 !important;
  font-weight: 600;
}
.btn-primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.trust-strip {
  list-style: none;
  padding: 24px 0 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  border-top: 1px solid var(--border);
}
.trust-strip li {
  font-size: 14px;
  color: var(--text-muted);
}
.trust-strip strong {
  color: var(--text);
  font-weight: 600;
  margin-right: 4px;
}

/* Hero visual */
.hero-visual {
  position: relative;
}
.portrait-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 4 / 5;
  box-shadow: var(--shadow-lg);
}
.portrait-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 85%;
  display: block;
}
.terminal-card {
  position: absolute;
  bottom: -36px;
  left: -36px;
  background: var(--bg-alt);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  width: min(280px, 80%);
  box-shadow: var(--shadow-lg);
}
.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.terminal-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-strong);
}
.terminal-card pre {
  margin: 0;
  padding: 14px 16px 0;
  color: var(--text-muted);
  line-height: 1.7;
  white-space: pre;
}
.t-prompt { color: var(--mono-accent); }
.t-cmd    { color: var(--accent-strong); }
.t-out    { color: var(--text); }

/* ───────── Sections ───────── */
.section {
  padding: 110px 0;
  border-top: 1px solid var(--border);
}
.section-alt {
  background: var(--bg-alt);
}
.section-head {
  margin-bottom: 56px;
  max-width: 760px;
}
.section-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  margin: 0 0 12px;
  letter-spacing: 0.05em;
}
.section-num::before { content: '// '; opacity: 0.6; }
.section-title {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0;
  font-weight: 700;
  color: var(--text);
}
.section-sub {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 17px;
}

/* About */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 64px;
  align-items: start;
}
.about-body p {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 22px;
  line-height: 1.7;
}
.about-body p:last-child { margin-bottom: 0; }
.about-body strong { color: var(--text); font-weight: 600; }

/* Cards */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.card-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 16px;
}
.card h3 {
  font-size: 18px;
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Timeline */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.timeline-item:first-child { border-top: 0; padding-top: 8px; }
.timeline-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.timeline-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--accent-dim);
  flex-shrink: 0;
}
.timeline-period {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}
.timeline-body h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.timeline-org {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
}
.timeline-body > p:last-child {
  margin: 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}

/* Writing */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.writing-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
  color: var(--text) !important;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.writing-card:hover {
  border-color: var(--accent);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.writing-domain {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mono-accent);
  margin: 0 0 16px;
}
.writing-card h3 {
  font-size: 24px;
  margin: 0 0 12px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
}
.writing-card > p {
  color: var(--text-muted);
  margin: 0 0 20px;
  font-size: 16px;
}
.writing-link {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent) !important;
  margin: 0 !important;
}

/* Contact */
.section-contact { background: var(--bg-alt); }
.contact-inner {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.contact-inner .section-head {
  margin: 0 auto 24px;
  text-align: center;
}
.contact-lede {
  font-size: 19px;
  color: var(--text-muted);
  margin: 0 auto 40px;
  max-width: 580px;
}
.contact-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  text-align: left;
}
.contact-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  color: var(--text) !important;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.contact-link:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.contact-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.contact-value {
  font-size: 16px;
  color: var(--text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}
.footer-inner p { margin: 0; }
.footer-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* ───────── Responsive ───────── */
@media (max-width: 920px) {
  .nav-toggle { display: flex; }
  .site-header { position: relative; }
  .site-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 24px 32px;
    gap: 20px;
    align-items: stretch;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s, transform 0.18s;
    z-index: 40;
  }
  .site-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .hero { padding: 64px 0 96px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero-visual { max-width: 380px; margin: 0 auto; }
  .terminal-card { left: -16px; bottom: -28px; }
  .section { padding: 88px 0; }
  .section-grid { grid-template-columns: 1fr; gap: 32px; }
  .cards-grid { grid-template-columns: 1fr 1fr; }
  .writing-grid { grid-template-columns: 1fr; }
  .contact-links { grid-template-columns: 1fr; }
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
}
@media (max-width: 600px) {
  .container { padding: 0 20px; }
  .hero { padding: 48px 0 80px; }
  .section { padding: 72px 0; }
  .cards-grid { grid-template-columns: 1fr; }
  .brand-name { display: none; }
  .trust-strip { gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
