:root {
  --bg: #0e0c18;
  --bg-deep: #09070f;
  --panel: rgba(20, 17, 36, 0.82);
  --panel-soft: rgba(26, 22, 46, 0.80);
  --panel-bright: rgba(34, 28, 58, 0.94);
  --text: #edeaff;
  --muted: #8a86a6;
  --line: rgba(138, 108, 232, 0.16);
  --line-strong: rgba(138, 108, 232, 0.30);
  --accent: #9b74f5;
  --accent-deep: #7b52e8;
  --accent-warm: #e8c44a;
  --accent-lime: #90d940;
  --accent-rose: #c084fc;
  --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.48);
  --shadow-md: 0 18px 42px rgba(0, 0, 0, 0.30);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Source Serif 4", Georgia, serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 16%, rgba(110, 58, 220, 0.22), transparent 28%),
    radial-gradient(circle at 86% 12%, rgba(140, 217, 64, 0.10), transparent 24%),
    radial-gradient(circle at 66% 80%, rgba(232, 196, 74, 0.11), transparent 26%),
    linear-gradient(180deg, #0f0c1c 0%, #09060f 52%, #0e0c18 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(138, 108, 232, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 108, 232, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 80%);
}

body::after {
  background:
    radial-gradient(circle at 50% 0%, rgba(155, 116, 245, 0.09), transparent 30%),
    linear-gradient(180deg, rgba(155, 116, 245, 0.04), transparent 18%);
  opacity: 0.7;
}

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

a {
  color: inherit;
}

.page-shell {
  position: relative;
  width: min(calc(100% - 34px), var(--content));
  margin: 0 auto;
  padding-bottom: 72px;
}

.brand,
.site-nav a,
.header-cta,
.button,
.timeline-period,
.mini-label,
.cert-badge,
.hero-role,
.hero-kicker,
.hero-meta span,
.value-index,
.stack-list span,
.tag-list li {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

/* ── Header ─────────────────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 8, 20, 0.76);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-md);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-decoration: none;
  color: #100c20;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.header-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.header-cta {
  color: var(--text);
  font-size: 0.92rem;
  border: 1px solid rgba(155, 116, 245, 0.18);
  background: rgba(155, 116, 245, 0.06);
}

.header-cta:hover,
.header-cta:focus-visible,
.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

/* ── Spacing ─────────────────────────────────────────────────────────── */

.hero,
.section,
.closing,
.value-strip {
  margin-top: 34px;
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 26px;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-xl) + 4px);
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(110, 58, 220, 0.14), transparent 32%),
    radial-gradient(circle at 80% 18%, rgba(232, 196, 74, 0.09), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 34%),
    rgba(14, 11, 26, 0.88);
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -6% -32% auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(123, 82, 232, 0.26), transparent 68%);
  filter: blur(12px);
}

.hero-copy,
.hero-panel,
.section,
.closing {
  position: relative;
  z-index: 1;
}

.hero-copy h1,
.section-heading h2,
.closing h2 {
  margin: 0;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  line-height: 0.98;
}

.hero-copy h1 {
  max-width: 10ch;
  font-size: clamp(3rem, 6vw, 5.9rem);
  letter-spacing: -0.055em;
}

.eyebrow,
.mini-label {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.78rem;
}

.hero-kicker {
  margin: 0 0 14px;
  color: rgba(237, 234, 255, 0.55);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-role {
  margin: 20px 0 10px;
  color: var(--accent-warm);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 1.02rem;
}

.hero-summary,
.panel p,
.timeline-content p,
.timeline-content li,
.project-card p,
.value-card p,
.impact-list li {
  font-size: 1.06rem;
  line-height: 1.74;
  color: #ccc8ee;
}

.hero-actions,
.hero-meta,
.closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 28px;
}

.hero-meta {
  margin-top: 24px;
}

.hero-meta span {
  padding: 10px 14px;
  border-radius: 999px;
  color: #d8d4f8;
  font-size: 0.82rem;
  border: 1px solid rgba(138, 108, 232, 0.20);
  background: rgba(138, 108, 232, 0.06);
}

.button {
  border: 1px solid transparent;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.button-primary {
  color: #100c1e;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
}

.button-secondary {
  color: var(--text);
  border-color: rgba(138, 108, 232, 0.22);
  background: rgba(138, 108, 232, 0.07);
}

/* ── Hero panel ──────────────────────────────────────────────────────── */

.hero-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 18px;
}

.portrait-card,
.cert-card,
.impact-card,
.panel,
.project-card,
.closing,
.value-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
}

.portrait-card {
  padding: 16px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(155, 116, 245, 0.05), transparent 36%),
    rgba(16, 13, 30, 0.92);
}

.portrait-frame {
  position: relative;
  border-radius: calc(var(--radius-lg) - 6px);
  overflow: hidden;
  min-height: 420px;
  background:
    radial-gradient(circle at top, rgba(155, 116, 245, 0.28), transparent 32%),
    #0d0b1e;
}

.portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(8, 5, 16, 0.42) 100%);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  transform: scale(1.02);
}

.portrait-card figcaption {
  display: grid;
  gap: 4px;
  padding: 18px 10px 4px;
}

.portrait-card strong,
.stack-list strong,
.value-card h2,
.panel h3,
.project-card h3,
.timeline-content h3,
.cert-card h2 {
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
}

.portrait-card strong {
  font-size: 1.06rem;
}

.portrait-card span {
  color: var(--muted);
}

.hero-side-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.cert-card,
.impact-card,
.panel,
.project-card,
.value-card {
  padding: 24px;
}

.cert-card {
  background:
    radial-gradient(circle at top right, rgba(232, 196, 74, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 38%),
    var(--panel-bright);
}

.cert-card h2 {
  font-size: 1.72rem;
}

.cert-badge {
  display: inline-flex;
  margin: 12px 0 10px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(232, 196, 74, 0.10);
  border: 1px solid rgba(232, 196, 74, 0.22);
  color: var(--accent-warm);
  font-size: 0.82rem;
}

.impact-card {
  background:
    radial-gradient(circle at top left, rgba(155, 116, 245, 0.14), transparent 30%),
    var(--panel-soft);
}

.impact-list {
  margin: 8px 0 0;
  padding-left: 18px;
}

.impact-list li + li {
  margin-top: 10px;
}

/* ── Value strip ─────────────────────────────────────────────────────── */

.value-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.value-card {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(155, 116, 245, 0.04), transparent 44%),
    rgba(12, 10, 22, 0.72);
}

.value-card--dev {
  background:
    radial-gradient(circle at top left, rgba(155, 116, 245, 0.14), transparent 36%),
    rgba(14, 10, 26, 0.80);
  border-color: rgba(155, 116, 245, 0.26);
}

.value-index {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--accent-warm);
  letter-spacing: 0.12em;
  font-size: 0.82rem;
}

.value-card h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

/* ── Sections ────────────────────────────────────────────────────────── */

.section {
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(155, 116, 245, 0.03), transparent 24%),
    rgba(11, 9, 22, 0.76);
  box-shadow: var(--shadow-md);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: clamp(2.1rem, 4vw, 3.45rem);
  letter-spacing: -0.05em;
}

.profile-grid,
.skills-grid,
.project-grid,
.education-layout {
  display: grid;
  gap: 18px;
}

.profile-grid,
.education-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.skills-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-accent {
  background:
    radial-gradient(circle at top right, rgba(155, 116, 245, 0.18), transparent 36%),
    rgba(18, 14, 34, 0.94);
  border-color: rgba(155, 116, 245, 0.24);
}

/* ── Timeline ────────────────────────────────────────────────────────── */

.timeline {
  position: relative;
  display: grid;
  gap: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 118px;
  width: 1px;
  background: linear-gradient(180deg, rgba(155, 116, 245, 0.65), rgba(155, 116, 245, 0.06));
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 28px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 112px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-warm);
  box-shadow: 0 0 0 6px rgba(232, 196, 74, 0.16);
}

.timeline-period {
  padding-top: 10px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}

.timeline-content {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
}

.timeline-content h3,
.panel h3,
.project-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.timeline-company {
  margin: 0 0 14px;
  color: var(--accent-warm);
}

.timeline-content ul {
  margin: 0;
  padding-left: 18px;
}

.timeline-content li + li {
  margin-top: 8px;
}

/* ── Tag list ────────────────────────────────────────────────────────── */

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.tag-list li {
  padding: 8px 13px;
  border-radius: 8px;
  border: 1px solid rgba(138, 108, 232, 0.18);
  background: rgba(138, 108, 232, 0.06);
  color: #d8d4f2;
  font-size: 0.80rem;
}

.tag--cyan {
  border-color: rgba(155, 116, 245, 0.32);
  color: var(--accent-rose);
  background: rgba(155, 116, 245, 0.08);
}

.tag--rose {
  border-color: rgba(144, 217, 64, 0.30);
  color: var(--accent-lime);
  background: rgba(144, 217, 64, 0.07);
}

.tag--warm {
  border-color: rgba(232, 196, 74, 0.30);
  color: var(--accent-warm);
  background: rgba(232, 196, 74, 0.07);
}

/* ── Stack list (education) ──────────────────────────────────────────── */

.stack-list {
  display: grid;
  gap: 18px;
}

.stack-list strong {
  display: block;
  margin-bottom: 4px;
}

.stack-list span,
.site-footer p,
.portrait-card span {
  color: var(--muted);
}

/* ── Closing ─────────────────────────────────────────────────────────── */

.closing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  background:
    radial-gradient(circle at left center, rgba(155, 116, 245, 0.14), transparent 30%),
    rgba(16, 13, 30, 0.92);
}

.closing-actions {
  flex-shrink: 0;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 30px 8px 0;
}

/* ── Desarrollo section ──────────────────────────────────────────────── */

.section--dev {
  background:
    radial-gradient(circle at 88% 8%, rgba(144, 217, 64, 0.08), transparent 28%),
    radial-gradient(circle at 8% 76%, rgba(155, 116, 245, 0.10), transparent 28%),
    linear-gradient(180deg, rgba(155, 116, 245, 0.04), transparent 24%),
    rgba(11, 9, 22, 0.76);
}

.dev-intro-text {
  max-width: 680px;
  margin: 0 0 28px;
  font-size: 1.06rem;
  line-height: 1.74;
  color: #ccc8ee;
}

.stack-showcase {
  display: grid;
  gap: 0;
  margin-bottom: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.stack-row {
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 8, 22, 0.45);
  transition: background 200ms ease;
}

.stack-row:last-child {
  border-bottom: none;
}

.stack-row:hover {
  background: rgba(20, 16, 40, 0.65);
}

.stack-row-label {
  flex-shrink: 0;
  width: 148px;
  padding: 16px 20px;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-right: 1px solid var(--line);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.stack-row .tag-list {
  margin: 12px 16px;
  flex: 1;
}

.dev-project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.dev-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.dev-card--featured {
  background:
    radial-gradient(circle at 92% 0%, rgba(155, 116, 245, 0.18), transparent 42%),
    rgba(16, 12, 32, 0.94);
  border-color: rgba(155, 116, 245, 0.28);
}

.dev-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.dev-card-head .mini-label {
  margin: 0;
}

.dev-badge {
  flex-shrink: 0;
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid rgba(232, 196, 74, 0.24);
  background: rgba(232, 196, 74, 0.08);
  color: var(--accent-warm);
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dev-card h3 {
  margin: 10px 0 8px;
  font-family: "Space Grotesk", "Trebuchet MS", sans-serif;
  font-size: 1.18rem;
}

.dev-card p {
  font-size: 1rem;
  line-height: 1.72;
  color: #ccc8ee;
  flex: 1;
}

/* ── Reveal ──────────────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 760ms ease, transform 760ms ease;
}

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

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1140px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .profile-grid,
  .skills-grid,
  .project-grid,
  .education-layout,
  .value-strip,
  .dev-project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stack-row-label {
    width: 120px;
  }
}

@media (max-width: 860px) {
  .site-header {
    border-radius: 28px;
    flex-direction: column;
    padding: 16px;
  }

  .timeline::before,
  .timeline-item::before {
    display: none;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .timeline-period {
    padding-top: 0;
  }

  .closing {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(calc(100% - 20px), var(--content));
  }

  .hero,
  .section,
  .closing {
    padding: 22px;
  }

  .hero-copy h1 {
    max-width: 100%;
    font-size: clamp(2.6rem, 14vw, 4.1rem);
  }

  .profile-grid,
  .skills-grid,
  .project-grid,
  .education-layout,
  .value-strip,
  .dev-project-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    gap: 12px;
  }

  .portrait-frame {
    min-height: 340px;
  }

  .stack-row {
    flex-direction: column;
  }

  .stack-row-label {
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 10px 16px;
    align-self: auto;
  }

  .stack-row .tag-list {
    margin: 10px 16px 14px;
  }
}
