:root {
  color-scheme: light dark;
  font-family: 'Inter', sans-serif;
  background: #f8fafc;
  color: #0f172a;
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #38bdf8;
}

html.dark {
  background: #0f172a;
  color: #e2e8f0;
  --background: #0f172a;
  --surface: #111827;
  --surface-strong: #1f2937;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #60a5fa;
  --primary-dark: #3b82f6;
  --accent: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  line-height: 1.6;
}

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

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

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(248, 250, 252, 0.86);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

html.dark .site-header {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(51, 65, 85, 0.8);
}

.site-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.brand-dot {
  color: var(--primary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.site-nav a {
  color: var(--text);
  transition: color 0.2s ease;
}

.site-nav a:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-button {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

html.dark .icon-button {
  background: var(--surface-strong);
  border-color: rgba(100, 116, 139, 0.35);
}

.mobile-menu-button {
  display: none;
}

.mobile-menu {
  display: none;
}

.hidden {
  display: none !important;
}

.hero-section {
  min-height: calc(100vh - 5.2rem);
  padding: 4rem 1.5rem 2.5rem;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.18), transparent 32%), radial-gradient(circle at 25% 20%, rgba(56, 189, 248, 0.16), transparent 18%);
}

.content-wrap {
  max-width: 1200px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  justify-items: center;
}

.hero-copy {
  text-align: center;
}

.hero-copy h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 4vw, 4.4rem);
  line-height: 1.05;
  white-space: normal;
}

@media (min-width: 1024px) {
  .hero-copy h1 {
    white-space: nowrap;
  }
}

.hero-subtitle {
  margin: 0 0 1rem;
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--primary);
}

.hero-copy p {
  max-width: 42rem;
  margin: 0 0 1.75rem;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

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

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

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

.button-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

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

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.project-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.project-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.project-card-body h3 {
  margin: 0;
  font-size: 1.4rem;
}

.project-card-body p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.project-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-group span {
  display: inline-flex;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: var(--primary);
  font-size: 0.85rem;
}

.section {
  padding: 4rem 1.5rem;
}

.section-header {
  max-width: 900px;
  margin: 0 auto 2rem;
  text-align: center;
}

.section-header h2 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 3vw, 3rem);
}

.section-header p {
  margin: 0;
  color: var(--muted);
}

.about-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2rem;
  align-items: center;
}

.about-grid p {
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  overflow: hidden;
}

.contact-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.site-footer {
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--surface-strong);
}

.site-footer p {
  margin: 0 0 0.75rem;
}

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

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--background);
}

.error-shell {
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3rem 2rem;
  border-radius: 1.5rem;
  max-width: 30rem;
  margin: 1.5rem;
}

.error-shell h1 {
  margin: 0 0 1rem;
  font-size: 5rem;
}

.error-shell h2 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
}

.error-shell p {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .content-wrap,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .site-bar {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .site-nav {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
  }
}

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

  .hero-section {
    padding-top: 3rem;
  }

  .site-bar {
    padding: 1rem;
  }

  .section {
    padding: 3rem 1rem;
  }

  .hero-copy h1 {
    font-size: 2.6rem;
  }
}

@media (min-width: 981px) {
  .mobile-menu {
    display: none;
  }
}
