:root {
  --bg: #f4f4f0;
  --bg-spot-a: rgba(182, 133, 86, 0.1);
  --bg-spot-b: rgba(13, 18, 34, 0.08);
  --surface: #fcfcfa;
  --surface-strong: #ffffff;
  --surface-alt: #f1f1ec;
  --ink: #12161f;
  --muted: #5a6170;
  --line: #dde1e8;
  --brand: #0d1222;
  --brand-soft: #1d2640;
  --accent: #b68556;
  --header-bg: rgba(244, 244, 240, 0.86);
  --header-bg-solid: rgba(244, 244, 240, 0.98);
  --section-muted: linear-gradient(180deg, transparent 0%, rgba(13, 18, 34, 0.03) 100%);
  --section-accent: linear-gradient(140deg, rgba(13, 18, 34, 0.98), rgba(29, 38, 64, 0.95));
  --section-accent-text: #f3f5fb;
  --btn-primary-bg: #0d1222;
  --btn-primary-bg-hover: #060b16;
  --btn-primary-text: #ffffff;
  --btn-primary-shadow: 0 8px 18px rgba(13, 18, 34, 0.22);
  --radius: 14px;
  --shadow: 0 14px 30px rgba(13, 18, 34, 0.08);
}

html[data-theme="dark"] {
  --bg: #090d19;
  --bg-spot-a: rgba(182, 133, 86, 0.14);
  --bg-spot-b: rgba(121, 147, 201, 0.12);
  --surface: #0f1526;
  --surface-strong: #171f34;
  --surface-alt: #10182b;
  --ink: #e9edf8;
  --muted: #a5b0c6;
  --line: #293650;
  --brand: #e9edf8;
  --brand-soft: #c3cee3;
  --accent: #d2a172;
  --header-bg: rgba(9, 13, 25, 0.86);
  --header-bg-solid: rgba(9, 13, 25, 0.98);
  --section-muted: linear-gradient(180deg, transparent 0%, rgba(121, 147, 201, 0.09) 100%);
  --section-accent: linear-gradient(140deg, #1b2440, #10182b);
  --section-accent-text: #eef2ff;
  --btn-primary-bg: #dbe4ff;
  --btn-primary-bg-hover: #c8d5ff;
  --btn-primary-text: #10182b;
  --btn-primary-shadow: 0 10px 20px rgba(0, 0, 0, 0.32);
  --shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 100% -10%, var(--bg-spot-a), transparent 35%),
    radial-gradient(circle at 0% 20%, var(--bg-spot-b), transparent 45%),
    var(--bg);
  line-height: 1.65;
}

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

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

.skip-link {
  position: absolute;
  left: 0;
  top: -100%;
  background: var(--brand);
  color: #fff;
  padding: 0.65rem 1rem;
  z-index: 999;
}

.skip-link:focus {
  top: 0;
}

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

.section {
  padding: 5.5rem 0;
}

.section-muted {
  background: var(--section-muted);
}

.section-accent {
  background: var(--section-accent);
  color: var(--section-accent-text);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
  background: var(--header-bg);
  border-bottom: 1px solid rgba(13, 18, 34, 0.07);
}

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

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-logo {
  width: 152px;
  height: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.97rem;
  font-weight: 600;
  transition: color 180ms ease;
}

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

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  width: 44px;
  height: 40px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  min-height: 40px;
  min-width: 92px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--brand);
  border-color: var(--brand-soft);
  transform: translateY(-1px);
}

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

.eyebrow {
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

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

h1 {
  font-size: clamp(2rem, 4.6vw, 3.7rem);
  max-width: 18ch;
}

h2 {
  font-size: clamp(1.55rem, 2.7vw, 2.4rem);
}

h3 {
  font-size: 1.2rem;
}

.hero-subtitle {
  color: var(--muted);
  max-width: 60ch;
  margin: 1.3rem 0 1.9rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.1rem;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

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

.btn-primary {
  color: var(--btn-primary-text);
  background: var(--btn-primary-bg);
  box-shadow: var(--btn-primary-shadow);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--btn-primary-bg-hover);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--brand);
  background: transparent;
}

.hero-panel {
  background: linear-gradient(155deg, var(--surface), var(--surface-strong));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  font-size: 1.12rem;
  margin-bottom: 0.7rem;
}

.hero-panel p {
  margin: 0;
  color: var(--muted);
}

.section-heading {
  margin-bottom: 1.7rem;
}

.cards-grid,
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 10px 20px rgba(13, 18, 34, 0.04);
}

.project-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: var(--surface-alt);
}

.card p,
.project-card p {
  color: var(--muted);
}

.card ul,
.project-outcomes {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink);
}

.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 800;
  color: var(--brand);
}

.stat-label {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.project-meta p {
  margin: 0 0 0.2rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.project-meta h3 {
  margin-bottom: 0.7rem;
}

.project-stack {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--brand-soft);
}

.project-link {
  margin-top: 0.8rem;
}

.contact-box {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: center;
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: flex-end;
}

.contact-actions .btn-ghost {
  border-color: rgba(255, 255, 255, 0.35);
  color: #e7ebf8;
}

.contact-meta {
  width: 100%;
  text-align: right;
  color: rgba(243, 245, 251, 0.75);
  margin: 0.2rem 0 0;
}

.site-footer {
  border-top: 1px solid rgba(13, 18, 34, 0.08);
  padding: 1.2rem 0 1.5rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.social-list {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-list a {
  color: var(--muted);
  font-weight: 600;
}

.social-list a:hover,
.social-list a:focus-visible {
  color: var(--brand);
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 460ms ease, transform 460ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .cards-grid,
  .projects-grid,
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-grid,
  .about-layout,
  .contact-box {
    grid-template-columns: 1fr;
    display: grid;
  }

  .contact-actions,
  .contact-meta {
    justify-content: flex-start;
    text-align: left;
  }
}

@media (max-width: 900px) {
  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 74px;
    left: 0;
    width: 100%;
    background: var(--header-bg-solid);
    border-bottom: 1px solid rgba(13, 18, 34, 0.08);
    transform: scaleY(0);
    transform-origin: top;
    opacity: 0;
    transition: transform 170ms ease, opacity 170ms ease;
  }

  .site-nav ul {
    padding: 0.9rem 4vw 1.1rem;
    flex-direction: column;
    gap: 0.7rem;
  }

  .site-nav.is-open {
    transform: scaleY(1);
    opacity: 1;
  }

  .theme-toggle {
    min-width: 86px;
  }
}

@media (max-width: 680px) {
  .section {
    padding: 4.4rem 0;
  }

  h1 {
    font-size: clamp(1.9rem, 8vw, 2.5rem);
  }

  .cards-grid,
  .projects-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

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