:root {
  --bg-start: #f4efe8;
  --bg-end: #e8d7c3;
  --panel: #fffaf4;
  --panel-strong: #fff1e0;
  --ink: #1f1b16;
  --muted: #6b6157;
  --accent: #d97706;
  --accent-2: #0f766e;
  --line: rgba(31, 27, 22, 0.1);
  --shadow: 0 24px 50px rgba(20, 16, 10, 0.16);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fff7ed 0%, transparent 50%),
    linear-gradient(145deg, var(--bg-start), var(--bg-end));
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.45) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.5;
}

.footnote {
  display: flex;
  justify-content: center;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin: 24px 0 32px;
  position: relative;
  z-index: 1;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 2fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
}

h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 40px;
  margin: 0 0 12px;
}

.subtitle {
  font-size: 16px;
  color: var(--muted);
  margin: 0;
}

.scene-examples {
  font-size: 14px;
  margin-top: 0px;
}

.stars-badge {
  display: inline-block;
  height: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

.hero-card {
  background: var(--panel-strong);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.hero-card .card-title {
  font-weight: 600;
  margin: 0 0 12px;
}

.hero-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.hero-card code {
  background: rgba(15, 118, 110, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
}

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 22px;
}

.chip {
  background: rgba(15, 118, 110, 0.12);
  color: var(--accent-2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  background: #fff;
}

.picker-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.secondary {
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 600;
  cursor: pointer;
}

.secondary:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.is-hidden {
  display: none;
}

.field small {
  color: var(--muted);
  font-weight: 550;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.details {
  border: 1px dashed rgba(31, 27, 22, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-2);
}

.details-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.switch-field {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-control {
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: rgba(31, 27, 22, 0.18);
  position: relative;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(31, 27, 22, 0.08);
  flex-shrink: 0;
}

.switch-control .slider {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffaf4;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  transform: translateX(18px);
  box-shadow: 0 2px 6px rgba(31, 27, 22, 0.25);
}

.switch-control.is-on {
  background: rgba(15, 118, 110, 0.65);
}

.switch-control.is-on .slider {
  transform: translateX(0);
}

.switch-control:focus-visible {
  outline: 2px solid rgba(15, 118, 110, 0.5);
  outline-offset: 2px;
}

.actions {
  display: flex;
  gap: 12px;
}

.primary {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #f2a74a);
  color: #fff;
  border: none;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(217, 119, 6, 0.25);
}

.primary:hover {
  transform: translateY(-1px);
}

.ghost {
  padding: 12px 16px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--line);
  font-weight: 600;
  cursor: pointer;
}

.examples {
  margin-top: 24px;
}

.examples-header h3 {
  margin: 0 0 4px;
}

.examples-header p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}

.examples-grid {
  display: grid;
  gap: 10px;
}

.example {
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
}

.example:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.viewer .plot {
  min-height: 540px;
}

#plot canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 16px;
}

.placeholder {
  border: 1px dashed rgba(31, 27, 22, 0.2);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.placeholder span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}

.alert {
  background: rgba(217, 119, 6, 0.12);
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  color: #7a3e05;
}

.status {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

[data-field="pose"].is-disabled {
  opacity: 0.5;
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }
}
