/* CWNDE 2027 — hoja de estilos
   Paletas: se elige con <html data-palette="...">. Cada una define los mismos colores. */

:root,
html[data-palette="arena"] {          /* arena cálida + terracota */
  --bg: #e8e1d3; --bg-alt: #ddd4c2; --surface: #f1ece2;
  --ink: #1f1b15; --muted: #675d4c; --line: #cdc2ab;
  --accent: #a94b25; --accent-2: #2f5d50; --accent-ink: #ffffff; --wave: #1f1b15;
}
html[data-palette="salvia"] {         /* verde salvia + verde bosque */
  --bg: #dce2d6; --bg-alt: #cfd7c8; --surface: #e8ece3;
  --ink: #172019; --muted: #536051; --line: #bcc7b5;
  --accent: #2b5e4c; --accent-2: #a94b25; --accent-ink: #ffffff; --wave: #172019;
}
html[data-palette="pizarra"] {        /* gris azulado + azul */
  --bg: #d6dce3; --bg-alt: #c8d0da; --surface: #e4e8ee;
  --ink: #131a24; --muted: #505d6f; --line: #b7c1ce;
  --accent: #2441b8; --accent-2: #b8461a; --accent-ink: #ffffff; --wave: #131a24;
}
html[data-palette="lavanda"] {        /* lavanda gris + violeta (guiño a 2025) */
  --bg: #dddae6; --bg-alt: #d0ccdc; --surface: #e9e7f0;
  --ink: #1b1726; --muted: #5b5470; --line: #c2bcd2;
  --accent: #5a3ea6; --accent-2: #0e7480; --accent-ink: #ffffff; --wave: #1b1726;
}
html[data-palette="ocre"] {           /* ocre + petróleo */
  --bg: #e3d7bf; --bg-alt: #d7c9ac; --surface: #eee6d6;
  --ink: #221b10; --muted: #695c42; --line: #c9b994;
  --accent: #0b6a66; --accent-2: #9c3d1a; --accent-ink: #ffffff; --wave: #221b10;
}
html[data-palette="niebla"] {         /* niebla verdeazulada + cobre */
  --bg: #d3dedd; --bg-alt: #c4d2d1; --surface: #e2eae9;
  --ink: #10201f; --muted: #4b605f; --line: #b2c5c3;
  --accent: #a24a1e; --accent-2: #0f6873; --accent-ink: #ffffff; --wave: #10201f;
}

:root {
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 14px;
  color-scheme: light;
}
body { transition: background-color .35s, color .35s; }

/* ---------- idioma: se muestra solo el bloque del idioma activo ---------- */
html[lang="es"] body [lang="en"],
html[lang="en"] body [lang="es"] { display: none !important; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.label, .eyebrow, .num, dt {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- navegación ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.nav.is-scrolled { border-bottom-color: var(--line); }
.nav__inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand__mark { width: 34px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.brand__text { font-family: var(--mono); font-size: 14px; letter-spacing: .04em; }
.brand__text b { font-weight: 500; color: var(--accent); }
.menu { display: flex; gap: 4px; margin-left: auto; }
.menu a {
  text-decoration: none; font-size: 14px; color: var(--muted);
  padding: 8px 10px; border-radius: 8px; transition: color .15s, background .15s;
}
.menu a:hover { color: var(--ink); background: var(--bg-alt); }
.nav__tools { display: flex; align-items: center; gap: 8px; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang button {
  font: 500 12px/1 var(--mono); letter-spacing: .06em;
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 10px; border-radius: 999px; cursor: pointer;
}
html[lang="es"] .lang [data-set-lang="es"],
html[lang="en"] .lang [data-set-lang="en"] { background: var(--ink); color: var(--bg); }
.burger { display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: transparent; border-radius: 10px; cursor: pointer; position: relative; }
.burger i { position: absolute; left: 11px; right: 11px; height: 1.5px; background: var(--ink); transition: transform .2s, top .2s; }
.burger i:nth-of-type(1) { top: 15px; }
.burger i:nth-of-type(2) { top: 23px; }
.burger[aria-expanded="true"] i:nth-of-type(1) { top: 19px; transform: rotate(45deg); }
.burger[aria-expanded="true"] i:nth-of-type(2) { top: 19px; transform: rotate(-45deg); }

@media (max-width: 960px) {
  .burger { display: block; }
  .nav__tools { margin-left: auto; }
  .menu {
    position: fixed; inset: 64px 0 auto 0; margin: 0;
    flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    transform: translateY(-8px); opacity: 0; visibility: hidden;
    transition: opacity .2s, transform .2s, visibility .2s;
  }
  .menu.is-open { transform: none; opacity: 1; visibility: visible; }
  .menu a { font-size: 17px; padding: 12px 0; border-radius: 0; border-bottom: 1px solid var(--line); color: var(--ink); }
  .menu a:last-child { border-bottom: 0; }
  .menu a:hover { background: transparent; }
}

/* ---------- portada ---------- */
.hero { padding-top: clamp(40px, 8vw, 96px); }
.hero__text { max-width: 860px; }
.eyebrow { margin-bottom: 20px; }
.hero__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(40px, 7.2vw, 88px);
  line-height: 1.02;
  letter-spacing: -.02em;
}
.hero__title em { font-style: italic; color: var(--accent); }
.facts {
  display: grid; grid-template-columns: repeat(3, auto); justify-content: start;
  gap: 16px 48px; margin: 40px 0 0;
}
.facts dt { margin-bottom: 6px; }
.facts dd { margin: 0; font-size: 16px; line-height: 1.45; }
.tag {
  display: inline-block; margin-left: 6px; vertical-align: 2px;
  font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); border: 1px solid currentColor; border-radius: 999px; padding: 4px 7px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 15px/1 var(--sans); text-decoration: none;
  padding: 14px 20px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); background: transparent;
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: var(--ink); }
.btn--solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--solid:hover { border-color: var(--accent); transform: translateY(-1px); }

.hero__wave { margin: clamp(32px, 6vw, 64px) 0 0; }
#soliton { display: block; width: 100%; height: clamp(220px, 34vw, 400px); }
.hero__wave figcaption {
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline;
  padding-top: 14px; padding-bottom: 14px;
  font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line);
}
.hero__wave figcaption .mono { color: var(--ink); font-size: 13px; }

@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; gap: 18px; margin-top: 28px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- aviso ---------- */
.notice { display: flex; gap: 12px; align-items: flex-start; padding-top: 24px; padding-bottom: 8px; color: var(--muted); font-size: 14px; }
.notice .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex-shrink: 0; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .notice .dot { animation: none; } }

/* ---------- secciones ---------- */
.section { padding: clamp(64px, 10vw, 120px) 0; border-bottom: 1px solid var(--line); }
.section--alt { background: var(--bg-alt); }
.split { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 32px 64px; }
.section__head .num { margin-bottom: 10px; color: var(--accent); }
.section__head h2 { font-family: var(--serif); font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; letter-spacing: -.01em; }
.section__head--row { display: grid; grid-template-columns: minmax(200px, 1fr) 2fr; gap: 0 64px; margin-bottom: 40px; align-items: end; }
.section__head--row .num { grid-column: 1; }
.section__head--row h2 { grid-column: 1; }
.section__head--row .aside { grid-column: 2; grid-row: 1 / span 2; color: var(--muted); max-width: 52ch; }
@media (max-width: 820px) {
  .split, .section__head--row { grid-template-columns: 1fr; }
  .section__head--row .aside { grid-column: 1; grid-row: auto; margin-top: 14px; }
}

.prose p { font-size: 18px; line-height: 1.65; max-width: 62ch; }
.prose p + p { margin-top: 1em; }
.prose .label { margin: 40px 0 14px; }
.lead { font-size: 18px; max-width: 62ch; margin-bottom: 24px; }

.topics { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
.topics li { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; display: flex; gap: 12px; }
.topics li::before { content: "∂"; font-family: var(--serif); font-style: italic; color: var(--accent); }
@media (max-width: 560px) { .topics { grid-template-columns: 1fr; } }

/* fechas */
.timeline { border-top: 1px solid var(--line); }
.timeline li { display: grid; grid-template-columns: 170px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.timeline .when { font-family: var(--mono); font-size: 14px; }
.timeline .when.tbd { color: var(--muted); }
.timeline .what { font-size: 17px; }
.timeline small { color: var(--muted); font-size: 14px; }
.timeline .is-main .when { color: var(--accent); font-weight: 500; }
.timeline .is-main .what { font-family: var(--serif); font-size: 22px; }
@media (max-width: 560px) { .timeline li { grid-template-columns: 1fr; gap: 4px; } }

/* ponentes */
.people { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px 20px; }
.person img, .person .ph { aspect-ratio: 4 / 5; width: 100%; object-fit: cover; border-radius: var(--radius); background: var(--bg-alt); margin-bottom: 14px; }
.person h3 { font-size: 17px; font-weight: 500; }
.person p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.person--tba .ph {
  border: 1px dashed var(--line); background:
    repeating-linear-gradient(0deg, transparent 0 22px, color-mix(in srgb, var(--line) 60%, transparent) 22px 23px);
  position: relative; overflow: hidden;
}
.person--tba .ph::after {
  /* perfil sech² de un solitón, dibujado con máscara para heredar el color */
  content: ""; position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%;
  background: var(--muted); opacity: .35;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 50'%3E%3Cpath d='M0 46 C 30 46, 38 4, 50 4 S 70 46, 100 46' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 50'%3E%3Cpath d='M0 46 C 30 46, 38 4, 50 4 S 70 46, 100 46' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
.person--tba h3 { color: var(--muted); }
@media (max-width: 900px) { .people { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .people { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; } }

/* programa */
.formats { border-top: 1px solid var(--line); }
.formats li { display: grid; grid-template-columns: 220px 1fr; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.formats b { font-weight: 500; }
.formats li > span { color: var(--muted); }
@media (max-width: 620px) { .formats li { grid-template-columns: 1fr; gap: 4px; } }

/* comités */
.committees { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.committees .label { margin-bottom: 14px; }
.names { border-top: 1px solid var(--line); }
.names li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.names li > span { display: block; color: var(--muted); font-size: 14px; }
.names li.tbd { color: var(--muted); font-style: italic; font-family: var(--serif); font-size: 18px; }
@media (max-width: 620px) { .committees { grid-template-columns: 1fr; } }

/* sede */
.venue { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.venue__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.venue__card h3 { font-family: var(--serif); font-size: 26px; line-height: 1.2; }
.venue__card p:not(.label) { color: var(--muted); }
.venue__info li { padding: 16px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.venue__info li:first-child { padding-top: 0; }
.venue__info b { font-weight: 500; }
.venue__info span { color: var(--muted); }
.link { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 15px; margin-top: auto; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 820px) { .venue { grid-template-columns: 1fr; } }

/* ediciones anteriores */
.editions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.edition {
  display: grid; grid-template-columns: auto 1fr; gap: 24px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; text-decoration: none; transition: border-color .15s, transform .15s;
}
.edition:hover { border-color: var(--accent); transform: translateY(-2px); }
.edition__year { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--accent); }
.edition h3 { font-family: var(--serif); font-size: 24px; margin: 6px 0 10px; }
.edition p:not(.label):not(.edition__year) { color: var(--muted); font-size: 15px; margin-bottom: 16px; }
@media (max-width: 820px) { .editions { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .edition { grid-template-columns: 1fr; gap: 12px; padding: 22px; } }

/* llamado */
.cta { border-bottom: 0; }
.cta__inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cta h2 { font-family: var(--serif); font-size: clamp(28px, 4vw, 44px); }
.cta p { color: var(--muted); max-width: 52ch; }
.cta .btn { margin-top: 8px; max-width: 100%; overflow-wrap: anywhere; }

/* pie */
.footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: 14px; }
.footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.footer a { color: var(--muted); }

/* ---------- franjas animadas entre secciones ---------- */
.strip { margin: 0; border-bottom: 1px solid var(--line); }
.strip canvas { display: block; width: 100%; height: clamp(90px, 12vw, 140px); }
.strip figcaption {
  display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline;
  padding-top: 10px; padding-bottom: 14px; font-size: 13px; color: var(--muted);
}
.strip figcaption .mono { color: var(--ink); font-size: 12.5px; }
.strip--alt { background: var(--bg-alt); }


/* ---------- patrocinadores ---------- */
.sponsors { border-top: 1px solid var(--line); padding: clamp(40px, 6vw, 64px) 0; }
.sponsors .label { text-align: center; margin-bottom: 28px; }
.sponsors__row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 28px clamp(40px, 8vw, 96px); }
.sponsor { display: block; padding: 6px; border-radius: 10px; }
.sponsor__logo {
  display: block; height: clamp(56px, 7vw, 76px); aspect-ratio: var(--ratio);
  background: var(--ink); opacity: .78; transition: opacity .2s, background-color .2s;
  -webkit-mask: var(--logo) center / contain no-repeat;
          mask: var(--logo) center / contain no-repeat;
}
.sponsor:hover .sponsor__logo { opacity: 1; background: var(--accent); }
