/* ==========================================================================
   NO-PURPOSE DEMO // 001 — Multi-Theme Awwwards Architecture
   Themes: [data-theme="swiss"] | [data-theme="gallery"] | [data-theme="instrument"]
   ========================================================================== */

:root {
  --bg: #F2F0EB;
  --surface: #F2F0EB;
  --surface-alt: #E9E6DF;
  --ink: #111111;
  --muted: #5C5B57;
  --line: #111111;
  --line-soft: rgba(17, 17, 17, 0.16);
  --accent: #E63B2E;
  --accent-ink: #FFFFFF;
  --radius: 0px;
  --radius-pill: 0px;
  --font-display: 'Antonio', 'Arial Narrow', sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --hero-transform: uppercase;
  --hero-tracking: -0.02em;
  --hero-weight: 700;
  --panel-shadow: none;
  --btn-shadow: none;
}

[data-theme="gallery"] {
  --bg: #0B0B0D;
  --surface: #111114;
  --surface-alt: #18181D;
  --ink: #EDEAE4;
  --muted: #8A8883;
  --line: rgba(237, 234, 228, 0.18);
  --line-soft: rgba(237, 234, 228, 0.09);
  --accent: #EDEAE4;
  --accent-ink: #0B0B0D;
  --radius: 2px;
  --radius-pill: 999px;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --hero-transform: uppercase;
  --hero-tracking: -0.015em;
  --hero-weight: 400;
  --panel-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  --btn-shadow: none;
}

[data-theme="instrument"] {
  --bg: #E4E3DF;
  --surface: #DDDBD5;
  --surface-alt: #D2D0C9;
  --ink: #1A1A1A;
  --muted: #5E5D58;
  --line: #1A1A1A;
  --line-soft: rgba(26, 26, 26, 0.22);
  --accent: #FF4D00;
  --accent-ink: #FFFFFF;
  --radius: 4px;
  --radius-pill: 4px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --hero-transform: uppercase;
  --hero-tracking: -0.04em;
  --hero-weight: 700;
  --panel-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 1px 2px rgba(0, 0, 0, 0.08);
  --btn-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 2px 0 rgba(26, 26, 26, 0.18);
}

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

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background-color 260ms ease, color 260ms ease;
}

/* Subtle paper/grain overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: radial-gradient(var(--ink) 0.5px, transparent 0.5px);
  background-size: 4px 4px;
}

/* Top Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 65%, transparent);
  flex-shrink: 0;
}

.nav-rail {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
}

.nav-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 180ms ease;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--ink);
}

.nav-tab.active {
  background: var(--ink);
  color: var(--bg);
}

[data-theme="instrument"] .nav-tab.active {
  background: var(--surface-alt);
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.theme-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
}

.theme-btn {
  appearance: none;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 160ms ease;
  box-shadow: var(--btn-shadow);
}

.theme-btn:hover {
  color: var(--ink);
  border-color: var(--line);
}

.theme-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

/* Hero Section */
.hero {
  position: relative;
  padding: 36px 28px 28px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: end;
}

[data-theme="gallery"] .hero {
  padding: 48px 28px 36px;
}

.hero-headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--hero-weight);
  font-size: clamp(3.4rem, 9.2vw, 8.8rem);
  line-height: 0.9;
  letter-spacing: var(--hero-tracking);
  text-transform: var(--hero-transform);
}

.hero-sub {
  margin: 18px 0 0;
  max-width: 680px;
  font-size: clamp(0.98rem, 1.35vw, 1.18rem);
  line-height: 1.48;
  color: var(--muted);
}

.spec-plate {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
  font-family: var(--font-mono);
  font-size: 11px;
}

.spec-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-k {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.spec-v {
  font-weight: 500;
  color: var(--ink);
}

.spec-v.accent {
  color: var(--accent);
}

/* App Overview Strip (4 Index Cards) */
.index-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.index-card {
  appearance: none;
  text-align: left;
  border: none;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 16px 22px;
  cursor: pointer;
  transition: background-color 180ms ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.index-card:last-child {
  border-right: none;
}

.index-card:hover {
  background: var(--surface-alt);
}

.index-card.active {
  background: var(--surface-alt);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.index-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.index-card.active .index-num .dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.index-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.index-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* Main App Stage */
.stage-wrap {
  padding: 28px;
  min-height: 620px;
}

.app-panel {
  display: none;
  animation: fadeSlide 240ms ease;
}

.app-panel.active {
  display: block;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 20px;
  align-items: stretch;
}

.canvas-box, .ctrl-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--panel-shadow);
  position: relative;
  overflow: hidden;
}

.canvas-box {
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.box-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stage-canvas {
  width: 100%;
  height: 460px;
  display: block;
  flex-shrink: 0;
  cursor: grab;
}

.stage-canvas:active {
  cursor: grabbing;
}

/* Controls & Forms */
.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ctrl-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ctrl-label strong {
  color: var(--ink);
  font-weight: 500;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 13px;
  cursor: pointer;
  transition: all 150ms ease;
  box-shadow: var(--btn-shadow);
}

.btn:hover {
  background: var(--surface-alt);
}

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

.btn.active-toggle {
  background: var(--ink);
  color: var(--bg);
}

/* Telemetry Readout Bar */
.telemetry-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

.telemetry-bar span strong {
  color: var(--ink);
  font-weight: 500;
}

/* Market Terminal Specific */
.market-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft);
}

.kpi-cell {
  padding: 12px 16px;
  border-right: 1px solid var(--line-soft);
}

.kpi-cell:last-child {
  border-right: none;
}

.kpi-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}

.kpi-val {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
}

.orderbook-mini {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.ob-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  border-bottom: 1px solid var(--line-soft);
}

.pos-up { color: #15803D; }
.pos-dn { color: #DC2626; }
[data-theme="gallery"] .pos-up { color: #4ADE80; }
[data-theme="gallery"] .pos-dn { color: #F87171; }

/* Synth Lab Specific */
.seq-grid {
  display: grid;
  grid-template-columns: repeat(16, minmax(0, 1fr));
  gap: 4px;
  padding: 14px 16px;
  border-top: 1px solid var(--line-soft);
}

.seq-step {
  aspect-ratio: 1 / 1.15;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  transition: transform 90ms ease, background-color 120ms ease;
}

.seq-step.on {
  background: var(--ink);
  color: var(--bg);
}

.seq-step.playing {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.piano-keys {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  padding: 0 16px 16px;
}

.piano-key {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  padding: 18px 6px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--btn-shadow);
}

.piano-key:active, .piano-key.pressed {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* Footer */
.footer {
  padding: 18px 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}

/* Hero 3D Sculpture (Gallery theme) & Model Provenance Credits Strip */
.hero-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-sculpture-wrap {
  display: none;
  position: relative;
  width: 100%;
  height: 290px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.04), transparent 72%);
  overflow: hidden;
}

[data-theme="gallery"] .hero-sculpture-wrap {
  display: block;
}

#hero-sculpture-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.crosshair {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
  user-select: none;
}
.crosshair.tl { top: 8px; left: 10px; }
.crosshair.tr { top: 8px; right: 10px; }
.crosshair.bl { bottom: 8px; left: 10px; }
.crosshair.br { bottom: 8px; right: 10px; }

.hero-telemetry {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.credits-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.credit-cell {
  padding: 16px 20px;
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.credit-cell:last-child {
  border-right: none;
}

.credit-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.credit-model {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.credit-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* Responsive */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; }
  .credits-strip { grid-template-columns: repeat(2, 1fr); }
  .credit-cell { border-bottom: 1px solid var(--line-soft); }
  .index-strip { grid-template-columns: repeat(2, 1fr); }
  .index-card { border-bottom: 1px solid var(--line); }
  .app-grid { grid-template-columns: 1fr; }
  .market-kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
  }
  .nav-rail {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .hero, .stage-wrap, .footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .credits-strip { grid-template-columns: 1fr; }
  .credit-cell { border-right: none; }
  .index-strip { grid-template-columns: 1fr; }
  .seq-grid { grid-template-columns: repeat(8, 1fr); }
  .canvas-box { min-height: 360px; }
  .stage-canvas { height: 320px; }
  .hero-sculpture-wrap { height: 240px; }
}
