/* ============================================
   PORTFOLIO — Clean Soft Style
   Mobile-first, no glass, solid & reliable
   ============================================ */

:root {
  --accent: #6d5af0;
  --accent-soft: #f0edff;
  --accent-hover: #5b4bd4;

  --bg: #faf9f7;
  --bg-alt: #f2f0eb;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-2: #555555;
  --text-3: #888888;
  --border: #e6e3dc;

  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;

  --radius: 12px;
  --shadow: 0 4px 20px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
  --header-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #111111;
  --bg-alt: #181818;
  --surface: #1e1e1e;
  --text: #f0f0f0;
  --text-2: #aaaaaa;
  --text-3: #777777;
  --border: #2c2c2c;
  --accent-soft: #2a2540;
  --shadow: 0 4px 20px rgba(0,0,0,0.25);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.35);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button, input, textarea {
  font: inherit;
  border: none;
  outline: none;
  background: none;
}
button { cursor: pointer; }

/* Container */
.container {
  width: min(1100px, 100% - 2rem);
  margin-inline: auto;
}

/* Progress bar */
.progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 999;
  transition: width 0.1s linear;
}

/* ========== HEADER ========== */
.header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  height: var(--header-h);
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, background 0.3s;
}
.header.scrolled {
  border-bottom-color: var(--border);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
}
.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  font-weight: 700;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.logo span { color: var(--accent); }

.nav {
  display: none;
  gap: 1.5rem;
}
.nav__link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.25s;
}
.nav__link:hover,
.nav__link.active { color: var(--accent); }

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.theme-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text);
  transition: background 0.25s;
}
.theme-btn:hover { background: var(--bg-alt); }
.theme-btn .icon-moon { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-moon { display: block; }

.menu-btn {
  width: 40px; height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
@media (max-width: 900px) {
  .nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem 1.5rem;
    gap: 0.75rem;
    transform: translateY(-120%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s var(--ease), opacity 0.35s;
    z-index: 99;
  }
  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__link { font-size: 1rem; padding: 0.4rem 0; }
}

@media (min-width: 901px) {
  .nav { display: flex; }
  .menu-btn { display: none; }
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s var(--ease);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(109, 90, 240, 0.3);
}
.btn--outline {
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--full { width: 100%; }

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  padding: calc(var(--header-h) + 3rem) 0 4rem;
  display: flex;
  align-items: center;
}
.hero__grid {
  display: grid;
  gap: 3rem;
  align-items: center;
}
.hero__badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.25rem;
}
.hero__title em {
  font-style: normal;
  color: var(--accent);
}
.hero__desc {
  font-size: 1.1rem;
  color: var(--text-2);
  max-width: 460px;
  margin-bottom: 1.75rem;
}
.hero__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat strong {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.1;
}
.stat span {
  font-size: 0.8rem;
  color: var(--text-3);
  margin-top: 0.2rem;
}

.hero__visual {
  display: flex;
  justify-content: center;
}
.avatar {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-soft), var(--bg-alt));
  display: grid;
  place-items: center;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--accent);
  box-shadow: var(--shadow-lg);
  position: relative;
}
.avatar::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px dashed var(--border);
  animation: spin 30s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 800px) {
  .hero__grid {
    grid-template-columns: 1.2fr 0.8fr;
  }
  .avatar {
    width: 280px;
    height: 280px;
    font-size: 4.5rem;
  }
}

/* ========== SECTIONS ========== */
.section {
  padding: 5rem 0;
}
.section--alt {
  background: var(--bg-alt);
}
.section__head {
  text-align: center;
  margin-bottom: 3rem;
}
.section__label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.section__desc {
  color: var(--text-2);
  max-width: 440px;
  margin-inline: auto;
}

/* ========== ABOUT ========== */
.about__grid {
  display: grid;
  gap: 2.5rem;
}
.about__text .lead {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 1rem;
}
.about__text p {
  color: var(--text-2);
  margin-bottom: 0.9rem;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.tags span {
  padding: 0.35rem 0.85rem;
  background: var(--bg-alt);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-2);
}

.about__cards {
  display: grid;
  gap: 1rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.card__icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; }
.card p { font-size: 0.9rem; color: var(--text-2); }

@media (min-width: 700px) {
  .about__grid { grid-template-columns: 1.2fr 1fr; }
  .about__cards { grid-template-columns: 1fr; }
}
@media (min-width: 900px) {
  .about__cards { grid-template-columns: 1fr; }
}

/* ========== SERVICES ========== */
.services__grid {
  display: grid;
  gap: 1.25rem;
}
.service {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
  position: relative;
  overflow: hidden;
}
.service::before {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 0;
  background: var(--accent);
  transition: height 0.4s var(--ease);
}
.service:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.service:hover::before { height: 100%; }
.service__num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.service h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }
.service p { font-size: 0.9rem; color: var(--text-2); margin-bottom: 1rem; }
.service ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.service li {
  font-size: 0.78rem;
  padding: 0.25rem 0.6rem;
  background: var(--bg-alt);
  border-radius: 999px;
  color: var(--text-3);
}

@media (min-width: 600px) {
  .services__grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .services__grid { grid-template-columns: repeat(4, 1fr); }
}

/* ========== SKILLS ========== */
.skills__grid {
  display: grid;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.skills__col h3 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
}
.skill { margin-bottom: 1.2rem; }
.skill__top {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}
.skill__top span:last-child { color: var(--text-3); font-size: 0.85rem; }
.skill__bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.skill__fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #9b7ef0);
  border-radius: 99px;
  transition: width 1.3s var(--ease);
}
.skills__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.skills__tags span {
  padding: 0.4rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--text-2);
  transition: all 0.25s;
}
.skills__tags span:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

@media (min-width: 700px) {
  .skills__grid { grid-template-columns: 1fr 1fr; }
}

/* ========== PROJECTS ========== */
.filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.filter {
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: all 0.25s;
}
.filter:hover,
.filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.projects__grid {
  display: grid;
  gap: 1.5rem;
}
.project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s;
}
.project:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.project.hide { display: none; }
.project__img {
  height: 150px;
  background: linear-gradient(135deg, var(--c, #6366f1), color-mix(in srgb, var(--c, #6366f1) 70%, #111));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.03em;
}
.project__body { padding: 1.35rem; }
.project__cat {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}
.project h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.project p { font-size: 0.9rem; color: var(--text-2); margin-bottom: 0.9rem; }
.project__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.project__tech span {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  background: var(--bg-alt);
  border-radius: 4px;
  color: var(--text-3);
}
.project__links {
  display: flex;
  gap: 1rem;
}
.project__links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
}
.project__links a:hover { text-decoration: underline; }

@media (min-width: 600px) {
  .projects__grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .projects__grid { grid-template-columns: repeat(3, 1fr); }
}

/* ========== PROCESS ========== */
.process {
  max-width: 680px;
  margin-inline: auto;
  position: relative;
}
.process::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 20px; bottom: 20px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
}
.process__item {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}
.process__item:last-child { margin-bottom: 0; }
.process__num {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--accent);
  z-index: 1;
  transition: all 0.3s;
}
.process__item:hover .process__num {
  background: var(--accent);
  color: #fff;
}
.process__item h3 { font-size: 1.15rem; margin-bottom: 0.35rem; }
.process__item p { font-size: 0.95rem; color: var(--text-2); }

/* ========== EXPERIENCE ========== */
.exp {
  max-width: 700px;
  margin-inline: auto;
}
.exp__item {
  display: grid;
  gap: 0.35rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}
.exp__item:last-child { border-bottom: none; }
.exp__date {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.exp__item h3 { font-size: 1.1rem; }
.exp__item h4 {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 0.4rem;
}
.exp__item p { font-size: 0.95rem; color: var(--text-2); }

@media (min-width: 600px) {
  .exp__item {
    grid-template-columns: 150px 1fr;
    gap: 1.5rem;
  }
}

/* ========== TESTIMONIALS ========== */
.testimonials {
  display: grid;
  gap: 1.25rem;
}
.quote {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  transition: transform 0.3s, box-shadow 0.3s;
}
.quote:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.quote p {
  font-size: 1.05rem;
  font-style: italic;
  margin-bottom: 1.25rem;
  line-height: 1.7;
}
.quote footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.quote__avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.quote cite {
  font-style: normal;
  font-weight: 600;
  display: block;
  font-size: 0.95rem;
}
.quote span {
  font-size: 0.8rem;
  color: var(--text-3);
}
@media (min-width: 700px) {
  .testimonials { grid-template-columns: repeat(3, 1fr); }
}

/* ========== CONTACT ========== */
.contact {
  display: grid;
  gap: 2.5rem;
}
.contact__item {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.25s;
}
.contact__item:hover { color: var(--accent); }
.contact__icon { font-size: 1.3rem; }
.contact__item small {
  display: block;
  font-size: 0.8rem;
  color: var(--text-3);
}
.contact__item strong { font-weight: 500; font-size: 1rem; }
.contact__socials {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.contact__socials a {
  padding: 0.45rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.25s;
}
.contact__socials a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}
.form__row {
  display: grid;
  gap: 1rem;
}
.form__group { margin-bottom: 1rem; }
.form__group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}
.form__group input,
.form__group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  transition: border-color 0.25s;
}
.form__group input:focus,
.form__group textarea:focus {
  border-color: var(--accent);
}
.form__group textarea { resize: vertical; min-height: 110px; }
.form__status {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}
.form__status.ok { color: #10b981; }
.form__status.err { color: #ef4444; }

@media (min-width: 700px) {
  .contact { grid-template-columns: 0.9fr 1.3fr; }
  .form__row { grid-template-columns: 1fr 1fr; }
}

/* ========== FOOTER ========== */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding-top: 3.5rem;
}
.footer__inner {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer__brand p {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-2);
  max-width: 260px;
}
.footer__links {
  display: flex;
  gap: 2.5rem;
}
.footer__links h4 {
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}
.footer__links a {
  display: block;
  font-size: 0.9rem;
  color: var(--text-2);
  margin-bottom: 0.4rem;
  transition: color 0.25s;
}
.footer__links a:hover { color: var(--accent); }
.footer__bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-3);
}

@media (min-width: 700px) {
  .footer__inner {
    grid-template-columns: 1.4fr 1fr;
  }
}

/* To top */
.to-top {
  position: fixed;
  right: 1.25rem;
  bottom: -3.5rem;
  width: 42px; height: 42px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  z-index: 50;
  box-shadow: 0 4px 16px rgba(109, 90, 240, 0.35);
  transition: bottom 0.35s var(--ease), transform 0.25s;
}
.to-top:hover { transform: translateY(-2px); }
.to-top.show { bottom: 1.5rem; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}