/* ─────────────────────────────────────────────────────────
   Gerardo González Rodríguez · Design System
   Professional, high-end, clean aesthetics.
   ───────────────────────────────────────────────────────── */

:root {
  /* Colors - Refined Palette */
  --bg:           #0a0f1e;
  --bg-soft:      #121b33;
  --bg-card:      #16213e;
  --bg-card-h:    #1e2d55;
  --fg:           #f1f5f9;
  --fg-soft:      #cbd5e1;
  --fg-mute:      #94a3b8;
  
  --accent:       #38bdf8;
  --accent-strong:#0ea5e9;
  --accent-soft:  rgba(56, 189, 248, 0.1);
  --accent-border:rgba(56, 189, 248, 0.2);
  
  --success:      #10b981;
  --success-soft: rgba(16, 185, 129, 0.1);
  
  --border:       #1e293b;
  --border-soft:  #334155;
  
  --shadow-sm:    0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow:       0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-lg:    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-glow:  0 0 20px rgba(56, 189, 248, 0.15);

  --radius-sm:    8px;
  --radius:       16px;
  --radius-lg:    24px;
  
  --maxw:         1200px;

  /* Typography */
  --f-display:    "Fraunces", Georgia, serif;
  --f-heading:    "Space Grotesk", system-ui, sans-serif;
  --f-body:       "Inter", system-ui, sans-serif;
  --f-mono:       "JetBrains Mono", monospace;

  /* Transitions */
  --t-fast:       0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --t-base:       0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow:       0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:           #f8fafc;
    --bg-soft:      #ffffff;
    --bg-card:      #ffffff;
    --bg-card-h:    #f1f5f9;
    --fg:           #0f172a;
    --fg-soft:      #475569;
    --fg-mute:      #64748b;
    --accent:       #0284c7;
    --accent-strong:#0369a1;
    --accent-soft:  rgba(2, 132, 199, 0.08);
    --accent-border:rgba(2, 132, 199, 0.2);
    --border:       #e2e8f0;
    --border-soft:  #f1f5f9;
    --shadow:       0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  }
}

/* Base Styles */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  line-height: 1.6;
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-image: 
    radial-gradient(circle at 50% -20%, var(--accent-soft), transparent 50%),
    radial-gradient(circle at 100% 20%, rgba(56, 189, 248, 0.03), transparent 40%);
  background-attachment: fixed;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

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

a:hover {
  color: var(--accent-strong);
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.1;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── Header ──────────────────────────────────────────── */
header.top {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: padding var(--t-base);
}

header.top .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
}

.brand {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--fg);
  letter-spacing: -0.02em;
}

header.top nav {
  display: flex;
  gap: 2rem;
  font-family: var(--f-heading);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

header.top nav a {
  color: var(--fg-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

header.top nav a:hover, 
header.top nav a.active {
  color: var(--accent);
}

/* ─── Hero ─────────────────────────────────────────────── */
.hero {
  padding: 8rem 0 4rem;
  text-align: left;
}

.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  max-width: 900px;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.hero .tagline {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--fg-soft);
  max-width: 700px;
  line-height: 1.5;
  margin-bottom: 3rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--f-heading);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  position: relative;
}

.status-pill .dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.4;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.75rem;
  border-radius: 999px;
  font-family: var(--f-heading);
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--t-base);
  cursor: pointer;
  border: 1px solid var(--border);
}

.btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--accent-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn.secondary {
  background: transparent;
  color: var(--fg);
}

.btn.secondary:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* ─── Sections ────────────────────────────────────────── */
section {
  padding: 6rem 0;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.section-head .ico {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 12px;
  border: 1px solid var(--accent-border);
}

.section-head h2 {
  font-family: var(--f-heading);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-head:has(+ .section-sub) {
  margin-bottom: 0.75rem;
}

.section-sub {
  margin: 0 0 3rem 56px;
  color: var(--fg-mute);
  font-size: 1rem;
  font-style: italic;
  max-width: 700px;
}

/* ─── Cards & Grid ────────────────────────────────────── */
.grid-2, .grid-3 {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--t-base);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: var(--accent-border);
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  background: var(--bg-card-h);
}

.card h3 {
  font-family: var(--f-heading);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.card p {
  color: var(--fg-soft);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.card .stack {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  font-family: var(--f-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  text-transform: uppercase;
}

/* ─── Timeline ────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline .item {
  position: relative;
  padding-left: 2.5rem;
}

.timeline .item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 15px;
  height: 15px;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 50%;
  z-index: 1;
}

.timeline .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.timeline .head strong {
  font-family: var(--f-heading);
  font-size: 1.1rem;
  color: var(--fg);
}

.timeline .when {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.timeline .where {
  color: var(--fg-mute);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

/* ─── Stats ───────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 2rem;
  margin-top: 4rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border);
}

.stat .num {
  font-family: var(--f-display);
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat .label {
  font-family: var(--f-heading);
  font-size: 0.75rem;
  color: var(--fg-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ─── Accordion (CV) ──────────────────────────────────── */
.accordion {
  border-top: 1px solid var(--border);
}

details {
  border-bottom: 1px solid var(--border);
}

summary {
  list-style: none;
  padding: 1.5rem 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--f-heading);
  font-weight: 600;
  color: var(--fg);
  transition: color var(--t-fast);
}

summary:hover {
  color: var(--accent);
}

summary::-webkit-details-marker { display: none; }

.acc-chevron {
  width: 20px;
  height: 20px;
  transition: transform var(--t-base);
}

details[open] .acc-chevron {
  transform: rotate(180deg);
}

.acc-body {
  padding: 0 0 2rem;
}

/* ─── Footer ──────────────────────────────────────────── */
footer {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
  margin-top: 4rem;
}

footer .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

footer .copy {
  color: var(--fg-mute);
  font-size: 0.875rem;
}

footer .socials {
  display: flex;
  gap: 1.5rem;
}

footer .socials a {
  color: var(--fg-mute);
  font-size: 1.25rem;
}

footer .socials a:hover {
  color: var(--accent);
  transform: translateY(-3px);
}

/* ─── Animations ───────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--t-slow), transform var(--t-slow);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .hero { padding: 6rem 0 3rem; }
  header.top nav { display: none; } /* Could add a mobile menu later */
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .container { padding: 0 1.5rem; }
}

@media print {
  body { background: #fff; color: #000; }
  header, footer, .btn, .status-pill { display: none !important; }
  section { border: none; padding: 2rem 0; }
  .card { border: 1px solid #ddd; break-inside: avoid; }
  .timeline::before { background: #ddd; }
}

