:root {
  --navy-deep: #10122a;
  --navy: #1a1f3a;
  --tech-pink: #ff4fc3;
  --tech-blue: #3ec6ff;
  --cream: #f2ede2;
  --lavender: #9295c2;
  --surface: #201f3d;
  --surface-line: #34335c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--navy-deep);
  color: var(--cream);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

/* ---------- ambient liquid background ---------- */

.ambient-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  filter: blur(60px);
}

.blob {
  position: absolute;
  border-radius: 50%;
  opacity: 0.9;
  mix-blend-mode: screen;
  will-change: transform;
}

.blob-a {
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, var(--tech-pink) 0%, rgba(255,79,195,0.4) 45%, transparent 72%);
  top: -18%; left: -16%;
  animation: drift-a 34s ease-in-out infinite;
}

.blob-b {
  width: 52vw; height: 52vw;
  background: radial-gradient(circle, var(--lavender) 0%, rgba(146,149,194,0.4) 45%, transparent 72%);
  bottom: -20%; right: -14%;
  animation: drift-b 40s ease-in-out infinite;
}

.blob-c {
  width: 42vw; height: 42vw;
  background: radial-gradient(circle, var(--tech-blue) 0%, rgba(62,198,255,0.4) 45%, transparent 72%);
  top: 32%; left: 50%;
  animation: drift-c 30s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vw, 10vh) scale(1.15); }
}

@keyframes drift-b {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-10vw, -6vh) scale(1.1); }
}

@keyframes drift-c {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-6vw, 8vh) scale(0.9); }
}

.ambient-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(16,18,42,0.12), rgba(16,18,42,0.42));
}

/* ---------- liquid glass utility ---------- */

.glass {
  position: relative;
  isolation: isolate;
  background: rgba(32,31,61,0.35);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.25),
    inset 0 -1px 0 rgba(0,0,0,0.2);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,0.16) 35%, transparent 50%);
  transform: translateX(-120%);
  transition: transform 0.7s ease;
  pointer-events: none;
}

.glass:hover::before {
  transform: translateX(120%);
}

.glass > * {
  position: relative;
  z-index: 1;
}

/* ---------- scroll reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.hero-content, .hills {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .blob, .jumper-icon, .hourglass-icon, .avatar-frame::after { animation: none; }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

h1, h2, h3 {
  font-family: 'Fraunces', serif;
  margin: 0;
  font-weight: 600;
}

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

/* ---------- header ---------- */

.site-header {
  position: fixed;
  top: 1rem; left: 1rem; right: 1rem;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem clamp(1.25rem, 4vw, 2.5rem);
  border-radius: 999px;
  max-width: 64rem;
  margin: 0 auto;
}

.brand {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  letter-spacing: 0.02em;
  color: var(--cream);
}

.brand-dot { color: var(--tech-pink); }

.site-header nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2.25rem);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.site-header nav a {
  opacity: 0.75;
  padding: 0.4rem 0.75rem;
  margin: -0.4rem -0.75rem;
  border-radius: 999px;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.site-header nav a:hover,
.site-header nav a:focus-visible {
  opacity: 1;
  background: rgba(255,79,195,0.16);
}

/* ---------- hero / sky ---------- */

.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.sky {
  position: absolute;
  inset: 0;
  background: var(--navy-deep);
}

.sky-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.sky-night {
  background: linear-gradient(180deg, #060714 0%, #10122a 55%, #191b3a 100%);
  animation: sky-fade-night 48s linear infinite;
}

.sky-dawn {
  background: linear-gradient(180deg, #2b2350 0%, #7a4a5a 55%, #ff4fc3 100%);
  animation: sky-fade-dawn 48s linear infinite;
}

.sky-noon {
  background: linear-gradient(180deg, #4a86c9 0%, #7fb3d9 55%, #e9dcae 100%);
  animation: sky-fade-noon 48s linear infinite;
}

.sky-dusk {
  background: linear-gradient(180deg, #2c2a5c 0%, #7a4560 55%, #ff4fc3 100%);
  animation: sky-fade-dusk 48s linear infinite;
}

/* Crossfade: cada capa llega a opacidad 1 en su instante (0/22/45/72%)
   y se funde con la siguiente en el punto medio hacia la próxima fase. */
@keyframes sky-fade-night {
  0%   { opacity: 1; }
  11%  { opacity: 0; }
  86%  { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes sky-fade-dawn {
  0%    { opacity: 0; }
  11%   { opacity: 0; }
  22%   { opacity: 1; }
  33.5% { opacity: 0; }
  100%  { opacity: 0; }
}

@keyframes sky-fade-noon {
  0%    { opacity: 0; }
  33.5% { opacity: 0; }
  45%   { opacity: 1; }
  58.5% { opacity: 0; }
  100%  { opacity: 0; }
}

@keyframes sky-fade-dusk {
  0%   { opacity: 0; }
  58.5% { opacity: 0; }
  72%  { opacity: 1; }
  86%  { opacity: 0; }
  100% { opacity: 0; }
}

.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, #fff, transparent),
    radial-gradient(1px 1px at 25% 15%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 30%, #fff, transparent),
    radial-gradient(1px 1px at 60% 10%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 75% 25%, #fff, transparent),
    radial-gradient(1px 1px at 88% 18%, #fff, transparent),
    radial-gradient(1px 1px at 95% 35%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 15% 40%, #fff, transparent),
    radial-gradient(1px 1px at 50% 5%, #fff, transparent);
  background-repeat: no-repeat;
  animation: stars-cycle 48s ease-in-out infinite;
}

@keyframes stars-cycle {
  0%   { opacity: 0.9; }
  22%  { opacity: 0.15; }
  45%  { opacity: 0; }
  72%  { opacity: 0.15; }
  100% { opacity: 0.9; }
}

.celestial {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  top: 62%;
  left: 8%;
  animation: celestial-arc 48s linear infinite, celestial-drift 7s ease-in-out infinite;
}

@keyframes celestial-arc {
  0%   { left: 8%;  top: 68%; background: #e9e6ef; box-shadow: 0 0 24px 6px rgba(233,230,239,0.5); opacity: 0.85; }
  22%  { left: 30%; top: 30%; background: var(--tech-blue); box-shadow: 0 0 30px 10px rgba(62,198,255,0.5); opacity: 1; }
  45%  { left: 55%; top: 10%; background: #fff6d8; box-shadow: 0 0 40px 14px rgba(255,246,216,0.55); opacity: 1; }
  72%  { left: 78%; top: 32%; background: var(--tech-pink); box-shadow: 0 0 30px 10px rgba(255,79,195,0.55); opacity: 1; }
  100% { left: 8%;  top: 68%; background: #e9e6ef; box-shadow: 0 0 24px 6px rgba(233,230,239,0.5); opacity: 0.85; }
}

@keyframes celestial-drift {
  0%   { transform: translate(0, 0) scale(1); }
  25%  { transform: translate(7px, -9px) scale(1.03); }
  50%  { transform: translate(0, -5px) scale(1.07); }
  75%  { transform: translate(-7px, -9px) scale(1.03); }
  100% { transform: translate(0, 0) scale(1); }
}

.hills {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%;
  height: 32%;
  z-index: 2;
}

.hill-far {
  animation: hill-sway-far 11s ease-in-out infinite;
  transform-origin: 50% 100%;
}

.hill-near {
  animation: hill-sway-near 8s ease-in-out infinite;
  transform-origin: 50% 100%;
}

@keyframes hill-sway-far {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(0.6deg) translateY(-3px); }
}

@keyframes hill-sway-near {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(-0.9deg) translateY(-2px); }
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 0 clamp(1.5rem, 6vw, 4rem);
  max-width: 46rem;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--tech-blue);
  margin: 0 0 1rem;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(3rem, 9vw, 6rem);
  color: var(--cream);
  line-height: 1;
}

.tagline {
  margin: 1.5rem 0 2rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: rgba(242,237,226,0.85);
  max-width: 34rem;
}

.cta {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cta:hover, .cta:focus-visible {
  border-color: rgba(255,79,195,0.7);
  background: rgba(255,79,195,0.16);
  transform: translateY(-2px);
}

/* ---------- sections ---------- */

.section {
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(4rem, 8vw, 7rem) clamp(1.5rem, 6vw, 4rem);
  border-top: 1px solid var(--surface-line);
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--lavender);
  margin: 0 0 2rem;
}

.about-wrap {
  display: flex;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3rem);
  flex-wrap: wrap;
}

.avatar-frame {
  position: relative;
  flex-shrink: 0;
  width: 160px;
  height: 160px;
}

.avatar-frame::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  box-shadow: 0 0 34px 6px rgba(255,79,195,0.35), 0 0 34px 6px rgba(62,198,255,0.25);
  animation: avatar-glow-pulse 3.2s ease-in-out infinite;
}

@keyframes avatar-glow-pulse {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

.avatar-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.about-panel {
  border-radius: 20px;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 46rem;
  flex: 1;
  min-width: 260px;
}

.about-text {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: rgba(242,237,226,0.9);
  font-family: 'Fraunces', serif;
  font-weight: 400;
  margin: 0;
}

/* ---------- projects ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.75rem;
}

.project-card {
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: rgba(255,79,195,0.6);
}

.project-media {
  height: 140px;
  position: relative;
  overflow: hidden;
}

.dusk-dash-media {
  background: linear-gradient(180deg, #2c2a5c 0%, #7a4560 60%, #ff4fc3 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.jumper-icon {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 10px rgba(242,237,226,0.5));
  animation: jumper-hop 1.4s ease-in-out infinite;
}

@keyframes jumper-hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.matriculeo-media {
  background: var(--navy);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.coming-soon {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.hourglass-icon {
  width: 30px;
  height: 30px;
  animation: hourglass-spin 2.2s linear infinite;
}

@keyframes hourglass-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.coming-soon span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tech-blue);
}

.grid-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(242,237,226,0.18) 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}

.youtube-media {
  background: radial-gradient(circle at 30% 30%, #34335c 0%, var(--navy) 70%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.youtube-icon {
  width: 64px;
  height: auto;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.4));
}

.project-body {
  padding: 1.5rem 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
}

.project-desc {
  font-size: 0.95rem;
  color: rgba(242,237,226,0.78);
  margin: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(146,149,194,0.15);
  color: var(--lavender);
}

.project-shot {
  width: 100%;
  display: block;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
}

.project-links {
  margin-top: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.project-links a {
  color: var(--tech-pink);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.project-links a:hover, .project-links a:focus-visible {
  border-color: var(--tech-pink);
}

.project-links .pending {
  color: var(--lavender);
  opacity: 0.8;
}

/* ---------- socials ---------- */

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.social-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.social-pill:hover, .social-pill:focus-visible {
  border-color: rgba(255,79,195,0.6);
  background: rgba(255,79,195,0.18);
  transform: translateY(-2px);
}

.social-icon {
  color: var(--tech-pink);
}

/* ---------- contact ---------- */

.contact-panel {
  border-radius: 20px;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  max-width: 34rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.contact-text {
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: rgba(242,237,226,0.85);
}

.contact-email {
  display: inline-block;
  align-self: flex-start;
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--tech-pink);
  border-bottom: 1px solid rgba(255,79,195,0.4);
  padding-bottom: 0.15rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.contact-email:hover, .contact-email:focus-visible {
  color: var(--tech-blue);
  border-color: var(--tech-blue);
}

/* ---------- footer ---------- */

.site-footer {
  text-align: center;
  padding: 2.5rem 1.5rem 3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: rgba(242,237,226,0.5);
}

.footer-legal {
  margin: 0.6rem 0 0;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
}

.footer-legal a {
  color: rgba(242,237,226,0.5);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-legal a:hover, .footer-legal a:focus-visible {
  color: var(--tech-pink);
  border-color: var(--tech-pink);
}

/* ---------- legal pages ---------- */

.legal-main {
  padding-top: 6rem;
}

.legal-section {
  max-width: 46rem;
}

.legal-title {
  font-size: clamp(2.2rem, 5vw, 3rem);
  color: var(--cream);
  margin-bottom: 2rem;
}

.legal-panel {
  border-radius: 20px;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.legal-panel h2 {
  font-size: 1.15rem;
  color: var(--tech-blue);
  margin: 1rem 0 0;
}

.legal-panel h2:first-child {
  margin-top: 0;
}

.legal-panel p,
.legal-panel li {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(242,237,226,0.82);
  margin: 0;
}

.legal-panel ul {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.legal-panel a {
  color: var(--tech-pink);
  border-bottom: 1px solid rgba(255,79,195,0.4);
}

.legal-panel code {
  font-family: 'JetBrains Mono', monospace;
  background: rgba(146,149,194,0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
}

.legal-updated {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--lavender);
  opacity: 0.8;
  margin-top: 0.5rem;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .sky-layer, .stars, .celestial, .hill-far, .hill-near {
    animation: none;
  }
  .sky-dusk { opacity: 1; }
  .stars { opacity: 0.15; }
  .celestial { left: 55%; top: 15%; background: #fff6d8; box-shadow: 0 0 40px 14px rgba(255,246,216,0.55); }
}

@media (max-width: 640px) {
  .site-header { padding: 1.25rem 1.5rem; }
  .site-header nav { gap: 0.9rem; }
}
