:root {
  --bg: #0b0d10;
  --surface: #11151a;
  --surface-2: #161b21;
  --text: #f2f4f6;
  --body: #c9d0d6;
  --muted: #9aa4ae;
  --line: #252b32;
  --accent: #d7ff5f;
  --max: 1120px;
  --measure: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}
.skip-link {
  position: absolute; left: 12px; top: -56px; z-index: 10;
  background: var(--accent); color: #0b0d10; padding: 10px 14px; border-radius: 8px; font-weight: 750;
}
.skip-link:focus { top: 12px; }
.wrap { width: min(calc(100% - 40px), var(--max)); margin: 0 auto; }

/* Header */
.topbar { border-bottom: 1px solid var(--line); }
.topbar-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; }
.topbar nav { display: flex; gap: 24px; }
.wordmark {
  display: grid; place-items: center; width: 42px; height: 42px;
  border: 1px solid var(--line); border-radius: 10px; font-weight: 800; letter-spacing: -.04em;
}
.nav-link { color: var(--muted); font-weight: 650; }
.nav-link[aria-current="page"] { color: var(--text); }
.nav-link:hover, .text-link:hover, .footer a:hover, .card-links a:hover, .crumb a:hover, .case-links a:hover, .end-link a:hover { color: var(--accent); }

/* Home hero */
.hero { min-height: auto; display: grid; grid-template-columns: 1.5fr .75fr; gap: 80px; align-items: center; padding: 80px 0 40px; }
.kicker { margin: 0 0 16px; color: var(--accent); font-size: .92rem; font-weight: 700; letter-spacing: .01em; }
h1, h2, h3, p { margin-top: 0; }
.hero h1 { font-size: clamp(2.8rem, 6vw, 5rem); line-height: .9; letter-spacing: -.075em; margin-bottom: 24px; }
.headline { font-size: clamp(1.5rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -.035em; max-width: 720px; }
.intro { max-width: 640px; color: var(--muted); font-size: 1.06rem; }
.socials { display: flex; gap: 10px; margin-top: 30px; }
.icon-link { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); transition: .18s ease; }
.icon-link:hover { color: var(--text); border-color: #48505a; transform: translateY(-2px); }
.icon-link svg { width: 20px; height: 20px; fill: currentColor; }
.hero-side { align-self: end; padding-bottom: 10px; }
.hero-line { width: 64px; height: 2px; background: var(--accent); margin-bottom: 24px; }
.hero-side p { color: var(--muted); margin-bottom: 10px; font-size: .9rem; font-weight: 650; }
.hero-side ul { list-style: none; margin: 0; padding: 0; color: var(--text); }
.hero-side li { padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Project cards */
.projects-preview { padding: 0 0 80px; }
.section-top { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 30px; }
.section-top h2 { font-size: clamp(2.2rem, 4vw, 3.5rem); letter-spacing: -.055em; margin: 0; }
.text-link { color: var(--muted); font-weight: 700; }
.preview-grid, .cards-grid { display: grid; gap: 18px; }
.preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-bottom: 120px; }
.preview-card, .project-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; min-height: 310px; display: flex; flex-direction: column; }
.preview-card.featured { background: linear-gradient(135deg, #11151a 0%, #151b1f 100%); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.status { color: var(--accent); font-size: .82rem; font-weight: 700; }
.card-category { color: var(--muted); font-size: .86rem; font-weight: 650; margin: 28px 0 8px; }
.preview-card h3, .project-card h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.1; letter-spacing: -.04em; margin-bottom: 14px; }
.card-description { color: var(--muted); max-width: 720px; }
.tech-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 22px; }
.tech-row span { border: 1px solid var(--line); color: #cbd1d7; border-radius: 999px; padding: 6px 10px; font-size: .78rem; }
.card-links { display: flex; flex-wrap: wrap; gap: 8px 22px; padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); font-weight: 750; font-size: .9rem; }

/* Projects page */
.projects-page { padding-top: 90px; }
.projects-hero { padding-bottom: 52px; max-width: 850px; }
.projects-hero h1 { font-size: clamp(3.2rem, 7vw, 6rem); letter-spacing: -.07em; line-height: .95; margin-bottom: 18px; }
.projects-hero p:last-child { color: var(--muted); font-size: 1.12rem; max-width: 660px; }

/* Case study page */
.case { padding-top: 72px; padding-bottom: 120px; }
.case-inner { max-width: var(--measure); }
.crumb { margin-bottom: 28px; color: var(--muted); font-size: .92rem; }
.case h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); line-height: 1; letter-spacing: -.06em; margin-bottom: 20px; }
.lead { font-size: clamp(1.15rem, 2.2vw, 1.4rem); line-height: 1.45; letter-spacing: -.02em; margin-bottom: 26px; }
.case-links { display: flex; flex-wrap: wrap; gap: 8px 22px; font-weight: 750; font-size: .95rem; margin-bottom: 18px; }
.tech-row.static { margin-top: 0; padding-top: 0; }
.case h2 { font-size: 1.55rem; line-height: 1.2; letter-spacing: -.035em; margin: 60px 0 14px; }
.case p, .case li { color: var(--body); }
.case ul, .case ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.case li { margin-bottom: .6rem; }
.case strong { color: var(--text); }
.table-wrap { overflow-x: auto; margin: 18px 0 14px; border: 1px solid var(--line); border-radius: 12px; }
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .95rem; }
.table-wrap caption { text-align: left; padding: 14px 16px; color: var(--muted); font-size: .86rem; caption-side: top; }
.table-wrap th, .table-wrap td { padding: 12px 16px; text-align: left; border-top: 1px solid var(--line); font-weight: 400; color: var(--body); }
.table-wrap thead th { color: var(--muted); font-weight: 650; font-size: .86rem; }
.table-wrap tbody th { color: var(--text); font-weight: 600; }
.table-wrap .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap .best { color: var(--accent); font-weight: 800; }
.note { border-left: 2px solid var(--accent); padding: 2px 0 2px 16px; margin: 22px 0; }
.end-link { margin-top: 48px; font-weight: 750; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; color: var(--muted); font-size: .88rem; }
.footer-links { display: flex; gap: 22px; }

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; gap: 48px; min-height: auto; padding: 64px 0 56px; }
  .hero-side { max-width: 600px; }
  .preview-grid, .cards-grid { grid-template-columns: 1fr; }
  .section-top { align-items: start; flex-direction: column; }
  .projects-page { padding-top: 70px; }
  .case { padding-top: 56px; }
}
@media (max-width: 520px) {
  .wrap { width: min(calc(100% - 28px), var(--max)); }
  .topbar-inner { height: 68px; }
  .hero h1 { font-size: 3.7rem; }
  .preview-card, .project-card { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .icon-link:hover { transform: none; }
}