/* Shared chrome for the editor demo pages (classic, studio, matrix) and 404. */

:root {
  --bar-h: 46px;
  --bg: #14171c;
  --bg-raised: #22262e;
  --bg-raised-hover: #2d323b;
  --fg: #f4f5f7;
  --fg-dim: rgba(244, 245, 247, 0.62);
  --line: rgba(255, 255, 255, 0.14);
  --accent: #7c5cff;
  --accent-warm: #f5a623;
  --radius: 7px;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

#topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--bar-h);
  box-sizing: border-box;
  padding: 0 14px;
  background: var(--bg);
  color: var(--fg);
  font-size: 13px;
}

#topbar .brand {
  font-weight: 650;
  font-size: 15px;
  color: var(--fg);
  text-decoration: none;
}

#topbar .tag {
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg-dim);
}

#topbar .tag--studio {
  background: rgba(124, 92, 255, 0.2);
  color: #c3b2ff;
}

#topbar .spacer {
  flex: 1;
}

#topbar button,
#topbar .ghost {
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg);
  border-radius: var(--radius);
  padding: 6px 11px;
  text-decoration: none;
  transition:
    background 140ms ease,
    border-color 140ms ease;
}

#topbar button:hover,
#topbar .ghost:hover {
  background: var(--bg-raised-hover);
  border-color: rgba(255, 255, 255, 0.24);
}

#topbar button:focus-visible,
#topbar .ghost:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#topbar .ghost {
  background: transparent;
}

/*
 * The live readout. This is the demo's own proof that the plugin is doing what
 * it claims: the active breakpoint, the media query it maps to, and how many
 * @media blocks the export currently carries.
 */
#readout {
  font-size: 12px;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#readout b {
  color: var(--fg);
}

#readout code {
  color: var(--accent-warm);
  font-size: 11.5px;
}

#gjs,
#studio {
  border: none;
  height: calc(100% - var(--bar-h));
}

/* Exported-CSS drawer, shown by the classic demo. */
#css-out {
  position: fixed;
  inset: auto 0 0 0;
  max-height: 46vh;
  overflow: auto;
  margin: 0;
  padding: 16px 18px;
  background: #0d1014;
  color: #cfe3ff;
  border-top: 1px solid var(--line);
  font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  z-index: 100;
}

#css-out[hidden] {
  display: none;
}

#css-out .close {
  position: sticky;
  top: 0;
  float: right;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--bg-raised);
  color: var(--fg);
  border-radius: var(--radius);
  padding: 4px 10px;
  font: inherit;
}

/* ---- 404 ---- */
.page {
  min-height: 100%;
  margin: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--fg);
  padding: 40px 20px;
  box-sizing: border-box;
}

.card {
  width: 100%;
  max-width: 640px;
}

.card h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 5vw, 40px);
  letter-spacing: -0.02em;
}

.card p {
  margin: 0 0 28px;
  color: var(--fg-dim);
  font-size: 16px;
  line-height: 1.55;
}

.choices {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.choice {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-raised);
  color: var(--fg);
  text-decoration: none;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.choice:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--bg-raised-hover);
}

.choice strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.choice span {
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1.45;
}

.foot {
  margin-top: 28px;
  font-size: 13px;
  color: var(--fg-dim);
}

.foot a {
  color: #c3b2ff;
}

@media (prefers-reduced-motion: reduce) {
  .choice,
  #topbar button,
  #topbar .ghost {
    transition: none;
  }
  .choice:hover {
    transform: none;
  }
}
