/* ============================================================
   PATRICIA ALONSO — Sistema de diseño
   Tokens: color, tipografía, espaciado
   ============================================================ */

:root {
  /* Color */
  --ink: #0B2027;
  --ink-soft: #123039;
  --cream: #FDF9F3;
  --cream-soft: #F6F1E8;
  --cyan: #4FC3E0;
  --cyan-tint: #D9F1F7;
  --orange: #F2A365;
  --orange-tint: #FBE3CE;
  --gray: #3A5860;
  --gray-line: #E0DCD5;
  --white: #FFFFFF;
  --green: #6FD9A0;
  --green-tint: #DCF3E5;

  /* Degradado vibrante: fondo persistente de toda la web */
  --hero-gradient: linear-gradient(135deg, #4FC3E0 0%, #6FD9A0 45%, #F2A365 100%);

  /* Gradiente de marca (para acentos puntuales, botones, barras) */
  --brand-gradient: linear-gradient(135deg, #1FA8C9 0%, #E8722C 100%);

  /* Tipografía */
  --font-display: Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Espaciado */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 7rem;

  --radius: 6px;
  --max-width: 1220px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--hero-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Textura de grano sutil: conecta visualmente con la textura metálica del logo */
img { max-width: 100%; display: block; }

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

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Marco decorativo lateral (solo pantallas anchas) ---------- */
.side-rail {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 84px;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.side-rail-left { left: 0; }
.side-rail-right { right: 0; }
.rail-canvas { display: block; width: 100%; height: 100%; }

@media (max-width: 900px) {
  .side-rail { width: 40px; }
}
@media (max-width: 600px) {
  .side-rail { width: 24px; }
}

/* ---------- Eyebrow / etiqueta tipo ruta de archivo ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: var(--space-sm);
}
.eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-gradient);
  flex-shrink: 0;
}

/* ---------- Tipografía general ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); position: relative; }
h1::after {
  content: '';
  display: block;
  width: 72px;
  height: 4px;
  margin-top: 0.9rem;
  border-radius: 2px;
  background: var(--brand-gradient);
}
.hero h1::after { margin-top: 1.1rem; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin-bottom: var(--space-sm); }
h3 { font-size: 1.3rem; }

/* Cabeceras de páginas interiores: el degradado real de fondo (body)
   se ve directamente, con una burbuja translúcida de más, igual que el hero */
.page-hero {
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: -14%;
  right: -6%;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
  z-index: 0;
}
.page-hero .wrap { position: relative; z-index: 1; }

p { color: var(--ink); }
p, .lede, .section-intro {
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}
.lede {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 46ch;
}

.section-intro { max-width: 60ch; margin-bottom: var(--space-lg); }

/* ---------- Header / navegación ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
}
.brand img.brand-icon { height: 34px; width: auto; flex-shrink: 0; }

nav.main-nav { display: flex; align-items: center; gap: var(--space-md); }
nav.main-nav ul { list-style: none; display: flex; gap: var(--space-md); }
nav.main-nav a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray);
  position: relative;
  padding: 0.2rem 0;
  transition: color 0.2s ease;
}
nav.main-nav a:hover, nav.main-nav a.active { color: var(--ink); }
nav.main-nav a.active::after {
  content: '';
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: var(--brand-gradient);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink);
  background: var(--cyan-tint);
  border: 1px solid var(--cyan);
  padding: 0.35rem 0.8rem;
  border-radius: 100px;
}
.status-badge .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #3CB371;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.4; }
}

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; }
.nav-toggle span {
  display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--ink);
  color: var(--cream);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(26,26,26,0.25); }
.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--cream); }
.btn-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: var(--space-md); }

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-xl) 0 var(--space-lg);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -18%;
  right: -6%;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -14%;
  left: -6%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
  z-index: 0;
}
.hero .wrap { position: relative; z-index: 1; }
.hero .lede { max-width: 640px; color: var(--ink-soft); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

/* Panel de código decorativo */
/* Código escribiéndose en vivo, varias líneas a la vez, coloreado
   como un editor, sin caja ni fondo — directo sobre la página */
.live-code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 1.8rem;
  min-height: 7.5em;
  white-space: pre;
}
.live-code .lc-kw { color: #0E7A93; }
.live-code .lc-fn { color: #1F7A50; font-weight: 700; }
.live-code .lc-str { color: #B85A1D; }
.live-code .lc-cm { color: var(--ink-soft); font-style: italic; opacity: 0.7; }
.live-code .lc-plain { color: var(--ink); }
.live-code-cursor {
  color: #B85A1D;
  animation: blinkCursor 1s steps(1) infinite;
}
@keyframes blinkCursor { 50% { opacity: 0; } }

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: var(--space-md);
}
.tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink);
  border: 1px solid var(--gray-line);
  background: var(--white);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
}

/* ---------- Tarjetas de contenido flotando sobre el degradado ---------- */
.content-card {
  background: rgba(253, 249, 243, 0.95);
  border-radius: 28px;
  padding: 3rem 2.5rem;
  box-shadow: 0 24px 60px rgba(20, 49, 58, 0.14);
}
.content-card.tint-cyan { background: rgba(217, 241, 247, 0.92); }
.content-card.tint-orange { background: rgba(251, 227, 206, 0.92); }
.content-card.tint-green { background: rgba(220, 243, 229, 0.92); }

@media (max-width: 720px) {
  .content-card { padding: 2rem 1.4rem; border-radius: 20px; }
}

/* ---------- Secciones ---------- */
section { padding: 2rem 0; }
section.tight { padding: 1.4rem 0; }
section.hero { padding: var(--space-xl) 0 var(--space-lg); }
.section-alt { background: transparent; }

/* ---------- Tarjetas de proyecto ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  box-shadow: 0 2px 8px rgba(26,26,26,0.05);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 16px 32px rgba(31,168,201,0.14), 0 4px 10px rgba(26,26,26,0.06);
}
.project-card .path {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--gray);
}
.project-card .tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
.project-card .tags span {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: var(--cyan-tint);
  color: var(--ink);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}
.project-card .status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--orange-tint);
  color: var(--orange);
  width: fit-content;
}
.project-card .link-out {
  margin-top: auto;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  border-bottom: 2px solid var(--orange);
  width: fit-content;
  padding-bottom: 2px;
}

/* ---------- Proceso ---------- */
.process-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  counter-reset: step;
}
.process-step {
  border-top: 3px solid var(--gray-line);
  padding-top: 1rem;
  position: relative;
}
.process-step .step-index {
  font-family: var(--font-mono);
  color: var(--cyan);
  font-size: 0.85rem;
  display: block;
  margin-bottom: 0.4rem;
}

/* ---------- Skills grid (sobre-mi) ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.skills-group h3 {
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.skills-group h3 svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--cyan);
}
.skills-group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skills-group li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--white);
  border: 1px solid var(--gray-line);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
}

/* ---------- CTA final ---------- */
.cta-block {
  background: var(--ink);
  color: var(--cream);
  border-radius: 10px;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
}
.cta-block h2 { color: var(--cream); }
.cta-block p { color: var(--gray-line); max-width: 50ch; margin: 0 auto; }
.cta-block .btn-row { justify-content: center; }
.cta-block .btn-primary { background: var(--cream); color: var(--ink); }
.cta-block .btn-outline { border-color: var(--gray-line); color: var(--cream); }
.cta-block .btn-outline:hover { background: var(--cream); color: var(--ink); }

/* ---------- Footer ---------- */
footer {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  padding: var(--space-md) 0;
  position: relative;
  z-index: 2;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--gray);
}
.footer-links { display: flex; gap: 1.2rem; }
.footer-links a:hover { color: var(--ink); }

/* ---------- Contacto ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}
.contact-card {
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.contact-card .label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray);
  display: block;
  margin-bottom: 0.2rem;
}
.contact-card .value { font-weight: 600; }

/* ---------- Página interior (about/contact hero simple) ---------- */
.page-hero { padding: var(--space-lg) 0 var(--space-md); }
.page-hero h1 { font-size: clamp(2rem, 4vw, 2.8rem); }

/* ---------- Sobre mí: layout con foto ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-lg);
  align-items: start;
}
.photo-frame {
  position: relative;
  width: 100%;
}
.photo-frame::before {
  content: '';
  position: absolute;
  top: 14px;
  left: 14px;
  width: 100%;
  height: 100%;
  border: 2px solid var(--orange);
  border-radius: 4px;
  z-index: 0;
}
.photo-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  border-radius: 4px;
  border: 8px solid var(--white);
  box-shadow: 0 24px 50px rgba(26,26,26,0.18);
}
.photo-caption {
  margin-top: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray);
  text-align: center;
}

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .photo-frame { max-width: 280px; margin: 0 auto; }
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.lang-switch a {
  color: var(--gray);
  padding: 0.2rem 0.15rem;
}
.lang-switch a:hover { color: var(--ink); }
.lang-switch a.active {
  color: var(--ink);
  font-weight: 700;
}
.lang-sep { color: var(--gray-line); }

/* ---------- Formulario de contacto ---------- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.contact-form label {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--gray);
  margin-top: 0.8rem;
}
.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px var(--cyan-tint);
}
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 1rem;
  font-family: var(--font-body) !important;
  font-size: 0.85rem !important;
  color: var(--gray);
  cursor: pointer;
}
.consent-check input[type="checkbox"] {
  margin-top: 0.2rem;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--cyan);
}
.consent-check a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.form-alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}
.form-alert-success {
  background: #E9F5EC;
  color: #2A6B3F;
  border: 1px solid #A8D8B5;
}
.form-alert-error {
  background: var(--orange-tint);
  color: #A0431A;
  border: 1px solid var(--orange);
}

.section-divider {
  border: none;
  height: 2px;
  max-width: 1120px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent 0%, var(--orange) 50%, transparent 100%);
  opacity: 0.55;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  nav.main-nav ul { display: none; }
  .nav-toggle { display: block; }
  nav.main-nav.open ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-line);
    gap: 1rem;
  }
  .status-badge { display: none; }
  .lang-switch { order: -1; }
}

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

/* ---------- Foco visible accesible ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}