:root {
  --bg: #070b14;
  --surface: #0e1525;
  --surface-hover: #131d32;
  --border: rgba(148, 179, 224, 0.16);
  --border-strong: rgba(148, 179, 224, 0.28);
  --text: #edf2fb;
  --text-muted: #98aac8;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-ink: #041320;

  /* 3-size body hierarchy (hero H1 & brand wordmark exempt) */
  --text-heading: 1.5rem;
  --text-body: 1rem;
  --text-sm: 0.875rem;

  --font-display: 'Sora', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Noto Sans SC', 'Sora', -apple-system, BlinkMacSystemFont, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --container: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: 68px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background-color 220ms var(--ease-out), border-color 220ms var(--ease-out), backdrop-filter 220ms var(--ease-out);
}

.site-header.is-scrolled {
  background: rgba(7, 11, 20, 0.84);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

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

.site-nav a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  transition: color 180ms var(--ease-out);
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

/* Full-bleed interactive globe hero */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: flex-end;
  padding: 120px 0 88px;
  overflow: hidden;
  background: radial-gradient(circle at 68% 36%, rgba(30, 64, 124, 0.36) 0%, rgba(7, 11, 20, 0.96) 64%);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.hero-canvas:active {
  cursor: grabbing;
}

.hero-veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(7, 11, 20, 0.38) 0%, rgba(7, 11, 20, 0.08) 38%, rgba(7, 11, 20, 0.88) 88%, #070b14 100%),
    linear-gradient(90deg, rgba(7, 11, 20, 0.72) 0%, rgba(7, 11, 20, 0.28) 54%, rgba(7, 11, 20, 0.04) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.hero-title {
  margin: 0 0 22px;
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(2.85rem, 6.2vw, 5.5rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--text);
}

.nowrap {
  white-space: nowrap;
}

.hero-summary {
  margin: 0 0 32px;
  max-width: 46ch;
  font-size: var(--text-body);
  color: var(--text-muted);
}

.hero-action {
  pointer-events: auto;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 24px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  transition: color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.text-link:hover,
.text-link:focus-visible {
  color: var(--accent-hover);
  transform: translateX(3px);
}

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

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-desc {
  margin: 0;
  max-width: 58ch;
  font-size: var(--text-body);
  color: var(--text-muted);
}

/* Connected segmented control */
.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.seg-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 180ms var(--ease-out), color 180ms var(--ease-out);
}

.seg-item:hover {
  color: var(--text);
}

.seg-item.is-active {
  background: rgba(56, 189, 248, 0.16);
  color: var(--accent-hover);
}

/* Systems gallery */
.systems-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.project-entry {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 200ms var(--ease-out), background-color 200ms var(--ease-out), transform 200ms var(--ease-out);
}

.project-entry:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.project-entry.is-hidden {
  display: none;
}

.project-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: stretch;
}

.project-visual-link {
  display: block;
  position: relative;
  background: #060a12;
  overflow: hidden;
}

.project-canvas {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform 320ms var(--ease-out);
}

.project-featured .project-canvas {
  min-height: 320px;
  aspect-ratio: auto;
}

.project-entry:hover .project-canvas {
  transform: scale(1.02);
}

.project-body {
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.project-meta {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
}

.project-body h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-heading);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.project-body p:not(.project-meta) {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-muted);
  max-width: 58ch;
}

.project-footer {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-top: 8px;
  flex-wrap: wrap;
}

/* Capabilities: crisp 1px hairlines, zero nested boxes */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.cap-item {
  padding: 32px 32px 32px 0;
  border-bottom: 1px solid var(--border);
}

.cap-item:nth-child(2n) {
  padding-left: 36px;
  padding-right: 0;
  border-left: 1px solid var(--border);
}

.cap-item h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--text);
}

.cap-item p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--text-muted);
  max-width: 54ch;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 44px 0 56px;
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.footer-note {
  margin: 8px 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color 180ms var(--ease-out);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--accent-hover);
}

@media (max-width: 900px) {
  .project-featured {
    grid-template-columns: 1fr;
  }
  .project-featured .project-canvas {
    min-height: 220px;
    aspect-ratio: 16 / 9;
  }
  .systems-grid {
    grid-template-columns: 1fr;
  }
  .cap-grid {
    grid-template-columns: 1fr;
  }
  .cap-item,
  .cap-item:nth-child(2n) {
    padding: 26px 0;
    border-left: none;
  }
}

@media (max-width: 600px) {
  .container {
    padding: 0 20px;
  }
  .hero {
    padding: 104px 0 64px;
  }
  .section {
    padding: 68px 0;
  }
  .site-nav {
    gap: 18px;
  }
  .project-body {
    padding: 22px 20px;
  }
  .segmented {
    width: 100%;
    overflow-x: auto;
  }
  .seg-item {
    flex: 1;
    white-space: nowrap;
    padding: 8px 12px;
  }
}

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