:root {
  --bg-desk: #ffffff;
  --bg-panel: #f4f5f7;
  --bg-paper: #fbfbfc;
  --ink: #111214;
  --ink-muted: #555962;
  --accent-cobalt: #1e40ff;
  --accent-lime: #d4f542;
  --accent-coral: #ff5a36;
  --border: #111214;
  --hairline: #dcdfe4;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-pill: 999px;
  --shadow-hard: 4px 4px 0 #111214;
  --shadow-hard-sm: 2px 2px 0 #111214;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --title-scale: 1;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-desk);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow-x: hidden;
  transition: filter 0.2s ease;
}

body.filter-invert {
  filter: invert(1) hue-rotate(180deg);
}

body.filter-mono {
  filter: grayscale(1) contrast(1.1);
}

body.filter-crt::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background: repeating-linear-gradient(
    to bottom,
    rgba(17, 18, 20, 0.06) 0px,
    rgba(17, 18, 20, 0.06) 1px,
    transparent 1px,
    transparent 3px
  );
}

.mono {
  font-family: var(--font-mono);
}

#cursor-trail {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

:focus-visible {
  outline: 2px solid var(--accent-cobalt);
  outline-offset: 2px;
}

/* TOPBAR */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand-sep {
  color: var(--ink-muted);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  background: var(--accent-lime);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
}

.topbar-nav {
  display: flex;
  gap: 6px;
}

.topbar-nav a {
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-pill);
  transition: background 0.15s ease;
}

.topbar-nav a:hover {
  background: var(--bg-panel);
}

.btn-chip,
.btn-small,
.btn-outline,
.btn-solid {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

.btn-chip {
  padding: 6px 12px;
  font-size: 13px;
  background: var(--bg-desk);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-hard-sm);
}

.btn-chip[aria-pressed='false'] {
  background: var(--bg-panel);
  color: var(--ink-muted);
  box-shadow: none;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  background: var(--bg-desk);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hard-sm);
}

.btn-small:active,
.btn-chip:active,
.btn-solid:active,
.btn-outline:active {
  transform: translate(1px, 1px);
  box-shadow: none;
}

/* HERO DESK */
.hero-desk {
  position: relative;
  min-height: 540px;
  padding: 20px 24px 32px;
  background: var(--bg-paper);
  border-bottom: 1.5px solid var(--border);
  overflow: hidden;
  user-select: none;
}

.desk-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 5;
}

.hud-coords {
  font-size: 12px;
  color: var(--ink-muted);
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.hud-controls {
  display: flex;
  gap: 8px;
}

.hero-title-layer {
  position: relative;
  z-index: 2;
  max-width: 680px;
  margin: 44px auto 0;
  text-align: center;
  pointer-events: none;
}

.hero-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(56px, 10vw, 124px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.04em;
  transform: scale(var(--title-scale));
  transform-origin: center;
  transition: transform 0.12s ease-out;
}

.hero-sub {
  margin: 18px auto 0;
  max-width: 440px;
  font-size: 17px;
  color: var(--ink-muted);
}

.desk-stage {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.desk-item {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  transition: box-shadow 0.15s ease;
}

.desk-item.is-dragging {
  cursor: grabbing;
  z-index: 40;
}

.item-badge {
  width: 176px;
  padding: 14px;
  background: var(--bg-desk);
  border: 2px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-hard);
}

.badge-hole {
  width: 28px;
  height: 6px;
  margin: 0 auto 10px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: 99px;
}

.badge-top {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--accent-cobalt);
}

.badge-name {
  margin-top: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
}

.badge-meta {
  margin-top: 8px;
  font-size: 10px;
  color: var(--ink-muted);
}

.item-sticky {
  width: 184px;
  padding: 14px 14px 12px;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-hard);
}

.sticky-lime {
  background: var(--accent-lime);
}

.sticky-coral {
  background: #ffd4c9;
}

.sticky-text {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.sticky-sign {
  font-size: 11px;
  color: var(--ink);
}

.item-disk {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent-cobalt);
  border: 2px solid var(--border);
  box-shadow: var(--shadow-hard);
  display: grid;
  place-items: center;
}

.disk-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}

.item-pill-toy {
  width: 136px;
  padding: 12px 14px;
  background: var(--bg-desk);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
  text-align: center;
}

.toy-label {
  display: block;
  font-size: 10px;
  color: var(--ink-muted);
}

.toy-num {
  display: block;
  margin: 2px 0;
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1;
}

.toy-hint {
  font-size: 11px;
  color: var(--accent-cobalt);
  font-weight: 600;
}

.item-ruler {
  width: 240px;
  height: 42px;
  padding: 6px 12px;
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--shadow-hard-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
}

.ruler-ticks {
  height: 10px;
  background: repeating-linear-gradient(
    to right,
    var(--ink) 0 1.5px,
    transparent 1.5px 10px
  );
}

/* WORKBENCH SECTIONS */
.workbench-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 56px 24px;
  border-bottom: 1.5px solid var(--hairline);
}

.section-head {
  max-width: 580px;
  margin-bottom: 28px;
}

.section-head-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.section-desc {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 16px;
}

/* SINTE */
.sinte-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.sinte-left,
.sinte-right {
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-hard);
}

.pad-bank {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.synth-pad {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 82px;
  padding: 12px;
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hard-sm);
  cursor: pointer;
  text-align: left;
  transition: transform 0.08s ease, background 0.12s ease;
}

.synth-pad:hover {
  background: #f9fafb;
}

.synth-pad.is-hit,
.synth-pad:active {
  background: var(--accent-lime);
  transform: translate(2px, 2px);
  box-shadow: none;
}

.pad-key {
  font-size: 11px;
  color: var(--ink-muted);
}

.pad-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.synth-sliders {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.select-box {
  padding: 7px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
}

.val-readout {
  min-width: 48px;
  text-align: right;
  font-size: 12px;
}

.sinte-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.xy-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 8px;
  color: var(--ink-muted);
}

.xy-pad {
  position: relative;
  height: 190px;
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: crosshair;
  touch-action: none;
  overflow: hidden;
  background-image:
    linear-gradient(to right, var(--hairline) 1px, transparent 1px),
    linear-gradient(to bottom, var(--hairline) 1px, transparent 1px);
  background-size: 25% 25%;
}

.xy-puck {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-cobalt);
  border: 2px solid var(--border);
  transform: translate(-50%, -50%);
  left: 35%;
  top: 50%;
  pointer-events: none;
}

.oscilloscope {
  width: 100%;
  height: 92px;
  background: var(--ink);
  border-radius: var(--radius-sm);
  display: block;
}

/* SELLOS */
.stamp-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.stamp-toolbar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
}

.tool-label {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.tool-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tool-btn,
.stamp-choice {
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
}

.tool-btn {
  text-align: center;
}

.tool-btn.is-active,
.stamp-choice.is-active {
  background: var(--accent-lime);
}

.stamp-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ink-swatches {
  display: flex;
  gap: 10px;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
}

.swatch.is-active {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.tool-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-outline {
  justify-content: center;
  padding: 9px 14px;
  font-size: 14px;
  background: var(--bg-desk);
  border-radius: var(--radius-sm);
}

.btn-solid {
  justify-content: center;
  padding: 10px 14px;
  font-size: 14px;
  background: var(--accent-cobalt);
  color: #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hard-sm);
}

.stamp-sheet-wrap {
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
}

#stamp-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

/* GRAVEDAD */
.gravity-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grav-preset {
  padding: 6px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.grav-preset.is-active {
  background: var(--accent-coral);
  color: #ffffff;
}

.gravity-stage-wrap {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  background: var(--bg-panel);
}

#gravity-canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: grab;
  touch-action: none;
}

#gravity-canvas:active {
  cursor: grabbing;
}

/* EFECTOS */
.effects-board {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.effect-control {
  padding: 18px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.effect-name {
  font-weight: 700;
  font-size: 15px;
}

.effect-state {
  font-size: 12px;
  color: var(--accent-cobalt);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-btn {
  padding: 7px 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-desk);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.seg-btn.is-active {
  background: var(--ink);
  color: #ffffff;
}

input[type='range'] {
  accent-color: var(--accent-cobalt);
  cursor: pointer;
}

/* FOOTER */
.site-footer {
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 24px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-muted);
}

@media (max-width: 860px) {
  .topbar-nav {
    display: none;
  }

  .sinte-grid,
  .stamp-layout,
  .effects-board {
    grid-template-columns: 1fr;
  }

  .hero-desk {
    min-height: 600px;
  }
}

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