/* ICPC Uruguay — estilos base */

:root {
  --bg: #0a1628;
  --bg-alt: #0f1e36;
  --surface: #132745;
  --surface-2: #17305a;
  --border: #22375c;
  --text: #eaf1fb;
  --text-dim: #9fb3d1;
  --sky: #4fb4e8;
  --sky-strong: #7fd0ff;
  --gold: #ffcc33;
  --gold-strong: #ffdb6b;
  --danger: #ff6b6b;
  --radius: 14px;
  --max: 1120px;
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(79, 180, 232, 0.16), transparent 60%),
    radial-gradient(50rem 35rem at -10% 20%, rgba(255, 204, 51, 0.10), transparent 55%),
    var(--bg);
}

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

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

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

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

h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
h3 { font-size: 1.25rem; }

p { color: var(--text-dim); margin: 0 0 1em; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sky-strong);
  margin-bottom: 14px;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--gold);
  display: inline-block;
}

.section {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  max-width: 640px;
  margin: 0 0 48px;
}

.section-head.center { margin-inline: auto; text-align: center; }

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

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  color: #1a1200;
  box-shadow: 0 10px 30px -12px rgba(255, 204, 51, 0.55);
}

.btn-primary:hover { box-shadow: 0 14px 34px -10px rgba(255, 204, 51, 0.65); }

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

.btn-outline:hover { border-color: var(--sky); color: var(--sky-strong); }

/* Header */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10, 22, 40, 0.72);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
}

.brand .sun {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg);
  display: grid;
  place-items: center;
}

.brand .sun svg { width: 22px; height: 22px; }

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

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--text-dim);
  transition: color .15s ease, background .15s ease;
}

nav.main-nav a:hover { color: var(--text); background: rgba(255,255,255,0.05); }

nav.main-nav a.is-active { color: var(--sky-strong); }

nav.main-nav a.highlight {
  color: var(--gold-strong);
  font-weight: 700;
}

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

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 42px; height: 42px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.lang-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  cursor: pointer;
  transition: border-color .15s ease;
}

.lang-toggle:hover { border-color: var(--sky); }

.lang-toggle:focus-visible {
  outline: 2px solid var(--sky-strong);
  outline-offset: 2px;
}

.lang-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--sky-strong), var(--sky));
  box-shadow: 0 4px 14px -4px rgba(79, 180, 232, 0.65);
  transition: transform .28s cubic-bezier(.65, 0, .35, 1);
  z-index: 0;
}

.lang-toggle[data-active="en"] .lang-thumb { transform: translateX(100%); }

.lang-option {
  position: relative;
  z-index: 1;
  display: inline-block;
  min-width: 26px;
  padding: 7px 11px;
  border-radius: 999px;
  text-align: center;
  font-family: var(--font-head);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--text-dim);
  transition: color .2s ease;
}

.lang-option.is-active { color: #051524; }

/* Fondo fotografico. La foto va en ::before y el degradado en ::after,
   ambos por debajo del contenido, que sube a z-index 1. La opacidad se
   regula por seccion con --photo-opacity. */
.has-photo { position: relative; isolation: isolate; }

.has-photo > * { position: relative; z-index: 1; }

.has-photo::before,
.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.has-photo::before {
  background-image: var(--photo);
  background-size: cover;
  background-position: var(--photo-position, center);
  opacity: var(--photo-opacity, .12);
}

.has-photo::after {
  background: linear-gradient(180deg,
    rgba(10, 22, 40, .82) 0%,
    rgba(10, 22, 40, .45) 45%,
    var(--bg) 100%);
}

/* Hero: ocupa el viewport completo, contenido centrado.
   El padding superior es mayor que el inferior para compensar
   el header fijo de 72px y que el bloque quede optimamente centrado. */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 128px 0 72px;
  --photo: url("../assets/training-camp.jpg");
  --photo-opacity: .30;
}

#resultados {
  --photo: url("../assets/equipo.jpg");
  --photo-opacity: .38;
  /* Encuadre alto: las caras estan en la franja superior de la foto. */
  --photo-position: center 25%;
}

.hero-inner { text-align: center; }

.hero h1 {
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  max-width: 20ch;
  margin-inline: auto;
  text-wrap: balance;
}

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

.hero-lede {
  font-size: 1.1rem;
  max-width: 62ch;
  margin-inline: auto;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 34px;
}

/* Logic path (about section) */
.path {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.path-step {
  position: relative;
  padding: 22px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.02);
}

.path-step .n {
  font-family: var(--font-head);
  font-size: .8rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
}

.path-step.is-goal {
  border-color: var(--gold);
  background: rgba(255, 204, 51, 0.08);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

/* Timeline / results */
.timeline {
  display: grid;
  gap: 18px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
}

.timeline-item:first-child { border-top: none; }

.timeline-item .year {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--gold-strong);
}

.timeline-item .badge {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(79, 180, 232, 0.14);
  color: var(--sky-strong);
  font-size: .74rem;
  font-weight: 700;
}

/* ICPC House */
#icpc-house {
  background:
    linear-gradient(180deg, rgba(255, 204, 51, 0.05), transparent 40%),
    var(--bg-alt);
}

.house-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 40px 0;
}

/* Variante para listas de actividades: se acomodan solas sin filas huérfanas */
.house-features--auto {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-top: 20px;
}

.feature-card {
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.feature-card .icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: rgba(79, 180, 232, 0.14);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--sky-strong);
}

.goal-callout {
  margin: 24px 0 0;
  padding: 16px 20px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 204, 51, 0.06);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
  font-size: 1.15rem;
}

.funding-goal {
  padding: 26px 30px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 204, 51, 0.35);
  background: rgba(255, 204, 51, 0.06);
  margin: 40px 0 0;
}

.funding-goal-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.funding-goal-icon { font-size: 1.25rem; line-height: 1; }

.funding-goal-label {
  font-family: var(--font-head);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-strong);
}

/* El porcentaje se empuja al extremo opuesto del rotulo. */
.funding-goal-pct {
  margin-left: auto;
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-strong);
  line-height: 1;
}

.progress {
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-strong));
  transition: width .6s cubic-bezier(.65, 0, .35, 1);
}

.funding-goal-amounts {
  margin-top: 12px;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--text);
}

/* En ancho holgado la descripcion y el CTA comparten fila; en angosto se apilan. */
.funding-goal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.funding-goal-foot p { margin: 0; max-width: 40ch; font-size: .92rem; }

.house-driver {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 44px;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.driver-logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s ease, color .15s ease;
}

a.driver-logo:hover { border-color: var(--sky); color: var(--sky-strong); }

/* Sponsors */
.sponsor-tiers { display: grid; gap: 28px; }

.sponsor-main {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 204, 51, 0.35);
  background: rgba(255, 204, 51, 0.06);
}

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

.sponsor-slot {
  padding: 28px 16px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
}

/* Contact */
.contact-inner {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
}

.contact-inner p { margin-bottom: 32px; }

/* CTA grande: pill dorado. Se usa en recaudacion y en contacto. */
.btn-xl {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 20px 44px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-strong), var(--gold));
  color: #1a1200;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  box-shadow: 0 14px 36px -14px rgba(255, 204, 51, 0.6);
  transition: transform .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}

.btn-xl:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px -12px rgba(255, 204, 51, 0.7);
}

/* Page header (subpages) */
.page-header { padding: 152px 0 56px; }

.page-header .page-lede { max-width: 62ch; font-size: 1.05rem; }

/* Competitors */
.team-block {
  padding: 44px 0;
  border-top: 1px solid var(--border);
}

.team-block:first-of-type { border-top: none; padding-top: 0; }

.team-name {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 204, 51, 0.4);
  background: rgba(255, 204, 51, 0.08);
  color: var(--gold-strong);
  font-size: .78rem;
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 16px;
}

.team-name-placeholder {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px dashed var(--border);
  color: var(--text-dim);
  font-size: .78rem;
  font-family: var(--font-head);
  font-weight: 600;
  margin-bottom: 16px;
}

.team-head { margin-bottom: 32px; }

.team-head h3 { margin-bottom: 4px; font-size: 1.4rem; }

.team-head .team-tag {
  margin: 0;
  color: var(--sky-strong);
  font-weight: 600;
  font-size: .92rem;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.member-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.member-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--sky-strong), var(--gold));
  color: #051524;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
}

.member-card h4 { margin: 0; }

.member-role {
  margin: -8px 0 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--gold-strong);
}

.member-card p.member-bio { margin: 0; font-size: .92rem; }

.member-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.member-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: .8rem;
  font-weight: 600;
  transition: color .15s ease, border-color .15s ease;
}

.member-links a:hover { color: var(--sky-strong); border-color: var(--sky); }

.member-links a.cf { font-family: "Space Grotesk", monospace; }

.cf-elo {
  font-weight: 700;
}

/* Placeholder member cards: integrantes de equipo aun sin confirmar */
.member-card.is-placeholder {
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 168px;
  border-style: dashed;
  background: transparent;
}

.member-card.is-placeholder .member-avatar {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-dim);
}

.member-card .placeholder-label {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .92rem;
  color: var(--text-dim);
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}

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

.footer-note { font-size: .85rem; color: var(--text-dim); }

/* Responsive */
@media (max-width: 900px) {
  nav.main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .two-col { grid-template-columns: 1fr; }
  .path { grid-template-columns: repeat(2, 1fr); }
  .house-features { grid-template-columns: 1fr; }
  .sponsor-grid { grid-template-columns: repeat(2, 1fr); }
  .members-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .site-header.nav-open nav.main-nav {
    display: flex;
    position: absolute;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 12px 24px 24px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.6);
    gap: 2px;
  }
}

@media (max-width: 560px) {
  .hero { padding-top: 140px; }
  .page-header { padding-top: 128px; }
  /* El CTA del header no entra junto al logo, el switch de idioma y el
     hamburguesa. Se oculta: el mismo destino esta en el menu y en el hero. */
  .header-cta .btn-primary { display: none; }

  /* A este ancho el pill con padding fijo se desborda de su contenedor:
     pasa a ocupar el ancho completo y puede partir el texto antes que salirse. */
  .btn-xl {
    width: 100%;
    justify-content: center;
    padding: 18px 20px;
    font-size: 1rem;
    white-space: normal;
  }
}
