/* Marrowe — shared app styles
   Editorial minimalism, warm paper neutrals, ember accent.
   Used by every signed-in page in the chef portal. */

:root {
  --bg: #FAF8F4;
  --surface: #FCFAF7;
  --surface-2: #F5F1E9;
  --text: #1A1612;
  --text-muted: #6B6358;
  --text-quiet: #948A7D;
  --border: #E8E2D7;
  --border-soft: #EFEADF;
  --accent: #B8472E;
  --accent-hover: #9A3A24;
  --accent-soft: #FBF1EA;
  --accent-soft-border: #F2DAC9;
  --severe: #B91C1C;
  --moderate: #C2410C;
  --preference: #1F2937;
  --ok: #4A6B3A;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --max-w: 1120px;
  --col-w: 580px;
  --reading-w: 760px;

  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
::selection { background: var(--accent-soft); color: var(--text); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
}

/* ─── Nav ─────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); }
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (max-width: 640px) {
  .nav-inner { padding: 14px 20px; }
}
.brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 60;
  text-decoration: none;
  line-height: 1;
}
.brand::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  margin-right: 9px;
  vertical-align: -4px;
  background: url("logo.svg") center / contain no-repeat;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.nav-links a, .nav-links button {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  letter-spacing: 0.005em;
  transition: color 160ms ease;
}
.nav-links a:hover, .nav-links button:hover { color: var(--text); }
.nav-links a.is-active { color: var(--text); }
.nav-links .chev {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-links .chev svg { width: 9px; height: 9px; opacity: 0.8; }
@media (max-width: 640px) {
  .nav-links { gap: 18px; }
  .nav-links a:nth-child(2), .nav-links a:nth-child(3) { display: none; }
}

/* ─── Type primitives ─────────────────────────────────────────── */
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
.eyebrow.sans {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.14em;
}
.page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
  font-size: clamp(40px, 5.6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.025em;
  color: var(--text);
  margin: 16px 0 0 0;
  text-wrap: pretty;
  max-width: 16ch;
}
.page-title .accent { font-style: italic; font-weight: 400; }

.lede {
  font-family: var(--sans);
  font-size: 17px;
  color: var(--text-muted);
  margin: 18px 0 0 0;
  max-width: 56ch;
  line-height: 1.55;
}

/* Hairline divider with eyebrow + count */
.divider {
  margin: 80px 0 36px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.divider .rule-row {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}
.divider .lbl {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.divider .count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-quiet);
  text-align: right;
}

/* Buttons */
.btn-pill {
  appearance: none;
  background: var(--text);
  color: #F8F2E8;
  border: 0;
  padding: 11px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  line-height: 1;
  transition: background 160ms ease;
}
.btn-pill:hover { background: #2A2018; }
.btn-pill.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-pill.ghost:hover {
  background: var(--surface);
  border-color: var(--text-muted);
}

/* Quiet inline text-link with arrow */
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 160ms ease, gap 200ms var(--ease-expo);
}
.text-link:hover { color: var(--text); gap: 12px; }

/* Status chips */
.tag {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  line-height: 1.4;
  white-space: nowrap;
}
.tag.ember  { color: var(--accent); border-color: rgba(184,71,46,0.35); background: var(--accent-soft); }
.tag.ok     { color: var(--ok); border-color: rgba(74,107,58,0.35); background: #F2F5EE; }
.tag.quiet  { color: var(--text-quiet); }

/* ─── Reading-list row (body of work, bookings, etc.) ────────── */
.list-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 24px;
  align-items: baseline;
  padding: 22px 18px;
  margin: 0 -18px;
  border-top: 1px solid var(--border-soft);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 180ms ease, background 180ms ease, opacity 120ms ease;
}
.list-row:first-of-type { border-top: 0; }
.list-row:hover {
  box-shadow: 0 1px 0 rgba(26, 22, 18, 0.08), 0 6px 18px rgba(26, 22, 18, 0.05);
  background: var(--surface);
  opacity: 0.98;
}
.list-row .row-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 6px;
  font-variant-numeric: tabular-nums;
}
.list-row .row-body .title {
  font-family: var(--serif);
  font-weight: 500;
  font-variation-settings: "opsz" 60;
  font-size: 22px;
  letter-spacing: -0.005em;
  color: var(--text);
  margin: 0;
  line-height: 1.25;
}
.list-row .row-body .sub {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 6px 0 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.list-row .row-body .sub .dot {
  display: inline-block;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-quiet);
  opacity: 0.7;
}
.list-row .row-end {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-quiet);
  padding-top: 6px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
@media (max-width: 640px) {
  .list-row { grid-template-columns: 64px 1fr; gap: 16px; }
  .list-row .row-end { display: none; }
  .list-row .row-body .title { font-size: 19px; }
}

/* ─── Motion ─────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition:
    opacity 700ms var(--ease-expo),
    transform 700ms var(--ease-expo);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: translate3d(0, 0, 0); }
.reveal[data-delay="1"] { transition-delay: 70ms; }
.reveal[data-delay="2"] { transition-delay: 140ms; }
.reveal[data-delay="3"] { transition-delay: 210ms; }
.reveal[data-delay="4"] { transition-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ─── Tooltip ────────────────────────────────────────────────── */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translate(-50%, 4px);
  background: var(--text);
  color: #F8F2E8;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.005em;
  padding: 9px 13px;
  border-radius: 7px;
  text-align: center;
  width: max-content;
  max-width: min(340px, 78vw);
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms var(--ease-expo), transform 240ms var(--ease-expo);
  box-shadow: 0 6px 18px rgba(26, 22, 18, 0.18);
  z-index: 200;
}
[data-tooltip]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--text);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 200ms var(--ease-expo);
  z-index: 200;
  pointer-events: none;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 220ms;
}
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
  opacity: 1;
  transition-delay: 220ms;
}
@media (max-width: 640px) {
  [data-tooltip]::after, [data-tooltip]::before { display: none; }
}

/* ─── Kitchen card composition (BEO becoming the card) ───────── */
.mock[data-compose] .mock-head,
.mock[data-compose] .mock-meta,
.mock[data-compose] .mock-allergens,
.mock[data-compose] .mock-section,
.mock[data-compose] .mock-section ul li,
.mock[data-compose] .mock-timeline > span {
  opacity: 0;
  will-change: opacity, transform;
}
.mock.is-composing .mock-head    { animation: card-piece 560ms var(--ease-expo) 60ms forwards; }
.mock.is-composing .mock-meta    { animation: card-piece 560ms var(--ease-expo) 140ms forwards; }
.mock.is-composing .mock-allergens { animation: card-piece 600ms var(--ease-expo) 240ms forwards; }
.mock.is-composing .mock-section:has(ul) { animation: card-piece 560ms var(--ease-expo) 380ms forwards; }
.mock.is-composing .mock-section:has(.mock-timeline) { animation: card-piece 560ms var(--ease-expo) 520ms forwards; }

.mock.is-composing .mock-section ul li:nth-child(1) { animation: line-in 440ms var(--ease-expo) 460ms forwards; }
.mock.is-composing .mock-section ul li:nth-child(2) { animation: line-in 440ms var(--ease-expo) 520ms forwards; }
.mock.is-composing .mock-section ul li:nth-child(3) { animation: line-in 440ms var(--ease-expo) 580ms forwards; }
.mock.is-composing .mock-section ul li:nth-child(4) { animation: line-in 440ms var(--ease-expo) 640ms forwards; }

.mock.is-composing .mock-timeline > span:nth-child(1)  { animation: line-in 360ms var(--ease-expo) 600ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(2)  { animation: line-in 360ms var(--ease-expo) 640ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(3)  { animation: line-in 360ms var(--ease-expo) 700ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(4)  { animation: line-in 360ms var(--ease-expo) 740ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(5)  { animation: line-in 360ms var(--ease-expo) 800ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(6)  { animation: line-in 360ms var(--ease-expo) 840ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(7)  { animation: line-in 360ms var(--ease-expo) 900ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(8)  { animation: line-in 360ms var(--ease-expo) 940ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(9)  { animation: line-in 360ms var(--ease-expo) 1000ms forwards; }
.mock.is-composing .mock-timeline > span:nth-child(10) { animation: line-in 360ms var(--ease-expo) 1040ms forwards; }

.mock.is-composing .mock-chip {
  animation: chip-pulse 900ms var(--ease-expo) 320ms;
}

@keyframes card-piece {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes line-in {
  from { opacity: 0; transform: translate3d(-8px, 0, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes chip-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.45); }
  55%  { box-shadow: 0 0 0 9px rgba(185, 28, 28, 0); }
  100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); }
}

/* ─── Book entrance (slight depth, no spin) ──────────────────── */
.book[data-shelf] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition:
    opacity 680ms var(--ease-expo),
    transform 880ms var(--ease-expo);
}
.book.is-shelved { opacity: 1; transform: translate3d(0, 0, 0); }

/* ─── Press feedback ─────────────────────────────────────────── */
.cta:active { transform: scale(0.985); }
.nav-links a, .nav-links button { transition: color 160ms ease, transform 180ms var(--ease-expo); }
.nav-links a:active, .nav-links button:active { transform: translateY(1px); }
.pricing-row { transition: background 220ms var(--ease-expo); }
.pricing-row:hover { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  .mock[data-compose] .mock-head,
  .mock[data-compose] .mock-meta,
  .mock[data-compose] .mock-allergens,
  .mock[data-compose] .mock-section,
  .mock[data-compose] .mock-section ul li,
  .mock[data-compose] .mock-timeline > span {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }
  .book[data-shelf] { opacity: 1; transform: none; }
  .mock.is-composing .mock-chip { animation: none; }
}
