/* =========================
   PORTAFOLIO IVAN MAMANI
   Archivo: styles.css
========================= */

:root {
  --font-title: "Syne", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --bg: #080b12;
  --bg-2: #0d1220;
  --card: rgba(255, 255, 255, 0.06);
  --card-strong: rgba(255, 255, 255, 0.09);
  --text: #f4f7fb;
  --muted: #a5afc2;
  --accent: #38bdf8;
  --accent-2: #a78bfa;
  --accent-3: #22c55e;
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 24px;
  --nav-height: 78px;
}

html[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-2: #ffffff;
  --card: rgba(8, 11, 18, 0.045);
  --card-strong: rgba(8, 11, 18, 0.075);
  --text: #101828;
  --muted: #5d6678;
  --accent: #0ea5e9;
  --accent-2: #7c3aed;
  --accent-3: #16a34a;
  --border: rgba(16, 24, 40, 0.12);
  --shadow: 0 24px 70px rgba(16, 24, 40, 0.13);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  min-height: 100vh;
  font-family: var(--font-mono);
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.16), transparent 32%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 75%);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font: inherit;
}

.container {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

section {
  padding: 110px 0;
}

/* Navbar */

nav {
  width: min(1180px, calc(100% - 32px));
  height: var(--nav-height);
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;

  padding: 0 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(8, 11, 18, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] nav {
  background: rgba(255, 255, 255, 0.82);
}

.nav-logo {
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.nav-logo span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  transition: 0.25s ease;
}

.nav-links a:hover {
  color: var(--text);
  background: var(--card);
}

.toggle-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: 0.25s ease;
  position: relative;
}

.toggle-btn::before {
  content: "☾";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

html[data-theme="light"] .toggle-btn::before {
  content: "☀";
}

.toggle-btn:hover {
  transform: translateY(-2px);
  background: var(--card-strong);
}

.hamburger {
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  cursor: pointer;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.hamburger span {
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: var(--text);
  transition: 0.25s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Hero */

#inicio {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding-top: 140px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 54px;
}

.hero-tag,
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 700;
}

.hero-tag::before,
.section-tag::before {
  content: "";
  width: 34px;
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(3.4rem, 9vw, 7.5rem);
  line-height: 0.92;
  letter-spacing: -0.075em;
  margin-bottom: 26px;
}

.highlight {
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  max-width: 650px;
  color: var(--muted);
  font-size: 1.08rem;
  margin-bottom: 34px;
}

.hero-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.95rem;
  transition: 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  box-shadow: 0 12px 32px rgba(56, 189, 248, 0.22);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(56, 189, 248, 0.3);
}

.btn-ghost {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
}

.btn-ghost:hover {
  transform: translateY(-3px);
  background: var(--card-strong);
}

/* Terminal */

.hero-terminal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.term-bar {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.055);
}

.term-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.term-body {
  padding: 24px;
  font-size: 0.92rem;
  color: var(--text);
  min-height: 380px;
}

.term-body div {
  margin-bottom: 7px;
}

.t-p {
  color: var(--accent-2);
}

.t-g {
  color: var(--accent-3);
}

.t-y {
  color: #facc15;
}

.t-c {
  color: var(--accent);
}

.cursor {
  display: inline-block;
  width: 9px;
  height: 18px;
  background: var(--accent);
  transform: translateY(3px);
  animation: blink 0.9s infinite;
}

@keyframes blink {
  0%, 45% {
    opacity: 1;
  }

  46%, 100% {
    opacity: 0;
  }
}

/* Títulos */

.section-header {
  display: flex;
  align-items: end;
  gap: 18px;
  margin-bottom: 42px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-title);
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.section-line {
  flex: 1;
  min-width: 160px;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
  margin-bottom: 12px;
}

/* Sobre mí */

.about-grid {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 70px;
  align-items: center;
}

.about-avatar-wrap {
  position: relative;
  width: min(360px, 100%);
  margin: 0 auto;
}

.about-avatar {
  aspect-ratio: 1 / 1;
  border-radius: 38px;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  font-size: 6rem;
  font-weight: 800;
  letter-spacing: -0.12em;
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(167, 139, 250, 0.18)),
    var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: var(--text);
  position: relative;
  z-index: 2;
}

.about-deco {
  position: absolute;
  inset: 28px -24px -24px 28px;
  border-radius: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.45;
  z-index: 1;
  filter: blur(2px);
}

.about-text p {
  color: var(--muted);
  margin-bottom: 18px;
  font-size: 1rem;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.skill-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: 0.25s ease;
}

.skill-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

/* Proyectos */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
  transition: 0.28s ease;
}

.project-card:hover {
  transform: translateY(-9px);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.28);
}

.project-img {
  height: 230px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 45%),
    radial-gradient(circle at bottom right, rgba(167, 139, 250, 0.18), transparent 45%),
    rgba(255, 255, 255, 0.05);
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 5rem;
  font-weight: 800;
}

.project-img img {
  height: 100%;
  object-fit: cover;
  transition: 0.35s ease;
}

.project-card:hover .project-img img {
  transform: scale(1.06);
}

.project-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-title {
  font-family: var(--font-title);
  font-size: 1.42rem;
  letter-spacing: -0.04em;
  line-height: 1.12;
  margin-bottom: 12px;
}

.project-desc {
  color: var(--muted);
  font-size: 0.93rem;
  margin-bottom: 20px;
  flex: 1;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.stack-tag {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.11);
  border: 1px solid rgba(56, 189, 248, 0.18);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.proj-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
  font-weight: 800;
  transition: 0.25s ease;
}

.proj-link:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  transform: translateY(-2px);
}

/* Contacto */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 780px);
}

.contact-info {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(56, 189, 248, 0.08), rgba(167, 139, 250, 0.07)),
    var(--card);
  box-shadow: var(--shadow);
}

.contact-info p {
  color: var(--muted);
  margin-bottom: 24px;
}

.social-links {
  display: grid;
  gap: 12px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  transition: 0.25s ease;
  word-break: break-word;
}

.social-link:hover {
  transform: translateX(6px);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.11);
}

.social-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #ffffff;
  font-weight: 900;
  flex: 0 0 auto;
}

/* Footer */

footer {
  padding: 34px 0;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
}

.footer-copy {
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-copy span {
  color: var(--accent);
}

/* Animaciones */

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.fade-up.show,
.fade-up.visible,
.fade-up.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.no-animation .fade-up {
  opacity: 1;
  transform: none;
}

/* Responsive */

@media (max-width: 980px) {
  .hero-inner,
  .about-grid {
    grid-template-columns: 1fr;
  }

  .hero-inner {
    gap: 44px;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-avatar-wrap {
    width: min(300px, 100%);
  }

  .about-avatar {
    font-size: 5rem;
  }
}

@media (max-width: 820px) {
  nav {
    top: 10px;
    width: calc(100% - 20px);
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    left: 0;
    right: 0;
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(8, 11, 18, 0.94);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
  }

  html[data-theme="light"] .nav-links {
    background: rgba(255, 255, 255, 0.96);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    justify-content: center;
    padding: 13px 14px;
  }
}

@media (max-width: 700px) {
  .container {
    width: min(100% - 28px, 1120px);
  }

  section {
    padding: 82px 0;
  }

  #inicio {
    padding-top: 132px;
  }

  .hero-title {
    font-size: clamp(3.05rem, 18vw, 5rem);
  }

  .hero-desc {
    font-size: 1rem;
  }

  .hero-btns {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary,
  .btn-ghost {
    width: 100%;
  }

  .term-body {
    min-height: auto;
    padding: 20px;
    font-size: 0.82rem;
  }

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

  .project-img {
    height: 220px;
  }

  .contact-info {
    padding: 22px;
  }

  .footer-inner {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 460px) {
  nav {
    padding: 0 12px;
  }

  .nav-logo {
    font-size: 1rem;
  }

  .toggle-btn,
  .hamburger {
    width: 40px;
    height: 40px;
  }

  .section-header {
    gap: 10px;
  }

  .section-line {
    min-width: 100%;
  }

  .about-avatar {
    border-radius: 28px;
  }

  .about-deco {
    border-radius: 28px;
  }

  .social-link {
    font-size: 0.82rem;
  }
}
.nav-links a.active {
  color: var(--text);
  background: var(--card-strong);
}