/* Story Engine — design tokens, reset, shared primitives */

:root {
  --bg: #08080a;
  --bg-deep: #060607;
  --panel: #0b0b0d;
  --panel-2: #101012;
  --panel-3: #141417;
  --line: rgba(236, 231, 221, 0.09);
  --line-strong: rgba(236, 231, 221, 0.17);
  --ink: #ece7dd;
  --ink-dim: #a9a299;
  --muted: #7b766c;
  --gold: #e6c383;
  --gold-bright: #f4dcae;
  --gold-soft: #c6a067;
  --gold-ink: #17110a;
  --green: #8fd6a4;
  --red: #e2867a;

  --sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --radius-sm: 7px;
}

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

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 620px at 72% -12%, rgba(230, 195, 131, 0.07), transparent 62%),
    radial-gradient(900px 500px at 4% 108%, rgba(230, 195, 131, 0.03), transparent 60%);
}

button { font-family: inherit; color: inherit; }
input, select, textarea { font-family: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -0.015em; }

a { color: var(--gold); text-decoration: none; }

::selection { background: rgba(230, 195, 131, 0.28); color: #fff; }

/* ---------- type primitives ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow-line {
  width: 34px;
  height: 1px;
  background: var(--line-strong);
  display: inline-block;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 64px 0 20px;
}
.section-heading h2 {
  font-size: 34px;
  line-height: 1.1;
  margin-top: 10px;
  color: #f2ede4;
}
.section-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
.heading-rule {
  display: inline-block;
  width: 60px;
  height: 1px;
  background: var(--line-strong);
}

/* ---------- controls ---------- */

label {
  display: block;
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.field-hint {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 12px;
  line-height: 1.45;
}

.sub-label {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--ink-dim);
}

input[type="text"],
input[type="url"],
input:not([type]),
select,
textarea {
  width: 100%;
  margin-top: 7px;
  padding: 10px 11px;
  background: #08080a;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input::placeholder,
textarea::placeholder { color: #56524a; }

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(230, 195, 131, 0.55);
  box-shadow: 0 0 0 3px rgba(230, 195, 131, 0.08);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237b766c' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

input[type="file"] {
  padding: 8px;
  font-size: 11.5px;
  color: var(--ink-dim);
}
input[type="file"]::file-selector-button {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-right: 10px;
  padding: 5px 9px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--panel-3);
  color: var(--ink);
  cursor: pointer;
}

button {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--gold-ink);
  background: linear-gradient(180deg, #f2d59b, #dcb471);
  border-color: rgba(255, 240, 205, 0.5);
  box-shadow: 0 6px 18px -10px rgba(230, 195, 131, 0.7);
}
.primary:hover { background: linear-gradient(180deg, #f7e0b1, #e7c07c); }
.primary:active { transform: translateY(1px); }
.primary:disabled { opacity: 0.55; cursor: not-allowed; }

.quiet {
  padding: 7px 12px;
  font-size: 11px;
  color: var(--ink-dim);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.015);
}
.quiet:hover { color: var(--ink); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.04); }

.action-button {
  padding: 7px 13px;
  font-size: 11.5px;
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.action-button:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }

.action-button.save-button { color: var(--ink); }
.action-button.save-button:hover { color: var(--gold-bright); border-color: rgba(230, 195, 131, 0.4); }

.local-video-button {
  border-color: rgba(230, 195, 131, 0.38);
  color: var(--gold-bright);
  background: rgba(230, 195, 131, 0.08);
}
.local-video-button:hover { background: rgba(230, 195, 131, 0.16); }

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(230, 195, 131, 0.14);
  display: inline-block;
  flex: 0 0 auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(20, 20, 23, 0.96);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 60;
  max-width: min(90vw, 460px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
