/* =============================================================================
   Photon Design System — sitio público
   ============================================================================= */

body {
  background:
    radial-gradient(1100px 560px at 10% -12%, var(--glow-1) 0, transparent 55%),
    radial-gradient(900px 520px at 104% -4%, var(--glow-2) 0, transparent 52%),
    var(--bg);
  background-attachment: fixed;
}

.skip-link {
  position: fixed; left: 16px; top: -100px; z-index: 100;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  padding: 14px clamp(18px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  backdrop-filter: blur(18px) saturate(1.1);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px; background: var(--ink); color: var(--peach);
  display: grid; place-items: center; font-size: 16px; font-weight: 700; letter-spacing: -0.04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand-text span { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.top-spacer { flex: 1; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.control-group { display: flex; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-pill); background: color-mix(in srgb, var(--surface) 78%, transparent); }
.control-label { padding: 0 8px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.accent-dot {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  background: var(--dot); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.accent-dot[aria-pressed="true"] { border-color: var(--ink); }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-soft); }

.layout {
  display: grid; grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  width: min(1440px, calc(100% - 2 * clamp(18px, 4vw, 48px)));
  margin: 0 auto; padding: 42px 0 90px;
  align-items: start;
}

.sidebar { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 26px; }
.sidebar-title { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); padding-left: 12px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 450;
  border-left: 2px solid transparent; transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.side-nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.side-nav a.active { color: var(--ink); background: var(--surface); border-left-color: var(--peach); font-weight: 500; box-shadow: var(--shadow-soft); }
.side-nav .num { font-family: var(--font-mono); font-size: 10.5px; color: var(--soft); width: 16px; }
.sidebar-note { margin-top: 4px; padding: 14px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.5; }
.sidebar-note b { color: var(--ink); font-weight: 500; }

.content { min-width: 0; display: flex; flex-direction: column; gap: 84px; }

.hero { position: relative; padding: 18px 0 10px; }
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--ink); opacity: .5; }
.hero h1 {
  margin: 0; max-width: 16ch; font-size: var(--fs-display); line-height: 0.95; letter-spacing: -0.055em;
  font-weight: 500; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--peach-ink); }
.hero-lead { max-width: 58ch; margin: 24px 0 0; font-size: 18px; line-height: 1.55; color: var(--muted); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; font-size: 12px; color: var(--soft); }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta i { width: 5px; height: 5px; border-radius: 50%; background: var(--peach); display: inline-block; }

/* Mini app preview */
.preview {
  position: relative; margin-top: 44px; border-radius: var(--r-xl); padding: 16px;
  background: linear-gradient(150deg, #f6c3a8 0%, #fadccd 46%, #fdf0ea 100%);
  border: 1px solid rgba(122, 75, 49, 0.14);
  box-shadow: var(--shadow-card);
  color: #1d1c1a;
  overflow: hidden;
}
.preview::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(600px 240px at 88% -10%, rgba(255,255,255,.55), transparent 60%);
}
.preview-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; position: relative; z-index: 1; }
.preview-dots { display: flex; gap: 5px; }
.preview-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(29,28,26,.22); }
.preview-url { flex: 1; height: 26px; border-radius: var(--r-pill); background: rgba(255,255,255,.55); display: flex; align-items: center; padding: 0 12px; font-family: var(--font-mono); font-size: 10.5px; color: rgba(29,28,26,.6); }
.preview-app { position: relative; z-index: 1; display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 12px; align-items: start; }
.preview-rail { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 12px 0; border-radius: 20px; background: rgba(255,255,255,.38); }
.preview-mark { width: 30px; height: 30px; border-radius: 9px; background: #1d1c1a; color: #f8c7aa; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.preview-rail i { width: 26px; height: 26px; border-radius: 8px; background: rgba(29,28,26,.08); }
.preview-rail i.on { background: #1d1c1a; opacity: .9; }
.preview-main { border-radius: 20px; background: rgba(255,255,255,.72); padding: 16px; backdrop-filter: blur(10px); }
.preview-kicker { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #7a4b31; }
.preview-main h3 { margin: 4px 0 2px; font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.preview-main p { margin: 0; font-size: 12px; color: #6b5a50; }
.preview-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.preview-stat { background: #fff; border: 1px solid rgba(122,75,49,.1); border-radius: 12px; padding: 10px; }
.preview-stat b { display: block; font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.preview-stat span { font-size: 9.5px; color: #7a6a60; }
.preview-row { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.preview-pill { border-radius: 999px; padding: 4px 9px; font-size: 10px; font-weight: 600; background: #e6f7ee; color: #0f5a3a; }
.preview-pill.peach { background: #fbe3d3; color: #7a4b31; }

.section { scroll-margin-top: 92px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.section-head .eyebrow { margin-bottom: 8px; }
.section-head h2 { margin: 0; font-size: var(--fs-h1); line-height: 1.05; letter-spacing: -0.035em; font-weight: 500; }
.section-head p { max-width: 58ch; margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.section-index { font-family: var(--font-mono); font-size: 11px; color: var(--soft); }
.lead { max-width: 66ch; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-6); }
.card + .card { margin-top: 14px; }
.card-soft { background: var(--surface-soft); }
.card-peach {
  color: #1d1c1a; border: 1px solid rgba(122,75,49,.14);
  background: linear-gradient(150deg, #f6c3a8 0%, #fadccd 48%, #fdf0ea 100%);
  box-shadow: var(--shadow-soft);
}
.card-peach p, .card-peach .muted { color: #6b4a39; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border: 0; border-radius: var(--r-sm);
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none;
  cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--surface-soft); }
.btn-soft { background: var(--surface-sunken); color: var(--ink); }
.btn-soft:hover { background: var(--hover); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-danger { background: var(--danger-soft); color: var(--danger-ink); }
.btn-danger:hover { filter: brightness(.97); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 11px; }
.btn-lg { height: 52px; padding: 0 24px; font-size: 15px; border-radius: var(--r-md); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* Formularios */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 52px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); padding: 0 15px; font: inherit; font-size: 15px;
  outline: none; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea { height: auto; min-height: 104px; padding: 13px 15px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--soft); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 8%, transparent); }
.select { appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 23px, calc(100% - 15px) 23px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.hint { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.error-text { font-size: 12.5px; color: var(--danger-ink); }
.input.invalid { border-color: var(--danger); }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ink); }
.switch { position: relative; display: inline-flex; align-items: center; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { width: 100%; height: 100%; border-radius: 999px; background: var(--surface-sunken); border: 1px solid var(--line); transition: background var(--dur) var(--ease); }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-soft); transition: transform var(--dur) var(--ease); }
.switch input:checked + span { background: var(--ink); border-color: var(--ink); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--peach); }

/* Color */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.swatch { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.swatch-color { height: 78px; border-bottom: 1px solid var(--line); }
.swatch-meta { padding: 12px 14px 13px; }
.swatch-meta b { display: block; font-size: 13px; font-weight: 600; }
.swatch-meta code { font-family: var(--font-mono); font-size: 11px; color: var(--muted); text-transform: uppercase; }
.swatch-meta p { margin: 4px 0 0; font-size: 11.5px; color: var(--soft); line-height: 1.4; }
.swatch button { width: 100%; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit; }
.swatch:hover { box-shadow: var(--shadow-soft); }

/* Tipografía */
.type-list { display: flex; flex-direction: column; }
.type-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); align-items: baseline; }
.type-row:first-child { border-top: 0; padding-top: 0; }
.type-label { font-family: var(--font-mono); font-size: 11px; color: var(--soft); }
.type-sample { margin: 0; color: var(--ink); }
.display-sample { font-size: clamp(38px, 5.5vw, 64px); line-height: .98; letter-spacing: -.055em; font-weight: 500; }
.h1-sample { font-size: 34px; line-height: 1.05; letter-spacing: -.035em; font-weight: 500; }
.h2-sample { font-size: 26px; line-height: 1.1; letter-spacing: -.025em; font-weight: 500; }
.h3-sample { font-size: 20px; line-height: 1.2; font-weight: 500; }
.body-sample { font-size: 16px; line-height: 1.6; }
.small-sample { font-size: 14px; color: var(--muted); }
.meta-sample { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.specimen { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 18px; }
.specimen input { max-width: 340px; }

/* Escalas */
.scale-list { display: flex; flex-direction: column; gap: 10px; }
.scale-row { display: grid; grid-template-columns: 64px minmax(0,1fr) 64px; gap: 14px; align-items: center; font-size: 12px; color: var(--muted); }
.scale-bar { height: 10px; border-radius: 999px; background: var(--peach); opacity: .85; }
.radius-grid, .shadow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.radius-tile, .shadow-tile { min-height: 104px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 15px; }
.radius-tile { border-radius: var(--r); }
.radius-tile b, .shadow-tile b { font-size: 13px; font-weight: 600; }
.radius-tile code, .shadow-tile code { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.shadow-tile { border-radius: var(--r-md); box-shadow: var(--sh); }

/* Datos */
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--r-pill); padding: 5px 10px; font-size: 11.5px; font-weight: 600; background: var(--surface-sunken); color: var(--muted); }
.pill.ok { background: var(--success-soft); color: var(--success-ink); }
.pill.warn { background: var(--warning-soft); color: var(--warning-ink); }
.pill.err { background: var(--danger-soft); color: var(--danger-ink); }
.pill.peach { background: var(--peach-soft); color: var(--peach-ink); }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
.stat b { display: block; font-size: 32px; font-weight: 500; letter-spacing: -.04em; line-height: 1; }
.stat span { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-soft); }
.mono { font-family: var(--font-mono); font-size: 12px; }

/* Navegación */
.rail-demo { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: var(--r-pill); background: var(--surface-sunken); width: fit-content; }
.rail-btn { width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.rail-btn:hover { background: var(--hover); }
.rail-btn.on { background: var(--ink); color: var(--peach); }
.rail-btn svg { width: 19px; height: 19px; }

/* Riel lateral canónico */
.rail-spec { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 30px; align-items: start; }
.rail-model { width: 76px; display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 2px 0; }
.rail-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--ink); color: var(--peach);
  display: grid; place-items: center; flex: 0 0 48px;
  font-size: 20px; font-weight: 600; text-decoration: none;
}
.rail-mark.small { width: 40px; height: 40px; border-radius: 12px; flex-basis: 40px; font-size: 16px; }
.rail-nav {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px; border-radius: 30px; background: var(--surface-sunken);
}
.rail-item {
  position: relative; width: 52px; height: 52px; flex: 0 0 52px;
  border: 0; border-radius: 13px; background: transparent; color: var(--ink);
  display: grid; place-items: center; text-decoration: none; cursor: pointer;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.rail-item:hover { background: var(--hover); }
.rail-item.on { background: var(--ink); color: var(--peach); }
.rail-item svg { width: 22px; height: 22px; }
.rail-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rail-avatar {
  position: relative; width: 40px; height: 40px; border-radius: 13px;
  background: var(--peach-soft); color: var(--peach-ink);
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
  cursor: default;
}
.rail-item[data-label]::after, .rail-avatar[data-label]::after {
  content: attr(data-label);
  position: absolute; left: calc(100% + 12px); top: 50%;
  transform: translate(-4px, -50%);
  background: var(--ink); color: var(--bg);
  padding: 6px 9px; border-radius: 8px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  opacity: 0; pointer-events: none; z-index: 30;
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
}
.rail-item:hover::after, .rail-item:focus-visible::after, .rail-avatar:hover::after {
  opacity: 1; transform: translate(0, -50%);
}
.rail-notes { display: flex; flex-direction: column; gap: 13px; }
.rail-note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.rail-note > span {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--soft);
  padding-top: 2px;
}
.rail-note b { display: block; font-size: 13.5px; font-weight: 600; }
.rail-note p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.rail-scale {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px; margin-top: 22px;
}
.rail-scale > div {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px 12px;
}
.rail-scale b { display: block; font-size: 20px; font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.rail-scale span { display: block; margin-top: 4px; font-size: 10.5px; color: var(--soft); }
.rail-mobile {
  display: flex; align-items: center; gap: 10px; width: fit-content;
  padding: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; box-shadow: var(--shadow-soft);
}
.rail-mobile .rail-nav { flex-direction: row; gap: 3px; padding: 4px; border-radius: 16px; }
.rail-mobile .rail-item { width: 42px; height: 42px; flex-basis: 42px; border-radius: 11px; }
.rail-mobile .rail-item::after { display: none; }
.rail-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rail-rules li { position: relative; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.rail-rules li::before { content: "→"; position: absolute; left: 0; color: var(--accent); font-weight: 600; }
.rail-rules.bad li::before { content: "×"; color: var(--danger); }
.rail-rules b { color: var(--ink); font-weight: 500; }
@media (max-width: 760px) {
  .rail-spec { grid-template-columns: 1fr; gap: 22px; }
  .rail-scale { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.tabs { display: inline-flex; gap: 3px; padding: 4px; border-radius: var(--r-sm); background: var(--surface-sunken); }
.tab { border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; padding: 8px 14px; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-soft); }
.tab-panel { margin-top: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-size: 14px; color: var(--muted); }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--soft); }
.breadcrumb b { color: var(--ink); font-weight: 500; }
.breadcrumb span { color: var(--soft); }

/* Feedback */
.alert { display: flex; gap: 11px; padding: 14px 16px; border-radius: var(--r-sm); font-size: 13.5px; line-height: 1.5; border: 1px solid transparent; }
.alert.ok { background: var(--success-soft); color: var(--success-ink); }
.alert.warn { background: var(--warning-soft); color: var(--warning-ink); }
.alert.err { background: var(--danger-soft); color: var(--danger-ink); }
.alert.info { background: var(--info-soft); color: var(--info-ink); }
.empty { text-align: center; padding: 34px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty-tile { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: var(--r-sm); background: var(--peach-soft); color: var(--peach-ink); display: grid; place-items: center; }
.empty h3 { margin: 0 0 5px; font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.empty p { margin: 0 auto; max-width: 38ch; font-size: 13.5px; color: var(--muted); }
.skeleton { border-radius: var(--r-xs); background: linear-gradient(90deg, var(--surface-sunken) 0%, var(--surface-soft) 50%, var(--surface-sunken) 100%); background-size: 200% 100%; animation: shimmer 1.6s infinite linear; }
.skeleton-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Movimiento */
.motion-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.motion-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; transition: transform 260ms var(--ease), box-shadow 260ms var(--ease), border-color 260ms var(--ease); }
.motion-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-float); border-color: var(--line-strong); }
.motion-card b { display: block; font-size: 14px; font-weight: 600; }
.motion-card span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.motion-play .bar { height: 8px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; margin-top: 14px; }
.motion-play .bar i { display: block; width: 18%; height: 100%; background: var(--peach); border-radius: inherit; transition: width 520ms var(--ease); }
.motion-play.playing .bar i { width: 100%; }

/* Productos */
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.product-card { position: relative; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; text-decoration: none; color: var(--ink); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.product-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 15px; background: var(--peach-soft); color: var(--peach-ink); }
.product-card h3 { margin: 2px 0 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.product-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.product-card code { margin-top: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--soft); }

/* Código */
.code-block { position: relative; margin: 0; border-radius: var(--r-md); border: 1px solid var(--line); background: #12151a; color: #d9e0ea; overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #232a33; font-size: 11px; color: #8e99a8; font-family: var(--font-mono); }
.copy-btn { border: 1px solid #2d3541; background: #1a1f27; color: #aab4c3; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 10.5px; cursor: pointer; }
.copy-btn:hover { color: #fff; }
pre { margin: 0; padding: 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 12px; line-height: 1.65; }
.code-ink { color: #f3d2ba; }
.code-accent { color: #b8f25a; }
.code-muted { color: #7d8795; }

/* Checklist */
.checklist { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font-size: 13.5px; color: var(--ink-soft); }
.checklist li::before { content: "✓"; color: var(--success); font-weight: 700; line-height: 1.3; }
.checklist li b { color: var(--ink); font-weight: 600; }

/* Toast global */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow-float); z-index: 80;
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  max-width: min(90vw, 520px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Footer */
.footer { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; font-size: 12px; color: var(--soft); }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* Utilidades de demo */
.demo { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.demo + .demo { margin-top: 12px; }
.demo-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--peach); display: inline-block; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; gap: 34px; }
  .sidebar { position: static; order: 0; }
  .side-nav { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .side-nav a { border-left: 0; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); }
  .side-nav a.active { border-color: var(--peach); }
  .sidebar-note { display: none; }
  .sidebar-title { display: none; }
  .content { order: 1; }
  .type-row { grid-template-columns: 92px minmax(0,1fr); }
}

@media (max-width: 780px) {
  .topbar { padding: 12px 16px; }
  .brand-text span { display: none; }
  .control-group .control-label { display: none; }
  .layout { width: calc(100% - 32px); padding-top: 26px; }
  .hero h1 { max-width: none; }
  .hero-lead { font-size: 16px; }
  .preview-app { grid-template-columns: 1fr; }
  .preview-rail { flex-direction: row; justify-content: flex-start; padding: 8px 10px; }
  .preview-rail i:nth-of-type(n+4) { display: none; }
  .section { scroll-margin-top: 78px; }
  .section-head h2 { font-size: 30px; }
  .grid-2, .grid-3, .stat-grid, .motion-grid, .product-grid, .checklist { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; gap: 6px; }
  .swatch-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .footer { flex-direction: column; align-items: flex-start; }
}

.hidden { display: none !important; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Riel en dark: se invierte el contraste del activo y la marca. */
html[data-theme="dark"] .rail-mark { color: var(--bg); }
html[data-theme="dark"] .rail-item.on { background: var(--peach); color: var(--bg); }
