/* =============================================================================
 * movies.addict.best — prompt hub
 * Register: product. This is an instrument — an operator pastes from it many
 * times a day, so density and speed beat decoration.
 * ============================================================================= */

:root {
  /* Neutrals tinted toward the brand amber so greys read as authored. */
  --n-0:  oklch(99% 0.004 75);
  --n-1:  oklch(96.5% 0.006 75);
  --n-2:  oklch(93% 0.008 70);
  --n-3:  oklch(88% 0.010 70);
  --n-4:  oklch(74% 0.012 70);
  --n-5:  oklch(58% 0.014 70);
  --n-6:  oklch(42% 0.014 70);
  --n-7:  oklch(28% 0.012 70);
  --n-8:  oklch(19% 0.012 70);
  --n-9:  oklch(13% 0.012 70);

  --ink: var(--n-9);
  --ink-soft: var(--n-6);
  --line: var(--n-3);
  --surface: var(--n-0);
  --surface-2: var(--n-1);

  /* One accent. Amber, because the product is a warm production bench and the
   * borrowed category reflex here is a blue-violet SaaS hue. */
  --accent:      oklch(62% 0.16 58);
  --accent-deep: oklch(48% 0.15 52);
  --accent-tint: oklch(95% 0.035 70);
  --accent-ink:  oklch(30% 0.06 50);

  --danger: oklch(52% 0.17 25);

  --r-sm: 4px;
  --r-md: 9px;
  --r-lg: 14px;

  --u1: 4px;  /* micro */
  --u4: 16px; /* paragraph */
  --u9: 36px; /* macro */

  --sans: "Inter Tight", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  --shadow-1: 0 1px 2px oklch(20% 0.02 70 / 0.06);
  --shadow-2: 0 4px 14px oklch(20% 0.02 70 / 0.09);
  --shadow-3: 0 14px 40px oklch(20% 0.02 70 / 0.16);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--n-1);
  /* Grid paper plane, behind everything, never interactive. */
  background-image:
    linear-gradient(oklch(90% 0.008 70 / 0.5) 1px, transparent 1px),
    linear-gradient(90deg, oklch(90% 0.008 70 / 0.5) 1px, transparent 1px);
  background-size: 32px 32px;
  padding-bottom: env(safe-area-inset-bottom);
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: var(--u4); border-radius: 0 0 var(--r-md) 0;
}
.skip:focus { left: 0; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ----------------------------------------------------------------- topbar --- */

.topbar {
  display: flex; flex-wrap: wrap; gap: var(--u4);
  align-items: center; justify-content: space-between;
  padding: var(--u4) var(--u4);
  padding-top: calc(var(--u4) + env(safe-area-inset-top));
  background: var(--n-8);
  color: var(--n-0);
  border-bottom: 3px solid var(--accent);
}
.brand { display: flex; align-items: center; gap: var(--u4); min-width: 0; }
.brand .mark {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: var(--r-md);
  background: linear-gradient(145deg, var(--accent), var(--accent-deep));
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.35);
}
.brand h1 {
  margin: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em;
}
.brand p { margin: 0; font-size: 0.8125rem; color: var(--n-3); }
.topbar-actions { display: flex; gap: var(--u1); }

/* ------------------------------------------------------------------ apps ---- */

.apps, .sections {
  position: sticky; z-index: 20;
  background: var(--n-7);
  border-bottom: 1px solid var(--n-6);
}
.apps { top: 0; }
.sections { top: 57px; background: var(--n-8); }

.apps-inner, .sections-inner {
  display: flex; gap: var(--u1); overflow-x: auto;
  padding: var(--u1) var(--u4);
  scrollbar-width: thin;
}
.sections-inner { padding-top: 6px; padding-bottom: 6px; }

.tab {
  flex: 0 0 auto;
  appearance: none; border: 1px solid transparent; cursor: pointer;
  background: var(--n-6); color: var(--n-1);
  font: 600 0.8125rem/1 var(--sans);
  padding: 11px 14px; min-height: 40px;
  border-radius: var(--r-md);
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, transform 90ms ease;
}
.tab:hover { background: var(--n-5); }
.tab:active { transform: translateY(1px); }
.tab[aria-selected="true"] {
  background: var(--accent); color: #fff;
  border-color: var(--accent-deep);
  box-shadow: 0 2px 0 var(--accent-deep);
}
.tab .count {
  display: inline-block; margin-inline-start: 6px;
  font-family: var(--mono); font-size: 0.6875rem;
  opacity: 0.72;
}

/* ------------------------------------------------------------------ main ---- */

main {
  max-width: 1180px; margin: 0 auto;
  padding: var(--u9) var(--u4) var(--u9);
}

.section-head { margin-bottom: var(--u4); }
.section-head h2 {
  margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
}
.section-head p { margin: 0 0 var(--u1); color: var(--ink-soft); max-width: 70ch; }
.section-stats { display: flex; flex-wrap: wrap; gap: var(--u1); margin-top: var(--u1); }

.chip {
  display: inline-block; padding: 3px 9px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 0.75rem/1.6 var(--mono); color: var(--ink-soft);
}
.chip.accent { background: var(--accent-tint); border-color: oklch(88% 0.06 60); color: var(--accent-ink); }

/* --------------------------------------------------------------- folders ---- */

.folders {
  margin: var(--u4) 0;
  padding: var(--u4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
}
.folders h3 {
  margin: 0 0 var(--u1);
  font: 700 0.6875rem/1 var(--sans);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft);
}
.folder-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.folder-chip {
  padding: 5px 10px; background: var(--n-2);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  font: 500 0.75rem/1.4 var(--mono); color: var(--n-7);
}

/* ---------------------------------------------------------------- cards ----- */

.content { display: flex; flex-direction: column; gap: var(--u9); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card > header {
  display: flex; flex-wrap: wrap; gap: var(--u1);
  align-items: center; justify-content: space-between;
  padding: var(--u4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.card h3 { margin: 0; font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; }
.card h3 .id {
  font: 600 0.75rem/1 var(--mono); color: var(--accent-deep);
  margin-inline-end: 8px; letter-spacing: 0.04em;
}
.card .sub {
  margin: 3px 0 0; font: 400 0.8125rem/1.5 var(--sans); color: var(--ink-soft);
}
.card .card-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.card-body { padding: var(--u4); display: flex; flex-direction: column; gap: var(--u4); }

/* --------------------------------------------------------------- scenes ----- */

.scene {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.scene > header {
  display: flex; flex-wrap: wrap; gap: var(--u1);
  align-items: center; justify-content: space-between;
  padding: 10px var(--u4);
  background: var(--n-2);
  border-bottom: 1px solid var(--line);
}
.scene > header h4 {
  margin: 0; font: 700 0.8125rem/1.4 var(--sans);
  letter-spacing: 0.02em; text-transform: uppercase; color: var(--n-7);
}
.scene-grid { padding: var(--u4); display: flex; flex-direction: column; gap: var(--u4); }

.element { border-left: 3px solid var(--n-3); padding-inline-start: var(--u4); }
.element.e2 { border-left-color: var(--accent); }
.element.e3 { border-left-color: oklch(62% 0.14 210); }
.element.e4 { border-left-color: oklch(58% 0.16 320); }

.element-label {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-bottom: 6px;
}
.element-label .name {
  font: 700 0.6875rem/1.4 var(--sans);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--n-6);
}
.element-label .hint {
  font: 400 0.75rem/1.4 var(--sans); color: var(--n-5);
}
.element-label .spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------------- boxes ----- */

.box {
  position: relative;
  background: var(--n-0);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.box-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--u1);
  padding: 7px 10px;
  background: var(--n-2);
  border-bottom: 1px solid var(--line);
}
.box-head .tag {
  font: 600 0.6875rem/1.5 var(--mono);
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--n-6);
}
.box pre {
  margin: 0; padding: var(--u4);
  font-family: var(--mono); font-size: 0.78125rem; line-height: 1.65;
  color: var(--n-8);
  white-space: pre-wrap; word-break: break-word;
  max-height: 340px; overflow-y: auto;
  scrollbar-width: thin;
}
.box pre.long { max-height: 520px; }

/* --------------------------------------------------------------- buttons ---- */

.btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 7px 13px;
  background: var(--n-0); color: var(--n-8);
  border: 1px solid var(--n-4); border-radius: var(--r-md);
  font: 600 0.8125rem/1.2 var(--sans);
  white-space: nowrap;
  transition: background 110ms ease, border-color 110ms ease, transform 80ms ease;
}
.btn:hover { background: var(--n-2); border-color: var(--n-5); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 0.75rem; }
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent-deep);
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn-dark {
  background: var(--n-7); color: var(--n-0); border-color: var(--n-8);
}
.btn-dark:hover { background: var(--n-6); border-color: var(--n-6); }
.btn.done {
  background: oklch(48% 0.15 150); border-color: oklch(40% 0.14 150); color: #fff;
}

/* --------------------------------------------------------------- notes ------ */

.note {
  padding: 10px 12px;
  background: var(--accent-tint);
  border: 1px solid oklch(88% 0.06 60);
  border-radius: var(--r-md);
  font: 400 0.8125rem/1.6 var(--sans);
  color: var(--accent-ink);
}
.note ol, .note ul { margin: 6px 0 0; padding-inline-start: 20px; }
.note li { margin-bottom: 3px; }
.note .caption { font-weight: 700; }

.empty {
  padding: var(--u9) var(--u4);
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--n-4);
  border-radius: var(--r-lg);
  color: var(--ink-soft);
}
.empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.0625rem; }
.empty p { margin: 0 auto; max-width: 56ch; }
.loading { padding: var(--u9); text-align: center; color: var(--ink-soft); }

/* --------------------------------------------------------------- toast ------ */

.toast {
  position: fixed; z-index: 60;
  inset-inline: 0; bottom: calc(var(--u4) + env(safe-area-inset-bottom));
  margin-inline: auto; width: fit-content; max-width: 90vw;
  padding: 10px 18px;
  background: var(--n-9); color: var(--n-0);
  border-radius: 999px;
  font: 600 0.8125rem/1.3 var(--sans);
  box-shadow: var(--shadow-3);
  opacity: 0; transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

.foot {
  max-width: 1180px; margin: 0 auto;
  padding: var(--u9) var(--u4) calc(var(--u9) * 2);
  border-top: 1px solid var(--line);
}
.foot p { margin: 0; font-size: 0.8125rem; color: var(--ink-soft); max-width: 70ch; }

/* ------------------------------------------------------------ responsive --- */

@media (max-width: 720px) {
  body { font-size: 15px; }
  .apps { top: 0; }
  .sections { position: static; }
  main { padding-top: var(--u4); }
  .topbar { padding-bottom: 10px; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1 1 auto; justify-content: center; }
  .card > header { flex-direction: column; align-items: stretch; }
  .card-actions .btn { flex: 1 1 auto; justify-content: center; }
  .box pre { font-size: 0.75rem; max-height: 260px; }
  .scene-grid { padding: 10px; }
  .element { padding-inline-start: 10px; }
}

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