/* ═══════════════ Pablo Garrido — personal site ═══════════════ */

:root {
  --bg: #191a1c;
  --bg-soft: #1e1f22;
  --surface: #212226;
  --border: #2e2f34;
  --text: #ecebe7;
  --text-dim: #a09d96;
  --gold: #cfa860;
  --gold-soft: rgba(207, 168, 96, 0.10);
  --gold-line: rgba(207, 168, 96, 0.35);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Fira Code", Consolas, monospace;

  /* right-hand pane reserved for the spinning avatar */
  --avatar-pane: 46vw;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(236, 235, 231, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(236, 235, 231, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
}

.gold { color: var(--gold); }

/* ═══════════════ NAV ═══════════════ */

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(25, 26, 28, 0.78);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.scrolled { border-bottom-color: var(--border); }

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 1px;
}

.nav-right { display: flex; align-items: center; gap: 28px; }

.nav-links { display: flex; gap: 26px; }

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold); }

/* ── Language switch (flags) ── */

.lang-switch { display: flex; gap: 8px; }

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  opacity: 0.45;
  filter: saturate(0.75);
  transition: opacity 0.2s, border-color 0.2s, filter 0.2s, transform 0.15s;
}

.lang-btn svg { width: 26px; height: 19px; display: block; border-radius: 3px; }

.lang-btn:hover { opacity: 0.85; transform: translateY(-1px); }

.lang-btn.active {
  opacity: 1;
  filter: saturate(1);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-line), 0 0 14px rgba(207, 168, 96, 0.18);
}

/* ═══════════════ AVATAR PANE (fixed right, frameless) ═══════════════ */

.avatar-pane {
  position: fixed;
  top: 0;
  right: 0;
  width: var(--avatar-pane);
  height: 100vh;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* solid backdrop that quiets the grid behind the bust, so any leftover
   near-bg pixels in the frames sit on a uniform surface */
.avatar-pane::before {
  content: "";
  position: absolute;
  inset: -6%;
  background: radial-gradient(ellipse 62% 58% at 50% 48%,
    var(--bg) 0%,
    var(--bg) 46%,
    rgba(25, 26, 28, 0) 78%);
}

.avatar-glow {
  position: absolute;
  width: 70%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(207, 168, 96, 0.10) 0%,
    rgba(207, 168, 96, 0.04) 42%,
    transparent 70%);
  filter: blur(10px);
}

#avatarCanvas {
  position: relative;
  width: min(94%, 92vh);
  aspect-ratio: 1 / 1;
}

/* ═══════════════ CONTENT COLUMN ═══════════════ */

.content {
  position: relative;
  z-index: 2;
  width: calc(100vw - var(--avatar-pane));
  padding: 0 48px 0 max(32px, calc((100vw - var(--avatar-pane) - 640px) / 2 + 16px));
}

.content > * { max-width: 640px; }

/* ── Hero ── */

.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 70px;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 0.92rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-name {
  font-size: clamp(3rem, 6.4vw, 5.4rem);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 22px;
}

.hero-tagline {
  font-size: 1.18rem;
  color: var(--text-dim);
  max-width: 480px;
  margin-bottom: 26px;
}

.hero-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 34px; }

.chip {
  font-family: var(--mono);
  font-size: 0.8rem;
  padding: 6px 14px;
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--gold-soft);
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.15s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary { background: var(--gold); color: #1a1508; }
.btn-primary:hover { background: #e0bd7b; }

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

.scroll-hint {
  position: absolute;
  bottom: 34px;
  left: 0;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.5s;
}
.scroll-hint.hidden { opacity: 0; }

.scroll-hint-icon {
  display: inline-block;
  animation: bob 1.6s ease-in-out infinite;
  font-size: 1.05rem;
  color: var(--gold);
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ═══════════════ SECTIONS ═══════════════ */

.section { padding: 96px 0; }

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 44px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--gold);
  font-weight: 500;
}

/* ── About ── */

.about-main p { margin-bottom: 18px; color: var(--text-dim); font-size: 1.04rem; }
.about-main strong { color: var(--text); }

.quote {
  margin: 28px 0 40px;
  padding: 18px 24px;
  border-left: 2px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text);
}

.about-facts {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.about-facts li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
}

.fact-num {
  font-family: var(--mono);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.25;
}
.fact-num.fact-text { font-size: 1.25rem; }
.fact-label { color: var(--text-dim); font-size: 0.88rem; }

/* ── Timeline ── */

.timeline {
  position: relative;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: linear-gradient(var(--gold), var(--border));
}

.tl-item {
  position: relative;
  padding-bottom: 40px;
}
.tl-item:last-child { padding-bottom: 0; }

.tl-item::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--gold);
}

.tl-period {
  font-family: var(--mono);
  font-size: 0.83rem;
  color: var(--gold);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.tl-body h3 { font-size: 1.15rem; margin-bottom: 6px; }

.tl-role {
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-dim);
  font-family: var(--mono);
  margin-left: 10px;
}

.tl-body p { color: var(--text-dim); }
.tl-body strong { color: var(--text); }

/* ── Stack ── */

.stack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.stack-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.2s, border-color 0.2s;
}
.stack-card:hover { transform: translateY(-4px); border-color: var(--gold); }

.stack-card h3 { font-size: 0.98rem; margin-bottom: 14px; color: var(--gold); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tags span {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 5px 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
}

/* ── Education / learning ── */

.edu-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 40px;
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}

.edu-year {
  font-family: var(--mono);
  color: var(--gold);
  font-size: 0.85rem;
}

.edu-card h3 { font-size: 1.02rem; flex: 1 1 auto; }
.edu-card p { color: var(--text-dim); font-size: 0.9rem; width: 100%; padding-left: 52px; }

.learning-focus {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
}
.learning-focus h3 { margin-bottom: 12px; font-size: 1.15rem; }
.learning-focus p { color: var(--text-dim); margin-bottom: 22px; }

/* ── Contact ── */

.contact { padding-bottom: 60px; }

.contact-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
}

.contact-sub {
  color: var(--text-dim);
  margin-bottom: 34px;
  font-size: 1.04rem;
}

.footer {
  margin-top: 80px;
  padding: 28px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

/* ═══════════════ Reveal on scroll ═══════════════ */

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint-icon { animation: none; }
}

/* ═══════════════ Responsive ═══════════════ */

@media (max-width: 960px) {
  .nav-links { display: none; }

  /* avatar becomes a large, soft backdrop behind the content */
  .avatar-pane {
    width: 100vw;
    justify-content: center;
    opacity: 0.22;
  }
  #avatarCanvas { width: min(120vw, 96vh); }

  .content {
    width: 100vw;
    padding: 0 24px;
  }
  .content > * { max-width: 640px; margin-left: auto; margin-right: auto; }

  .hero { text-align: center; align-items: center; }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-chips, .hero-cta { justify-content: center; }
  .scroll-hint { left: 50%; transform: translateX(-50%); }

  .about-facts, .stack-grid { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
}
