/* ==========================================================================
   Carlos Servín — Portfolio
   Minimalist, light, professional theme
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --text: #13161c;
  --text-muted: #5b6472;
  --text-faint: #8a93a3;
  --border: #e7eaf0;
  --accent: #2554e8;
  --accent-dark: #1b3fc4;
  --accent-soft: #eef2ff;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(19, 22, 28, 0.06);
  --shadow: 0 10px 30px -12px rgba(19, 22, 28, 0.16);
  --shadow-lg: 0 24px 48px -20px rgba(19, 22, 28, 0.22);
  --max-width: 1120px;
  --header-h: 76px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

p {
  margin: 0;
}

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

section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 56px;
}

.section-head .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: 12px;
}

.section-head p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* .reveal previously drove a scroll-triggered fade-in via JS. Dropped:
   on tall pages the opt-in class raced the IntersectionObserver callback
   and could leave whole sections invisible. Content is simply visible. */
.reveal {
  opacity: 1;
  transform: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px -8px rgba(37, 84, 232, 0.55);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -10px rgba(37, 84, 232, 0.55);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* ==========================================================================
   Header / Nav
   ========================================================================== */

#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0);
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}

#site-header.scrolled {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom-color: var(--border);
}

#site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-menu a {
  padding: 9px 13px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-btn {
  width: auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
}

/* ==========================================================================
   Hero
   ========================================================================== */

#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  background:
    radial-gradient(60% 50% at 85% 12%, var(--accent-soft) 0%, rgba(238, 242, 255, 0) 70%),
    var(--bg);
}

#hero .container {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
}

#hero h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  margin-bottom: 16px;
}

#hero h1 .highlight {
  color: var(--accent);
}

.hero-role {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 22px;
  height: 1.6em;
  display: flex;
  align-items: center;
}

.hero-role .role-text {
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.hero-role .role-text.swap {
  opacity: 0;
  transform: translateY(6px);
}

.hero-lede {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 46ch;
  margin-bottom: 34px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

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

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

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

.hero-photo-wrap {
  position: relative;
  justify-self: center;
}

.hero-photo-wrap .blob {
  position: absolute;
  inset: -18px;
  background: linear-gradient(145deg, var(--accent), #7aa2ff);
  border-radius: 36% 64% 62% 38% / 42% 40% 60% 58%;
  opacity: 0.16;
  z-index: 0;
  animation: blob-move 10s ease-in-out infinite;
}

@keyframes blob-move {
  0%, 100% { border-radius: 36% 64% 62% 38% / 42% 40% 60% 58%; }
  50% { border-radius: 58% 42% 40% 60% / 58% 62% 38% 42%; }
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: min(340px, 70vw);
  height: min(340px, 70vw);
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid #fff;
  box-shadow: var(--shadow-lg);
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scroll-cue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-faint);
  animation: bob 2.2s ease-in-out infinite;
}

.scroll-cue svg {
  width: 22px;
  height: 22px;
}

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

/* ==========================================================================
   About
   ========================================================================== */

#about .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

#about .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

#about h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: 20px;
}

#about .about-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 18px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 26px 0 30px;
}

.info-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.98rem;
}

.info-list svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.info-list b {
  font-weight: 600;
  margin-right: 4px;
}

.fact-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fact-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.fact-card .fact-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fact-card svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.fact-card h4 {
  font-size: 0.98rem;
  margin-bottom: 2px;
}

.fact-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ==========================================================================
   Skills
   ========================================================================== */

.skills-categories {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px 48px;
  max-width: 900px;
  margin: 0 auto;
}

.skill-category h4 {
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-chips span {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
}

.section-alt .tool-chips span {
  background: #fff;
}

/* ==========================================================================
   Experience timeline
   ========================================================================== */

.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

.timeline-item {
  position: relative;
  padding-left: 44px;
  padding-bottom: 40px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 24px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: 0;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
}

.timeline-dot::after {
  content: '';
  position: absolute;
  inset: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.timeline-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
}

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.timeline-head h3 {
  font-size: 1.08rem;
  margin-bottom: 4px;
}

.timeline-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.timeline-date {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.timeline-bullets {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.timeline-bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.timeline-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ==========================================================================
   Projects / Portfolio
   ========================================================================== */

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.project-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: transparent;
}

.project-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-alt);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-thumb img {
  transform: scale(1.05);
}

.project-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), #f6f8fb);
}

.project-thumb.placeholder svg {
  width: 52px;
  height: 52px;
  color: var(--accent);
  opacity: 0.55;
}

.project-body {
  padding: 26px 28px 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.project-body h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.project-body p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-bottom: 18px;
  flex: 1;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.94rem;
}

.project-link svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.project-card:hover .project-link {
  color: var(--accent);
}

.project-card:hover .project-link svg {
  transform: translate(3px, -3px);
}

/* ==========================================================================
   Emprendimiento
   ========================================================================== */

.venture-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.venture-visual {
  background: linear-gradient(160deg, var(--accent) 0%, #1b3fc4 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 32px;
  text-align: center;
}

.venture-visual svg {
  width: 56px;
  height: 56px;
}

.venture-visual span {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}

.venture-visual small {
  opacity: 0.85;
  font-size: 0.85rem;
}

.venture-content {
  padding: 44px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.venture-content .eyebrow {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.venture-content h3 {
  font-size: 1.5rem;
  margin-bottom: 14px;
}

.venture-content p {
  color: var(--text-muted);
  margin-bottom: 22px;
}

/* ==========================================================================
   Contact
   ========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 900px;
  margin: 0 auto 44px;
}

.contact-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 22px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.contact-card svg {
  width: 26px;
  height: 26px;
  color: var(--accent);
  margin-bottom: 14px;
}

.contact-card h4 {
  font-size: 0.9rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.contact-card p, .contact-card a {
  font-weight: 600;
  font-size: 1rem;
}

.contact-cta {
  text-align: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */

#footer {
  background: #11141a;
  color: #aeb4c0;
  padding: 48px 0 28px;
}

#footer .footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#footer .logo {
  color: #fff;
}

#footer .footer-social {
  display: flex;
  gap: 10px;
}

#footer .icon-btn {
  border-color: rgba(255, 255, 255, 0.14);
  color: #aeb4c0;
}

#footer .icon-btn:hover {
  border-color: var(--accent);
  background: rgba(37, 84, 232, 0.15);
  color: #fff;
}

#footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.86rem;
}

#footer .footer-bottom a:hover {
  color: #fff;
}

.back-to-top {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aeb4c0;
  transition: all 0.2s ease;
}

.back-to-top svg {
  width: 16px;
  height: 16px;
}

.back-to-top:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-3px);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  #hero .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-lede {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-actions,
  .hero-social {
    justify-content: center;
  }

  .hero-photo-wrap {
    order: -1;
  }

  #about .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .venture-card {
    grid-template-columns: 1fr;
  }

  .venture-visual {
    padding: 40px 32px;
  }
}

@media (max-width: 768px) {
  section {
    padding: 72px 0;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 24px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-menu a {
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }

  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .skills-categories {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    padding-left: 32px;
  }

  .timeline-content {
    padding: 22px 20px;
  }

  .timeline-date {
    order: -1;
  }

  #footer .footer-top,
  #footer .footer-bottom {
    justify-content: center;
    text-align: center;
  }
}
