/* ignaciofuenzalida.com — dark tech, violeta + rojo puntual */

:root {
  --bg: #08060d;
  --bg-2: #0d0a16;
  --bg-card: rgba(139, 92, 246, 0.045);
  --text: #e9e5f2;
  --muted: #9c93b0;
  --violet: #8b5cf6;
  --violet-bright: #a78bfa;
  --violet-deep: #6d28d9;
  --red: #ff2e4d;
  --line: rgba(139, 92, 246, 0.16);
  --line-soft: rgba(139, 92, 246, 0.09);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: rgba(139, 92, 246, 0.4); }

/* ===== Fondo: geometría sagrada sutil (semilla de la vida) + glow ===== */
.bg-geometry {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 45% at 70% 8%, rgba(109, 40, 217, 0.14), transparent 70%),
    radial-gradient(ellipse 50% 40% at 15% 85%, rgba(109, 40, 217, 0.09), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Cg fill='none' stroke='%238b5cf6' stroke-width='0.6' opacity='0.35'%3E%3Ccircle cx='120' cy='120' r='40'/%3E%3Ccircle cx='120' cy='80' r='40'/%3E%3Ccircle cx='120' cy='160' r='40'/%3E%3Ccircle cx='85.4' cy='100' r='40'/%3E%3Ccircle cx='85.4' cy='140' r='40'/%3E%3Ccircle cx='154.6' cy='100' r='40'/%3E%3Ccircle cx='154.6' cy='140' r='40'/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto, auto, 240px 240px;
  opacity: 1;
}
.bg-geometry::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0.86;
}

/* ===== Nav ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem clamp(1.2rem, 4vw, 3rem);
  transition: background 0.35s, backdrop-filter 0.35s, border-color 0.35s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8, 6, 13, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.nav-name {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.06em;
}
.nav-dot { color: var(--violet); }
.nav-right { display: flex; align-items: center; gap: 1.1rem; }
.lang-toggle {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.25s;
}
.lang-toggle:hover { border-color: var(--violet); }
.lang-toggle .active { color: var(--violet-bright); font-weight: 700; }
.lang-sep { margin: 0 0.3rem; opacity: 0.5; }
.nav-linkedin {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  transition: color 0.25s;
}
.nav-linkedin:hover { color: var(--violet-bright); }

/* ===== Hero ===== */
.hero-track { height: 340vh; position: relative; }
.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
}
#heroCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 clamp(1.2rem, 5vw, 4.5rem);
  max-width: 34rem;
  pointer-events: none;
}
.hero-content a { pointer-events: auto; }
.hero-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.14em;
  margin-bottom: 0.7rem;
}
.hero-name {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.1rem;
  background: linear-gradient(120deg, var(--text) 55%, var(--violet-bright));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-tagline {
  color: var(--muted);
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  max-width: 30rem;
  margin-bottom: 1.6rem;
}
.hero-tagline em { color: var(--violet-bright); font-style: normal; }
.btn-linkedin {
  display: inline-block;
  border: 1px solid var(--violet);
  color: var(--violet-bright);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}
.btn-linkedin:hover {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.45);
}
.hero-captions {
  position: absolute;
  right: clamp(1.2rem, 6vw, 5rem);
  bottom: clamp(4.5rem, 10vh, 7rem);
  z-index: 2;
  text-align: right;
  pointer-events: none;
}
.hero-caption {
  position: absolute;
  right: 0;
  bottom: 0;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet-bright);
  opacity: 0;
}
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  transition: opacity 0.5s;
  pointer-events: none;
}
.scroll-line {
  width: 1px;
  height: 42px;
  background: linear-gradient(var(--violet), transparent);
  animation: scrollPulse 1.8s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%, 100% { transform: scaleY(0.5); opacity: 0.4; transform-origin: top; }
  50% { transform: scaleY(1); opacity: 1; transform-origin: top; }
}

/* ===== Secciones ===== */
.section {
  max-width: 68rem;
  margin: 0 auto;
  padding: clamp(4rem, 10vw, 7rem) clamp(1.2rem, 4vw, 3rem);
}
.section-title {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--violet-bright);
  margin-bottom: clamp(2rem, 5vw, 3.4rem);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}

/* ===== Skills ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 1.6rem 1.7rem;
  transition: border-color 0.3s, transform 0.3s;
}
.card:hover { border-color: var(--line); transform: translateY(-2px); }
.card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.8rem;
}
.card ul { list-style: none; }
.card li {
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 1.1rem;
  position: relative;
  margin-bottom: 0.55rem;
}
.card li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0.1em;
  font-size: 0.55rem;
  color: var(--violet);
}
.card li strong { color: var(--text); font-weight: 600; }
.card-metric {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.9rem;
}
.metric-num {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--violet-bright);
  letter-spacing: 0;
  margin-right: 0.2rem;
}

.skills-lead {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}
.card-lead {
  border-color: var(--line);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.10), rgba(139, 92, 246, 0.03) 60%);
}
.card-lead h3 { font-size: 1.35rem; color: var(--violet-bright); }

.skills-high {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}

.skills-mid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}
.card-mid { padding: 1.2rem 1.4rem; }
.card-mid h3 { font-size: 1rem; }
.card-mid li { font-size: 0.86rem; }
.card-mid .metric-num { font-size: 1.3rem; }

.skills-mention {
  margin-top: 2.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

/* ===== Trayectoria ===== */
.timeline {
  list-style: none;
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--violet-deep), var(--line), var(--violet-deep));
}
.tl-item {
  position: relative;
  padding-bottom: 1.9rem;
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 44rem;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item strong { color: var(--text); }
.tl-marker {
  position: absolute;
  left: -2rem;
  top: 0.42em;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--violet);
  background: var(--bg);
  transform: rotate(45deg);
}
.tl-now .tl-marker {
  background: var(--violet);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.7);
}

/* ===== Contacto ===== */
.section-contact { padding-bottom: clamp(3rem, 8vw, 5rem); }
.contact-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.contact-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.contact-form input,
.contact-form textarea {
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.btn-send {
  align-self: flex-start;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.75rem 2.4rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.25s, opacity 0.25s;
}
.btn-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 28px rgba(255, 46, 77, 0.45);
}
.btn-send:disabled { opacity: 0.5; cursor: wait; transform: none; box-shadow: none; }
.form-status { font-size: 0.85rem; min-height: 1.4em; color: var(--muted); }
.form-status.ok { color: var(--violet-bright); }
.form-status.err { color: var(--red); }
.contact-aside {
  border-left: 1px solid var(--line-soft);
  padding-left: clamp(1.2rem, 3vw, 2.4rem);
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  align-items: flex-start;
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 1.6rem clamp(1.2rem, 4vw, 3rem);
  color: var(--muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .skills-lead, .skills-high, .skills-mid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .hero-track { height: 300vh; }
  .hero-sticky {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding-bottom: 5.5rem;
  }
  .hero-content { max-width: 100%; padding: 0 1.2rem; }
  .hero-tagline { font-size: 0.95rem; }
  .hero-captions {
    right: auto;
    left: 1.2rem;
    bottom: 3.4rem;
    text-align: left;
  }
  .hero-caption { right: auto; left: 0; font-size: 0.78rem; }
  .scroll-hint {
    left: auto;
    right: 1.2rem;
    bottom: 1rem;
    transform: none;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
  }
  .scroll-line {
    height: 1px;
    width: 34px;
    background: linear-gradient(90deg, var(--violet), transparent);
    animation: none;
  }
  .skills-lead, .skills-high, .skills-mid { grid-template-columns: 1fr; }
  .card { padding: 1.3rem 1.3rem; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-aside {
    border-left: none;
    border-top: 1px solid var(--line-soft);
    padding-left: 0;
    padding-top: 1.4rem;
  }
  .timeline { padding-left: 1.7rem; }
  .tl-marker { left: -1.7rem; width: 11px; height: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-line { animation: none; }
}
