/* ==========================================================
   Adrian Rivera Borjas — Landing page
   Paleta: azul marino profundo + azul eléctrico + cian
   ========================================================== */

:root {
  --bg: #f6f8fc;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --border: #dde3ee;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --accent: #00a5c6; /* color del logo */
  --hero-bg: #0b1220;
  --hero-text: #e6edf8;
  --hero-muted: #9fb0cc;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --radius: 14px;
  --max: 1120px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-alt: #0f1729;
    --surface: #131d33;
    --border: #22304d;
    --text: #e6edf8;
    --text-muted: #9fb0cc;
    --primary: #3b82f6;
    --primary-strong: #60a5fa;
    --accent: #1fc0e0;
    --hero-bg: #070c17;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

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

img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 8px; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 18, 32, 0.82);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 28px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--hero-muted); font-size: 0.93rem; font-weight: 500; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.lang-switch {
  font-family: var(--mono); font-size: 0.8rem !important;
  border: 1px solid rgba(255,255,255,0.18); padding: 4px 10px; border-radius: 999px;
}
.nav-toggle {
  display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: #0b1220; border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 8px 20px 16px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 10px 0; font-size: 1rem; }
  .lang-switch { display: inline-block !important; margin-top: 6px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg); color: var(--hero-text);
  padding: 96px 0 88px;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(59,130,246,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,0.08) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 20%, transparent 70%);
}
.hero::after {
  content: ""; position: absolute; width: 620px; height: 620px; right: -180px; top: -220px;
  background: radial-gradient(circle, rgba(37,99,235,0.45), rgba(6,182,212,0.15) 45%, transparent 70%);
  filter: blur(20px);
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 0.82rem; color: var(--accent);
  border: 1px solid rgba(34,211,238,0.3); background: rgba(34,211,238,0.06);
  padding: 5px 12px; border-radius: 999px; margin-bottom: 22px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,0.2); }
.hero h1 {
  font-size: clamp(2.3rem, 5.4vw, 3.9rem); line-height: 1.08; letter-spacing: -0.03em;
  margin: 0 0 14px; color: #fff;
}
.hero h1 .grad {
  background: linear-gradient(90deg, #60a5fa, #1fc0e0);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .role { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--hero-text); font-weight: 600; margin: 0 0 18px; }
.hero .lead { color: var(--hero-muted); font-size: 1.08rem; max-width: 600px; margin: 0 0 32px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 0.97rem; padding: 12px 22px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 22px -8px rgba(37,99,235,0.7); }
.btn-primary:hover { background: var(--primary-strong); color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.06); color: #fff; border-color: rgba(255,255,255,0.18); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-linkedin { background: #0a66c2; color: #fff; }
.btn-linkedin:hover { background: #0958a8; }

.hero-card {
  background: rgba(19, 29, 51, 0.7); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px; padding: 26px; box-shadow: 0 30px 60px -30px rgba(0,0,0,0.8);
  font-family: var(--mono); font-size: 0.86rem; color: var(--hero-muted);
}
.hero-card .bar { display: flex; gap: 6px; margin-bottom: 18px; }
.hero-card .bar span { width: 10px; height: 10px; border-radius: 50%; background: #334155; }
.hero-card .bar span:nth-child(1) { background: #f87171; }
.hero-card .bar span:nth-child(2) { background: #fbbf24; }
.hero-card .bar span:nth-child(3) { background: #34d399; }
.hero-card .row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed rgba(255,255,255,0.08); }
.hero-card .row:last-child { border-bottom: 0; }
.hero-card .k { color: #64748b; }
.hero-card .v { color: #e2e8f0; text-align: right; }
.hero-card .ok { color: #34d399; }

@media (max-width: 900px) {
  .hero { padding: 64px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---------- Stats ---------- */
.stats { margin-top: -40px; position: relative; z-index: 2; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.stat { padding: 26px 22px; border-right: 1px solid var(--border); }
.stat:last-child { border-right: 0; }
.stat .num {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .label { color: var(--text-muted); font-size: 0.92rem; margin-top: 4px; }
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}

/* ---------- Sections ---------- */
section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 44px; }
.kicker { font-family: var(--mono); font-size: 0.82rem; color: var(--primary); letter-spacing: 0.04em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -0.02em; line-height: 1.2; margin: 8px 0 12px; }
.section-head p { color: var(--text-muted); margin: 0; }
@media (max-width: 760px) { section { padding: 64px 0; } }

/* About */
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: start; }
.about-text p { margin: 0 0 16px; color: var(--text-muted); }
.about-text p strong { color: var(--text); }
.focus-list { display: grid; gap: 14px; }
.focus-item {
  display: flex; gap: 14px; padding: 18px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px;
}
.focus-item .ico {
  flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary);
}
.focus-item .ico svg { width: 22px; height: 22px; }
.focus-item h3 { font-size: 1rem; margin: 0 0 2px; }
.focus-item p { font-size: 0.92rem; margin: 0; color: var(--text-muted); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* Timeline */
.timeline { position: relative; display: grid; gap: 26px; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--primary), var(--accent), transparent);
}
.job {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 28px;
}
.job::before {
  content: ""; position: absolute; left: -29px; top: 30px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--primary);
}
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-bottom: 4px; }
.job h3 { margin: 0; font-size: 1.2rem; }
.job .company { color: var(--primary); font-weight: 600; }
.job .when { font-family: var(--mono); font-size: 0.84rem; color: var(--text-muted); white-space: nowrap; }
.job .desc { color: var(--text-muted); font-size: 0.95rem; margin: 6px 0 12px; font-style: italic; }
.job ul { margin: 0; padding-left: 20px; color: var(--text-muted); }
.job li { margin: 4px 0; }
.job .sub { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border); }
.job .sub h4 { margin: 0; font-size: 1.02rem; }

/* Achievements */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: var(--shadow); }
.card .metric {
  font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1;
  color: var(--primary); margin-bottom: 12px;
}
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--text-muted); font-size: 0.94rem; }
.card .tag {
  display: inline-block; margin-top: 14px; font-family: var(--mono); font-size: 0.75rem;
  color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px;
}

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skill-group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.skill-group h3 { margin: 0 0 14px; font-size: 1rem; display: flex; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li {
  font-size: 0.88rem; padding: 6px 12px; border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 9%, transparent);
  color: var(--text); border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}
@media (max-width: 860px) { .skills-grid { grid-template-columns: 1fr; } }

/* Credentials */
.cred-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cred { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.cred h3 { margin: 0 0 14px; font-size: 1rem; }
.cred ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cred li strong { display: block; }
.cred li span { color: var(--text-muted); font-size: 0.9rem; }
.badge {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem; font-weight: 600;
  color: #fff; background: linear-gradient(90deg, var(--primary), var(--accent));
  padding: 2px 8px; border-radius: 6px; margin-left: 6px; vertical-align: middle;
}
@media (max-width: 860px) { .cred-grid { grid-template-columns: 1fr; } }

/* Blog teaser */
.blog-teaser {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); padding: 28px;
}
.blog-teaser p { margin: 0; color: var(--text-muted); max-width: 640px; }
.btn-outline { border-color: var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; }
.contact-aside p { color: var(--text-muted); }
.contact-aside .actions { display: grid; gap: 12px; margin-top: 24px; justify-items: start; }
.form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; display: grid; gap: 16px; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.9rem; font-weight: 600; }
.field input, .field textarea, .field select {
  font: inherit; font-size: 0.97rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; color: var(--text-muted); }
.check input { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.hidden { display: none; }
.form .btn { justify-self: start; }
.form-status { font-size: 0.92rem; margin: 0; }
.form-status.ok { color: #16a34a; }
.form-status.err { color: #dc2626; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } .form .row2 { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--hero-bg); color: var(--hero-muted); padding: 36px 0; font-size: 0.9rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.site-footer a { color: var(--hero-muted); }
.site-footer a:hover { color: #fff; }
.footer-links { display: flex; gap: 18px; }

/* Simple pages (blog / privacy / thanks) */
.page-hero { background: var(--hero-bg); color: var(--hero-text); padding: 72px 0 56px; }
.page-hero h1 { margin: 0 0 8px; font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.02em; color: #fff; }
.page-hero p { margin: 0; color: var(--hero-muted); }
.prose { max-width: 760px; }
.prose h2 { font-size: 1.3rem; margin-top: 32px; }
.prose p, .prose li { color: var(--text-muted); }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
}
