/* The primitives in primitives.mjs, and only those. Tokens live in app.css. */

.icon { display: inline-block; vertical-align: -.16em; flex-shrink: 0; }
.stack-xs { display: flex; flex-direction: column; gap: 2px; }

/* ── page header: what this is, what to do here ────────────────────────── */
.page-header { display: flex; align-items: flex-start; gap: var(--s-3); margin: var(--s-1) 0 var(--s-4); }
.page-header h1 { margin: 0; font-size: var(--fs-xl); line-height: var(--lh-tight); letter-spacing: -.01em; }
.page-header .purpose { margin: var(--s-1) 0 0; color: var(--text-dim); font-size: var(--fs-sm); max-width: var(--measure); }
.page-header-side { flex-shrink: 0; }

/* ── the next step ─────────────────────────────────────────────────────── */
.hero {
  display: flex; align-items: flex-start; gap: var(--s-3);
  padding: var(--s-4); border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface-1)), var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-2);
}
.hero-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--accent-ink);
}
.hero-kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); }
.hero-title { font-size: var(--fs-lg); font-weight: 680; line-height: var(--lh-tight); }
.hero-why { color: var(--text-dim); font-size: var(--fs-sm); max-width: var(--measure); }
.hero-action { align-self: center; }
@media (max-width: 480px) {
  .hero { flex-wrap: wrap; }
  .hero-action { width: 100%; }
}

/* ── stepper ───────────────────────────────────────────────────────────── */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.stepper li { display: flex; align-items: center; gap: var(--s-3); color: var(--text-faint); font-size: var(--fs-sm); }
.stepper li.now { color: var(--text); font-weight: 600; }
.step-text { min-width: 0; }
.stepper li.done { color: var(--text-dim); }
.step-n {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700;
  background: var(--surface-3); color: var(--text-dim);
}
.stepper li.now .step-n { background: var(--accent); color: var(--accent-ink); }
.stepper li.done .step-n { background: color-mix(in srgb, var(--emerald) 22%, transparent); color: var(--emerald); }

/* ── progress ──────────────────────────────────────────────────────────── */
.progress { display: flex; flex-direction: column; gap: var(--s-1); }
.progress-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width var(--dur) var(--ease); }

/* ── segmented ─────────────────────────────────────────────────────────── */
.segmented { display: inline-flex; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-3); gap: 2px; }
.segmented button {
  min-height: 34px; padding: 0 var(--s-3); border: 0; border-radius: 6px;
  background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.segmented button[aria-selected="true"] { background: var(--surface-1); color: var(--text); box-shadow: var(--shadow-1); }

/* ── sheet ─────────────────────────────────────────────────────────────── */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  margin: 0 auto; max-width: 560px;
  padding: var(--s-3) var(--s-4) calc(var(--s-5) + env(safe-area-inset-bottom, 0));
  background: var(--surface-1); border: 1px solid var(--border); border-bottom: 0;
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow-3);
  animation: sheet-in var(--dur) var(--ease) both;
}
.sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto var(--s-2); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 820px) { .sheet { bottom: 24px; border-radius: 16px; border-bottom: 1px solid var(--border); } }

/* ── list row ──────────────────────────────────────────────────────────── */
.list-row {
  display: flex; align-items: center; gap: var(--s-3); width: 100%;
  min-height: var(--tap); padding: var(--s-2) var(--s-1);
  border: 0; border-bottom: 1px solid var(--border-soft); background: transparent;
  color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: default;
}
.list-row:last-child { border-bottom: 0; }
a.list-row, button.list-row { cursor: pointer; }
a.list-row:hover, button.list-row:hover { background: var(--surface-2); text-decoration: none; }
.row-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-dim);
}
.row-icon[data-tone="accent"]  { background: var(--accent-soft); color: var(--accent); }
.row-icon[data-tone="amber"]   { background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.row-icon[data-tone="emerald"] { background: color-mix(in srgb, var(--emerald) 18%, transparent); color: var(--emerald); }
.row-icon[data-tone="rose"]    { background: color-mix(in srgb, var(--rose) 18%, transparent); color: var(--rose); }
.row-icon[data-tone="indigo"]  { background: color-mix(in srgb, var(--indigo) 18%, transparent); color: var(--indigo); }
.row-trailing { flex-shrink: 0; }
.row-chevron { color: var(--text-faint); flex-shrink: 0; }

/* ── callout ───────────────────────────────────────────────────────────── */
.callout { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.callout summary {
  display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3);
  cursor: pointer; font-weight: 600; font-size: var(--fs-sm); list-style: none;
}
.callout summary::-webkit-details-marker { display: none; }
.callout[data-tone="warn"] { border-color: color-mix(in srgb, var(--amber) 45%, var(--border)); }
.callout[data-tone="warn"] summary { color: var(--amber); }
.callout[data-tone="info"] summary { color: var(--accent); }
.callout-body { padding: 0 var(--s-3) var(--s-3); color: var(--text-dim); font-size: var(--fs-sm); }

/* ── stat tiles ────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-2); }
.stat-tile {
  display: flex; flex-direction: column; gap: 2px; padding: var(--s-3);
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; text-decoration: none;
}
a.stat-tile:hover { border-color: var(--accent); text-decoration: none; }
.stat-value { font-size: var(--fs-xl); font-weight: 700; line-height: var(--lh-tight); letter-spacing: -.01em; }
.stat-value[data-tone="emerald"] { color: var(--emerald); }
.stat-value[data-tone="amber"]   { color: var(--amber); }
.stat-value[data-tone="rose"]    { color: var(--rose); }
.stat-label { font-size: var(--fs-xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat-delta { font-size: var(--fs-xs); color: var(--text-dim); }

/* ── date strip ────────────────────────────────────────────────────────── */
.date-strip { display: flex; gap: var(--s-1); overflow-x: auto; padding-bottom: var(--s-1); scrollbar-width: none; }
.date-strip::-webkit-scrollbar { display: none; }
.date-strip button {
  flex: 0 0 44px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: var(--s-2) 0; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim); font: inherit; cursor: pointer;
}
.date-strip button.today { border-color: var(--border); }
.date-strip button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.ds-dow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; }
.ds-day { font-size: var(--fs-md); font-weight: 700; }
.ds-dots { display: flex; gap: 2px; height: 5px; }
.ds-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--text-faint); }
.ds-dots i[data-tone="accent"]  { background: var(--accent); }
.ds-dots i[data-tone="emerald"] { background: var(--emerald); }
.ds-dots i[data-tone="amber"]   { background: var(--amber); }
.ds-dots i[data-tone="rose"]    { background: var(--rose); }

/* ── post states, as chips ─────────────────────────────────────────────── */
.chip[data-tone="state-ready"]     { color: var(--state-ready);     background: color-mix(in srgb, var(--state-ready) 15%, transparent); }
.chip[data-tone="state-filmed"]    { color: var(--state-filmed);    background: color-mix(in srgb, var(--state-filmed) 15%, transparent); }
.chip[data-tone="state-scheduled"] { color: var(--state-scheduled); background: color-mix(in srgb, var(--state-scheduled) 15%, transparent); }
.chip[data-tone="state-live"]      { color: var(--state-live);      background: color-mix(in srgb, var(--state-live) 15%, transparent); }
.chip[data-tone="state-skipped"]   { color: var(--state-skipped);   background: color-mix(in srgb, var(--state-skipped) 15%, transparent); }

/* ── display type and the style page ───────────────────────────────────── */
.t-display { font-size: var(--fs-display); font-weight: 720; line-height: var(--lh-tight); letter-spacing: -.02em; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: var(--s-2); }
.icon-cell { display: flex; flex-direction: column; align-items: center; gap: var(--s-1); padding: var(--s-2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }

/* ── screens: post, week, numbers, calendar, help ──────────────────────── */
.hook-display { font-size: var(--fs-display); font-weight: 720; line-height: var(--lh-tight); letter-spacing: -.02em; }
.beats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); counter-reset: beat; }
.beats li { display: flex; gap: var(--s-3); align-items: baseline; font-size: var(--fs-lg); line-height: 1.4; }
.beats li.large { font-size: var(--fs-xl); }
.beat-n { flex: 0 0 34px; font-size: var(--fs-xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.shots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-1); }
.shots li { display: flex; gap: var(--s-2); align-items: center; font-size: var(--fs-sm); }
.shot-where { color: var(--text-faint); }
.tags { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.action-bar {
  position: sticky; bottom: calc(var(--nav-h) + 8px); z-index: 20;
  display: flex; gap: var(--s-2); padding: var(--s-2); margin-top: var(--s-4);
  background: color-mix(in srgb, var(--surface-1) 94%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-2);
}
.action-bar .btn { flex: 1; }
.film-done { text-align: center; padding: var(--s-6) var(--s-4); }
.film-done .hook-display { margin-bottom: var(--s-2); }
.day-label { font-size: var(--fs-xs); font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; width: 34px; flex-shrink: 0; }
.numbers-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
.numbers-grid .field input { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
@media (min-width: 480px) { .numbers-grid { grid-template-columns: repeat(4, 1fr); } }
.weeks-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.weeks-table th, .weeks-table td { text-align: right; padding: var(--s-1) var(--s-2); border-bottom: 1px solid var(--border-soft); }
.weeks-table th:first-child, .weeks-table td:first-child { text-align: left; }
.cal-day { margin-top: var(--s-4); }
.cal-day-title { display: flex; align-items: baseline; gap: var(--s-2); margin-bottom: var(--s-1); }
.cal-day-title .dow { font-weight: 700; }
.cal-day-title.today .dow { color: var(--accent); }
.cal-time { font-variant-numeric: tabular-nums; color: var(--text-dim); font-size: var(--fs-xs); }
.help-body h1 { font-size: var(--fs-xl); margin: 0 0 var(--s-3); }
.help-body h2 { font-size: var(--fs-lg); margin: var(--s-5) 0 var(--s-2); }
.help-body p, .help-body li { font-size: var(--fs-md); line-height: var(--lh); max-width: var(--measure); }
.help-body ol { padding-left: var(--s-5); }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 16px); z-index: 25; width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-3); }
@media (min-width: 820px) { .fab { bottom: 24px; right: 24px; } }

/* Room to scroll the last line clear of a sticky bar or a floating button. */
.main.has-actions { padding-bottom: calc(var(--nav-h) + 110px); }
.main.has-fab { padding-bottom: calc(var(--nav-h) + 90px); }

/* "For you" on a queue card: the one fact that decides whether the card is
   yours to open, so it carries the accent and the others do not. */
.for-you { color: var(--accent); font-weight: 700; }

/* A card the Next button pointed at: lit for a moment so the eye lands on it. */
.card.spotlight { animation: spotlight 1.8s ease-out; }
@keyframes spotlight {
  0%   { box-shadow: 0 0 0 4px var(--accent); }
  70%  { box-shadow: 0 0 0 4px var(--accent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
