/* =========================================================
   Rogelio Uribe Rivera — Sports Data Analyst Portfolio
   Design system: clean professional (light body + navy hero)
   ========================================================= */

:root {
  --bg:            #f4f7fb;
  --surface:       #ffffff;
  --surface-2:     #eef2f8;
  --ink:           #0f172a;
  --ink-2:         #334155;
  --muted:         #64748b;
  --border:        #e2e8f0;

  --navy-1:        #0b1220;
  --navy-2:        #121c33;
  --navy-3:        #1e2a47;

  --primary:       #2563eb;
  --primary-2:     #3b82f6;
  --primary-soft:  rgba(37, 99, 235, .10);
  --accent:        #10b981;   /* positive / data green */
  --accent-soft:   rgba(16, 185, 129, .12);
  --brand:         #7c3aed;   /* subtle nod to RRoux */

  --radius:        16px;
  --radius-sm:     10px;
  --shadow:        0 6px 24px rgba(15, 23, 42, .07);
  --shadow-lg:     0 18px 50px rgba(15, 23, 42, .18);
  --maxw:          1120px;

  --font-head: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  line-height: 1.2;
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; color: var(--ink-2); }
code {
  font-family: ui-monospace, "SFMono-Regular", "Consolas", monospace;
  font-size: .88em;
  background: var(--surface-2);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 6px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

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

section { padding: 76px 0; }

/* ---------- Language toggle visibility ---------- */
html:not(.lang-en) [data-lang="en"] { display: none !important; }
html.lang-en        [data-lang="es"] { display: none !important; }

/* =========================================================
   Navbar
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 18, 32, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: .2px;
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand .brand-tag { color: #7dd3fc; font-weight: 600; }

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}
.nav-links a {
  color: #cbd5e1;
  font-size: .92rem;
  font-weight: 500;
}
.nav-links a:hover { color: #fff; text-decoration: none; }

/* Language segmented control */
.lang-switch {
  display: inline-flex;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  overflow: hidden;
}
.lang-switch button {
  background: transparent;
  color: #cbd5e1;
  border: 0;
  padding: 6px 12px;
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .5px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-switch button.active {
  background: var(--primary);
  color: #fff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(124, 58, 237, .25), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(37, 99, 235, .28), transparent 55%),
    linear-gradient(160deg, var(--navy-1), var(--navy-2) 55%, var(--navy-3));
  color: #e5e9f4;
  padding: 84px 0 72px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 8px;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #7dd3fc;
  background: rgba(125, 211, 252, .10);
  border: 1px solid rgba(125, 211, 252, .25);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero .role {
  font-family: var(--font-head);
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 600;
  color: #93c5fd;
  margin-bottom: 18px;
}
.hero .lead {
  max-width: 680px;
  color: #c3cce0;
  font-size: 1.05rem;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 8px 22px rgba(37, 99, 235, .35);
}
.btn-ghost {
  background: rgba(255, 255, 255, .06);
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-dark {
  background: var(--ink);
  color: #fff;
}

/* KPI strip */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 46px;
}
.kpi {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: left;
}
.kpi .kpi-top {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi .kpi-sub { font-size: .85rem; color: #aab6d3; margin: 6px 0 0; }

/* =========================================================
   Section headers
   ========================================================= */
.section-head { margin-bottom: 40px; max-width: 720px; }
.section-head .tag {
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--primary);
}
.section-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  margin: 8px 0 10px;
}
.section-head p { color: var(--muted); margin: 0; }
.section-alt { background: var(--surface-2); }

/* =========================================================
   Cards / Expertise grid
   ========================================================= */
.grid {
  display: grid;
  gap: 20px;
}
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #cdd8ec;
}
.card .icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  background: var(--primary-soft);
  margin-bottom: 16px;
}
.card h3 { font-size: 1.12rem; margin-bottom: 8px; }
.card p { font-size: .95rem; margin: 0; color: var(--muted); }

/* =========================================================
   Featured project banner (Sports Monitor Pro)
   ========================================================= */
.featured {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 320px at 90% 10%, rgba(16, 185, 129, .18), transparent 60%),
    linear-gradient(135deg, var(--navy-2), var(--navy-3));
  color: #e5e9f4;
  border-radius: 22px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
  box-shadow: var(--shadow-lg);
}
.featured .badge {
  display: inline-block;
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #6ee7b7;
  background: rgba(16, 185, 129, .14);
  border: 1px solid rgba(16, 185, 129, .3);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.featured h2 { color: #fff; font-size: clamp(1.6rem, 3.2vw, 2.1rem); margin-bottom: 12px; }
.featured p { color: #c3cce0; }
.featured ul { margin: 16px 0 24px; padding: 0; list-style: none; }
.featured li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 8px;
  color: #d4dcee;
  font-size: .96rem;
}
.featured li::before {
  content: "▸";
  position: absolute;
  left: 4px;
  color: #6ee7b7;
}

/* Mini dashboard mock (CSS only) */
.mock {
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 18px;
}
.mock-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}
.mock-head span {
  width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255, 255, 255, .25);
}
.mock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  margin-bottom: 8px;
  font-size: .85rem;
  font-family: var(--font-head);
  color: #cbd5e1;
}
.mock-row b { color: #fff; }
.mock-row .up { color: #6ee7b7; }
.mock-row .down { color: #fca5a5; }
.mock-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 90px;
  margin-top: 14px;
  padding: 0 2px;
}
.mock-bars i {
  flex: 1;
  background: linear-gradient(180deg, var(--primary-2), var(--brand));
  border-radius: 5px 5px 0 0;
  opacity: .9;
}

/* =========================================================
   Experience timeline
   ========================================================= */
.timeline { position: relative; max-width: 820px; margin: 0 auto; }
.timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--primary), var(--brand));
  opacity: .4;
}
.tl-item { position: relative; padding: 0 0 30px 52px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--primary);
}
.tl-item .tl-when {
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--primary);
  text-transform: uppercase;
}
.tl-item h3 { font-size: 1.1rem; margin: 4px 0 2px; }
.tl-item .tl-org { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.tl-item p { font-size: .95rem; margin: 0; }

/* =========================================================
   Skills
   ========================================================= */
.skill-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.skill-block h3 { font-size: 1rem; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--ink-2);
  font-family: var(--font-head);
}
.chip.is-primary { background: var(--primary-soft); border-color: rgba(37,99,235,.25); color: var(--primary); }
.chip.is-accent  { background: var(--accent-soft);  border-color: rgba(16,185,129,.3);  color: #047857; }

/* =========================================================
   Projects grid (game dev — preserved)
   ========================================================= */
.proj-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.proj {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.proj:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
.proj .proj-type {
  font-family: var(--font-head);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand);
}
.proj h3 { font-size: 1.08rem; margin: 6px 0 6px; color: var(--ink); }
.proj p { font-size: .9rem; color: var(--muted); margin: 0 0 14px; }
.proj .proj-meta {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: var(--muted);
}
.proj .proj-meta .arrow { color: var(--primary); font-weight: 700; }

/* =========================================================
   Contact / footer
   ========================================================= */
.contact {
  background: linear-gradient(160deg, var(--navy-1), var(--navy-3));
  color: #e5e9f4;
}
.contact h2 { color: #fff; }
.contact p { color: #c3cce0; }
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.contact-list { list-style: none; padding: 0; margin: 18px 0 0; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #d4dcee;
}
.contact-list .ico {
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,.07);
  display: grid; place-items: center; font-size: 1.1rem;
}
.contact-list a { color: #93c5fd; }

.footer {
  background: var(--navy-1);
  color: #8493b5;
  text-align: center;
  padding: 26px 0;
  font-size: .85rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* =========================================================
   Sub-page (Sports Monitor Pro) helpers
   ========================================================= */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .9rem;
  margin-top: 8px;
}
.subhero { padding: 64px 0 48px; }
.steps { counter-reset: step; display: grid; gap: 16px; }
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 24px 24px 76px;
  box-shadow: var(--shadow);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 22px;
  top: 22px;
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--brand));
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-weight: 700;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { margin: 0; font-size: .95rem; }

.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.feature-list li { display: flex; gap: 14px; align-items: flex-start; }
.feature-list .fi {
  flex: none;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-soft); color: #047857;
  display: grid; place-items: center; font-size: 1.15rem;
}
.feature-list strong { display: block; color: var(--ink); font-family: var(--font-head); }
.feature-list span { color: var(--muted); font-size: .92rem; }

.note {
  background: var(--surface-2);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: .9rem;
  color: var(--ink-2);
}

/* =========================================================
   Case study — badges, metrics, screenshot gallery, table
   ========================================================= */

/* Tech badges (shield-style pills) */
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .3px;
  color: #dbe4f5;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 6px 13px;
  border-radius: 999px;
}
.badge-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.badge-pill .dot.blue { background: var(--primary-2); }
.badge-pill .dot.purple { background: var(--brand); }

/* Metrics row (big number + label) — light section */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}
.metric .num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  background: linear-gradient(135deg, var(--primary), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.metric .lbl { font-size: .85rem; color: var(--muted); margin-top: 6px; }

/* Screenshot gallery */
.shot-feature { margin-bottom: 26px; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }

.shot {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.shot:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }

.shot .winbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: #0b1220;
  border-bottom: 1px solid #1e2a47;
}
.shot .winbar i { width: 10px; height: 10px; border-radius: 50%; background: #33415a; display: block; }
.shot .winbar i:nth-child(1) { background: #f87171; }
.shot .winbar i:nth-child(2) { background: #fbbf24; }
.shot .winbar i:nth-child(3) { background: #34d399; }
.shot .winbar .url {
  margin-left: 10px;
  font-family: var(--font-head);
  font-size: .72rem;
  color: #64748b;
}

.shot .frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0b1220;
}
.shot.feature .frame { aspect-ratio: 21 / 9; }
.shot .frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.shot .frame::after {
  content: "⤢";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(11, 18, 32, .7);
  color: #cbd5e1;
  font-size: .9rem;
  opacity: 0;
  transition: opacity .18s ease;
}
.shot:hover .frame::after { opacity: 1; }

.shot .cap { padding: 14px 16px 16px; }
.shot .cap b { display: block; font-family: var(--font-head); color: var(--ink); font-size: 1rem; }
.shot .cap span { font-size: .88rem; color: var(--muted); }

/* Data pipeline table */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table.data {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: .92rem;
  min-width: 520px;
}
table.data th, table.data td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--border); }
table.data thead th {
  background: var(--ink);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .82rem;
  letter-spacing: .3px;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:nth-child(even) td { background: #f8fafc; }
table.data td:first-child { font-weight: 600; color: var(--ink); font-family: var(--font-head); }

/* Checklist (engineering challenges) */
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.checks li { display: flex; gap: 14px; align-items: flex-start; }
.checks .ck {
  flex: none;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--accent-soft); color: #047857;
  display: grid; place-items: center; font-size: .9rem; font-weight: 700;
  margin-top: 2px;
}
.checks strong { color: var(--ink); font-family: var(--font-head); }
.checks p { margin: 2px 0 0; font-size: .93rem; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 900px) {
  .kpis, .metrics { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .skill-cols, .proj-grid, .gallery { grid-template-columns: repeat(2, 1fr); }
  .featured { grid-template-columns: 1fr; padding: 34px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  section { padding: 56px 0; }
  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--navy-1);
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 8px 24px 16px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 0; width: 100%; }
  .nav-links .lang-switch { margin-top: 10px; }
  .nav-toggle { display: block; margin-left: auto; }
  .kpis, .metrics, .grid-3, .grid-2, .skill-cols, .proj-grid, .gallery { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 50px; }
  .featured { padding: 26px; }
}
