/* =====================================================================
   Guido Canales · capa visual profesional (v4.11.0)
   Se carga al final: unifica la paleta y refina componentes sin tocar
   la estructura existente.
   ===================================================================== */

/* ---------- 1. Paleta ---------- */
:root {
  --ink: #0b1f3b;          /* azul marino del logo: títulos y fondos oscuros */
  --ink-soft: #1f3555;
  --muted: #4a5b6e;        /* texto secundario (contraste AA sobre blanco) */
  --brand: #0068fb;        /* azul eléctrico del logo: botones y enlaces */
  --brand-dark: #0050c8;
  --brand-soft: #d3e3f9;
  --ink-deep: #050d1c;     /* fondo más oscuro (loader, contacto, pie) */
  --ink-mid: #0b1f3b;      /* segundo tono oscuro (degradados) */
  --sky: #8fc0ff;          /* detalle claro sobre fondos oscuros */
  --ink-rgb: 11, 31, 59;   /* mismos colores en RGB (para transparencias) */
  --brand-rgb: 0, 104, 251;
  --accent-rgb: 0, 89, 217;
  --accent-light-rgb: 77, 155, 255;
  --sky-rgb: 143, 192, 255;
  --canvas-rgb: 228, 237, 248;   /* fondo de la página en RGB (encabezado translúcido) */
  /* Iconos de redes (sección Sigamos conectados) */
  --icon-size: 20px;
  --icon-color: var(--ink);
  --icon-bg: var(--surface);
  --icon-border: var(--line);
  --icon-hover-color: #ffffff;
  --icon-hover-bg: var(--brand);
  --icon-hover-border: var(--brand);
  /* Iconos de redes del pie de página (fondo oscuro) */
  --icon-footer-color: #d7e5ec;
  --icon-footer-border: rgba(255, 255, 255, .22);
  --icon-footer-hover-color: var(--ink);
  --icon-footer-hover-bg: var(--accent-light);
  /* Botón volver arriba */
  --top-color: #ffffff;
  --top-bg: var(--brand);
  --top-hover-bg: var(--accent);
  --accent: #0059d9;       /* azul intenso: etiquetas y detalles (AA sobre claro) */
  --accent-light: #4d9bff; /* azul claro: detalles sobre fondos oscuros */
  --canvas: #e4edf8;
  --canvas-alt: #d6e3f3;
  --surface: #f5f8fd;
  --line: #c2d3e8;
  --blue: #0068fb;
  --focus: #0068fb;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(var(--ink-rgb), .06), 0 4px 14px rgba(var(--ink-rgb), .05);
  --shadow-md: 0 10px 30px rgba(var(--ink-rgb), .10);
  --shadow-lg: 0 22px 50px rgba(var(--ink-rgb), .16);
}

/* ---------- 2. Tipografía y ritmo ---------- */
h1 { font-size: clamp(2.4rem, 4.4vw, 4rem); line-height: 1.08; letter-spacing: -.03em; }
h2 { font-size: clamp(2rem, 3.6vw, 3.2rem); line-height: 1.14; letter-spacing: -.028em; }
h3 { line-height: 1.2; }
.section { padding-block: clamp(64px, 7vw, 104px); }
.hero h1 em { color: var(--accent); font-style: normal; font-weight: 600; }
.section-label {
  display: inline-flex; align-items: center; gap: .6rem; align-self: start;
  color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .18em;
}
.section-label::before { content: ""; width: 22px; height: 2px; border-radius: 2px; background: currentColor; flex: none; }
.eyebrow, .hero-role { color: var(--accent); }
:focus-visible { outline-color: rgba(var(--brand-rgb), .55); }

/* ---------- 3. Header ---------- */
.brand-logo { width: 190px; height: auto; }
.header {
  background: rgba(var(--canvas-rgb), .86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.header.is-scrolled { background: rgba(var(--canvas-rgb), .97); border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav a { color: var(--ink-soft); font-weight: 500; }
.nav > a:not(.btn):hover, .nav > a.is-active:not(.btn) { color: var(--brand); }
.nav > a.is-active:not(.btn)::after { right: 0; background: var(--accent); }
.nav .btn { background: var(--brand); border-color: var(--brand); }
.nav .btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* ---------- 4. Botones ---------- */
.btn { background: var(--brand); border-color: var(--brand); font-weight: 600; box-shadow: 0 8px 20px rgba(var(--brand-rgb), .22); }
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(var(--brand-rgb), .28); }
.btn-ghost { background: transparent; color: var(--ink) !important; border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: #fff !important; box-shadow: none; }
.contact-section .btn:not(.btn-ghost) { background: var(--accent-light); border-color: var(--accent-light); color: var(--ink) !important; box-shadow: none; }
.contact-section .btn:not(.btn-ghost):hover { background: #fff; border-color: #fff; }

/* ---------- 5. Portada ---------- */
.hero {
  background:
    radial-gradient(900px 520px at 88% 8%, rgba(var(--brand-rgb), .11), transparent 60%),
    radial-gradient(700px 420px at 0% 100%, rgba(var(--accent-rgb), .07), transparent 60%),
    linear-gradient(180deg, var(--canvas) 0%, var(--canvas-alt) 100%);
}
.hero-tags span { color: var(--accent); }
.portrait-card { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.bg-muted { background: var(--canvas-alt); }

/* ---------- 6. Tarjetas: creencias e ideas ---------- */
.beliefs-list { border-top: 0; gap: 18px; }
.beliefs-list article:nth-child(n) {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; min-height: 250px; box-shadow: var(--shadow-sm);
}
.beliefs-list b { color: var(--accent); }
.ideas-grid article { box-shadow: var(--shadow-sm); border-radius: var(--radius); }

/* ---------- 7. Proyectos ---------- */
.project-stack { border-top: 0; display: grid; gap: 20px; }
.project-stack > article {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 38px); box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.project-stack > article:hover {
  padding-left: clamp(24px, 3vw, 38px); background: var(--surface);
  transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(var(--brand-rgb), .4);
}
.project-stack > article.project-featured { padding-bottom: clamp(24px, 3vw, 38px); }
.project-stack > article > span:first-child { color: var(--accent); }

/* Tarjetas sin vista previa (Tirvo, Próximos proyectos): dos columnas simples */
.project-stack > article:not(.project-featured) { grid-template-columns: 56px minmax(0, 1fr); column-gap: 24px; row-gap: .5rem; align-items: start; }
.project-stack > article:not(.project-featured) > span:first-child { grid-column: 1; grid-row: 1 / span 6; }
.project-stack > article:not(.project-featured) > :not(span:first-child) { grid-column: 2; }
.project-stack > article:not(.project-featured) > .eyebrow { grid-row: auto; }
.project-stack > article:not(.project-featured) > p:not(.eyebrow) { max-width: 640px; }
.project-tirvo { background: linear-gradient(135deg, var(--surface) 0%, var(--brand-soft) 100%) !important; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: .9rem 0 1.1rem; padding: 0; }
.project-tags li {
  padding: 6px 13px; border: 1px solid rgba(var(--brand-rgb), .25); border-radius: 999px;
  background: var(--surface); color: var(--brand-dark); font-size: .76rem; font-weight: 600;
}
.text-link { color: var(--brand-dark); text-decoration-color: var(--accent); }
.text-link:hover { color: var(--accent); }

/* ---------- 8. Viajes y experiencia ---------- */
.field-section { background: linear-gradient(130deg, var(--ink-mid) 0%, #1d5f80 100%); }
.field-section .section-label { color: var(--accent-light); }
.field-section .text-link { border-color: var(--accent-light); }
.experience-section .section-label { color: var(--accent-light); }

/* ---------- 9. Sigamos conectados + redes ---------- */
.connect-section { background: linear-gradient(180deg, var(--canvas) 0%, var(--brand-soft) 100%); }
.social-links { gap: 12px; margin-top: 28px; }
.social-links a {
  display: inline-flex; align-items: center; gap: .6rem; padding: 12px 18px;
  background: var(--icon-bg); border: 1px solid var(--icon-border); border-radius: 999px;
  color: var(--icon-color); font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-sm);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.social-links a:hover { background: var(--icon-hover-bg); border-color: var(--icon-hover-border); color: var(--icon-hover-color); transform: translateY(-2px); }
.social-links a b { opacity: .6; }
.social-icon { width: var(--icon-size); height: var(--icon-size); flex: none; fill: currentColor; }

/* ---------- 10. Contacto y pie ---------- */
.contact-section { background: linear-gradient(160deg, var(--ink-deep) 0%, var(--ink) 55%, var(--ink-mid) 100%); }
.footer { background: var(--ink-deep); }
.footer-inner { flex-wrap: wrap; row-gap: 1.2rem; }
.footer-links a:hover { color: var(--accent-light); }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
  display: grid; place-items: center; width: calc(var(--icon-size) + 18px); height: calc(var(--icon-size) + 18px);
  border: 1px solid var(--icon-footer-border); border-radius: 50%; color: var(--icon-footer-color);
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.footer-social a:hover { background: var(--icon-footer-hover-bg); border-color: var(--icon-footer-hover-bg); color: var(--icon-footer-hover-color); transform: translateY(-2px); }

/* Formularios y menú móvil sin blanco puro */
.contact-form input, .contact-form textarea { background: var(--surface); }
@media (max-width: 800px) { .nav { background: rgba(var(--canvas-rgb), .98); } }

/* ---------- 11. Botón volver arriba ---------- */
.back-to-top {
  position: fixed; z-index: 90; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%;
  background: var(--top-bg); color: var(--top-color); cursor: pointer; box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease, background .2s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--top-hover-bg); }
.back-to-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back-to-top:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 3px; }

/* ---------- 12. Loader de bienvenida (claro y amigable) ---------- */
.gc-loader { display: none; }
html.gc-loading { overflow: hidden; }
html.gc-loading .gc-loader {
  position: fixed; inset: 0; z-index: 99999; display: grid; place-items: center; overflow: hidden; color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(var(--brand-rgb), .14) 0%, transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(var(--accent-light-rgb), .24) 0%, transparent 52%),
    linear-gradient(160deg, var(--surface) 0%, var(--canvas) 50%, var(--canvas-alt) 100%);
  transition: opacity .45s ease, visibility .45s ease;
}
.gc-loader.gc-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.gc-orbit { position: absolute; top: 50%; left: 50%; width: min(78vmin, 560px); aspect-ratio: 1; transform: translate(-50%, -50%); transition: transform .6s ease, opacity .5s ease; }
.gc-ring { position: absolute; border: 1px solid rgba(var(--brand-rgb), .16); border-radius: 50%; }
.gc-ring i { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 6px rgba(var(--brand-rgb), .14); }
.gc-ring-1 { inset: 0; animation: gc-spin 16s linear infinite; }
.gc-ring-2 { inset: 13%; border-style: dashed; border-color: rgba(var(--brand-rgb), .24); animation: gc-spin 11s linear infinite reverse; }
.gc-ring-2 i { background: var(--accent-light); box-shadow: 0 0 0 6px rgba(var(--accent-light-rgb), .28); }
.gc-ring-3 { inset: 27%; border-color: rgba(var(--accent-light-rgb), .5); animation: gc-pulse 3.2s ease-in-out infinite; }

.gc-particles { position: absolute; inset: 0; pointer-events: none; }
.gc-dot { position: absolute; top: 100%; border-radius: 50%; opacity: 0; animation: gc-rise var(--dur, 10s) ease-in-out var(--delay, 0s) infinite; }
.gc-dot-0 { background: rgba(var(--brand-rgb), .22); }
.gc-dot-1 { background: rgba(var(--accent-light-rgb), .5); }
.gc-dot-2 { background: rgba(var(--sky-rgb), .7); }

.gc-loader-content { position: relative; z-index: 2; width: min(90vw, 720px); display: flex; flex-direction: column; align-items: center; text-align: center; transition: opacity .4s ease, transform .5s ease; }
.gc-eyebrow { margin: 0 0 18px; padding: 7px 18px; border-radius: 999px; background: rgba(var(--brand-rgb), .1); color: var(--brand-dark); font-size: .92rem; font-weight: 600; letter-spacing: .02em; opacity: 0; animation: gc-fadeDown .7s ease .1s forwards; }
.gc-mark { display: block; width: min(120px, 30vw); height: auto; margin-bottom: 22px; opacity: 0; transform: scale(.85); animation: gc-logoIn .9s cubic-bezier(.2, .8, .2, 1) .25s forwards, gc-breathe 3.2s ease-in-out 1.3s infinite; }
.gc-brand { color: var(--ink); font-size: clamp(1.9rem, 6.2vw, 3.8rem); font-weight: 700; letter-spacing: .12em; line-height: 1.1; white-space: nowrap; }
.gc-brand .gc-light { font-weight: 300; }
.gc-brand span { display: inline-block; opacity: 0; transform: translateY(26px); filter: blur(6px); animation: gc-letterIn .7s cubic-bezier(.2, .8, .2, 1) forwards; }
.gc-line { display: block; position: relative; width: 0; height: 2px; margin-top: 28px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--brand), transparent); opacity: 0; animation: gc-lineIn .9s cubic-bezier(.2, .8, .2, 1) 1.05s forwards; }
.gc-tagline { margin: 18px 0 0; color: var(--muted); font-size: clamp(.9rem, 2.2vw, 1.1rem); letter-spacing: .03em; }
.gc-tagline span { display: inline-block; margin: 0 4px; opacity: 0; transform: translateY(8px); animation: gc-wordIn .5s ease forwards; }

.gc-progress { position: absolute; left: 50%; bottom: 11%; width: min(220px, 55vw); height: 6px; margin-left: calc(min(220px, 55vw) / -2); border-radius: 999px; overflow: hidden; background: rgba(var(--brand-rgb), .14); }
.gc-progress span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--sky)); animation: gc-progress var(--gc-time, 1900ms) cubic-bezier(.4, 0, .2, 1) forwards; }

.gc-loader.gc-closing .gc-loader-content { opacity: 0; transform: translateY(-14px); }
.gc-loader.gc-closing .gc-orbit { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }

@keyframes gc-spin { to { transform: rotate(360deg); } }
@keyframes gc-pulse { 0%, 100% { transform: scale(1); opacity: .6; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes gc-rise { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translate(var(--sway, 40px), -110vh); opacity: 0; } }
@keyframes gc-logoIn { to { opacity: 1; transform: none; } }
@keyframes gc-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes gc-letterIn { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes gc-fadeDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes gc-lineIn { to { width: min(220px, 55vw); opacity: 1; } }
@keyframes gc-wordIn { to { opacity: 1; transform: none; } }
@keyframes gc-progress { to { width: 100%; } }

/* ---------- 13. Responsive ---------- */
@media (max-width: 800px) {
  .brand-logo { width: 156px; }
  .project-stack > article:not(.project-featured) { grid-template-columns: 40px minmax(0, 1fr); column-gap: 16px; }
  .footer-social { justify-content: center; }
}
@media (max-width: 540px) {
  .beliefs-list article:nth-child(n) { min-height: 0; padding: 24px; }
  .back-to-top { right: 14px; width: 44px; height: 44px; }
  .gc-brand { letter-spacing: .08em; }
}

/* ---------- 14. Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .back-to-top, .project-stack > article, .btn, .social-links a, .footer-social a { transition: none; }
  .gc-ring, .gc-dot { animation: none; }
}

/* Redes: el nombre va sin el círculo/borde propio alrededor */
.social-links a span { border: 0; border-radius: 0; padding: 0; background: none; box-shadow: none; }
