/* Just POC code with mostly LLM generated code. */

:root {
  color-scheme: light;
  --bg: #f4efe5;
  --bg-deep: #ece3d4;
  --surface: rgba(255, 251, 245, 0.9);
  --ink: #1f1b17;
  --muted: #665b4f;
  --line: rgba(86, 62, 37, 0.18);
  --line-strong: rgba(86, 62, 37, 0.28);
  --accent: #b4552c;
  --accent-deep: #843615;
  --good: #1d6b47;
  --warn: #a5601f;
  --shadow: 0 26px 60px rgba(67, 47, 23, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(180, 85, 44, 0.14), transparent 30%),
    radial-gradient(circle at right, rgba(73, 105, 75, 0.10), transparent 28%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

.playground-shell {
  width: min(1500px, calc(100% - 24px));
  margin: 0 auto;
  padding: 12px 0;
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  padding: 16px 18px;
  align-items: start;
}

h1,
h2 {
  margin: 0;
  font-family: "Iowan Old Style", Georgia, serif;
  letter-spacing: -0.04em;
}

h1 {
  max-width: none;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  line-height: 0.96;
  text-align: left;
}

h2 {
  font-size: 1.35rem;
}

.hero-header {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 100%;
}

.how-card {
  width: 100%;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(86, 62, 37, 0.16);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(249, 243, 234, 0.9) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.how-card h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.how-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
  columns: 2;
  column-gap: 28px;
}

.how-list li + li {
  margin-top: 5px;
}

.how-list a {
  color: var(--accent-deep);
  text-decoration-color: rgba(132, 54, 21, 0.35);
  text-underline-offset: 0.14em;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(70, 48, 20, 0.12);
}

.button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.button-primary {
  border-color: transparent;
  color: white;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
}

.button-secondary {
  color: var(--ink);
  background: #fffdf9;
}

.button-compact {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.92rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  min-height: 0;
  align-items: stretch;
}

.column-stack {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
}

.panel {
  padding: 20px;
  min-height: 0;
}

.editor-panel,
.output-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

#status-pill[data-state="running"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #c97830 0%, #9f511e 100%);
}

#status-pill[data-state="loading"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #c97830 0%, #9f511e 100%);
}

#status-pill[data-state="warming"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #5f7ea8 0%, #3b5f88 100%);
}

#status-pill[data-state="success"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #2f8f64 0%, var(--good) 100%);
}

#status-pill[data-state="ready"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #2f8f64 0%, var(--good) 100%);
}

#status-pill[data-state="error"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #c26b33 0%, var(--warn) 100%);
}

textarea,
pre {
  margin: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #181512;
  color: #f6efe6;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  overflow: auto;
  scrollbar-gutter: stable;
}

.editor-surface {
  position: relative;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #181512;
  overflow: hidden;
}

.editor-highlight,
.editor-input {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 18px;
  border: 0;
  border-radius: 0;
  font-family: "IBM Plex Mono", "SFMono-Regular", monospace;
  font-size: 0.97rem;
  line-height: 1.65;
}

.editor-highlight {
  color: #f6efe6;
  white-space: pre-wrap;
  word-break: normal;
  overflow: hidden;
  pointer-events: none;
}

.editor-input {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: auto;
  resize: none;
  background: transparent;
  color: transparent;
  caret-color: #f6efe6;
  -webkit-text-fill-color: transparent;
  outline: none;
}

.editor-input::selection {
  background: rgba(216, 177, 121, 0.28);
}

pre {
  flex: 1;
  min-height: 0;
  height: auto;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

#compile-output .compiler-line,
#run-output .compiler-line {
  display: block;
}

#code-highlight .tok-comment,
#llvm-highlight .tok-comment {
  color: #7ea08f;
}

#code-highlight .tok-keyword,
#llvm-highlight .tok-keyword {
  color: #f4bf84;
}

#code-highlight .tok-type,
#llvm-highlight .tok-type {
  color: #89b8ff;
}

#code-highlight .tok-number,
#llvm-highlight .tok-number {
  color: #d7c785;
}

#code-highlight .tok-string,
#llvm-highlight .tok-string {
  color: #8bd3a8;
}

#code-highlight .tok-operator,
#llvm-highlight .tok-operator {
  color: #f0a2bd;
}

#code-highlight .tok-function {
  color: #ffddb3;
}

#llvm-highlight .tok-global {
  color: #ffb58a;
}

#llvm-highlight .tok-local {
  color: #a8d2ff;
}

#llvm-highlight .tok-metadata {
  color: #8fdcd1;
}

#llvm-highlight .tok-label {
  color: #e5c07b;
}

#compile-output .compiler-section,
#run-output .compiler-section {
  margin: 0.2rem 0 0.45rem;
  color: #f4bf84;
  font-weight: 700;
}

#compile-output .compiler-error,
#compile-output .compiler-error-line,
#run-output .compiler-error,
#run-output .compiler-error-line {
  color: #ff9d94;
}

#compile-output .compiler-warning,
#compile-output .compiler-warning-line,
#run-output .compiler-warning,
#run-output .compiler-warning-line {
  color: #ffd28a;
}

#compile-output .compiler-note,
#compile-output .compiler-note-line,
#run-output .compiler-note,
#run-output .compiler-note-line {
  color: #9bc0ff;
}

#compile-output .compiler-help,
#compile-output .compiler-help-line,
#run-output .compiler-help,
#run-output .compiler-help-line {
  color: #8fe2b6;
}

#compile-output .compiler-location,
#compile-output .compiler-location-text,
#run-output .compiler-location,
#run-output .compiler-location-text {
  color: #d7c29d;
}

#compile-output .compiler-gutter,
#compile-output .compiler-divider,
#run-output .compiler-gutter,
#run-output .compiler-divider {
  color: #8d7a66;
}

#compile-output .compiler-marker,
#run-output .compiler-marker {
  color: #ffb85c;
  font-weight: 700;
}

.notes-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .playground-shell {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .hero-header {
    justify-content: center;
  }

  h1 {
    text-align: center;
  }

  .how-list {
    columns: 1;
  }

  .editor-surface {
    height: 360px;
    min-height: 360px;
  }

  pre {
    height: 360px;
    min-height: 360px;
  }
}
