@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;700;900&family=JetBrains+Mono:wght@400;700&display=swap");

:root {
  --azul-claro: #00d4ff;
  --azul-oscuro: #0a1219;
  --naranja-hl: #ff9d00;
  --naranja-oscuro: #b36b00;
  --verde-hl: #00ff88;
  --morado-hl: #b200ff;
  --morado-oscuro: #6b0099;
  --texto-main: #e2e8f0;
  --texto-dim: #64748b;
  --borde: rgba(0, 212, 255, 0.2);
  --carta-bg: rgba(15, 25, 35, 0.9);
  --tema-color: var(--naranja-hl);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  color: var(--texto-main);
  line-height: 1.5;
}

html {
  background-color: var(--azul-oscuro);
}

body {
  background-color: transparent;
  font-family: "Inter", sans-serif;
  overflow-y: scroll;
  padding-bottom: 80px;
}

body.arquimedes {
  --tema-color: var(--azul-claro);
}

body.pascal {
  --tema-color: var(--verde-hl);
}

body.newton {
  --tema-color: var(--morado-hl);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(
      color-mix(in srgb, var(--tema-color) 48%, transparent) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--tema-color) 48%, transparent) 1px,
      transparent 1px
    );
  background-size: 40px 40px;
  mask-image: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 34%,
    rgba(0, 0, 0, 0.7) 62%,
    rgba(0, 0, 0, 1) 82%
  );
  -webkit-mask-image: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 34%,
    rgba(0, 0, 0, 0.7) 62%,
    rgba(0, 0, 0, 1) 82%
  );
}

body::before {
  opacity: 0.58;
  will-change: background-position, opacity;
  animation:
    grid-drift 10s linear infinite,
    grid-breathe 10s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes grid-drift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 40px 40px;
  }
}

@keyframes grid-breathe {
  0% {
    opacity: 0.28;
  }
  25% {
    opacity: 0.38;
  }
  50% {
    opacity: 0.62;
  }
  75% {
    opacity: 0.38;
  }
  100% {
    opacity: 0.28;
  }
}

.header {
  display: flex;
  z-index: 10000;
  position: fixed;
  width: 100%;
  background: var(--azul-oscuro);
  padding: 15px;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 rgb(255, 255, 255);
  backdrop-filter: none;
  align-items: center;
}

.header p {
  display: flex;
  font-size: 20px;
  align-items: center;
  justify-content: left;
  margin-left: 10px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.header p::before {
  content: "λ";
  color: var(--tema-color);
  margin-right: 20px;
  font-size: 30px;
  text-shadow: 0 0 15px var(--tema-color);
}

.header a {
  text-decoration: none;
  position: absolute;
  right: 30px;
  font-size: 20px;
}

.header a::before {
  content: "← VOLVER";
  color: #e2e8f08b;
  text-shadow: 0 0 10px var(--texto-dim);
}

.header a:hover::before {
  color: var(--texto-main);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.espacio {
  height: 125px;
}

.secciones {
  font-size: 12px;
  font-family: "JetBrains Mono", monospace;
  margin: 50px 30px;
  display: flex;
  flex-direction: column;
}

.infografia {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.info-titulo {
  font-size: 25px;
  color: var(--texto-main);
  margin: 40px 50px 0;
  font-family: "JetBrains Mono", monospace;
}

.info-titulo::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background-color: rgba(150, 150, 150, 0.5);
  margin: 20px 0;
}

.info-texto {
  color: var(--texto-main);
  font-size: 20px;
  margin: 0 50px 18px;
  border-left: 2px solid var(--tema-color);
  padding-left: 15px;
  transition: all 0.3s ease;
  text-align: justify;
}

.info-texto:hover {
  background-color: color-mix(in srgb, var(--tema-color) 8%, transparent);
  border-left: 4px solid var(--tema-color);
}

.portal-monitor {
  position: relative;
  width: 85%;
  max-width: none;
  margin: 30px auto;
  background-color: #050505;
  border: 2px solid var(--texto-dim);
  border-radius: 8px;
  box-shadow:
    0 0 20px rgba(0, 0, 0, 0.8),
    inset 0 0 10px rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.portal-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  filter: brightness(1.45) contrast(1.1) grayscale(10%);
}

.portal-monitor::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  z-index: 2;
  pointer-events: none;
}

.portal-caption {
  background-color: var(--texto-dim);
  color: var(--azul-oscuro);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 15px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
}

.formula-box {
  background-color: color-mix(in srgb, var(--tema-color) 8%, transparent);
  border: 1px dashed var(--tema-color);
  padding: 20px;
  text-align: center;
  width: 85%;
  margin: 30px auto;
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-family: "JetBrains Mono", monospace;
}

.videos-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  width: 85%;
  margin: 30px auto;
}

.videos-row .portal-monitor {
  margin: 0;
  width: 100%;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: var(--azul-oscuro);
  border-top: 1px solid var(--borde);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.github-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--texto-dim);
  text-decoration: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  transition: color 0.2s ease;
}

.github-link svg {
  width: 16px;
  height: 16px;
}

.github-link:hover {
  color: var(--tema-color);
}

@media (max-width: 768px) {
  .header a::before {
    content: "←";
    font-size: 25px;
  }

  .secciones {
    margin: 20px 10px;
  }

  .infografia {
    margin-bottom: 0;
  }

  .info-titulo {
    margin: 20px 20px 0;
    font-size: 14px;
  }

  .info-texto {
    margin: 0 10px 14px;
    font-size: 15px;
    line-height: 2;
  }

  .portal-monitor,
  .formula-box {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .videos-row {
    grid-template-columns: 1fr;
    width: 100%;
    margin: 20px 0;
  }

  .portal-caption {
    font-size: 11px;
    padding: 6px 10px;
  }

  .github-link span {
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
