:root {
  --bg: #0f1115;
  --surface: #171b23;
  --surface-alt: #131722;
  --text: #e7ebf3;
  --muted: #b7c0d4;
  --primary: #2f7de1;
  --primary-hover: #2768bb;
  --border: #273146;
  --focus: #7fb3ff;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body:not(.dark-mode) {
  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-alt: #ecf3ff;
  --text: #1a2437;
  --muted: #44516a;
  --primary: #1f6bd2;
  --primary-hover: #1858ad;
  --border: #cfd9ec;
  --focus: #0e4ea6;
}

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

.container {
  width: min(96%, 980px);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 0.5rem 0.75rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0c0f15;
  border-bottom: 1px solid var(--border);
}

body:not(.dark-mode) .site-header {
  background: #eaf2ff;
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 4rem;
}

.site-title {
  margin: 0;
  font-size: clamp(1rem, 1.5vw + 0.7rem, 1.4rem);
  color: #d8e7ff;
}

body:not(.dark-mode) .site-title {
  color: #123f7b;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary);
  background: rgba(47, 125, 225, 0.13);
}

.site-nav a.active {
  box-shadow: inset 0 0 0 1px rgba(47, 125, 225, 0.5);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 0.5rem;
  width: 2.4rem;
  height: 2.4rem;
}

.section {
  padding: clamp(2.5rem, 4vw, 4rem) 0;
}

.section-alt {
  background: var(--surface-alt);
}

.section h2 {
  margin: 0 0 1.1rem;
  text-align: center;
  color: #7bb2ff;
  font-size: clamp(1.4rem, 2vw + 0.7rem, 2rem);
  letter-spacing: 0.01em;
}

body:not(.dark-mode) .section h2 {
  color: #1f5fb8;
}

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

.home {
  background: linear-gradient(160deg, #121a2d 0%, #101623 100%);
}

body:not(.dark-mode) .home {
  background: linear-gradient(160deg, #e7f0ff 0%, #f4f8ff 100%);
}

.intro {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  font-size: clamp(1rem, 1vw + 0.8rem, 1.2rem);
}

.hero-cta {
  margin-top: 1.3rem;
  display: flex;
  justify-content: center;
}

.about-content {
  text-align: center;
}

.profile-photo {
  border-radius: 50%;
  margin: 0 auto 1rem;
  width: 160px;
  height: 160px;
  border: 2px solid var(--primary);
}

.skill-item {
  max-width: 760px;
  margin: 0 auto 1.1rem;
}

.skill-item p {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.skill-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.skill-label span {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.skill-bar {
  height: 0.75rem;
  border-radius: 999px;
  background: #2a3141;
  overflow: hidden;
}

body:not(.dark-mode) .skill-bar {
  background: #d7e2f3;
}

.skill-fill {
  display: block;
  height: 100%;
  width: var(--level);
  background: linear-gradient(90deg, #2f7de1 0%, #34a7e8 100%);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.05rem;
  box-shadow: 0 12px 24px rgba(8, 13, 24, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(47, 125, 225, 0.65);
  box-shadow: 0 14px 28px rgba(8, 13, 24, 0.28);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #8dbaff;
}

body:not(.dark-mode) .card h3 {
  color: #1459b6;
}

.card p {
  margin: 0 0 1rem;
}

.section-intro {
  margin: 0 auto 1rem;
  max-width: 700px;
  text-align: center;
}

.tech-stack {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: #8cb4eb;
}

body:not(.dark-mode) .tech-stack {
  color: #225faa;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.featured-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 16px 28px rgba(8, 13, 24, 0.24);
}

.featured-image {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.featured-content {
  padding: 1.2rem;
}

.featured-content h3 {
  margin: 0 0 0.45rem;
  color: #8dbaff;
}

body:not(.dark-mode) .featured-content h3 {
  color: #1459b6;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: #9bc7ff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  padding: 0.6rem 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.16s ease-in-out, transform 0.16s ease-in-out, box-shadow 0.16s ease-in-out;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(25, 55, 95, 0.35);
}

.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn-small {
  padding: 0.45rem 0.8rem;
  font-size: 0.85rem;
}

.btn-primary {
  min-width: 10.5rem;
}

form {
  max-width: 760px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 0.9rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--surface);
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

.form-feedback {
  min-height: 1.2rem;
  margin: 0.6rem 0 0;
  color: var(--muted);
}

.visitor-counter {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.visitor-counter .container {
  padding: 0.9rem 0;
  text-align: center;
}

.visitor-counter p {
  margin: 0.35rem 0;
}

.site-footer {
  padding: 1.5rem 0;
  background: #0c0f15;
  border-top: 1px solid var(--border);
}

body:not(.dark-mode) .site-footer {
  background: #eaf2ff;
}

.site-footer p {
  text-align: center;
  margin: 0.35rem 0;
  color: var(--muted);
}

.footer-thanks {
  font-weight: 600;
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem 1rem;
  margin: 0.7rem 0;
}

.site-footer a {
  color: #8dbaff;
  text-decoration: none;
}

body:not(.dark-mode) .site-footer a {
  color: #1656ac;
}

.site-footer a:hover {
  text-decoration: underline;
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(12px);
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

@media (max-width: 760px) {
  .header-inner {
    grid-template-columns: 1fr auto auto;
  }

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

  .site-nav {
    grid-column: 1 / -1;
    display: none;
    padding-bottom: 0.4rem;
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

  .featured-content {
    padding: 1rem;
  }

  .btn,
  .btn-small {
    min-height: 2.5rem;
  }

  .skill-label {
    flex-wrap: wrap;
  }

  .footer-links {
    gap: 0.7rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
  }
}
