:root {
  color-scheme: dark;
  --background: #07111f;
  --surface: #0d1b2d;
  --card: #0a1728;
  --text: #edf4ff;
  --muted: #a6b7ce;
  --accent: #36a2ff;
  --border: #1d3551;
  --header: rgba(7, 17, 31, 0.94);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 85px;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 72px;
  padding: 15px max(5%, calc((100% - 1100px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  background: var(--header);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.logo {
  font-size: 1.45rem;
  font-weight: 800;
  white-space: nowrap;
}

.logo:first-letter {
  color: var(--accent);
}

.logo span,
h1 span,
h2 span {
  color: var(--accent);
}

.navbar nav {
  display: flex;
  align-items: center;
  gap: 27px;
}

.navbar nav a {
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s;
}

.navbar nav a:hover,
.navbar nav a.active {
  color: var(--accent);
}

.theme-toggle,
.menu-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  cursor: pointer;
  padding: 7px 11px;
}

.menu-toggle {
  display: none;
}

.section {
  width: min(1100px, 90%);
  margin-inline: auto;
  padding-block: 85px;
}

.hero {
  min-height: 590px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 55px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.hero h1 {
  font-size: clamp(2.7rem, 6vw, 4.5rem);
  line-height: 1.15;
  letter-spacing: -2px;
  margin-bottom: 12px;
}

.hero h2 {
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  margin-bottom: 20px;
}

.hero-description,
.about-card p,
.project-card p,
.contact-layout p {
  color: var(--muted);
}

.hero-description {
  max-width: 520px;
  margin-bottom: 27px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 20px;
  border-radius: 7px;
  border: 1px solid var(--accent);
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 0.2s,
    background 0.2s;
}

.button:hover {
  transform: translateY(-2px);
}

.primary {
  background: var(--accent);
  color: #04101e;
}

.secondary {
  color: var(--text);
  background: transparent;
}

.secondary:hover {
  background: var(--surface);
}

.hero-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 22px;
}

.hero-visual {
  position: relative;
  padding: 20px 0;
}

.code-window {
  overflow: hidden;
  border: 1px solid #244768;
  border-radius: 14px;
  background: #081321;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.35),
    0 0 35px rgba(54, 162, 255, 0.08);
  transform: rotate(1deg);
}

.window-bar {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  background: #122238;
  border-bottom: 1px solid #203b58;
}

.window-bar > span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff6675;
}

.window-bar > span:nth-child(2) {
  background: #ffd166;
}

.window-bar > span:nth-child(3) {
  background: #55d6a0;
}

.window-bar small {
  color: #a6b7ce;
  margin-left: 12px;
}

.code-window pre {
  overflow-x: auto;
  padding: 27px 20px;
  font:
    0.9rem/1.9 Consolas,
    monospace;
}

.code-purple {
  color: #c6a0f6;
}

.code-green {
  color: #9ee6a8;
}

.code-blue {
  color: #65c5ff;
}

.floating-badge {
  position: absolute;
  right: -12px;
  bottom: 0;
  padding: 11px 17px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2);
}

.about {
  max-width: none;
  width: 100%;
  padding-inline: max(5%, calc((100% - 1100px) / 2));
  background: var(--surface);
}

.section-heading {
  margin-bottom: 30px;
}

.section-heading h2,
.contact-layout h2 {
  font-size: 2rem;
}

.about-card {
  display: grid;
  grid-template-columns: 145px 1fr;
  align-items: center;
  gap: 30px;
  max-width: 800px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 135px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: linear-gradient(145deg, #19395b, #0b1625);
  color: var(--accent);
  font:
    800 2.2rem Consolas,
    monospace;
}

.about-card h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.location {
  margin-top: 12px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.skill-card {
  padding: 24px 13px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.skill-card:hover,
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.skill-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 13px;
  border-radius: 12px;
  font-size: 1.3rem;
  font-weight: 800;
}

.html-icon {
  background: #71351f;
  color: #ff895c;
}
.css-icon {
  background: #183f78;
  color: #73b8ff;
}
.js-icon {
  background: #685b1b;
  color: #ffeb7a;
}
.node-icon {
  background: #1d4c35;
  color: #8ee7a9;
}
.pg-icon {
  background: #244d7c;
  color: #a4d0ff;
}

.skill-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.skill-card p {
  color: var(--muted);
  font-size: 0.82rem;
}

.projects-section {
  padding-top: 25px;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--card);
  transition:
    transform 0.2s,
    border-color 0.2s;
}

.project-art {
  display: grid;
  place-items: center;
  height: 125px;
  font-size: 3rem;
  font-weight: 800;
}

.social-art {
  color: #8acaff;
  background: linear-gradient(135deg, #102d4e, #153f60);
}

.portfolio-art {
  color: #c4a5ff;
  background: linear-gradient(135deg, #2d2452, #153653);
}

.server-art {
  color: #7df0bd;
  background: linear-gradient(135deg, #123c37, #102b49);
}

.project-content {
  padding: 20px;
}

.project-status {
  color: var(--accent) !important;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.project-content h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.project-content > p:not(.project-status) {
  font-size: 0.9rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 17px;
}

.tags span {
  padding: 4px 9px;
  border-radius: 20px;
  background: #132e4b;
  color: #9bcfff;
  font-size: 0.72rem;
}

.contact-section {
  background: var(--surface);
}

.contact-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 65px;
  align-items: start;
}

.contact-layout h2 {
  margin-bottom: 17px;
}

.contact-hint {
  font-size: 0.85rem;
  margin-top: 15px;
}

#contactForm {
  display: grid;
  gap: 10px;
}

#contactForm label {
  font-size: 0.9rem;
  font-weight: 600;
}

#contactForm input,
#contactForm textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 7px;
}

#contactForm textarea {
  resize: vertical;
}

.submit-button {
  width: 100%;
  margin-top: 7px;
}

#formStatus {
  font-size: 0.9rem;
  color: var(--accent);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 25px max(5%, calc((100% - 1100px) / 2));
  color: var(--muted);
  font-size: 0.85rem;
}

footer a {
  color: var(--accent);
}

body.light-theme {
  color-scheme: light;
  --background: #f3f7fc;
  --surface: #e6eef8;
  --card: #ffffff;
  --text: #162438;
  --muted: #53667e;
  --accent: #0878db;
  --border: #cbd9e9;
  --header: rgba(243, 247, 252, 0.95);
}

body.light-theme .code-window {
  background: #101b2a;
  color: #edf4ff;
}

body.light-theme .window-bar {
  background: #192b40;
}

body.light-theme .tags span {
  background: #dcecff;
  color: #175a9b;
}

body.light-theme .primary {
  color: white;
}

@media (max-width: 850px) {
  .navbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .navbar nav {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .navbar nav.open {
    display: flex;
  }

  .navbar nav a {
    padding: 10px 0;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 35px;
    padding-block: 65px;
  }

  .hero-visual {
    max-width: 600px;
    width: 100%;
    margin-inline: auto;
  }

  .skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (max-width: 540px) {
  .navbar {
    padding-inline: 5%;
  }

  .theme-toggle {
    padding: 6px 9px;
  }

  .section {
    padding-block: 55px;
  }

  .hero h1 {
    letter-spacing: -1px;
  }

  .code-window pre {
    font-size: 0.75rem;
    padding: 20px 12px;
  }

  .about-card {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 105px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
