/* lumbda playground — styled to match lumbda.com homepage.
 * palette + typography mirror www/style.css.
 */

@font-face {
  font-family: 'chunkfive';
  src: url('fonts/chunkfive/chunkfive-regular-webfont.woff2') format('woff2'),
       url('fonts/chunkfive/chunkfive-regular-webfont.woff')  format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --fg: #1a1a1a;
  --bg: #fafaf7;
  --muted: #666;
  --accent: #227842;            /* single brand green — matches homepage */
  --green: #227842;
  --rule: #d4d4d0;
  --code-bg: #f0ede4;
  --pane-bg: #ffffff;
  --busy: #b15a00;
  --err: #b1262b;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e8e6e0;
    --bg: #161613;
    --muted: #9a9892;
    --accent: #5ec07a;          /* lightened for contrast on dark bg */
    --green: #5ec07a;
    --rule: #3a3a36;
    --code-bg: #22221f;
    --pane-bg: #1c1c19;
    --busy: #e0a050;
    --err: #f06070;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  min-height: 100%;
}

/* ─── Header ────────────────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem 1.5rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}
.brand:hover .period { transform: translateY(-2px); }

.brand .logo {
  width: 3.2rem;
  height: auto;
  display: block;
}

header h1 {
  font-family: 'chunkfive', Georgia, serif;
  font-size: 2.4rem;
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1;
  font-weight: normal;
}
header h1 .period {
  color: var(--green);
  display: inline-block;
  transition: transform 120ms ease;
}

header .tagline {
  font-family: 'chunkfive', Georgia, serif;
  color: var(--muted);
  margin: 0.4rem 0 0.6rem;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

header .lede {
  margin: 0;
  max-width: 70rem;
  color: var(--fg);
  font-size: 0.85rem;
  line-height: 1.55;
}
header .lede strong {
  color: var(--green);
  font-weight: 600;
}
header code {
  background: var(--code-bg);
  padding: 0 0.2em;
  border-radius: 2px;
  font-size: 0.9em;
}

/* ─── Controls ──────────────────────────────────────────────────── */

.controls {
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg);
}

.controls fieldset {
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 3px 10px 5px;
  margin: 0;
  background: var(--pane-bg);
}
.controls fieldset legend {
  color: var(--muted);
  font-size: 0.7rem;
  padding: 0 0.4em;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.controls label {
  margin-right: 0.7em;
  cursor: pointer;
  user-select: none;
  font-size: 0.85em;
}
.controls label input {
  margin-right: 0.3em;
  accent-color: var(--green);
}

.controls button {
  font-family: var(--mono);
  font-size: 0.85em;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--green);
}
.controls button.primary {
  background: var(--green);
  color: var(--bg);
}
.controls button.primary:hover { filter: brightness(1.08); }
.controls button.primary:disabled {
  opacity: 0.4; cursor: wait;
  filter: none;
}
.controls button.secondary {
  background: transparent;
  color: var(--green);
}
.controls button.secondary:hover {
  background: var(--code-bg);
}
.controls button.secondary:disabled {
  opacity: 0.35; cursor: default;
}

.controls .status {
  color: var(--muted);
  font-size: 0.8em;
  margin-left: auto;
}
.controls .status.busy { color: var(--busy); }
.controls .status.warn { color: var(--busy); }
.controls .status.err  { color: var(--err); }
.controls .status.ok   { color: var(--green); }

/* ─── Panes ─────────────────────────────────────────────────────── */

.panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--rule);
  height: calc(100vh - 260px);
  min-height: 360px;
}
.pane {
  background: var(--pane-bg);
  padding: 0.5rem 0.75rem 0.75rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pane h2 {
  margin: 0 0 0.4rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#editor {
  flex: 1;
  overflow: hidden;
  border-radius: 2px;
}
.cm-editor { height: 100%; font-size: 13px; }
.cm-editor.cm-focused { outline: none; }

#output {
  flex: 1;
  white-space: pre;
  overflow: auto;
  background: var(--code-bg);
  border-radius: 2px;
  padding: 0.6rem 0.8rem;
  font-size: 13px;
  line-height: 1.35;
}
#output .tier-block { margin-bottom: 1rem; }
#output .tier-block:last-child { margin-bottom: 0; }
#output .tier-block h3 {
  margin: 0 0 0.25rem;
  font-size: 0.7rem;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}
#output .tier-block .time {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
#output .tier-block pre {
  margin: 0;
  white-space: pre;
  font-family: var(--mono);
}
#output .err {
  color: var(--err);
}

/* ─── Footer ────────────────────────────────────────────────────── */

footer {
  padding: 0.7rem 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.75rem;
}
footer code {
  background: var(--code-bg);
  padding: 0 0.2em;
  border-radius: 2px;
}
footer a {
  color: var(--green);
  text-decoration: none;
}
footer a:hover { text-decoration: underline; }
footer strong { color: var(--fg); }
