:root {
  --bg-light: #efe8f8;
  --bg-dark: #161126;
  --panel-light: #f7f2fc;
  --panel-dark: #251a3b;
  --heading-light: #2a1b3f;
  --heading-dark: #f1e9ff;
  --text-light: #4a3863;
  --text-dark: #c8bddc;
  --accent: #643294;
  --accent-bright: #9bcd6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-light);
  color: var(--text-light);
  min-height: 100vh;
  position: relative;
}

html.dark body {
  background: var(--bg-dark);
  color: var(--text-dark);
}

main,
.top-nav,
.site-footer {
  position: relative;
  z-index: 2;
}

.section-wrap,
.nav-inner,
.landing,
.about {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.top-nav {
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  padding: 1rem 0;
  z-index: 10;
}

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

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #000;
}

html.dark .logo-avatar {
  border-color: #000;
}

.logo-shape {
  width: 48px;
  height: 48px;
  border: 3px solid var(--heading-light);
  clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
}

html.dark .logo-shape {
  border-color: var(--accent-bright);
}

.desktop-nav {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.desktop-nav a,
.mobile-nav a {
  color: inherit;
  text-decoration: none;
  border-radius: 0.6rem;
  padding: 0.35rem 0.9rem;
  transition: 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  background: var(--accent);
  color: #fff;
}

html.dark .desktop-nav a:hover,
html.dark .mobile-nav a:hover {
  background: #7a47ad;
  color: #fff;
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.theme-switch {
  position: relative;
  width: 42px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  position: absolute;
}

.theme-switch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #c9b2e0;
  border: 2px solid #8b63b6;
}

.theme-switch span::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.theme-switch input:checked + span::after {
  transform: translateX(18px);
}

.menu-button {
  display: none;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 0.45rem;
  padding: 0.35rem 0.65rem;
}

.mobile-nav {
  display: none;
  width: min(1120px, 92%);
  margin: 0.8rem auto 0;
  background: rgba(42, 27, 63, 0.92);
  border-radius: 0.7rem;
  padding: 0.4rem;
}

.mobile-nav.open {
  display: grid;
}

.mobile-nav a {
  color: #fff;
}

.landing {
  min-height: 92vh;
  display: grid;
  place-items: center;
  padding: 3rem 0 2rem;
}

.terminal-card {
  width: min(900px, 100%);
  border-radius: 0.9rem;
  overflow: hidden;
  border: 1px solid rgba(100, 50, 148, 0.5);
  box-shadow: 0 24px 40px rgba(12, 7, 24, 0.35), 0 0 0 1px rgba(155, 205, 107, 0.12) inset;
}

.terminal-head {
  background:
    linear-gradient(90deg, rgba(155, 205, 107, 0.22), transparent 42%),
    linear-gradient(180deg, #312047, #241637);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(155, 205, 107, 0.2);
}

html.dark .terminal-head {
  background:
    linear-gradient(90deg, rgba(155, 205, 107, 0.18), transparent 42%),
    linear-gradient(180deg, #221631, #140f24);
}

.hud-left {
  display: flex;
  align-items: center;
}

.hud-id {
  font-family: 'Cutive Mono', monospace;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  color: #c6e69f;
  text-transform: uppercase;
}

.hud-right {
  display: flex;
  gap: 0.5rem;
}

.hud-pill {
  font-family: 'Cutive Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #d8efbf;
  border: 1px solid rgba(155, 205, 107, 0.38);
  border-radius: 0.3rem;
  padding: 0.16rem 0.4rem;
  background: rgba(155, 205, 107, 0.08);
}

.terminal-body {
  background:
    linear-gradient(180deg, rgba(155, 205, 107, 0.06), transparent 35%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.015) 0 1px,
      transparent 1px 4px
    ),
    var(--panel-light);
  color: var(--heading-light);
  text-align: center;
  padding: 4.5rem 1.2rem;
}

html.dark .terminal-body {
  background:
    linear-gradient(180deg, rgba(155, 205, 107, 0.07), transparent 35%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.02) 0 1px,
      transparent 1px 4px
    ),
    #1b132b;
  color: var(--heading-dark);
}

.kicker {
  font-family: 'Cutive Mono', monospace;
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  color: var(--accent);
}

html.dark .kicker {
  color: var(--accent-bright);
}

.terminal-body h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  font-weight: 700;
}

.subtitle {
  margin: 1.3rem 0 2rem;
  font-size: clamp(1rem, 3vw, 1.6rem);
  letter-spacing: 0.01em;
}

.cta {
  display: inline-block;
  background: linear-gradient(180deg, #7b43b3, #5f2f93);
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(155, 205, 107, 0.35);
  border-radius: 0.35rem;
  padding: 0.75rem 1.4rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.cta:hover {
  background: linear-gradient(180deg, #8f54cb, #7040a8);
}

@media (max-width: 700px) {
  .hud-id {
    font-size: 0.7rem;
  }

  .hud-pill {
    font-size: 0.62rem;
    padding: 0.14rem 0.3rem;
  }

  .hud-right {
    display: none;
  }
}

.panel {
  background: var(--panel-light);
  border-radius: 1.3rem;
  padding: 3rem;
}

html.dark .panel {
  background: #3a2458;
  color: #fff;
}

.about {
  display: grid;
  grid-template-columns: 1.5fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.about h2,
.section-wrap h2 {
  margin-top: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--heading-light);
}

html.dark .about h2,
html.dark .section-wrap h2 {
  color: #fff;
}

.about p {
  font-size: 1.15rem;
  line-height: 1.6;
}

.about img {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 1;
  border-radius: 50%;
  object-fit: cover;
  justify-self: center;
}

.section-wrap {
  padding: 5rem 0 1rem;
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}

.skill-pill {
  background: #ede3f7;
  border-radius: 1rem;
  padding: 1rem;
  text-align: center;
  font-weight: 700;
}

html.dark .skill-pill {
  background: #2d2043;
}

.section-intro {
  margin-top: -0.5rem;
  font-size: 1.1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.3rem;
}

.project-card {
  border-radius: 1rem;
  overflow: hidden;
  background: var(--panel-light);
}

html.dark .project-card {
  background: #30204a;
}

.project-media {
  position: relative;
  height: 190px;
  overflow: hidden;
  background:
    linear-gradient(130deg, rgba(100, 50, 148, 0.78), rgba(155, 205, 107, 0.58)),
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.4), transparent 60%);
}

.project-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 17, 38, 0.42), rgba(22, 17, 38, 0.05));
  pointer-events: none;
}

.project-media img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  filter: blur(8px) saturate(0.92);
  transform: scale(1.03);
  transition: filter 0.35s ease, transform 0.35s ease;
}

.project-card:hover .project-media img,
.project-card:focus-within .project-media img {
  filter: blur(0) saturate(1);
  transform: scale(1);
}

.project-content {
  padding: 1rem 1.1rem 1.3rem;
}

.tags {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.project-content h3 {
  margin: 0.5rem 0;
  font-size: 1.7rem;
  color: var(--heading-light);
}

html.dark .project-content h3 {
  color: #fff;
}

.project-content a {
  color: var(--accent);
  font-weight: 700;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 4rem;
}

.site-footer {
  width: min(1120px, 92%);
  margin: 0 auto;
  padding: 1rem 0 3rem;
  font-size: 0.95rem;
}

.brand {
  font-weight: 800;
  color: var(--heading-light);
}

html.dark .brand {
  color: #fff;
}

.site-footer .dot {
  color: var(--accent);
}

.dot-field {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0.16;
  background: var(--accent);
  animation: drift linear infinite;
}

html.dark .dot {
  background: var(--accent-bright);
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(120px, -220px, 0);
  }
}

@media (max-width: 900px) {
  .desktop-nav {
    display: none;
  }

  .menu-button {
    display: inline-block;
  }

  .about {
    grid-template-columns: 1fr;
    padding: 2rem;
  }

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