:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --text: #142033;
  --muted: #536277;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --shadow: 0 24px 64px rgba(15, 23, 42, 0.12);
  --tag-bg: rgba(37, 99, 235, 0.12);
  --hero-glow: radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), transparent 42%);
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08111f;
  --surface: rgba(10, 18, 32, 0.82);
  --surface-strong: #0f1b30;
  --border: rgba(148, 163, 184, 0.14);
  --text: #e2e8f0;
  --muted: #9fb0c5;
  --primary: #60a5fa;
  --primary-strong: #93c5fd;
  --shadow: 0 24px 64px rgba(2, 6, 23, 0.5);
  --tag-bg: rgba(96, 165, 250, 0.14);
  --hero-glow: radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 42%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, 0.06), transparent 22%),
    var(--bg);
  color: var(--text);
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

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

button {
  font: inherit;
  cursor: pointer;
}

.page-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.toggle-button,
.primary-button,
.secondary-button,
.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.toggle-button,
.project-link {
  padding: 10px 16px;
  background: var(--surface);
  color: var(--text);
  backdrop-filter: blur(14px);
}

.toggle-button:hover,
.primary-button:hover,
.secondary-button:hover,
.project-link:hover {
  transform: translateY(-1px);
}

.hero-card,
.content-card,
.project-card,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.95fr) minmax(190px, 0.42fr);
  gap: 16px;
  padding: 32px;
  border-radius: 28px;
  isolation: isolate;
  align-items: start;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  z-index: -1;
  border-radius: inherit;
}

.eyebrow,
.section-kicker,
.project-badge {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
}

.hero-copy h1,
.section-heading h2,
.project-title {
  margin: 0;
  line-height: 1.05;
}

.name-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-copy h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
}

.name-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
  flex: 0 0 auto;
}

.hero-title {
  margin: 16px 0 10px;
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
}

.hero-description,
.section-description,
#profile-summary,
.project-description,
.feature-list {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-tags,
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags {
  margin: 22px 0 26px;
}

.tag {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--tag-bg);
  color: var(--primary-strong);
  font-size: 0.92rem;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-wrap {
  position: relative;
}

.contact-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  z-index: 50;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.contact-wrap.is-open .contact-popover {
  opacity: 1;
  transform: translateY(0);
}

.primary-button,
.secondary-button {
  padding: 12px 18px;
  font-weight: 700;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
}

.secondary-button {
  background: transparent;
  color: var(--text);
}

.profile-panel {
  display: grid;
  gap: 12px;
  width: min(100%, 200px);
  justify-self: end;
}

.metric-card {
  border-radius: 22px;
  padding: 14px 16px;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}

.metric-value {
  font-size: 1.05rem;
  line-height: 1.35;
}

.section-block {
  margin-top: 32px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.about-grid,
.projects-grid {
  display: grid;
  gap: 18px;
}

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

.content-card,
.project-card {
  border-radius: 24px;
  padding: 24px;
}

.content-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

.feature-list {
  padding-left: 18px;
}

.feature-list li + li {
  margin-top: 8px;
}

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

.project-card {
  display: grid;
  gap: 16px;
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-title {
  font-size: 1.5rem;
}

.project-embed-shell {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 360px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.2), transparent),
    var(--surface-strong);
  border: 1px solid var(--border);
}

.project-embed {
  width: 100%;
  min-height: 360px;
  border: 0;
  background: var(--surface-strong);
}

.embed-fallback {
  position: absolute;
  inset: auto 18px 18px 18px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  display: grid;
  gap: 12px;
}

.embed-fallback-title {
  margin: 0;
  line-height: 1.5;
}

.embed-fallback-link {
  justify-self: start;
  color: #f8fafc;
  border-color: rgba(248, 250, 252, 0.2);
}

@media (max-width: 960px) {
  .hero-card,
  .about-grid,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .project-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 18px;
  }

  .hero-card,
  .content-card,
  .project-card {
    padding: 20px;
    border-radius: 22px;
  }

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

  .topbar-actions,
  .hero-actions {
    width: 100%;
  }

  .toggle-button,
  .primary-button,
  .secondary-button,
  .project-link {
    width: 100%;
  }

  .contact-wrap {
    width: 100%;
  }

  .contact-popover {
    left: 0;
    right: 0;
    min-width: 0;
    white-space: normal;
  }

  .name-row {
    gap: 10px;
  }

  .name-avatar {
    width: 52px;
    height: 52px;
  }
}
