:root {
  --ink: #101014;
  --paper: #0c0c10;
  --surface: #16161d;
  --line: rgba(255, 255, 255, .09);
  --text: #ececf1;
  --muted: #9a9aa6;
  --radius: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--paper);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Stage (tool, sin scroll) ---------- */

.app {
  position: relative;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
}

.stage {
  display: flex;
  height: 100%;
}

.swatch {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  padding: 0;
  color: var(--fg, #fff);
  transition: flex-grow .45s var(--ease), filter .2s ease;
  animation: rise .55s var(--ease) backwards;
  animation-delay: calc(var(--i) * 70ms);
}

.swatch.no-anim { animation: none; }

@keyframes rise {
  from { transform: translateY(4%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.swatch:hover { flex-grow: 1.25; }
.swatch:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

.swatch.dragging { opacity: .45; }
.swatch.drop-target::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: currentColor;
  opacity: .8;
}

.hex {
  font-size: clamp(1rem, 2.2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  user-select: none;
  transition: transform .25s var(--ease);
}

.swatch:hover .hex { transform: scale(1.08); }

.role {
  position: absolute;
  bottom: 18px;
  left: 50%;
  translate: -50% 0;
  font-size: .68rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .65;
  user-select: none;
}

.lock {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: .55;
  transition: opacity .2s ease, transform .2s var(--ease), background .2s ease;
}

.lock:hover { opacity: 1; transform: scale(1.1); }
.lock.is-locked { opacity: 1; background: rgba(0, 0, 0, .22); backdrop-filter: blur(4px); }
.lock svg { pointer-events: none; }

.grip {
  position: absolute;
  top: 24px;
  left: 50%;
  translate: -50% 0;
  width: 26px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  opacity: .35;
  cursor: grab;
}

/* ---------- Topbar ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  mix-blend-mode: difference;
  color: #fff;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-weight: 800;
  letter-spacing: .04em;
  color: inherit;
  text-decoration: none;
  pointer-events: auto;
}

.hint {
  font-size: .7rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .7;
}

/* ---------- Dock ---------- */

.dock {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  translate: -50% 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: min(94vw, 860px);
  padding: 12px 14px;
  background: rgba(14, 14, 19, .82);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(14px);
}

.dock-methods {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.chip {
  padding: 9px 14px;
  min-height: 36px;
  font: inherit;
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: all .2s ease;
}

.chip:hover { color: var(--text); border-color: var(--line); }
.chip.is-active { color: var(--ink); background: #fff; font-weight: 600; }
.chip:focus-visible, .btn:focus-visible, .lock:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.dock-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all .2s ease;
}

.btn:hover { background: rgba(255, 255, 255, .14); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: #fff; color: var(--ink); border-color: #fff; }
.btn-primary:hover { background: #e8e8ee; }

.hue-control {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hue-label {
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

#hueOut {
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: right;
}

input[type="range"] {
  appearance: none;
  width: 130px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right,
    hsl(0 80% 60%), hsl(60 80% 55%), hsl(120 70% 50%),
    hsl(180 75% 50%), hsl(240 80% 62%), hsl(300 75% 58%), hsl(360 80% 60%));
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--ink);
}

/* ---------- Export menu ---------- */

.export-wrap { position: relative; }

.export-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
}

.export-menu button {
  display: block;
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: .85rem;
  text-align: left;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.export-menu button:hover { background: rgba(255, 255, 255, .08); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  z-index: 40;
  padding: 10px 18px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  opacity: 0;
  translate: -50% 12px;
  pointer-events: none;
  transition: opacity .25s ease, translate .25s var(--ease);
}

.toast.show { opacity: 1; translate: -50% 0; }

/* ---------- Contenido SEO (debajo del fold) ---------- */

.content {
  max-width: 880px;
  margin: 0 auto;
  padding: 90px 22px 30px;
}

.block { margin-bottom: 72px; }

h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 18px;
}

h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 6px; }

p, li { line-height: 1.75; color: var(--muted); font-size: .98rem; }

strong { color: var(--text); }

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.steps {
  list-style: none;
  counter-reset: paso;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 22px;
}

.steps li {
  counter-increment: paso;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.steps li::before {
  content: "0" counter(paso);
  display: block;
  margin-bottom: 10px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .2em;
  color: #fff;
  opacity: .5;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

summary {
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 32px;
}

summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); transition: rotate .25s var(--ease); }
details[open] summary::after { rotate: 45deg; }
details p { margin-top: 10px; }

.cta {
  text-align: center;
  padding: 46px 20px;
  background: linear-gradient(135deg, #1a1a24, #12121a);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.cta p { margin-bottom: 20px; }

kbd {
  padding: 2px 8px;
  font-family: inherit;
  font-size: .8rem;
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.footer {
  padding: 34px 22px 44px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer nav {
  display: flex;
  gap: 22px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.footer a { color: var(--muted); text-decoration: none; font-size: .88rem; }
.footer a:hover { color: var(--text); }
.footer p { font-size: .8rem; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .stage { flex-direction: column; }
  .swatch { min-height: 0; }
  .hex { font-size: 1.05rem; }
  .role { display: none; }
  .grip { top: 50%; left: 14px; translate: 0 -50%; }
  .dock { gap: 8px; padding: 10px; }
  .hint { display: none; }
  input[type="range"] { width: 96px; }
}

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

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
