:root {
  color-scheme: light dark;
  --bg: #fbfbfd;
  --bg-elevated: #ffffff;
  --bg-dark: #000000;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.12);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --gradient: linear-gradient(135deg, #6e7bff 0%, #5ac8fa 42%, #bf5af2 100%);
  --shadow-sm: 0 2px 16px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --radius-lg: 28px;
  --max: 1080px;
  --nav-height: 52px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-elevated: #161617;
    --text: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #86868b;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.14);
    --shadow-sm: 0 2px 16px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 80px rgba(0, 0, 0, 0.55);
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

/* Nav */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.site-nav .wrap {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Hero */
.hero {
  padding: 72px 0 88px;
  text-align: center;
}

.hero-mark {
  width: 88px;
  height: 88px;
  margin: 0 auto 28px;
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.hero .gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  max-width: 38rem;
  margin: 20px auto 0;
  font-size: clamp(19px, 2.5vw, 24px);
  line-height: 1.381;
  font-weight: 400;
  letter-spacing: 0.011em;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 12px 22px;
  border-radius: 980px;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.022em;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  text-decoration: none;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: var(--accent-hover);
}

.button-secondary {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.button-secondary:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Projects */
.section {
  padding: 88px 0;
}

.section-dark {
  background: var(--bg-dark);
  color: #f5f5f7;
}

.section-dark .eyebrow,
.section-dark .section-lead,
.section-dark .project-card p,
.section-dark .nav-links a {
  color: #a1a1a6;
}

.section-dark .project-card {
  background: #161617;
  border-color: rgba(255, 255, 255, 0.1);
}

.section-dark .project-card h3,
.section-dark a {
  color: #f5f5f7;
}

.section-dark .button-secondary {
  color: #2997ff;
  box-shadow: inset 0 0 0 1px #2997ff;
}

.section-heading {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 56px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08349;
}

.section-lead {
  margin: 16px 0 0;
  font-size: 19px;
  line-height: 1.4211;
  color: var(--text-secondary);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.project-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin-bottom: 20px;
  object-fit: cover;
}

.project-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding: 48px;
}

.project-card.featured .project-visual {
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, #2b1810, #cc6600 120%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.project-card.featured .project-visual.connect {
  background: linear-gradient(145deg, #0d1117, #1c2541 55%, #5ac8fa 140%);
}

.project-card.featured .project-visual.names {
  background: linear-gradient(145deg, #0a0a0c, #1a1030 50%, #bf5af2 130%);
}

.project-card h3 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.project-card .tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.section-dark .tag {
  background: rgba(41, 151, 255, 0.15);
  color: #2997ff;
}

.project-card p {
  margin: 12px 0 0;
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.47059;
  flex: 1;
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 24px;
  font-size: 15px;
  font-weight: 500;
}

.project-links a {
  text-decoration: none;
}

.project-links a:hover {
  text-decoration: underline;
}

/* Pill row */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;
}

.pill {
  padding: 8px 14px;
  border-radius: 980px;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--line);
}

.section-dark .pill {
  background: #1d1d1f;
  border-color: rgba(255, 255, 255, 0.12);
  color: #a1a1a6;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-grid ul {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
}

.about-grid li {
  margin-bottom: 10px;
}

/* Footer */
.site-footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-tertiary);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.site-footer a {
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

/* Subpages */
.page-hero {
  padding: 48px 0 64px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin: 12px 0 0;
  font-size: clamp(40px, 6vw, 56px);
  letter-spacing: -0.03em;
}

.subpage-content {
  padding: 64px 0 96px;
}

.subpage-content .wrap {
  max-width: 720px;
}

.subpage-content h2 {
  margin: 48px 0 16px;
  font-size: 28px;
  letter-spacing: -0.02em;
}

.subpage-content h2:first-child {
  margin-top: 0;
}

.subpage-content p,
.subpage-content li {
  color: var(--text-secondary);
}

.steps {
  padding-left: 1.25rem;
}

.steps li {
  margin-bottom: 12px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.15em 0.4em;
  border-radius: 6px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

@media (max-width: 900px) {
  .project-card.featured {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .wrap {
    width: min(var(--max), calc(100% - 32px));
  }

  .hero {
    padding-top: 48px;
  }
}
