:root {
  --primary: #203a5b;
  --surface: #f4efe6;
  --accent: #836138;
  --neutral: #4a4a4a;
  --paper: #fffdf8;
  --ink: #18202a;
  --ink-muted: #5a6472;
  --line: color-mix(in srgb, var(--primary) 20%, transparent);
  --shadow: 0 24px 70px rgba(24, 32, 42, 0.14);
  --radius: 8px;
  --font-title: "Source Serif 4", Georgia, serif;
  --font-body: "Source Sans 3", Arial, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
  --theme-transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

/* ── Dark mode base ── */
[data-theme="dark"] {
  --ink: #e8e4dd;
  --ink-muted: #9ea8b3;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --paper: #1a1e24;
  --surface: #13171c;
}

/* ── Dark variants per palette ── */
[data-theme="dark"][data-palette="azul"],
[data-theme="dark"]:not([data-palette]) {
  --primary: #7eb0e0;
  --accent: #c4935a;
  --neutral: #9baab8;
  --surface: #0f1720;
  --paper: #162030;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="borgona"] {
  --primary: #e0758a;
  --accent: #e8cc6a;
  --neutral: #a8a099;
  --surface: #1a0d10;
  --paper: #241218;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="verde"] {
  --primary: #6db88a;
  --accent: #deba7a;
  --neutral: #8fa096;
  --surface: #0c1610;
  --paper: #131f17;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="sideral"] {
  --primary: #7aaac8;
  --accent: #a8b4ba;
  --neutral: #8a9aa8;
  --surface: #0d1520;
  --paper: #121c2a;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="pizarra"] {
  --primary: #8a9ab2;
  --accent: #d4855a;
  --neutral: #8892a2;
  --surface: #0f1218;
  --paper: #161a22;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="arena"] {
  --primary: #c0b0a0;
  --accent: #bba07a;
  --neutral: #9a9490;
  --surface: #181410;
  --paper: #211c17;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="nogal"] {
  --primary: #c49a72;
  --accent: #e8c86e;
  --neutral: #9a8c7e;
  --surface: #130e08;
  --paper: #1c1510;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="noche"] {
  --primary: #c8d4e0;
  --accent: #94a3b8;
  --neutral: #8898a8;
  --surface: #0c0e12;
  --paper: #141820;
  --line: color-mix(in srgb, var(--primary) 20%, transparent);
}

[data-theme="dark"][data-palette="indigo"] {
  --primary: #9098e8;
  --accent: #f5aa40;
  --neutral: #7878c8;
  --surface: #0d0c24;
  --paper: #131230;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="tinta"] {
  --primary: #7aacd8;
  --accent: #f0845a;
  --neutral: #7a9ab8;
  --surface: #0a1018;
  --paper: #111820;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="esmeralda"] {
  --primary: #5cc49a;
  --accent: #e0ae38;
  --neutral: #4aac7c;
  --surface: #081612;
  --paper: #0e1e18;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="ciruela"] {
  --primary: #c080e8;
  --accent: #e8c060;
  --neutral: #9858c0;
  --surface: #130a1e;
  --paper: #1a1028;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="carbon"] {
  --primary: #c8c0bc;
  --accent: #e87044;
  --neutral: #8a7a70;
  --surface: #0c0a09;
  --paper: #161210;
  --line: color-mix(in srgb, var(--primary) 20%, transparent);
}

[data-theme="dark"][data-palette="zafiro"] {
  --primary: #6898e8;
  --accent: #38d4a8;
  --neutral: #4878c0;
  --surface: #080e1c;
  --paper: #0e1828;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="carmin"] {
  --primary: #e07878;
  --accent: #e8c040;
  --neutral: #b05858;
  --surface: #180808;
  --paper: #220e0e;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-theme="dark"][data-palette="canela"] {
  --primary: #d4986a;
  --accent: #4aaea8;
  --neutral: #9a6840;
  --surface: #180e06;
  --paper: #20140a;
  --line: color-mix(in srgb, var(--primary) 25%, transparent);
}

[data-palette="borgona"] {
  --primary: #800020;
  --surface: #e8e5da;
  --accent: #d4af37;
  --neutral: #3d3935;
  --paper: #fffdf8;
}

[data-palette="verde"] {
  --primary: #1a3a2b;
  --surface: #fdfbf7;
  --accent: #c5a059;
  --neutral: #5b5f63;
  --paper: #ffffff;
}

[data-palette="sideral"] {
  --primary: #1a2e40;
  --surface: #f4f6f7;
  --accent: #707c80;
  --neutral: #31363b;
  --paper: #ffffff;
}

[data-palette="pizarra"] {
  --primary: #2c3442;
  --surface: #f5f2ee;
  --accent: #a0522d;
  --neutral: #545c6b;
  --paper: #fdfaf7;
}

[data-palette="arena"] {
  --primary: #4a4238;
  --surface: #faf7f2;
  --accent: #8b7355;
  --neutral: #6b6560;
  --paper: #fffefb;
}

[data-palette="nogal"] {
  --primary: #3b2a1a;
  --surface: #fffcf5;
  --accent: #c9a84c;
  --neutral: #6b5e4e;
  --paper: #ffffff;
}

[data-palette="noche"] {
  --primary: #111827;
  --surface: #f9fafb;
  --accent: #94a3b8;
  --neutral: #374151;
  --paper: #ffffff;
}

[data-palette="indigo"] {
  --primary: #312e81;
  --surface: #eef2ff;
  --accent: #d97706;
  --neutral: #4338ca;
  --paper: #f8f9ff;
}

[data-palette="tinta"] {
  --primary: #1e3a5f;
  --surface: #fff8f6;
  --accent: #e05a3a;
  --neutral: #2d5282;
  --paper: #fffcfb;
}

[data-palette="esmeralda"] {
  --primary: #065f46;
  --surface: #ecfdf5;
  --accent: #b7820a;
  --neutral: #047857;
  --paper: #f6fffc;
}

[data-palette="ciruela"] {
  --primary: #4c1d6b;
  --surface: #fdf8ff;
  --accent: #c9963a;
  --neutral: #6d3a8a;
  --paper: #fffcff;
}

[data-palette="carbon"] {
  --primary: #1c1412;
  --surface: #fbf7f5;
  --accent: #c1440e;
  --neutral: #4a3728;
  --paper: #fffefd;
}

[data-palette="zafiro"] {
  --primary: #0c2d6b;
  --surface: #f0f9ff;
  --accent: #0e9e78;
  --neutral: #1a4a8a;
  --paper: #f8fcff;
}

[data-palette="carmin"] {
  --primary: #8b0000;
  --surface: #fdf6ee;
  --accent: #b8860b;
  --neutral: #6b3030;
  --paper: #fffdf8;
}

[data-palette="canela"] {
  --primary: #7b3f00;
  --surface: #f9f5f0;
  --accent: #1b5e5a;
  --neutral: #5c3317;
  --paper: #fffdf9;
}


.font-playfair {
  --font-title: "Playfair Display", Georgia, serif;
  --font-body: "Source Sans 3", Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, serif;
}

.font-baskerville {
  --font-title: "Libre Baskerville", Georgia, serif;
  --font-body: "Inter", Arial, sans-serif;
  --font-display: "Cinzel", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  transition: var(--theme-transition);
}

body *,
body *::before,
body *::after {
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

@media (prefers-reduced-motion: reduce) {
  body *,
  body *::before,
  body *::after {
    transition-duration: 0.01ms !important;
  }
}

a {
  color: inherit;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 1000;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}

/* ── Scroll progress bar ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  height: 3px;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* ── Scroll reveal ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Global focus states ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Theme toggle button ── */
.theme-toggle {
  flex-shrink: 0;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--neutral);
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.theme-toggle__icon {
  position: absolute;
  display: flex;
  transition: opacity 0.2s ease, transform 0.25s ease;
}

.theme-toggle__icon--light  { opacity: 1;  transform: rotate(0deg) scale(1); }
.theme-toggle__icon--dark   { opacity: 0;  transform: rotate(-30deg) scale(0.7); }

[data-theme="dark"] .theme-toggle__icon--light { opacity: 0;  transform: rotate(30deg) scale(0.7); }
[data-theme="dark"] .theme-toggle__icon--dark  { opacity: 1;  transform: rotate(0deg) scale(1); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

[data-theme="dark"] .site-header {
  background: color-mix(in srgb, var(--paper) 85%, transparent);
}

.brand-link,
.nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-link {
  text-decoration: none;
  font-weight: 700;
  color: var(--primary);
}

.nav a {
  position: relative;
  text-decoration: none;
  font-size: 0.92rem;
  color: var(--neutral);
  padding: 4px 2px;
  transition: color 0.2s ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--primary);
}

.nav a:hover::after,
.nav a[aria-current="page"]::after {
  width: 100%;
}

.mini-seal,
.seal {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--accent);
  color: var(--primary);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.mini-seal {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 0.82rem;
}

.section,
.section-band,
.control-panel {
  padding: clamp(56px, 8vw, 112px) clamp(18px, 5vw, 72px);
}

.section {
  background: var(--paper);
}

.section-band {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, white), var(--paper));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
  min-height: calc(100vh - 68px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.wordmark {
  font-family: var(--font-title);
  line-height: 1.08;
}

h1 {
  max-width: 880px;
  margin: 0;
  color: var(--primary);
  font-size: clamp(3rem, 8vw, 7.6rem);
}

h2 {
  margin: 0;
  color: var(--primary);
  font-size: clamp(2rem, 4.8vw, 4.4rem);
}

h3 {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 1.35rem;
}

.lead {
  margin: 22px 0 12px;
  color: var(--primary);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  font-weight: 600;
}

.hero-copy > p:not(.eyebrow):not(.lead) {
  max-width: 680px;
  color: var(--neutral);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  font: 700 0.95rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.button:active {
  transform: translateY(0);
  box-shadow: none;
}

.button.primary {
  background: var(--primary);
  color: white;
}

.button.primary:hover {
  background: color-mix(in srgb, var(--primary) 85%, black);
}

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

.button.secondary:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

.button[aria-busy="true"] {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.button[aria-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

.hero-stage {
  position: relative;
  display: grid;
  gap: 18px;
}

.signature-card,
.document-preview,
.control-panel,
.type-specimen,
.seal-panel,
.mockup-grid article,
.practice-grid article,
.timeline article,
.option-card,
.palette-card {
  border: 1px solid color-mix(in srgb, var(--card-accent, var(--accent)) 22%, transparent);
  border-radius: var(--radius);
  background: var(--card-bg, var(--paper));
  box-shadow: var(--shadow);
}

.communication {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--paper) 92%, white);
  box-shadow: var(--shadow);
}

.insight-grid article,
.practice-grid article,
.timeline article {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insight-grid article:hover,
.practice-grid article:hover,
.timeline article:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 48px rgba(24, 32, 42, 0.18);
}

.option-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.option-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(24, 32, 42, 0.16);
  border-color: var(--accent);
}

.palette-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, outline 0.15s ease;
}

.palette-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(24, 32, 42, 0.16);
}

select {
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  outline: none;
}

.signature-card {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: clamp(22px, 4vw, 36px);
}

.seal.xl {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  flex: 0 0 auto;
  font-size: 1.35rem;
}

.seal.huge {
  width: min(56vw, 340px);
  height: min(56vw, 340px);
  border-width: 2px;
  border-radius: 50%;
  font-size: clamp(2.8rem, 8vw, 5.8rem);
}

.wordmark {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 1.35rem;
  font-weight: 700;
}

.document-preview {
  padding: clamp(24px, 5vw, 42px);
}

.doc-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--accent);
  color: var(--neutral);
  font-size: 0.82rem;
}

.doc-lines {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.doc-lines span {
  height: 10px;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.doc-lines span:nth-child(2) {
  width: 82%;
}

.doc-lines span:nth-child(3) {
  width: 64%;
}

.doc-lines span:nth-child(4) {
  width: 74%;
}

.control-panel {
  position: relative;
  z-index: 2;
  margin: -42px clamp(18px, 5vw, 72px) 0;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.8fr);
  gap: 24px;
}

.control-panel h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.panel-status {
  margin: 10px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  min-height: 1.4em;
  overflow: hidden;
}

.panel-status-inner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}

.panel-status-inner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.panel-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

#panelTitle {
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

#panelTitle.is-updating {
  opacity: 0.4;
  transform: translateY(-4px);
}

#panelEyebrow {
  transition: color 0.22s ease;
}

/* ── Section changed indicator ── */
.eyebrow--changed {
  position: relative;
}

.eyebrow--changed::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
  vertical-align: middle;
  animation: pulse-dot 1.8s ease-in-out 2;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(1.5); }
}

.eyebrow--changed::after {
  content: " · cambio activo";
  font-size: 0.72em;
  opacity: 0.75;
  letter-spacing: 0.08em;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--neutral);
  font-weight: 700;
  font-size: 0.88rem;
}

select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: 600 0.95rem var(--font-body);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  outline: none;
}

.section-heading {
  max-width: 840px;
  margin-bottom: 34px;
}

.section-heading p:last-child {
  color: var(--neutral);
  font-size: 1.08rem;
}

.insight-grid,
.mockup-grid,
.practice-grid,
.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

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

.insight-grid article,
.practice-grid article,
.timeline article {
  padding: 22px;
}

.insight-grid span,
.timeline span {
  color: var(--accent);
  font-weight: 800;
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(24px, 6vw, 72px);
  align-items: start;
}

.split.reverse {
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
}

.option-list {
  display: grid;
  gap: 14px;
}

.option-card {
  padding: 20px;
}

.option-card.is-recommended {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--surface) 45%, white);
}

.option-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.palette-card {
  padding: 18px;
}

.palette-card.is-active {
  outline: 2px solid var(--accent);
}

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

.swatch {
  min-height: 86px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  display: flex;
  align-items: end;
  padding: 8px;
  color: white;
  font-size: 0.74rem;
  font-weight: 800;
}

.swatch.light {
  color: #222;
}

.type-specimen,
.seal-panel {
  padding: clamp(24px, 5vw, 42px);
}

.type-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 18px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.type-row span {
  color: var(--accent);
  font-weight: 800;
}

.type-row strong {
  color: var(--primary);
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

.seal-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.mockup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mockup-grid article {
  min-height: 260px;
  padding: 24px;
}

.business-card {
  display: grid;
  align-content: space-between;
  background: linear-gradient(90deg, var(--primary) 0 9px, var(--paper) 9px);
}

.accent-line {
  width: 100%;
  height: 1px;
  background: var(--accent);
}

.email-signature small {
  display: block;
  max-width: 520px;
  margin-top: 18px;
  color: var(--neutral);
}

.office-plate {
  text-align: center;
  display: grid;
  place-content: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 28%, white), var(--paper));
}

.plate-line {
  display: block;
  width: 120px;
  height: 2px;
  margin: 0 auto 22px;
  background: var(--accent);
}

.folder-cover {
  display: grid;
  align-content: end;
  background:
    radial-gradient(circle at 80% 18%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 34%),
    var(--primary);
  color: white;
}

.folder-cover .wordmark,
.folder-cover h3,
.folder-cover .seal {
  color: white;
}

.folder-cover .seal {
  border-color: color-mix(in srgb, white 72%, transparent);
  width: 78px;
  height: 78px;
  border-radius: 50%;
  margin-bottom: 30px;
}

.practice-grid article {
  min-height: 190px;
}

.communication {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
}

.rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rules p {
  margin: 0;
  padding: 16px;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--surface) 55%, white);
}

.timeline {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.closing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-weight: 800;
  transition: 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Inline editing ── */
[data-editable] {
  position: relative;
  border-radius: 4px;
  transition: background 0.15s ease, outline 0.15s ease;
  cursor: text;
}

[data-editable]:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  outline: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
  outline-offset: 3px;
}

[data-editable]:focus {
  background: color-mix(in srgb, var(--accent) 8%, white);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

[data-editable][contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: color-mix(in srgb, var(--neutral) 50%, transparent);
  pointer-events: none;
  font-style: italic;
}

/* Edit pencil tooltip */
[data-editable]::after {
  content: "✎";
  position: absolute;
  top: -20px;
  right: 0;
  padding: 2px 6px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  font-style: normal;
  font-weight: 700;
  line-height: 1.4;
}

[data-editable]:hover::after {
  opacity: 1;
}

[data-editable]:focus::after {
  opacity: 0;
}

/* Modified indicator */
[data-editable][data-modified="true"] {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

/* ── Tutorial button ── */
.tutorial-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font: 700 1rem/1 var(--font-body);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease, color 0.18s ease;
  flex-shrink: 0;
}
.tutorial-btn:hover {
  background: var(--primary);
  color: var(--paper);
}

/* ── Tutorial overlay ── */
.tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
}
.tut-overlay:not([hidden]) {
  pointer-events: auto;
}

.tut-spotlight {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  transition: clip-path 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  clip-path: inset(0 0 0 0);
}

.tut-bubble {
  position: absolute;
  width: min(340px, calc(100vw - 32px));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0,0,0,0.06);
  padding: 20px 22px 18px;
  transition: top 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              left 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              right 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              bottom 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.2s ease;
  pointer-events: auto;
}

.tut-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.tut-step-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.tut-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink-muted);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.tut-close:hover {
  background: color-mix(in srgb, var(--ink) 16%, transparent);
  color: var(--ink);
}

.tut-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 8px;
  line-height: 1.3;
}

.tut-desc {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-muted);
  margin: 0 0 16px;
}

.tut-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tut-dots {
  display: flex;
  gap: 5px;
  flex: 1;
  justify-content: center;
}

.tut-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 25%, transparent);
  transition: background 0.2s ease, transform 0.2s ease;
}
.tut-dot.is-active {
  background: var(--primary);
  transform: scale(1.3);
}

.tut-nav-btn {
  min-height: 34px;
  padding: 5px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  font: 600 0.82rem/1 var(--font-body);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.tut-nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.tut-nav-btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--paper);
}
.tut-nav-btn.primary:hover {
  background: color-mix(in srgb, var(--primary) 85%, black);
}
.tut-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* Dark mode adaptations */
[data-theme="dark"] .tut-bubble {
  background: color-mix(in srgb, var(--paper) 80%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 20%, transparent);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.06);
}
[data-theme="dark"] .tut-spotlight {
  background: rgba(0, 0, 0, 0.75);
}

/* Mobile */
@media (max-width: 640px) {
  .tut-bubble {
    width: calc(100vw - 24px);
    left: 12px !important;
    right: 12px !important;
  }
  .tutorial-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
  }
}

/* ── Edit toolbar ── */
.edit-toolbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #18202a;
  color: white;
  border-radius: 40px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

[data-theme="dark"] .edit-toolbar {
  background: #0d1117;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.07);
}

.edit-toolbar:not([hidden]) {
  pointer-events: auto;
}

.edit-toolbar.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.edit-toolbar-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding-right: 8px;
  border-right: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.85);
}

.edit-toolbar-btn {
  min-height: 32px;
  padding: 4px 14px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  background: transparent;
  color: white;
  font: 600 0.82rem/1 var(--font-body);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.edit-toolbar-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.6);
}

.edit-toolbar-btn.danger {
  border-color: rgba(220, 80, 80, 0.6);
  color: #ff9999;
}

.edit-toolbar-btn.danger:hover {
  background: rgba(220, 80, 80, 0.2);
  border-color: rgba(220, 80, 80, 0.9);
}

/* Don't show edit tooltip on seals — too small */
.seal[data-editable]::after {
  top: -24px;
  font-size: 0.65rem;
}

/* ────────────────────────────────────────────
   Dark mode component adjustments
   ──────────────────────────────────────────── */

[data-theme="dark"] .section-band {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--surface) 80%, transparent),
    var(--paper));
}

[data-theme="dark"] .section {
  background: var(--paper);
}

[data-theme="dark"] .signature-card,
[data-theme="dark"] .document-preview,
[data-theme="dark"] .control-panel,
[data-theme="dark"] .type-specimen,
[data-theme="dark"] .seal-panel,
[data-theme="dark"] .mockup-grid article,
[data-theme="dark"] .practice-grid article,
[data-theme="dark"] .timeline article,
[data-theme="dark"] .option-card,
[data-theme="dark"] .communication {
  background: color-mix(in srgb, var(--paper) 80%, var(--surface));
  border-color: color-mix(in srgb, var(--primary) 18%, transparent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .palette-card {
  background: var(--card-surface-dark, #0f1720);
  border-color: color-mix(in srgb, var(--card-accent-dark, var(--card-accent, #7eb0e0)) 28%, transparent);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .palette-card h3 {
  color: var(--card-ink-dark, #ccd8ea);
}

[data-theme="dark"] .palette-card > p {
  color: var(--card-ink-muted-dark, #8a99ad);
}

[data-theme="dark"] .rules p {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}

[data-theme="dark"] .insight-grid article:hover,
[data-theme="dark"] .practice-grid article:hover,
[data-theme="dark"] .timeline article:hover {
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] select {
  background: color-mix(in srgb, var(--paper) 90%, var(--surface));
  color: var(--ink);
  border-color: color-mix(in srgb, var(--primary) 30%, transparent);
}

[data-theme="dark"] .swatch {
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

[data-theme="dark"] .swatch.light {
  color: rgba(0,0,0,0.55);
  text-shadow: none;
}

[data-theme="dark"] .hero-copy > p:not(.eyebrow):not(.lead) {
  color: var(--ink-muted);
}

[data-theme="dark"] .doc-lines span {
  background: color-mix(in srgb, var(--ink) 20%, transparent);
}

[data-theme="dark"] .office-plate {
  background: color-mix(in srgb, var(--paper) 70%, var(--surface)) !important;
}

[data-theme="dark"] .folder-cover {
  background: color-mix(in srgb, var(--surface) 40%, var(--primary)) !important;
}

[data-theme="dark"] .email-signature {
  background: color-mix(in srgb, var(--paper) 85%, var(--surface)) !important;
}

[data-theme="dark"] [data-editable]:focus {
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
}

[data-theme="dark"] .palette-card.is-active {
  outline-color: var(--accent);
}

[data-theme="dark"] .option-card.is-recommended {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--paper));
}

/* ── Tablet (≤ 980px) ── */
@media (max-width: 980px) {
  .hero,
  .split,
  .split.reverse,
  .communication {
    grid-template-columns: 1fr;
  }

  .control-panel {
    grid-template-columns: 1fr;
    margin-left: clamp(18px, 5vw, 72px);
    margin-right: clamp(18px, 5vw, 72px);
  }

  .insight-grid,
  .palette-grid,
  .practice-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seal.huge {
    width: min(40vw, 280px);
    height: min(40vw, 280px);
  }

  .seal-panel {
    padding: 32px 24px;
  }
}

/* ── Mobile (≤ 640px) ── */
@media (max-width: 640px) {

  /* ── Header ── */
  .site-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    gap: 10px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .brand-link span:last-child {
    font-size: 0.82rem;
  }

  .nav {
    /* hidden by default, shown via hamburger-style horizontal scroll */
    display: flex;
    width: auto;
    max-width: calc(100vw - 160px);
    overflow-x: auto;
    padding-bottom: 0;
    gap: 18px;
    scrollbar-width: none;
    flex-shrink: 1;
  }
  .nav::-webkit-scrollbar { display: none; }

  .nav a {
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 2px 0;
  }

  /* ── Global section padding ── */
  .section,
  .section-band {
    padding: 36px 20px;
  }

  /* ── Hero ── */
  .hero {
    min-height: auto;
    display: block;
    padding: 36px 20px 28px;
  }

  .hero-stage {
    display: none;
  }

  h1 {
    font-size: clamp(2rem, 10.5vw, 3rem);
    line-height: 1.1;
    margin-bottom: 8px;
  }

  h2 {
    font-size: clamp(1.45rem, 6.5vw, 2.2rem);
    line-height: 1.2;
  }

  h3 {
    font-size: 1.1rem;
  }

  .lead {
    font-size: 1rem;
    margin: 14px 0 8px;
  }

  .hero-copy > p:not(.eyebrow):not(.lead) {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
  }

  .hero-actions .button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* ── Control panel ── */
  .control-panel {
    margin: 0;
    border-radius: 0;
    padding: 24px 20px;
    box-shadow: none;
    border-left: none;
    border-right: none;
    border-top: 2px solid var(--accent);
  }

  .control-panel h2 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }

  .panel-status {
    font-size: 0.75rem;
    margin-top: 6px;
  }

  .control-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  label {
    font-size: 0.8rem;
    gap: 5px;
  }

  select {
    min-height: 40px;
    font-size: 0.88rem;
    padding: 6px 8px;
  }

  /* ── Section headings ── */
  .section-heading {
    margin-bottom: 20px;
  }

  .section-heading p:last-child {
    font-size: 0.95rem;
  }

  .eyebrow {
    font-size: 0.72rem;
    margin-bottom: 8px;
  }

  /* ── Posicionamiento: insight grid 2 col ── */
  .insight-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .insight-grid article {
    padding: 16px;
    min-height: auto;
  }

  .insight-grid span {
    font-size: 1.1rem;
  }

  /* ── Explorador: split → block, cards compactas ── */
  .split,
  .split.reverse {
    display: block;
    gap: 0;
  }

  .split > div:first-child {
    margin-bottom: 20px;
  }

  .split.reverse > div:last-child {
    margin-bottom: 20px;
  }

  .option-list {
    gap: 10px;
  }

  .option-card {
    padding: 14px;
  }

  .option-card h3 {
    font-size: 0.95rem;
    line-height: 1.3;
  }

  .option-card p {
    font-size: 0.85rem;
    margin: 4px 0 0;
  }

  .badge {
    font-size: 0.7rem;
    padding: 3px 7px;
    min-height: 22px;
    flex-shrink: 0;
  }

  /* ── Paletas: 1 col, swatches 4 col ── */
  .palette-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .palette-card {
    padding: 14px;
  }

  .palette-card h3 {
    font-size: 1rem;
    margin-bottom: 0;
  }

  .palette-card p {
    font-size: 0.85rem;
    margin-top: 8px;
  }

  .swatches {
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    margin: 10px 0 0;
  }

  .swatch {
    min-height: 52px;
    color: transparent;
    padding: 4px;
    overflow: hidden;
    border-radius: 4px;
  }

  /* ── Tipografía: ocultar sello huge, mostrar compacto ── */
  .seal-panel {
    display: none;
  }

  .type-specimen {
    padding: 20px;
  }

  .type-row {
    grid-template-columns: 48px 1fr;
    gap: 10px;
    padding: 14px 0;
  }

  .type-row strong {
    font-size: clamp(1.3rem, 5.5vw, 2rem);
  }

  .type-row p {
    font-size: 0.9rem;
  }

  /* ── Aplicaciones: 1 col ── */
  .mockup-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mockup-grid article {
    min-height: 140px;
    padding: 18px 20px;
  }

  .wordmark {
    font-size: 1.1rem;
  }

  /* ── Areas de practica: 2 col ── */
  .practice-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .practice-grid article {
    padding: 16px;
    min-height: auto;
  }

  /* ── Voz y conducta ── */
  .communication {
    display: block;
    padding: 36px 20px;
  }

  .communication > div:first-child {
    margin-bottom: 16px;
  }

  .rules {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rules p {
    padding: 12px 14px;
    font-size: 0.9rem;
  }

  /* ── Roadmap: 1 col ── */
  .timeline {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .timeline article {
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }

  .timeline article span {
    flex-shrink: 0;
    font-size: 0.78rem;
    font-weight: 800;
    padding-top: 3px;
    min-width: 60px;
  }

  .timeline article h3 {
    font-size: 1rem;
    margin-bottom: 4px;
  }

  .timeline article p {
    font-size: 0.88rem;
    margin: 0;
  }

  /* ── Closing ── */
  .closing {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 36px 20px;
  }

  .closing .button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* ── Edit tooltip — tap is enough ── */
  [data-editable]::after {
    display: none;
  }

  /* ── Edit toolbar — full width ── */
  .edit-toolbar {
    bottom: 12px;
    left: 12px;
    right: 12px;
    width: auto;
    transform: translateX(0) translateY(90px);
    border-radius: 14px;
    padding: 10px 14px;
  }

  .edit-toolbar.is-visible {
    transform: translateX(0) translateY(0);
  }

  .edit-toolbar-btn {
    min-height: 34px;
    padding: 4px 12px;
    font-size: 0.8rem;
  }

  /* ── Toast ── */
  .toast {
    left: 12px;
    right: 12px;
    bottom: 76px;
    text-align: center;
    font-size: 0.88rem;
  }
}

/* ── Small mobile (≤ 400px) ── */
@media (max-width: 400px) {
  h1 {
    font-size: clamp(1.9rem, 10vw, 2.6rem);
  }

  .swatches {
    grid-template-columns: repeat(2, 1fr);
  }

  .swatch {
    min-height: 56px;
  }

  .edit-toolbar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }

  .edit-toolbar-label {
    width: 100%;
    border-right: none;
    padding-right: 0;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
  }
}
