:root {
  color-scheme: light;
  --size: 2rem;
  --accent: #e5b842; /* Dorado brillante universal */
  --accent-dark: #a37f24; /* Dorado medio para hovers */
  --bg: #0f0e0c; /* Carbón cálido (remplaza al azul medianoche) */
  --surface: #181613; /* Sutilmente más claro para tarjetas */
  --text: #fdfbf7; /* Blanco cálido/marfil legible */
  --text-lecture: #b6b4b0; /* Blanco cálido/marfil legible para lectura */
  --muted: #615d56; /* Gris cálido apagado */
  --border-color: #dbd0b6;

  --spaceC: calc(calc(clamp(48rem, 100vw, 90rem) - 48rem) / 42rem);
  --space: calc(1rem + calc(2rem * var(--spaceC)));
  --padding: calc(1rem + var(--space));
  --fullPadding: 0 calc(1rem + var(--space));

  --h1: 4rem;
  --h2: 2.5rem;
  --h3: 1.75rem;
  --h4: 1.5rem;
  --body: 1.125rem;
  --small: 0.875rem;
  --hero: calc(4.25rem + calc(1.25rem * var(--spaceC)));
  --border-size: 0.1875rem;
  --border: var(--border-size) solid var(--border-color);
}

li {
  list-style: none;
}

h1 {
  font-size: var(--h1);
  font-weight: 500;
}

h2 {
  font-size: var(--h2);
  font-weight: 500;
}

h3 {
  font-size: var(--h3);
  font-weight: 500;
}

h4 {
  font-size: var(--h4);
  font-weight: 500;
}

small {
  font-size: var(--small);
  font-weight: 300;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --accent: #e5b842; /* Dorado brillante universal */
  --accent-dark: #a37f24; /* Dorado medio para hovers */
  --bg: #0f0e0c; /* Carbón cálido (remplaza al azul medianoche) */
  --surface: #181613; /* Sutilmente más claro para tarjetas */
  --text: #fdfbf7; /* Blanco cálido/marfil legible */
  --text-lecture: #b6b4b0; /* Blanco cálido/marfil legible para lectura */
  --muted: #615d56; /* Gris cálido apagado */
  --border-color: #36332e; /* Gris cálido apagado para bordes */
}

html[data-theme="light"] {
  color-scheme: light;
  --accent: #8f6a00; /* Dorado ocre de alto contraste */
  --accent-dark: #664b00; /* Dorado profundo */
  --bg: #f9f7f2; /* Arena muy suave/marfil (remplaza al gris frío) */
  --surface: #ffffff; /* Blanco puro para contraste de tarjetas */
  --text: #1c1a17; /* Negro orgánico cálido */
  --text-lecture: #1c1a17; /* Negro orgánico cálido para lectura */
  --muted: #706b5f; /* Gris ocre para texto secundario */
  --border-color: #dbd0b6; /* Borde suave que unifica la paleta */
}

body {
  position: relative;
  margin: 0;
  padding: 0;
  font-family: "Futura PT", "Futura-pt", "Futura", sans-serif;
  font-size: var(--body);
  font-weight: 300;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  margin-bottom: 1rem;
}

nav {
  display: flex;
  padding: var(--fullPadding);
  border-bottom: var(--border-size) solid var(--border-color);
}

nav > ul {
  margin: 0;
  padding: 0;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: flex-end;
}

nav > ul > h3 {
  margin-right: auto;
}

nav > ul > li > a {
  text-decoration: none;
  color: var(--text);
  font-size: var(--small);
  text-transform: uppercase;
  font-weight: 400;
}

header {
  padding: var(--fullPadding);
}

section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: start;
  margin: var(--space) 0;
  padding-top: calc(var(--padding) / 4);
  padding-bottom: calc(var(--padding) / 2);
  padding-left: var(--padding);
  padding-right: calc(var(--padding) / 2);
  border: var(--border-size) solid var(--border-color);
  max-width: 48rem;
}

section > h2 {
  position: relative;
  margin-top: 0;
  font-size: 1rem;
  letter-spacing: 0.15rem;
  margin-bottom: calc(var(--space) / 4);
  text-transform: uppercase;
}

section > h2::after {
  position: absolute;
  top: 0.5rem;
  right: -2rem;
  content: "";
  display: block;
  width: 1.5rem;
  height: 0.25rem;
  background-color: var(--accent);
}

section > p {
  font-family: "Jost", sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.5rem;
  color: var(--text-lecture);
  font-weight: 350;
}

footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: max(1rem, auto);
  padding: var(--fullPadding);
  border-top: var(--border-size) solid var(--border-color);
  text-align: center;
  font-size: var(--small);
  color: var(--muted);
}

footer > p,
footer > .redes {
  text-wrap: balance;
  margin: calc(var(--space) / 4) 0;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: none;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--accent);
  mask-image: var(--hero-background-image, none);
  -webkit-mask-image: var(--hero-background-image, none);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: right center;
  -webkit-mask-position: right center;
  mask-size: 75%;
  -webkit-mask-size: 75%;
  pointer-events: none;
}

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

.hero h1 {
  --accent-size: 4rem;
  font-size: var(--hero);
  font-weight: 600;
  text-transform: uppercase;
  text-wrap: balance;
  line-height: calc(var(--hero) * 0.8);
  letter-spacing: calc(var(--hero) * 0.05);
  max-width: 10ch;
  border-bottom: 0.3rem solid var(--accent);
  border-image: linear-gradient(
      to right,
      var(--accent),
      var(--accent-dark) var(--accent-size),
      transparent var(--accent-size)
    )
    1;
  margin-top: var(--space);
  padding-bottom: calc(var(--space) / 4);
  margin-bottom: calc(var(--space) / 4);
}

.hero div {
  display: flex;
  flex-direction: column;
  gap: calc(var(--space) / 8);
  font-size: var(--body);
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: calc(var(--space) / 8);
}

.redes {
  display: flex;
  align-items: center;
  gap: var(--space);
}

.redes a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.icon-twitch,
.icon-twitch * {
  fill: currentColor;
  stroke: currentColor;
}

.icon-x {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

.icon-x path {
  fill: currentColor;
}

.redes svg,
.redes svg * {
  width: 1.125rem;
  height: 1.125rem;
  fill: var(--text);
  stroke: var(--text);
  color: var(--text);
}

.nav-item svg,
.nav-item svg * {
  fill: var(--accent) !important;
  stroke: var(--accent) !important;
  color: var(--accent) !important;
}

.cita {
  font-style: italic;
  color: var(--muted);
}

.aclaracion {
  position: relative;
  display: inline-block;
  border-bottom: 0.0625rem dotted var(--muted);
  cursor: help;
}

.aclaracion::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--surface);
  color: var(--text);
  padding: 0.375rem 0.625rem;
  border-radius: 0.25rem;
  font-size: var(--small);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 10;
}

.aclaracion:hover::after,
.aclaracion:focus-visible::after {
  opacity: 1;
  visibility: visible;
}

.nav-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: calc(var(--space) / 4);
  cursor: pointer;
  padding: calc(var(--space) / 4) calc(var(--space) / 2);
}

.nav-option__menu {
  display: none;
}

.nav-option.is-open {
  background-color: var(--surface);
}

.nav-option.is-open > .nav-option__menu {
  display: flex;
  flex-direction: column;
  gap: calc(var(--space) / calc(2 + calc(var(--spaceC) * 4)));
  position: absolute;
  top: 100%;
  left: 0;
  margin: 0;
  padding: calc(var(--space) / 4) calc(var(--space) / 2);
  background-color: var(--surface);
  border-bottom: var(--border-size) solid var(--border-color);
  z-index: 20;
}

.nav-option__menu > li > a {
  text-decoration: none;
  color: var(--text);
  font-size: var(--small);
  font-weight: 400;
}

.nav-item {
  display: grid;
  grid-template-rows: 1fr 1fr;
  grid-template-columns: 2.5rem 1fr;
  align-items: center;
  gap: 0.25rem;
  padding: calc(var(--space) / 4) 0;
  line-height: 0.75rem;
  text-decoration: none;
  text-transform: none;
}
.nav-item > svg {
  grid-area: 1 / 1 / 3 / 2;
  justify-self: center;
  width: 2rem;
  height: 2rem;
  color: var(--accent);
  fill: var(--accent);
  stroke: var(--accent);
}

.nav-item__title {
  grid-area: 1 / 2 / 3 / 2;
  font-size: var(--body);
  font-weight: 500;
  grid-column: 2 / 3;
  grid-row-start: 1;
}

.nav-item > svg * {
  fill: var(--accent);
  stroke: var(--accent);
}
.nav-item__hdr {
  font-size: var(--body);
  font-weight: 500;
}

.nav-item__sub {
  font-size: var(--small);
  font-weight: 400;
  letter-spacing: -0.0625rem;
  color: var(--muted);
  grid-column: 2 / 3;
  grid-row-start: 2;
}

#theme-toggle {
  background: var(--bg);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--space) / 4) calc(var(--space) / 2);
  cursor: pointer;
  border: none;
  margin-left: auto;
}

#theme-toggle > svg {
  height: var(--size);
  width: var(--size);
  display: block;
}

.md {
  font-family: "Jost", sans-serif;
  color: var(--text-lecture);
  max-width: 64rem;
  margin: 0 auto;
  padding: var(--space);
  font-weight: 300;
}

.md > * + * {
  margin-top: 1.25rem;
}

.md h1,
.md h2,
.md h3,
.md h4 {
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.md h1 {
  --accent-size: 3.5rem;
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  color: var(--text);
  background-image: linear-gradient(
    to right,
    var(--accent),
    var(--accent-dark) var(--accent-size),
    transparent var(--accent-size)
  );
  background-repeat: no-repeat;
  background-size: 100% 0.3rem;
  background-position: 0 100%;
}

.md h2,
.md h3,
.md h4 {
  color: var(--accent);
}

.md h2 {
  font-size: clamp(1.5rem, 2.25vw, 2.1rem);
  margin-top: 2.5rem;
}

.md h3 {
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  margin-top: 2rem;
}

.md p {
  line-height: 1.8;
  color: var(--text-lecture);
  font-weight: 300;
}

.md strong {
  color: var(--accent);
  font-weight: 600;
}

.md em {
  color: var(--text-lecture);
}

.md a {
  color: var(--accent);
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.2em;
}

.md a:hover,
.md a:focus-visible {
  color: var(--accent-dark);
}

.md ul,
.md ol {
  padding-left: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.md li {
  list-style: disc;
  line-height: 1.7;
}

.md blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 0.25rem solid var(--accent);
  background-color: var(--surface);
  border-radius: 0 0.25rem 0.25rem 0;
}

.md hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #05070a;
    --surface: #0c1018;
    --text: #f5f7fa;
    --muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.08);
  }
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #f8f7f3;
    --surface: #ffffff;
    --text: #111111;
    --muted: #666666;
    --border-color: #e5e5e5;
  }
}

@media screen and (min-width: 90rem) {
  body {
    padding: 0 calc((100vw - 90rem) / 2);
  }
}

@media screen and (max-width: 48rem) {
  nav > ul {
    position: relative;
    flex-direction: column;
    gap: calc(var(--space) / 4);
    padding-bottom: var(--space);
  }
  .nav-option {
    border-bottom: var(--border);
  }
  .nav-option.is-open {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
  }
  .nav-option.is-open > .nav-option__menu {
    position: relative;
    top: 0;
    left: 0;
    border-bottom: none;
  }
  .hero::before {
    display: none;
  }
  .hero h1 {
    letter-spacing: normal;
  }
  .hero img {
    display: none;
  }
  #theme-toggle {
    position: absolute;
    top: calc(var(--space) * 1.5);
    right: calc(var(--space) * -0.5);
  }
  footer {
    flex-direction: column;
    gap: calc(var(--space) / 4);
    padding: calc(var(--space) / 4) calc(var(--space) / 4);
  }
  .redes {
    justify-content: center;
  }
}
