:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --text: #0b0f1a;
  --muted: #4b5565;
  --muted-2: #6b7280;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);

  --primary: #0f172a;
  --primary-soft: rgba(15, 23, 42, 0.08);
  --accent: #1d4ed8;
  --accent-soft: rgba(29, 78, 216, 0.12);

  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

a {
  color: inherit;
  text-decoration-color: rgba(29, 78, 216, 0.35);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: rgba(29, 78, 216, 0.7);
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.hero {
  background:
    radial-gradient(1000px 700px at 12% -10%, rgba(29, 78, 216, 0.16) 0, rgba(29, 78, 216, 0) 55%),
    radial-gradient(900px 700px at 90% 10%, rgba(15, 23, 42, 0.14) 0, rgba(15, 23, 42, 0) 55%),
    var(--bg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2.75rem;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 0;
  backdrop-filter: saturate(180%) blur(10px);
  background: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.logo {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: -0.2px;
}

.logo-text {
  color: var(--primary);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.65);
  padding: 0.55rem 0.6rem;
  box-shadow: 0 6px 16px rgba(2, 6, 23, 0.06);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(15, 23, 42, 0.85);
  border-radius: 2px;
}

.nav-toggle span + span {
  margin-top: 4px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: rgba(15, 23, 42, 0.75);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
}

.nav-links a:hover {
  background: var(--primary-soft);
}

.hero-content {
  padding: 3.1rem 0 0.8rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: center;
  gap: 2rem;
}

.hero-copy {
  min-width: 0;
}

.hero-photo {
  justify-self: end;
  width: min(360px, 42vw);
  aspect-ratio: 4 / 5;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.12);
  overflow: hidden;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 22%;
}

.eyebrow {
  color: rgba(29, 78, 216, 0.95);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  margin: 0 0 0.8rem;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.15rem, 4.2vw, 3.3rem);
  max-width: 22ch;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem);
  max-width: 40ch;
}

h3 {
  font-size: 1.05rem;
}

.subtitle {
  color: var(--muted);
  max-width: 70ch;
  font-size: 1.05rem;
  line-height: 1.7;
}

.lead {
  color: var(--muted);
  max-width: 80ch;
  line-height: 1.7;
}

.cta-group,
.contact-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.75rem 1.05rem;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.16);
}

.btn-primary:hover {
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.2);
}

.btn-secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: rgba(15, 23, 42, 0.8);
}

.hero-metrics {
  margin-top: 1.65rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

.metric {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  padding: 0.9rem 0.95rem;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.06);
}

.metric-value {
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
  color: rgba(15, 23, 42, 0.95);
}

.metric-label {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted-2);
  line-height: 1.35;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-heading {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 1.15rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.expertise-card,
.callout,
.stack-card,
.panel,
.contact-card,
.project-card,
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.05);
}

.expertise-card,
.callout,
.stack-card,
.panel {
  padding: 1.05rem 1.05rem;
}

.bullets {
  margin: 0.75rem 0 0;
  padding-left: 1.05rem;
  color: rgba(15, 23, 42, 0.78);
  line-height: 1.65;
}

.bullets li + li {
  margin-top: 0.35rem;
}

.bullets-lg li + li {
  margin-top: 0.55rem;
}

.project-grid {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.project-card {
  padding: 1.05rem 1.05rem;
}

.project-topline {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: flex-start;
}

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.7);
  white-space: nowrap;
}

.project-desc {
  margin: 0;
  color: rgba(15, 23, 42, 0.74);
  line-height: 1.6;
}

.project-details {
  margin-top: 0.75rem;
}

.project-details summary {
  cursor: pointer;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.88);
  list-style: none;
}

.project-details summary::-webkit-details-marker {
  display: none;
}

.project-details summary::after {
  content: 'Expand';
  margin-left: 0.65rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(29, 78, 216, 0.95);
}

.project-details[open] summary::after {
  content: 'Collapse';
}

.project-meta {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.project-meta h4 {
  margin: 0 0 0.3rem;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}

.project-meta ul {
  margin: 0;
  padding-left: 1.05rem;
  line-height: 1.6;
  color: rgba(15, 23, 42, 0.75);
}

.project-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.project-metrics .chip {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.72);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.85rem;
}

.stat {
  padding: 1rem 0.95rem;
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.85));
}

.stat-value {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.stat-label {
  margin-top: 0.3rem;
  color: var(--muted-2);
  line-height: 1.4;
  font-size: 0.9rem;
}

.stack-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.stack-items {
  margin: 0;
  color: rgba(15, 23, 42, 0.72);
  line-height: 1.7;
}

.research-grid {
  margin-top: 1.35rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.research-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.05);
  padding: 1.05rem 1.05rem;
  display: grid;
  gap: 0.75rem;
}

.research-topline {
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  align-items: flex-start;
}

.research-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.72);
  text-decoration: none;
}

.chip-link:hover {
  background: rgba(29, 78, 216, 0.08);
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.panel .lead {
  margin: 0.25rem 0 0;
}

.contact-card {
  padding: 1.2rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.92));
}

.contact-lines .lead {
  margin: 0.1rem 0;
}

footer {
  border-top: 1px solid var(--border);
  padding: 1.2rem 0;
  background: #fff;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(15, 23, 42, 0.72);
}

@media (max-width: 980px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .hero-photo {
    justify-self: start;
    width: min(340px, 70vw);
  }

  .hero-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stack-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 0;
  }

  .nav-links {
    display: none;
    position: absolute;
    right: 4vw;
    top: 58px;
    width: min(340px, 92vw);
    flex-direction: column;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.6rem;
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    padding: 0.65rem 0.75rem;
  }

  .two-col {
    grid-template-columns: 1fr;
  }

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

  .footer-content {
    flex-direction: column;
    align-items: flex-start;
  }
}
