/* ─── Tokens ─────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --bg:          #faf9f6;
  --text:        #141414;
  --muted:       #6b6560;
  --soft:        #f0ece3;
  --line:        #e0d9ce;
  --accent:      #0e5c47;
  --accent-light:#e6f2ed;
  --accent-ink:  #ffffff;
  --field:       #ffffff;
  --max:         700px;
  --wide:        960px;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #0e0d0c;
  --text:        #f2ede4;
  --muted:       #9e9690;
  --soft:        #1c1a18;
  --line:        #312e2a;
  --accent:      #c9b56a;
  --accent-light:#26220e;
  --accent-ink:  #100f0d;
  --field:       #181614;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ─── Links ──────────────────────────────────────────────── */
a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--accent) 50%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s;
}

a:hover { color: var(--accent); }

/* ─── Layout ─────────────────────────────────────────────── */
.site-header,
.site-footer,
main {
  width: min(var(--wide), calc(100% - 48px));
  margin-inline: auto;
}

/* ─── Header ─────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0 52px;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  height: auto;
  width: clamp(68px, 7.5vw, 88px);
}

.brand-logo.dark { display: none; }

:root[data-theme="dark"] .brand-logo.light { display: none; }
:root[data-theme="dark"] .brand-logo.dark  { display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}

.nav a {
  text-decoration: none;
  transition: color 0.15s;
}

.nav a:hover { color: var(--text); }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.76rem;
  line-height: 1;
  min-height: 36px;
  padding: 0 14px;
  transition: border-color 0.15s, color 0.15s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Type ───────────────────────────────────────────────── */
h1, h2, h3 {
  font-weight: 400;
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.4rem, 6.5vw, 4.2rem); }
h2 { font-size: clamp(1.5rem, 3.8vw, 2.3rem); }
h3 { font-size: 1.05rem; font-weight: 500; letter-spacing: 0; }

p { margin: 0; }

.eyebrow {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 20px;
  text-transform: uppercase;
}

.lede {
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  line-height: 1.55;
  margin-top: 22px;
}

.micro {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.76rem;
  line-height: 1.5;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  width: min(var(--max), 100%);
  padding: 20px 0 80px;
}

.hero h1 {
  max-width: 680px;
}

.hero-micro {
  margin-top: 18px;
}

/* ─── Buttons ────────────────────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 36px;
}

.button {
  align-items: center;
  background: var(--text);
  border: 1.5px solid var(--text);
  border-radius: 3px;
  color: var(--bg);
  display: inline-flex;
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  justify-content: center;
  letter-spacing: 0.01em;
  min-height: 44px;
  padding: 0 20px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.button.secondary {
  background: transparent;
  color: var(--text);
}

.button.secondary:hover {
  color: var(--accent-ink);
}

/* ─── Sections ───────────────────────────────────────────── */
.section {
  width: min(var(--max), 100%);
  border-top: 1px solid var(--line);
  padding: 60px 0;
}

.section > h2 + p,
.section > h2 + .lede,
.page-intro .lede {
  margin-top: 16px;
}

.section p + p { margin-top: 1.1em; }
.section p.gap { margin-top: 2.8em; }

/* ─── Pillar grid ────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 36px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.pillar {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 22px 20px 24px;
  transition: background 0.15s;
}

.pillar:hover {
  background: var(--soft);
}

.pillar h3 {
  color: var(--text);
}

.pillar p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-top: 8px;
}

/* ─── Signup ─────────────────────────────────────────────── */
.signup {
  background: var(--soft);
  border-radius: 4px;
  margin-top: 28px;
  padding: 28px;
}

.form-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

input:not([type="checkbox"]),
textarea {
  appearance: none;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font: inherit;
  min-height: 44px;
  padding: 10px 13px;
  width: 100%;
  transition: border-color 0.15s;
}

input:not([type="checkbox"]):focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

label {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.consent {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  font-family: var(--sans);
  font-size: 0.76rem;
  gap: 10px;
  line-height: 1.5;
  margin: 10px 0 0;
}

.consent input[type="checkbox"] {
  flex: 0 0 auto;
  height: 16px;
  margin-top: 2px;
  min-height: 0;
  padding: 0;
  width: 16px;
}

.consent span { display: block; }

.consent label {
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 0;
  cursor: pointer;
  line-height: 1.5;
}

/* ─── Article list ───────────────────────────────────────── */
.list {
  display: grid;
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid var(--line);
}

.list a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  transition: color 0.15s;
  font-size: 1.02rem;
}

.list a:hover {
  color: var(--accent);
}

.list a:hover .meta {
  color: var(--accent);
}

.meta {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  flex: 0 0 auto;
  text-transform: uppercase;
  width: 90px;
  transition: color 0.15s;
}

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding: 28px 0 44px;
  font-family: var(--sans);
  font-size: 0.76rem;
}

.site-footer nav {
  display: flex;
  gap: 18px;
}

/* ─── Other pages ────────────────────────────────────────── */
.page-intro {
  width: min(var(--max), 100%);
  padding: 24px 0 56px;
}

.quote {
  border-left: 2px solid var(--accent);
  color: var(--muted);
  margin-top: 28px;
  padding-left: 18px;
}

ul.clean {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

ul.clean li {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.stack {
  display: grid;
  gap: 24px;
}

.contact-form {
  display: grid;
  gap: 16px;
  margin-top: 30px;
}

/* ─── Imagen editorial en prosa ─────────────────────────── */
.prose-img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin-top: 2.4em;
  border-radius: 2px;
  filter: grayscale(60%) contrast(1.05);
  opacity: 0.88;
}


/* ─── Collapsible ────────────────────────────────────────── */
.collapsible {
  border: none;
  padding: 0;
  margin: 0;
}

.collapsible summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.collapsible summary::-webkit-details-marker { display: none; }

.collapsible summary h2 {
  transition: color 0.15s;
}

.collapsible summary:hover h2 {
  color: var(--accent);
}

.collapsible summary::after {
  content: '↓';
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 400;
  color: var(--muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.collapsible[open] summary::after {
  transform: rotate(180deg);
}

.collapsible-body {
  margin-top: 24px;
}

.collapsible-body p + p { margin-top: 1.1em; }
.collapsible-body p.gap { margin-top: 2.8em; }

/* ─── Criterio (palabra destacada) ───────────────────────── */
.criterio {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-top: 4px;
  color: var(--text);
}

/* ─── Hero subtitle (propuesta) ──────────────────────────── */
.hero-sub {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0 0 28px;
}

/* ─── Phase toggle (botón desplegable de fase) ───────────── */
.phase-toggle {
  border: none;
  padding: 0;
  margin: 0;
  width: min(var(--max), 100%);
}

.phase-btn {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  border: 1.5px solid var(--text);
  border-radius: 3px;
  color: var(--bg);
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  min-height: 44px;
  padding: 0 20px;
  margin-top: 40px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.phase-btn::-webkit-details-marker { display: none; }

.phase-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.phase-toggle[open] .phase-btn::after {
  content: ' ↑';
  font-weight: 400;
  opacity: 0.6;
}

.phase-body {
  margin: 0;
  padding: 0;
}

/* ─── Aviso no-cookies ───────────────────────────────────── */
.cookie-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 20px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 14px 20px;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  z-index: 200;
  max-width: min(680px, calc(100% - 48px));
}

.cookie-notice p {
  margin: 0;
  line-height: 1.5;
}

.cookie-notice .button {
  flex-shrink: 0;
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.78rem;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .cookie-notice {
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    max-width: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  html { font-size: 17px; }

  .site-header,
  .site-footer,
  main {
    width: calc(100% - 40px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 36px;
  }

  .nav {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .hero { padding-top: 8px; }

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

  .form-row {
    grid-template-columns: 1fr;
  }

  .button,
  .form-row .button {
    width: 100%;
  }

  .signup {
    margin-inline: -20px;
    border-radius: 0;
    padding: 24px 20px;
  }

  .list a {
    flex-direction: column;
    gap: 4px;
  }

  .meta {
    width: auto;
  }
}
