/* Smoke Ring — BBQ Cook Journal
   Palette: deep charcoal neutrals + one saturated ember accent. No blues, no mustard/grey-green. */

:root {
  --ink: #17140f;
  --ink-soft: #241f18;
  --surface: #1d1912;
  --surface-2: #262019;
  --surface-3: #322a1e;
  --line: #3a3226;
  --text: #f2ead9;
  --text-dim: #b7ab94;
  --text-faint: #8a7f6b;
  --ember: #ff5a1f;
  --ember-hot: #ff7a3d;
  --ember-deep: #c9420f;
  --good: #d9c26a;
  --font-display: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -12px rgba(0,0,0,0.55);
  --danger: #e5484d;
  --danger-deep: #a6262b;
  /* Motion tokens — structural adoption from the AIOS design system
     (aios-design-system.css): consistent easing/duration instead of ad hoc
     per-rule values. Kept as app-local aliases rather than importing the
     system file wholesale, since that file's --ink/--bg/--accent tokens are
     named identically but mean the opposite thing here (--ink is this app's
     *background*, not its ink/text color) — importing verbatim would
     silently invert contrast. See design.md "Sean decision" note. */
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-expr: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
}

:root[data-theme="light"] {
  --ink: #faf5eb;
  --ink-soft: #f2ebda;
  --surface: #fffaf0;
  --surface-2: #f5eed9;
  --surface-3: #ece0c4;
  --line: #ddcca5;
  --text: #241f18;
  --text-dim: #5a5140;
  --text-faint: #8a7f6b;
  --ember: #d9440f;
  --ember-hot: #ff5a1f;
  --ember-deep: #a83208;
  --good: #92751f;
  --shadow: 0 10px 30px -14px rgba(60,40,10,0.25);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink: #faf5eb;
    --ink-soft: #f2ebda;
    --surface: #fffaf0;
    --surface-2: #f5eed9;
    --surface-3: #ece0c4;
    --line: #ddcca5;
    --text: #241f18;
    --text-dim: #5a5140;
    --text-faint: #8a7f6b;
    --ember: #d9440f;
    --ember-hot: #ff5a1f;
    --ember-deep: #a83208;
    --good: #92751f;
    --shadow: 0 10px 30px -14px rgba(60,40,10,0.25);
  }
}

* { box-sizing: border-box; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

body { overflow-x: hidden; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.01em; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; }
.brand-mark { color: var(--ember); font-size: 1.2rem; }
.tabs { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-active { color: var(--ink); background: var(--ember); }
/* Scoped to actual light contexts only (explicit data-theme, or the
   prefers-color-scheme fallback) — was previously also matching the
   default no-attribute state under a dark system preference, forcing
   low-contrast white text on the same-brightness dark active-tab bg. */
:root[data-theme="light"] .tab.is-active { color: #fffaf0; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .tab.is-active { color: #fffaf0; }
}
.theme-toggle {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

/* Draft banner — Zeigarnik effect / commitment device */
.draft-banner {
  background: var(--surface-3);
  border-bottom: 1px solid var(--ember-deep);
  color: var(--text);
  padding: 10px 24px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
}
.draft-banner.hidden { display: none; }
.link-btn {
  background: none;
  border: none;
  color: var(--ember-hot);
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  text-decoration: underline;
}
.link-btn.muted { color: var(--text-faint); }

.views { flex: 1; padding: 24px; max-width: 1080px; width: 100%; margin: 0 auto; }
.view { display: none; }
.view.is-active { display: block; animation: view-in 240ms var(--ease-expr) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateX(var(--slide-x, 0px)) translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* Dashboard */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card.accent { border-color: var(--ember-deep); }
.stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); font-weight: 700; }
.stat-value { font-family: var(--font-display); font-size: 2.1rem; margin-top: 4px; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-value .unit { font-size: 1rem; color: var(--text-dim); margin-left: 2px; }
.stat-sub { font-size: 0.82rem; color: var(--text-dim); margin-top: 2px; }
.stat-sub.at-risk { color: var(--ember-hot); font-weight: 700; }
.goal-bar { height: 6px; background: var(--surface-3); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.goal-fill { height: 100%; background: linear-gradient(90deg, var(--ember-deep), var(--ember-hot)); transition: width .4s ease; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-sub { font-size: 0.82rem; color: var(--text-faint); }

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: transform .1s ease, background .15s ease;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn-accent { background: var(--ember); border-color: var(--ember-deep); color: #1a0f08; }
:root[data-theme="light"] .btn-accent, :root:not([data-theme="dark"]) .btn-accent { color: #fffaf0; }
.btn-accent:hover { background: var(--ember-hot); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger-deep); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.form-head { margin-bottom: 14px; }

/* Cook list */
.cook-list { display: flex; flex-direction: column; gap: 10px; }
.cook-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.cook-card:hover { border-color: var(--ember); transform: translateY(-1px); box-shadow: 0 6px 18px -10px rgba(0,0,0,0.4); }
.cook-thumb {
  width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  background: var(--surface-3);
}
.cook-thumb.placeholder { display: flex; align-items: center; justify-content: center; color: var(--text-faint); font-size: 1.3rem; }
.cook-thumb-img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; display: block; }
.cook-info { flex: 1; min-width: 0; }
.cook-title-btn { background: none; border: none; padding: 0; margin: 0; color: var(--text); font-family: var(--font-body); cursor: pointer; text-align: left; display: block; }
.cook-title { font-weight: 700; font-size: 0.95rem; }
.cook-meta { font-size: 0.8rem; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-rating { color: var(--good); font-size: 0.95rem; letter-spacing: 1px; flex-shrink: 0; }
.cook-date { font-size: 0.78rem; color: var(--text-faint); flex-shrink: 0; min-width: 72px; text-align: right; font-variant-numeric: tabular-nums; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-dim); display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 320px; }
.empty-state.hidden { min-height: 0; }
.empty-state.hidden, .hidden { display: none !important; }
.empty-icon { font-size: 2.2rem; color: var(--ember); margin-bottom: 10px; }
.empty-state p { max-width: 420px; margin: 0 auto 16px; line-height: 1.5; }

/* Form */
.cook-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--text-dim); font-weight: 600; }
.field-wide { grid-column: 1 / -1; margin-top: 14px; }
input, select, textarea {
  font-family: var(--font-body);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  color: var(--text);
  font-size: 0.92rem;
  text-overflow: ellipsis;
}
input[type="text"], input[type="search"] { white-space: nowrap; overflow: hidden; }

input[type="file"] {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--text-dim);
  font-size: 0.85rem;
}
input[type="file"]::file-selector-button {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 12px;
  margin-right: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-3);
  color: var(--text);
  cursor: pointer;
  transition: background .15s ease;
}
input[type="file"]::file-selector-button:hover { background: var(--surface); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px rgba(255,90,31,0.18);
}
.was-validated input:invalid, .was-validated select:invalid, .was-validated textarea:invalid { border-color: var(--danger); }
textarea { resize: vertical; font-family: var(--font-body); }

.photo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-preview { width: 88px; height: 88px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.rating-picker { display: flex; gap: 4px; }
.star { background: none; border: none; font-size: 1.6rem; color: var(--surface-3); cursor: pointer; padding: 0 2px; line-height: 1; transition: color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.star.is-on { color: var(--good); }
.star:hover { color: var(--good); transform: scale(1.12); }
/* hover-preview: light every star up to the hovered one */
.rating-picker:hover .star { color: var(--good); }
.rating-picker .star:hover ~ .star { color: var(--surface-3); transform: none; }

.form-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 22px; flex-wrap: wrap; gap: 10px; }
.form-actions-btns { display: flex; gap: 10px; }
.autosave-note { font-size: 0.78rem; color: var(--text-faint); font-style: italic; }

/* Timeline filters */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-row input, .filter-row select { width: auto; }

/* Rub library */
.rub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.rub-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; transition: border-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.rub-card-btn { display: block; width: 100%; text-align: left; font-family: var(--font-body); cursor: pointer; }
.rub-card-btn:hover { border-color: var(--ember); transform: translateY(-1px); }
.rub-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; }
.rub-count { font-size: 0.8rem; color: var(--text-dim); }
.rub-best { font-size: 0.78rem; color: var(--good); margin-top: 6px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--ember-deep);
  color: var(--text);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.toast.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(8px); }
#toastAction { color: var(--ember-hot); }

/* Mobile */
@media (max-width: 640px) {
  .topbar { padding: 10px 14px; gap: 12px; }
  .brand-name { display: none; }
  .tabs { gap: 2px; }
  .tab { padding: 8px 10px; font-size: 0.82rem; }
  .views { padding: 14px; }
  .cook-date { display: none; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions-btns { justify-content: stretch; }
  .form-actions-btns .btn { flex: 1; }
  .stat-grid, .form-grid { grid-template-columns: 1fr; }
}

/* Touch targets — 44px per Apple HIG / WCAG 2.5.8 */
@media (pointer: coarse) {
  .tab, .btn, .star, .link-btn, .theme-toggle { min-height: 44px; }
  .star { min-width: 44px; }
  .theme-toggle { width: 44px; height: 44px; }
}

:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }

/* ===================== WOW PASS — firelight logbook (2026-07-19) =====================
   All ambience transform/opacity only. One accent stays ember; protein hues are
   semantic (hue = protein), never interactive. */

/* --- ember motes: topbar brand + empty states. 7 (or 5) tiny radial dots
       rising on GPU-cheap transform/opacity loops. --- */
.brand { position: relative; }
.embers { position: absolute; inset: -8px -14px; pointer-events: none; overflow: hidden; }
.embers i {
  position: absolute;
  bottom: 0;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ember-hot) 0%, var(--ember) 55%, transparent 75%);
  opacity: 0;
  animation: ember-rise 6.5s linear infinite;
  will-change: transform, opacity;
}
.embers i:nth-child(1) { left: 8%;  animation-delay: 0s;    animation-duration: 5.8s; }
.embers i:nth-child(2) { left: 26%; animation-delay: 1.4s;  animation-duration: 7.1s; width: 2px; height: 2px; }
.embers i:nth-child(3) { left: 44%; animation-delay: 2.8s;  animation-duration: 6.2s; }
.embers i:nth-child(4) { left: 58%; animation-delay: 0.9s;  animation-duration: 7.6s; width: 2px; height: 2px; }
.embers i:nth-child(5) { left: 74%; animation-delay: 3.6s;  animation-duration: 5.5s; }
.embers i:nth-child(6) { left: 88%; animation-delay: 2.1s;  animation-duration: 6.9s; width: 2px; height: 2px; }
.embers i:nth-child(7) { left: 16%; animation-delay: 4.4s;  animation-duration: 7.4s; }
@keyframes ember-rise {
  0%   { transform: translate3d(0, 6px, 0) scale(0.8); opacity: 0; }
  12%  { opacity: 0.5; }
  60%  { opacity: 0.3; }
  100% { transform: translate3d(7px, -46px, 0) scale(0.4); opacity: 0; }
}
@keyframes ember-rise-light {
  0%   { transform: translate3d(0, 6px, 0) scale(0.8); opacity: 0; }
  12%  { opacity: 0.35; }
  60%  { opacity: 0.2; }
  100% { transform: translate3d(7px, -46px, 0) scale(0.4); opacity: 0; }
}
:root[data-theme="light"] .embers i { animation-name: ember-rise-light; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .embers i { animation-name: ember-rise-light; }
}
.empty-state { position: relative; }
.embers-empty { inset: auto; left: 50%; bottom: 50%; width: 90px; height: 110px; transform: translateX(-50%); }
.embers-empty i { animation-duration: 8s; }

/* --- topbar heat: a barely-there ember wash behind the brand --- */
.topbar::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(220px 60px at 40px 100%, rgba(255,90,31,0.10), transparent 70%);
  pointer-events: none;
}
.topbar { position: sticky; }

/* --- sear-in cards: rise + one-shot ember edge flash on first viewport entry --- */
.cook-list .cook-card {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 320ms var(--ease-expr), transform 320ms var(--ease-expr),
              border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.cook-list .cook-card.seared { opacity: 1; transform: none; }
.cook-card { position: relative; overflow: hidden; }
.cook-card::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(100deg, transparent 30%, rgba(255,90,31,0.14) 50%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}
.cook-card.seared::before { animation: sear-flash 700ms var(--ease-out) 1; }
@keyframes sear-flash {
  0% { opacity: 0; transform: translateX(-40%); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translateX(40%); }
}
/* hover keeps its lift after searing (must outrank .cook-list .cook-card.seared) */
.cook-list .cook-card.seared:hover { transform: translateY(-1px); }

/* --- doneness accents by protein: hue = protein (semantic), 3px edge + thumb tint --- */
.cook-card { --bark: var(--line); border-left: 3px solid var(--bark); }
[data-meat="Brisket"]       { --bark: #8a3b1e; }
[data-meat="Ribs (Beef)"]   { --bark: #7c2d17; }
[data-meat="Pork Shoulder"] { --bark: #b0532f; }
[data-meat="Ribs (Pork)"]   { --bark: #a2412a; }
[data-meat="Sausage"]       { --bark: #96482b; }
[data-meat="Chicken"]       { --bark: #c08a2e; }
[data-meat="Turkey"]        { --bark: #ad7427; }
[data-meat="Fish"]          { --bark: #c96f4a; }
.cook-card .cook-thumb.placeholder { background: color-mix(in srgb, var(--bark) 26%, var(--surface-3)); }

/* --- star set pulse: brief coal-glow pop on the chosen star --- */
.star.pulse { animation: star-pulse 420ms var(--ease-expr) 1; }
@keyframes star-pulse {
  0% { transform: scale(1); text-shadow: 0 0 0 rgba(255,122,61,0); }
  40% { transform: scale(1.35); text-shadow: 0 0 14px rgba(255,122,61,0.85); }
  100% { transform: scale(1); text-shadow: 0 0 0 rgba(255,122,61,0); }
}

/* --- save toast coal-glow pulse --- */
.toast { position: fixed; overflow: visible; }
.toast.glow::after {
  content: "";
  position: absolute; inset: -2px;
  border-radius: inherit;
  border: 1px solid var(--ember-hot);
  opacity: 0;
  pointer-events: none;
  animation: coal-glow 900ms var(--ease-out) 1;
}
@keyframes coal-glow {
  0% { opacity: 0.9; transform: scale(0.98); }
  100% { opacity: 0; transform: scale(1.12); }
}

/* --- season strip (dashboard): last 12 months from real logs --- */
.season-panel { margin-bottom: 24px; }
.season-strip { display: flex; align-items: stretch; gap: 6px; height: 74px; padding-top: 6px; }
.season-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.season-bar {
  width: 100%; max-width: 38px;
  flex: 1;
  border-radius: 4px 4px 2px 2px;
  background: var(--surface-3);
  position: relative;
  overflow: hidden;
}
.season-bar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--heat, 0) * 1%);
  background: linear-gradient(180deg, var(--ember-hot), var(--ember-deep));
  border-radius: inherit;
  transition: height 500ms var(--ease-expr);
}
.season-cell.is-now .season-bar { box-shadow: inset 0 0 0 1px var(--ember-deep); }
.season-cell-label { font-size: 0.62rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; }
.season-cell.is-now .season-cell-label { color: var(--ember-hot); font-weight: 700; }

/* --- season scrubber (timeline): drag the rail, scrub the story --- */
.season-scrub { position: relative; margin: 4px 0 16px; padding-top: 26px; }
.scrub-rail {
  display: flex; gap: 4px;
  height: 34px;
  align-items: center;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.scrub-seg {
  flex: 1; height: 100%;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid transparent;
  position: relative;
}
.scrub-seg i {
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, var(--ember-hot) 0%, var(--ember-deep) 70%);
  transform: scale(var(--heat, 0));
  opacity: calc(0.25 + var(--heat, 0) * 0.75);
  transition: transform var(--dur-2) var(--ease-out);
}
.scrub-seg.is-active { border-color: var(--ember-deep); background: var(--surface-3); }
.scrub-label {
  position: absolute; top: 0; left: 0;
  transform: translateX(-50%);
  background: var(--surface-3);
  border: 1px solid var(--ember-deep);
  color: var(--text);
  font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-1) linear;
}
.season-scrub.scrubbing .scrub-label, .season-scrub:hover .scrub-label { opacity: 1; }

/* --- photo lightbox with drag physics --- */
.lightbox { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; }
.lightbox.hidden { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(10,7,4,0.88); }
.lightbox-figure {
  position: relative;
  margin: 0;
  max-width: min(92vw, 900px);
  max-height: 82vh;
  display: flex; flex-direction: column; gap: 10px;
  touch-action: none;
  cursor: grab;
  will-change: transform;
}
.lightbox-figure.dragging { cursor: grabbing; }
.lightbox-figure:not(.dragging) { transition: transform 260ms var(--ease-expr), opacity 260ms var(--ease-out); }
.lightbox.closing .lightbox-figure { transition: transform 220ms var(--ease-out), opacity 220ms var(--ease-out); }
.lightbox.opening .lightbox-figure { animation: lightbox-in 280ms var(--ease-expr) both; }
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(0.94) translateY(14px); }
  to { opacity: 1; transform: none; }
}
.lightbox-img {
  max-width: 100%; max-height: 68vh;
  border-radius: 10px;
  border: 1px solid #3a3226;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
  user-select: none; -webkit-user-drag: none;
}
.lightbox-caption {
  color: #f2ead9; font-size: 0.9rem;
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  border-left: 3px solid var(--bark, var(--ember));
  padding-left: 10px;
}
.lightbox-caption .lb-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.lightbox-caption .lb-stars { color: var(--good); letter-spacing: 1px; }
.lightbox-caption .lb-meta { color: #b7ab94; font-size: 0.8rem; }
.lightbox-close, .lightbox-nav {
  position: absolute;
  background: rgba(38,32,25,0.85);
  border: 1px solid #3a3226;
  color: #f2ead9;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: border-color var(--dur-2) var(--ease-out), background var(--dur-2) var(--ease-out);
}
.lightbox-close:hover, .lightbox-nav:hover { border-color: var(--ember); }
.lightbox-close { top: 18px; right: 18px; }
.lightbox-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox-nav[disabled] { opacity: 0.3; cursor: default; }
.lightbox-share { position: absolute; bottom: 20px; right: 18px; z-index: 2; color: #f2ead9; border-color: #3a3226; background: rgba(38,32,25,0.85); }
.cook-thumb-btn { padding: 0; border: none; background: none; cursor: zoom-in; border-radius: 8px; flex-shrink: 0; display: block; }

/* --- thumb-first mobile navigation: tab bar docks to the bottom --- */
@media (max-width: 640px) {
  .tabs {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 40;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    gap: 4px;
    flex-wrap: nowrap;
  }
  .tab { flex: 1; text-align: center; padding: 10px 4px; }
  .views { padding-bottom: 96px; }
  .topbar { justify-content: space-between; }
  .brand-name { display: inline; } /* room returns once tabs leave the topbar */
  .toast { bottom: calc(78px + env(safe-area-inset-bottom)); max-width: 92vw; }
  .lightbox-share { bottom: calc(20px + env(safe-area-inset-bottom)); }
  .season-strip { height: 58px; }
}
@media (max-width: 375px) {
  .brand-name { display: none; } /* the very narrowest screens keep the mark only */
}

/* Reduced motion — kill transforms/animations, keep instant state changes */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .view.is-active { animation: none; }
  .cook-card:hover, .rub-card-btn:hover, .star:hover { transform: none; }
  .embers i { animation: none; opacity: 0; }
  .cook-list .cook-card { opacity: 1; transform: none; transition: none; }
  .cook-card.seared::before, .star.pulse, .toast.glow::after { animation: none; }
  .lightbox.opening .lightbox-figure { animation: none; }
  .season-bar::after, .scrub-seg i { transition: none; }
}
