:root {
  --bg: #0b1020;
  --panel: #131a2e;
  --panel-soft: #f5f7fb;
  --text: #111827;
  --text-on-dark: #f8fafc;
  --muted: #5b6475;
  --muted-on-dark: #cbd5e1;
  --border: #dbe2ea;
  --accent: #2563eb;
  --accent-soft: #dbeafe;

  --routing: #0f766e;
  --routing-soft: #ccfbf1;

  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  --radius: 18px;
  --wrap: 1120px;
  --narrow: 760px;

  font-family: Inter, Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
}

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

.code-block {
  background: #0b1020;
  color: #e2e8f0;
  padding: 1rem;
  border-radius: 10px;
  font-family: monospace;
  font-size: 0.9rem;
  overflow-x: auto;
}

.flow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.flow::-webkit-scrollbar {
  display: none;
}

.flow-step {
  padding: 0.55rem 0.8rem;
  background: var(--accent-soft);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  color: #1e3a8a;
  flex-shrink: 0;
}

.flow-arrow {
  color: var(--muted);
  font-weight: 700;
  flex-shrink: 0;
}

.flow-routing .flow-step {
  background: var(--routing-soft);
  color: #065f46;
  border-radius: 8px;
  font-weight: 600;
}

.db-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}

.db-node {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  text-align: center;
  min-width: 220px;
}

.db-arrow {
  font-size: 1.2rem;
  color: var(--muted);
}

.db-branch {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
}

.db-child {
  background: #f8fafc;
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 10px;
  max-width: 260px;
}

.db-child strong {
  display: block;
  margin-bottom: 0.25rem;
}

.db-subtext {
  font-size: 0.85rem;
  color: var(--muted);
}

.flow-vertical {
  flex-direction: column;
  align-items: center;
  margin-top: 1.5rem;
}

.flow-split {
  display: flex;
  gap: 2rem;
  justify-content: center;
  text-align: left;
}

.flow-split > div {
  background: #f5f7fa;
  border-radius: 8px;
  padding: 1rem;
  max-width: 260px;
}

.flow-subtext {
  font-size: 0.85rem;
  margin-top: 0.25rem;
  color: #555;
}

.section-footnote {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: #555;
}

.wrap {
  width: min(var(--wrap), calc(100% - 2rem));
  margin: 0 auto;
}

.narrow {
  width: min(var(--narrow), 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(219, 226, 234, 0.8);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}

.brand {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero {
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 32%),
    linear-gradient(180deg, #0b1020 0%, #131a2e 100%);
  color: var(--text-on-dark);
  padding: 5.5rem 0 4rem;
}

.hero-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.4fr 0.9fr;
  align-items: start;
}

.eyebrow,
.section-label {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero .eyebrow {
  color: #93c5fd;
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 1.04;
}

.hero-lead {
  max-width: 60ch;
  margin: 1.25rem 0 0;
  font-size: 1.16rem;
  color: var(--text-on-dark);
}

.hero-sub {
  max-width: 60ch;
  margin: 1rem 0 0;
  color: var(--muted-on-dark);
}

.hero-actions,
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.22);
}

.button-secondary {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.section .button-secondary {
  border-color: var(--border);
}

.hero-card,
.card {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 1.35rem;
}

.hero-card h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.stat-list,
.feature-list {
  margin: 0;
  padding-left: 1.15rem;
}

.stat-list li,
.feature-list li {
  margin-bottom: 0.7rem;
}

.section {
  padding: 5rem 0;
}

.section-alt {
  background: var(--panel-soft);
}

.section h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.1;
}

.section p {
  color: var(--muted);
  font-size: 1.04rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.text-link {
  color: var(--accent);
  font-weight: 600;
}

.project-grid,
.decision-grid,
.skills-grid {
  display: grid;
  gap: 1.25rem;
}

.project-grid {
  grid-template-columns: 1.2fr 0.95fr;
  margin-bottom: 0;
}

.decision-grid,
.skills-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card {
  padding: 1.4rem;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.8rem;
  font-size: 1.12rem;
}

.card p:last-child,
.timeline-item p:last-child {
  margin-bottom: 0;
}

.compact li {
  margin-bottom: 0.55rem;
}

.architecture {
  margin-bottom: 0;
}

#platform .wrap > * + * {
  margin-top: 1.25rem;
}

.timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  padding: 1.2rem 0;
  border-top: 1px solid var(--border);
}

.timeline-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline-item h3 {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
}

.contact-note {
  margin-top: 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero-grid,
  .project-grid,
  .decision-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .nav {
    align-items: start;
    flex-direction: column;
    padding: 0.9rem 0;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .hero {
    padding-top: 4.5rem;
  }

  .hero h1 {
    max-width: none;
  }

  .nav-links {
    gap: 0.9rem;
    font-size: 0.92rem;
  }

  .flow {
    flex-direction: column;
    align-items: stretch;
  }

  .flow-arrow {
    display: none;
  }

  .db-branch {
    flex-direction: column;
    gap: 1rem;
  }
}