/* Globex Reel — a fictional film-archive SaaS, built as a Vemvavor demo (#220).
 *
 * Direction: a projection room. Deep aubergine rather than the usual dashboard
 * black, one warm accent (projector amber), a high-contrast serif for titles and
 * a monospaced face for catalogue data — the vernacular of an archive record.
 * Every poster is generated in the browser from the film's own slug; the app
 * fetches no image, ever.
 */

:root {
  --stage: #12101a;
  --panel: #1b1826;
  --panel-2: #221e30;
  --edge: #2e2940;
  --text: #ede9f5;
  --muted: #9c93b8;
  --amber: #e8a33d;
  --amber-deep: #c9812a;

  --display: Didot, "Bodoni MT", "Playfair Display", "Hoefler Text", Garamond, Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --gap: clamp(18px, 4vw, 44px);
  --radius: 8px;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--stage);
  color: var(--text);
  font: 15px/1.6 var(--ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(232, 163, 61, 0.2);
}

a {
  color: var(--amber);
  text-underline-offset: 3px;
}

a:hover {
  color: #f5c076;
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  touch-action: manipulation;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 60;
  background: var(--panel);
  padding: 10px 14px;
  border-radius: var(--radius);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gap);
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.005em;
}

h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
}

.rec a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
}

.rec {
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede {
  font-size: 17px;
  color: #c9c2dd;
  max-width: 58ch;
  text-wrap: pretty;
}

/* ── chrome ──────────────────────────────────────────────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(18, 16, 26, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--edge);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand .reel {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  position: relative;
}

.brand .reel::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--amber);
}

.topbar nav {
  display: flex;
  gap: 2px;
}

.topbar nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 6px;
}

.topbar nav a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.topbar nav a[aria-current="page"] {
  background: rgba(232, 163, 61, 0.14);
  color: var(--amber);
}

.topbar .who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--amber), #8b5cf6);
  display: grid;
  place-items: center;
  font: 600 12px/1 var(--ui);
  color: #1a1524;
}

footer.site {
  border-top: 1px solid var(--edge);
  margin-top: 84px;
  padding: 28px 0 56px;
  color: var(--muted);
  font: 12px/1.7 var(--mono);
  letter-spacing: 0.04em;
}

footer.site .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}

footer.site .right {
  margin-left: auto;
  text-transform: uppercase;
}

/* ── buttons ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--amber);
  color: #1a1524;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.16s ease,
    transform 0.16s ease;
}

.btn:hover {
  background: #f2b558;
  color: #1a1524;
}

.btn:active {
  transform: translateY(1px);
}

.btn.ghost {
  background: transparent;
  border-color: var(--edge);
  color: var(--text);
}

.btn.ghost:hover {
  background: var(--panel-2);
  border-color: #453e5e;
  color: var(--text);
}

.btn.ghost[aria-pressed="true"] {
  border-color: var(--amber);
  color: var(--amber);
}

/* ── sign in ─────────────────────────────────────────────────────────────── */

.signin {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.signin .pitch {
  padding: clamp(30px, 6vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  border-right: 1px solid var(--edge);
}

.signin .form-side {
  padding: clamp(30px, 6vw, 76px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--panel);
}

.signin form {
  max-width: 380px;
  width: 100%;
}

.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 12px;
}

label.f {
  display: block;
  margin-bottom: 16px;
}

label.f > span {
  display: block;
  font: 500 11px/1.5 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--edge);
  border-radius: 6px;
  background: var(--stage);
  color: var(--text);
}

input::placeholder {
  color: #9c93b8;
  opacity: 1;
}

.hint {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px dashed var(--edge);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
}

.said {
  margin-top: 12px;
  color: var(--amber);
  font: 500 13px/1.5 var(--ui);
  min-height: 1.5em;
}

/* ── posters ─────────────────────────────────────────────────────────────── */

.poster {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
}

.shelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.shelf.rail {
  grid-template-columns: repeat(auto-fill, minmax(198px, 1fr));
}

.film a {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
}

.film .poster {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.film a:hover .poster {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
}

.film .cap {
  padding: 10px 2px 0;
}

.film .cap .t {
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.2;
}

.film .cap .m {
  font: 11px/1.6 var(--mono);
  color: var(--muted);
  letter-spacing: 0.06em;
}

.row {
  padding: 40px 0 0;
}

.row-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
}

.row-head .count {
  margin-left: auto;
  font: 11px/1 var(--mono);
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ── library search ──────────────────────────────────────────────────────── */

.searchrow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 26px 0 4px;
}

.searchrow input {
  flex: 1 1 180px;
  min-width: 0;
}

.searchrow .btn {
  flex: 0 0 auto;
}

.chipset {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
}

.chip:hover {
  border-color: #4a4266;
}

.chip[aria-pressed="true"] {
  background: var(--amber);
  border-color: var(--amber);
  color: #1a1524;
}

/* ── title detail ────────────────────────────────────────────────────────── */

.title-page {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  padding-top: 40px;
  align-items: start;
}

.title-page .poster {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.facts {
  width: 100%;
  border-collapse: collapse;
  margin: 26px 0 0;
  max-width: 520px;
}

.facts th,
.facts td {
  text-align: left;
  padding: 9px 0;
  border-bottom: 1px solid var(--edge);
  font-size: 14px;
}

.facts th {
  font: 500 11px/1.6 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  width: 34%;
  padding-right: 14px;
}

.facts td {
  font-family: var(--mono);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin: 26px 0 0;
}

.stars {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.stars .rec {
  margin-right: 4px;
}

.stars button {
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  /* Empty stars still have to read as a control, not as disabled chrome,
   * and have to clear 3:1 against the stage at this size. */
  color: #7d75a3;
  padding: 4px;
}

.stars button:hover,
.stars button[data-on="1"] {
  color: var(--amber);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.empty {
  padding: 48px 0;
  max-width: 48ch;
  color: var(--muted);
}

@media (max-width: 700px) {
  /* The workspace name is chrome, not navigation — the avatar carries it. */
  .who .rec {
    display: none;
  }

  .topbar .wrap {
    gap: 10px 12px;
  }

  .topbar nav a {
    padding: 8px 10px;
  }
}

@media (max-width: 900px) {
  .signin {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .signin .pitch {
    border-right: 0;
    border-bottom: 1px solid var(--edge);
  }

  .title-page {
    grid-template-columns: minmax(0, 1fr);
  }

  .title-page .poster {
    max-width: 260px;
  }
}

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