:root {
  --bg: #050816;
  --bg-elevated: #0b1020;
  --bg-soft: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --border-subtle: rgba(148, 163, 184, 0.3);
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.7);
  --shadow-subtle: 0 10px 30px rgba(15, 23, 42, 0.6);
  --transition-fast: 180ms ease-out;
  --transition-med: 220ms ease-out;
}

:root[data-theme="light"] {
  --bg: #f3f4f6;
  --bg-elevated: #ffffff;
  --bg-soft: #e5e7eb;
  --text: #020617;
  --muted: #4b5563;
  --accent: #0ea5e9;
  --accent-soft: rgba(14, 165, 233, 0.16);
  --border-subtle: rgba(148, 163, 184, 0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #1d2433 0, #020617 50%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

html[data-theme="light"],
html[data-theme="light"] body {
  background: radial-gradient(circle at top left, #e5e7eb 0, #ffffff 55%);
}

.site-header {
  position: relative;
  z-index: 40;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(2, 6, 23, 0.98),
    rgba(2, 6, 23, 0.9),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

html[data-theme="light"] .site-header {
  background: linear-gradient(
    to bottom,
    rgba(249, 250, 251, 0.98),
    rgba(249, 250, 251, 0.96),
    transparent
  );
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.nav {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.92rem;
  color: var(--muted);
}

.logo span {
  color: var(--accent);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.6rem;
  margin: 0 0 0 auto;
  padding: 0;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 0.35rem;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #38bdf8, #22c55e);
  border-radius: 2px;
  transition: width var(--transition-fast);
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  width: 100%;
}

.theme-toggle {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: radial-gradient(circle at 30% 0%, #1f2937 0, #020617 70%);
  color: #f9fafb;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.8),
    0 14px 40px rgba(15, 23, 42, 0.8);
  transition: background var(--transition-med), transform var(--transition-fast),
    box-shadow var(--transition-med), border-color var(--transition-fast);
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5),
    0 18px 45px rgba(15, 23, 42, 0.95);
}

html[data-theme="light"] .theme-toggle {
  background: radial-gradient(circle at 30% 0%, #e5e7eb 0, #ffffff 70%);
  color: #020617;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.5),
    0 14px 40px rgba(15, 23, 42, 0.2);
}

html[data-theme="light"] .theme-toggle:hover {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.4),
    0 18px 45px rgba(15, 23, 42, 0.25);
}

.theme-toggle span {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero {
  max-width: 1120px;
  margin: 1.8rem auto 0;
  padding: 1.2rem 1.2rem 2.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr);
  gap: 2.4rem;
  align-items: center;
}

.hero-text {
  padding-right: 1rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 0.8rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 3vw, 3rem);
  letter-spacing: 0.02em;
  margin: 0 0 0.8rem;
}

.tagline {
  color: var(--muted);
  max-width: 38rem;
  line-height: 1.7;
  margin-bottom: 1.6rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: transform var(--transition-fast),
    box-shadow var(--transition-med), background var(--transition-med),
    border-color var(--transition-fast), color var(--transition-fast);
}

.btn.primary {
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  color: #0b1120;
  box-shadow: var(--shadow-subtle);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(34, 197, 94, 0.55);
}

.btn.ghost {
  border-color: rgba(148, 163, 184, 0.6);
  color: var(--text);
  background: rgba(15, 23, 42, 0.7);
}

.btn.ghost:hover {
  border-color: var(--accent);
  background: rgba(15, 23, 42, 0.95);
}

.btn.full-width {
  width: 100%;
  justify-content: center;
}

.hero-media {
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring {
  position: relative;
  padding: 0.35rem;
  border-radius: 999px;
  background: conic-gradient(
    from 180deg at 50% 50%,
    #38bdf8,
    #22c55e,
    #a855f7,
    #38bdf8
  );
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.95);
}

.avatar-ring::before {
  content: "";
  position: absolute;
  inset: 18%;
  border-radius: inherit;
  filter: blur(26px);
  background: radial-gradient(circle at 30% 0%, #38bdf8 0, transparent 55%);
  opacity: 0.4;
  z-index: -1;
}

.avatar {
  display: block;
  width: min(290px, 80vw);
  height: auto;
  border-radius: 999px;
  border: 4px solid #020617;
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.2rem 3rem;
}

.section {
  margin-top: 2.9rem;
}

.section-header {
  margin-bottom: 1.8rem;
}

.section-header h2 {
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.4rem;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  max-width: 32rem;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.8rem;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85), #020617);
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.7rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
}

html[data-theme="light"] .about-grid {
  background: linear-gradient(135deg, #ffffff, #e5e7eb);
}

.about-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.chips-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
}

.chip-group {
  background: rgba(15, 23, 42, 0.85);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.2rem 1.1rem;
  border: 1px solid rgba(55, 65, 81, 0.85);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.9);
}

html[data-theme="light"] .chip-group {
  background: #ffffff;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.18);
}

.chip-group h3 {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.chip {
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(75, 85, 99, 0.85);
  color: var(--muted);
}

html[data-theme="light"] .chip {
  background: #f9fafb;
}

.experience .timeline {
  display: grid;
  gap: 1rem;
}

.timeline-item {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.8);
}

html[data-theme="light"] .timeline-item {
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}

.timeline-item h3 {
  margin: 0 0 0.1rem;
  font-size: 1.02rem;
}

.timeline-item .meta {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.project-filters {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.25rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(55, 65, 81, 0.9);
  margin-bottom: 1.5rem;
}

html[data-theme="light"] .project-filters {
  background: #f9fafb;
}

.filter-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.filter-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.project-card {
  position: relative;
  padding: 1.1rem 1.1rem 1rem;
  border-radius: 16px;
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.08), #020617);
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.9);
  overflow: hidden;
  transition: transform var(--transition-med), box-shadow var(--transition-med),
    border-color var(--transition-fast), background var(--transition-med),
    opacity var(--transition-fast), visibility var(--transition-fast);
}

html[data-theme="light"] .project-card {
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.08), #ffffff);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.project-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(
    circle at 0 0,
    rgba(56, 189, 248, 0.12),
    transparent 55%
  );
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-med);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 1);
}

.project-card:hover::before {
  opacity: 1;
}

.project-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(55, 65, 81, 0.9);
  color: var(--muted);
  margin-bottom: 0.7rem;
}

html[data-theme="light"] .project-pill {
  background: #f3f4f6;
}

.project-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #38bdf8, #22c55e);
}

.project-card h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.project-tech {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: #e5e7eb;
}

.project-card.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 1.6rem;
}

.contact-grid > div:first-child {
  background: rgba(15, 23, 42, 0.9);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: var(--shadow-subtle);
}

html[data-theme="light"] .contact-grid > div:first-child {
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.contact-grid h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.contact-grid p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.contact-list .label {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.contact-list a {
  color: var(--text);
  text-decoration: none;
}

.contact-list a:hover {
  color: var(--accent);
}

.contact-form {
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.04), #020617);
  border-radius: var(--radius-lg);
  padding: 1.3rem 1.4rem;
  border: 1px solid rgba(55, 65, 81, 0.9);
  box-shadow: var(--shadow-soft);
}

html[data-theme="light"] .contact-form {
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.06), #ffffff);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.form-row {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.form-row label {
  font-size: 0.82rem;
  color: var(--muted);
}

.form-row input,
.form-row textarea {
  border-radius: 0.75rem;
  border: 1px solid rgba(55, 65, 81, 0.95);
  padding: 0.55rem 0.7rem;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

html[data-theme="light"] .form-row input,
html[data-theme="light"] .form-row textarea {
  background: #f9fafb;
}

.form-row input:focus-visible,
.form-row textarea:focus-visible {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.7);
  background: rgba(15, 23, 42, 1);
}

.form-status {
  min-height: 1rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.form-status.success {
  color: #4ade80;
}

.form-status.error {
  color: #f97373;
}

.site-footer {
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  padding: 0.95rem 1.2rem 1.2rem;
  margin-top: 1.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
  }

  .hero-media {
    order: -1;
    justify-content: flex-start;
  }

  .hero-text {
    padding-right: 0;
  }

  .about-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .chips-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .hero {
    padding-inline: 1rem;
  }

  main {
    padding-inline: 1rem;
  }

  .about-grid,
  .chip-group,
  .timeline-item,
  .contact-grid > div:first-child,
  .contact-form {
    padding: 1.1rem 1.1rem;
  }

  .project-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

