/* ==========================================================
   PORTAFOLIO DE ANDRÉS CORDERO · Estilos
   Orden: 1. Variables  2. Base  3. Componentes  4. Secciones  5. Responsive
   ========================================================== */

/* ---------- 1. VARIABLES (cambia los colores aquí) ---------- */
:root {
  --ink: #101828;          /* azul muy oscuro: fondo del inicio, textos, footer */
  --ink-deep: #0a1120;
  --accent: #ffd23f;       /* amarillo: botones y detalles */
  --accent-dark: #f0bd1f;
  --paper: #f7f8fa;        /* fondo claro */
  --paper-alt: #eceff4;    /* fondo claro alternativo (secciones intercaladas) */
  --white: #ffffff;
  --text: #1d2939;
  --muted: #475467;
  --line: #dfe3ea;

  --font-title: "Schibsted Grotesk", "Trebuchet MS", sans-serif;
  --font-body: "Onest", "Segoe UI", system-ui, sans-serif;
  --font-code: "JetBrains Mono", Consolas, monospace;

  --radius: 14px;
  --header-height: 68px;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-height) + 8px); }

body {
  margin: 0; font-family: var(--font-body); font-size: 1.05rem; line-height: 1.65;
  color: var(--text); background: var(--paper);
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.1; margin: 0; color: var(--ink); }
p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }

.container { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 3px; }

.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: 0.6rem 1rem; border-radius: 8px; background: var(--accent); color: var(--ink); font-weight: 600; }
.skip-link:focus { top: 1rem; }

/* ---------- 3. COMPONENTES ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.85rem 1.6rem; border: 2px solid transparent; border-radius: 10px;
  font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { border-color: rgba(255, 255, 255, 0.45); color: var(--white); }
.btn-outline:hover { border-color: var(--white); background: rgba(255, 255, 255, 0.08); }
.btn-outline-dark { border-color: var(--ink); color: var(--ink); }
.btn-outline-dark:hover { background: var(--ink); color: var(--white); }
.btn-small { padding: 0.55rem 1.1rem; font-size: 0.95rem; }

.section { padding-block: clamp(4rem, 8vw, 6.5rem); }
.section-alt { background: var(--paper-alt); }
.section h2 { font-size: clamp(2rem, 4.2vw, 2.9rem); font-weight: 800; letter-spacing: -0.02em; }
.section-head { margin-bottom: 2.5rem; }
.section-head p { margin-top: 0.6rem; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 200; width: min(92vw, 440px);
  padding: 0.9rem 1.2rem; border-radius: 12px; background: var(--ink); color: var(--white);
  font-size: 0.95rem; text-align: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, 1.5rem); opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 4. SECCIONES ---------- */

/* Navbar */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: var(--white); transition: box-shadow 0.25s ease; }
.site-header.is-scrolled { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-height); }

.logo { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; font: 700 1.15rem var(--font-title); }
.logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: var(--accent); color: var(--ink); font: 800 0.95rem var(--font-title); }

.nav-links { display: flex; gap: 0.15rem; }
.nav-links a { display: block; padding: 0.5rem 0.85rem; border-radius: 8px; text-decoration: none; font-size: 0.97rem; font-weight: 500; color: #c6cedb; transition: background-color 0.2s ease, color 0.2s ease; }
.nav-links a:hover { color: var(--white); background: rgba(255, 255, 255, 0.08); }
.nav-links a.is-active { color: var(--accent); }

.nav-toggle { display: none; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2.5px; margin: 5px auto; background: var(--white); border-radius: 2px; transition: transform 0.25s ease, opacity 0.2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* Inicio */
.hero { background: var(--ink); color: var(--white); padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.hero-inner { display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: clamp(2rem, 5vw, 4.5rem); }
.hero h1 { color: var(--white); font-size: clamp(2.8rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.03em; }
.hero-role { margin-top: 0.75rem; font: 600 clamp(1.2rem, 2.4vw, 1.6rem) var(--font-title); color: var(--accent); }
.hero-lead { margin-top: 1.5rem; max-width: 33rem; font-size: 1.15rem; color: #c6cedb; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2rem; }

/* Ventana de código decorativa */
.code-window { min-width: 0; border-radius: var(--radius); background: var(--ink-deep); border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35); overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 0.45rem; padding: 0.75rem 1rem; background: rgba(255, 255, 255, 0.05); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-1 { background: #ff6b60; } .dot-2 { background: #ffc43d; } .dot-3 { background: #3ad07d; }
.code-file { margin-left: 0.6rem; font: 400 0.82rem var(--font-code); color: #8d99ad; }
.code-body { margin: 0; padding: 1.4rem 1.3rem 1.6rem; overflow-x: auto; font: 400 0.92rem/1.75 var(--font-code); color: #d6deeb; }
.code-body code { font: inherit; }
.line { display: inline-block; animation: line-in 0.45s ease backwards; animation-delay: calc(var(--i) * 0.2s + 0.4s); }
.k { color: #c792ea; } .v { color: #82aaff; } .p { color: #7fdbca; } .s { color: #ffd23f; }
.cursor { display: inline-block; width: 0.55em; height: 1.1em; margin-left: 3px; vertical-align: text-bottom; background: var(--accent); animation: blink 1.1s steps(2, jump-none) infinite; }

@keyframes line-in { from { opacity: 0; transform: translateX(-8px); } }
@keyframes blink { 50% { opacity: 0; } }

/* Sobre mí */
.about-grid { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: start; }
.about-text p { color: var(--muted); }
.about-text p + p { margin-top: 1.1rem; }

/* Servicios */
.services-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.service-card { padding: 1.75rem; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.service-card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 12px 28px rgba(16, 24, 40, 0.1); }
.service-icon { width: 46px; height: 46px; padding: 10px; margin-bottom: 1.1rem; border-radius: 12px; background: var(--ink); fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.service-card h3 { font-size: 1.3rem; }
.service-card p { margin-top: 0.5rem; color: var(--muted); }

/* Tecnologías */
.tech-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tech-list li { display: flex; flex-direction: column; gap: 0.2rem; padding: 1.1rem 1.3rem; border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; background: var(--white); box-shadow: 0 0 0 1px var(--line); }
.tech-list strong { font: 700 1.2rem var(--font-title); color: var(--ink); }
.tech-list span { font-size: 0.95rem; color: var(--muted); }

/* Proyectos */
.projects-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.project-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); transition: transform 0.25s ease, box-shadow 0.25s ease; }
.project-card:hover { transform: translateY(-5px); box-shadow: 0 16px 34px rgba(16, 24, 40, 0.13); }
.project-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-bottom: 1px solid var(--line); background: var(--paper-alt); }
.project-body { display: flex; flex: 1; flex-direction: column; padding: 1.4rem 1.4rem 1.5rem; }
.project-body h3 { font-size: 1.4rem; }
.project-body > p { margin-top: 0.4rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.tags li { padding: 0.15rem 0.65rem; border-radius: 999px; background: var(--paper-alt); font: 500 0.82rem var(--font-code); color: var(--ink); }
.project-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: auto; padding-top: 1.4rem; }

/* Proceso: lista numerada (aquí sí es una secuencia) */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; counter-reset: step; }
.steps li { position: relative; padding: 4.4rem 1.5rem 1.6rem; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); counter-increment: step; }
.steps li::before {
  content: counter(step); position: absolute; left: 1.5rem; top: 1.4rem;
  display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--accent); color: var(--ink); font: 800 1.05rem var(--font-title);
}
.steps h3 { font-size: 1.2rem; }
.steps p { margin-top: 0.4rem; font-size: 0.97rem; color: var(--muted); }

/* Contacto */
.contact { background: var(--ink); color: var(--white); }
.contact h2 { color: var(--white); }
.contact-inner { text-align: center; }
.contact-inner > p { margin: 1rem auto 2.5rem; max-width: 34rem; color: #c6cedb; }
.contact-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 720px; margin-inline: auto; text-align: left; }
.contact-btn {
  display: flex; align-items: center; gap: 1rem; height: 100%; padding: 1.1rem 1.3rem; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.14); text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.contact-btn:hover { background: rgba(255, 255, 255, 0.11); border-color: var(--accent); transform: translateY(-3px); }
.contact-btn svg { flex: none; width: 30px; height: 30px; color: var(--accent); }
.contact-btn strong { display: block; font: 700 1.1rem var(--font-title); }
.contact-btn small { display: block; font-size: 0.9rem; color: #aeb8c8; }

/* Footer */
.site-footer { background: var(--ink-deep); color: #c6cedb; padding-block: 2.5rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 1.5rem 2rem; align-items: start; }
.footer-name { font: 700 1.25rem var(--font-title); color: var(--white); }
.footer-role { font-size: 0.95rem; color: #8d99ad; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }
.footer-copy { grid-column: 1 / -1; font-size: 0.88rem; color: #8d99ad; }

/* ---------- 5. RESPONSIVE ---------- */
@media (max-width: 960px) {
  .hero-inner, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps, .tech-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink); border-top: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 14px 24px rgba(0, 0, 0, 0.3); }
  .site-header.nav-open .nav { display: block; }
  .nav-links { flex-direction: column; padding: 0.75rem 1.25rem 1.25rem; }
  .nav-links a { padding: 0.8rem 1rem; }
}

@media (max-width: 640px) {
  .services-grid, .projects-grid, .steps, .tech-list, .contact-list, .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .code-body { font-size: 0.8rem; }
}

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


/* ---------- 6. REDISEÑO: cuaderno de ingeniería (papel milimetrado) ---------- */
:root { --ink: #0e1b3d; --ink-deep: #091330; --accent: #2b50ff; --accent-dark: #1d3ed6; --hi: #ffd23f; --paper: #f5f7fb; --paper-alt: #ffffff; --text: #1b2540; --muted: #48546f; --line: #d3daea; --radius: 6px; --font-title: "Syne", "Trebuchet MS", sans-serif; --font-body: "Instrument Sans", "Segoe UI", system-ui, sans-serif; }

.site-header { background: var(--paper); color: var(--ink); border-bottom: 1.5px solid var(--ink); }
.logo-mark { background: var(--ink); color: var(--hi); border-radius: 6px; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--ink); background: rgba(14, 27, 61, 0.07); }
.nav-links a.is-active { color: var(--accent-dark); border-radius: 0; box-shadow: inset 0 -2px 0 currentColor; }
.nav-toggle span { background: var(--ink); }

.btn { border-radius: 6px; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.hero { color: var(--ink); border-bottom: 1.5px solid var(--ink); background-color: var(--paper); background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 36px 36px; }
.hero h1 { color: var(--ink); }
.hero-role { color: var(--accent-dark); font-size: clamp(1.15rem, 2.2vw, 1.45rem); }
.hero-lead { color: var(--muted); }
.code-window { border-color: var(--ink); box-shadow: 10px 10px 0 var(--accent); }
.cursor { background: var(--hi); }

.section-alt { background: #fff; border-block: 1.5px solid var(--line); }
.about-grid { grid-template-columns: 0.7fr 1.3fr; }
.about-text p { color: var(--text); }
.formation { margin-top: 2.25rem; padding-top: 1.75rem; border-top: 1.5px solid var(--ink); }
.formation h3 { margin-bottom: 1rem; font-size: 1.15rem; }
.formation li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.3rem 1rem; padding: 0.9rem 1.1rem; border-left: 4px solid var(--accent); background: #fff; box-shadow: 0 0 0 1px var(--line); }
.formation li + li { margin-top: 0.75rem; }
.formation strong { font: 700 1.1rem var(--font-title); color: var(--ink); }
.formation span { font-size: 0.92rem; color: var(--muted); }

.service-card, .project-card, .steps li { border: 1.5px solid var(--ink); border-radius: var(--radius); }
.service-card:hover, .project-card:hover { transform: translate(-3px, -3px); border-color: var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.service-icon { border-radius: 6px; stroke: var(--hi); }
.tech-list li { border-radius: 0; border-left-color: var(--accent); }
.tags li { border-radius: 4px; background: var(--paper); }
.steps li::before { border-radius: 6px; background: var(--ink); color: var(--hi); }

.contact-list { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; }
.contact-btn { border-radius: 6px; }
.contact-btn:hover { border-color: var(--hi); }
.contact-btn svg { color: var(--hi); }
.footer-links a:hover { color: var(--hi); }

@media (max-width: 960px) {
  .about-grid { grid-template-columns: minmax(0, 1fr); }
  .contact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) { .nav { background: var(--paper); border-top: 1px solid var(--line); box-shadow: 0 14px 24px rgba(14, 27, 61, 0.15); } }
@media (max-width: 640px) { .contact-list { grid-template-columns: minmax(0, 1fr); } }
