:root {
  --bg: #f8f4ef;
  --bg-alt: #fffaf3;
  --surface: rgba(255, 248, 240, 0.82);
  --surface-strong: #ffffff;
  --text: #1f1f23;
  --muted: #62606f;
  --line: rgba(31, 31, 35, 0.12);
  --brand: #ec6f38;
  --brand-2: #0f9d8a;
  --brand-3: #f7c05d;
  --shadow: 0 16px 45px rgba(31, 31, 35, 0.12);
  --radius-lg: 28px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --max-width: 1120px;
  --ease: 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

body.dark {
  --bg: #14151a;
  --bg-alt: #191b22;
  --surface: rgba(31, 33, 41, 0.8);
  --surface-strong: #232632;
  --text: #f3f5fb;
  --muted: #bcc0d0;
  --line: rgba(243, 245, 251, 0.16);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 10% 10%, rgba(247, 192, 93, 0.35), transparent 35%),
    radial-gradient(circle at 85% 20%, rgba(15, 157, 138, 0.2), transparent 30%),
    var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition: background 0.5s ease, color 0.4s ease;
}

h1,
h2,
h3,
.logo-text,
.eyebrow {
  font-family: "Syne", "Segoe UI", sans-serif;
}

.skip-link {
  position: absolute;
  left: -1000px;
  top: 10px;
  background: var(--brand);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  z-index: 1000;
}

.skip-link:focus {
  left: 10px;
}

.background-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle at 70% 75%, rgba(236, 111, 56, 0.12) 0, transparent 30%),
    radial-gradient(circle at 15% 65%, rgba(15, 157, 138, 0.12) 0, transparent 28%);
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  z-index: 120;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 110;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 75%, transparent);
  border-bottom: 1px solid var(--line);
}

.navbar-content {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.logo-text {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--text);
}

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

.main-nav a {
  display: inline-block;
  text-decoration: none;
  color: var(--text);
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background var(--ease), color var(--ease), transform var(--ease);
}

.main-nav a:hover,
.main-nav a.active {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  color: var(--brand);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 6px;
  background: var(--text);
  margin: 7px 0;
  transition: transform var(--ease), opacity var(--ease);
}

.mode-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}

main {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

.section {
  margin: 1rem 0;
  padding: clamp(1.2rem, 2.6vw, 2.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.4rem;
  align-items: center;
  overflow: hidden;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--brand-2);
  font-size: 0.78rem;
}

.hero h1 {
  margin: 0.4rem 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.hero-accent {
  font-size: clamp(1rem, 2.2vw, 1.24rem);
  color: var(--muted);
  margin: 0.25rem 0 0.45rem;
}

.hero-catchphrase {
  min-height: 3rem;
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

.typed-keyword {
  color: var(--brand);
  font-weight: 700;
}

.typed-cursor {
  color: var(--brand);
  font-weight: 700;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.78rem 1.25rem;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}

.btn-primary {
  background: linear-gradient(120deg, var(--brand), #f19148);
  color: #fff;
  box-shadow: 0 8px 24px rgba(236, 111, 56, 0.35);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-strong);
}

.btn-primary:hover,
.btn-ghost:hover {
  transform: translateY(-2px);
}

.hero-highlights {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.highlight-card {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  padding: 0.8rem;
}

.highlight-card strong {
  display: block;
  font-size: 1rem;
}

.highlight-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-photo-wrap {
  position: relative;
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(236, 111, 56, 0.2), rgba(15, 157, 138, 0.12));
  border: 1px solid var(--line);
  padding: 0.9rem;
}

.hero-avatar {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 22px;
  display: block;
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.services-list,
.projects-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.service-card,
.project-card,
.skill-card {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease);
}

.service-card:hover,
.project-card:hover,
.skill-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--brand) 50%, var(--line));
  box-shadow: 0 12px 30px rgba(31, 31, 35, 0.12);
}

.service-card i,
.skill-icon i {
  font-size: 1.5rem;
  color: var(--brand);
}

.skills-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.skill-title {
  margin-top: 0.45rem;
  display: block;
  font-weight: 700;
}

.skill-desc {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: 0.22rem;
  min-height: 2.4rem;
}

.bar {
  margin-top: 0.6rem;
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  width: 0;
}

.project-card {
  padding: 0;
  overflow: hidden;
}

.project-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.project-card-content {
  padding: 1rem;
}

.project-card-title {
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.project-card-desc {
  color: var(--muted);
  font-size: 0.95rem;
}

.project-stack {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.stack-badge {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 80%, white);
}

.project-card-links {
  margin-top: 0.85rem;
  display: flex;
  gap: 0.65rem;
}

.project-card-links a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text);
  text-decoration: none;
}

.section-head p,
.cv p {
  margin-top: -0.2rem;
  color: var(--muted);
}

.contact-chic-card {
  border: 1px solid var(--line);
  background: var(--surface-strong);
  border-radius: var(--radius-md);
  padding: 0.8rem;
  display: grid;
  gap: 0.7rem;
  max-width: 560px;
}

.contact-chic-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.contact-chic-row.link-hover:hover {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}

.contact-chic-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
}

.contact-chic-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.contact-chic-value {
  font-weight: 700;
  word-break: break-word;
}

.footer {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto 2rem;
  text-align: center;
  color: var(--muted);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.footer-links a {
  color: var(--text);
  border: 1px solid var(--line);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
  z-index: 90;
}

.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

a:focus,
button:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 65%, white);
  outline-offset: 2px;
}

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

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-photo-wrap {
    max-width: 430px;
  }
}

@media (max-width: 760px) {
  .navbar-content {
    position: relative;
    min-height: 70px;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 0.5rem;
    transform: scaleY(0.85);
    transform-origin: top;
    opacity: 0;
    pointer-events: none;
    transition: transform var(--ease), opacity var(--ease);
  }

  .main-nav.open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }

  .main-nav a {
    width: 100%;
  }

  .hero-highlights,
  .about-grid,
  .skills-list,
  .services-list,
  .projects-container {
    grid-template-columns: 1fr;
  }

  .contact-chic-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
