/* ==========================================================================
   techwithgil.com — estilos globales
   Mobile-first · modo oscuro por defecto · modo claro según el sistema
   ========================================================================== */

:root {
  --bg: #0b0f17;
  --bg-elev: #121826;
  --bg-card: #161d2e;
  --border: #232c42;
  --text: #e6eaf2;
  --text-muted: #9aa4b8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-3: #34d399;
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --maxw: 1100px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fb;
    --bg-elev: #ffffff;
    --bg-card: #ffffff;
    --border: #e2e6ef;
    --text: #0f172a;
    --text-muted: #55607a;
    --accent: #0891b2;
    --accent-2: #7c3aed;
    --accent-3: #059669;
    --shadow: 0 10px 30px -14px rgba(15, 23, 42, 0.25);
    color-scheme: light;
  }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.6em;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1em;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  background: var(--accent);
  color: #000;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--text);
  font-size: 1.05rem;
}

.logo span {
  color: var(--accent);
}

.logo:hover {
  text-decoration: none;
}

.nav-links {
  display: none;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-primary {
  background: var(--gradient);
  color: #0b0f17;
  box-shadow: 0 8px 24px -10px var(--accent);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--bg-elev);
}

.btn-ghost:hover {
  border-color: var(--accent);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 4.5rem 0 4rem;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 520px;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 28%, transparent), transparent),
    radial-gradient(closest-side at 70% 60%, color-mix(in srgb, var(--accent-2) 24%, transparent), transparent);
  filter: blur(40px);
  z-index: -1;
}

.hero .eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 800;
}

.hero .lead {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  color: var(--text-muted);
  max-width: 38rem;
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.terminal {
  margin-top: 3rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 0.85rem;
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  gap: 6px;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border);
}

.terminal-bar span:nth-child(1) { background: #ff5f57; }
.terminal-bar span:nth-child(2) { background: #febc2e; }
.terminal-bar span:nth-child(3) { background: #28c840; }

.terminal pre {
  margin: 0;
  padding: 1rem 1.1rem 1.2rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-muted);
}

.terminal .prompt { color: var(--accent-3); }
.terminal .cmd { color: var(--text); }
.terminal .ok { color: var(--accent); }

/* ---------- Secciones ---------- */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-elev);
  border-block: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  font-weight: 800;
}

.section-kicker {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.section-intro {
  color: var(--text-muted);
  max-width: 40rem;
  margin-bottom: 2.5rem;
}

/* ---------- Sobre mí ---------- */
.about {
  display: grid;
  gap: 2rem;
  align-items: center;
}

.avatar {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient);
  color: #0b0f17;
  font-size: 3rem;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.about-text p {
  color: var(--text-muted);
}

.about-text strong {
  color: var(--text);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
}

.tags li {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
}

/* ---------- Tarjetas de temas ---------- */
.cards {
  display: grid;
  gap: 1.25rem;
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--card-accent, var(--accent)) 60%, var(--border));
  box-shadow: var(--shadow);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 1.25rem;
  color: var(--card-accent, var(--accent));
  background: color-mix(in srgb, var(--card-accent, var(--accent)) 14%, transparent);
}

.card-icon svg {
  width: 26px;
  height: 26px;
}

.card h3 {
  font-size: 1.3rem;
}

.card p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.card--cloud { --card-accent: var(--accent); }
.card--sec { --card-accent: var(--accent-3); }
.card--ai { --card-accent: var(--accent-2); }

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.footer-links a:hover {
  color: var(--text);
  border-color: var(--accent);
  text-decoration: none;
}

.footer-links svg {
  width: 16px;
  height: 16px;
}

/* ---------- Página de links (estilo Linktree) ---------- */
.links-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1.25rem 2rem;
  position: relative;
  overflow-x: hidden;
}

.links-page::before {
  content: "";
  position: fixed;
  inset: -30% -30% auto;
  height: 480px;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent),
    radial-gradient(closest-side at 70% 50%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent);
  filter: blur(40px);
  z-index: -1;
}

.links-wrap {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.links-wrap .avatar {
  width: 96px;
  height: 96px;
  font-size: 2.1rem;
  margin: 0 auto 1rem;
}

.links-wrap h1 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.links-bio {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: grid;
  gap: 0.85rem;
}

.link-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 600;
  text-align: left;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.link-btn:hover {
  text-decoration: none;
  transform: translateY(-2px) scale(1.01);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.link-btn .icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.link-btn .icon svg {
  width: 20px;
  height: 20px;
}

.link-btn .label {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.link-btn .label small {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.link-btn .arrow {
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.link-btn:hover .arrow {
  transform: translateX(3px);
  color: var(--accent);
}

.link-btn--featured {
  background: var(--gradient);
  border-color: transparent;
  color: #0b0f17;
}

.link-btn--featured .icon {
  color: #0b0f17;
  background: rgba(255, 255, 255, 0.35);
}

.link-btn--featured .label small,
.link-btn--featured .arrow,
.link-btn--featured:hover .arrow {
  color: rgba(11, 15, 23, 0.75);
}

.links-footer {
  color: var(--text-muted);
  font-size: 0.82rem;
}

/* ---------- Breakpoints ---------- */
@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }

  .hero {
    padding: 7rem 0 6rem;
  }

  .section {
    padding: 6rem 0;
  }

  .about {
    grid-template-columns: auto 1fr;
    gap: 3rem;
  }

  .avatar {
    width: 180px;
    height: 180px;
    font-size: 3.8rem;
  }
}

@media (min-width: 960px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 3rem;
    align-items: center;
  }

  .terminal {
    margin-top: 0;
  }
}

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