/* Buying Brief: shell styles. Max Fashion warmth, BuyOS discipline. */
@font-face {
  font-family: "Figtree";
  src: url("/assets/public/Figtree-VariableFont_wght.ttf") format("truetype");
  font-weight: 300 900;
  font-display: swap;
}
:root {
  --paper: #FAF8F5;
  --paper-2: #F3EDE4;
  --white: #FFFFFF;
  --ink: #0E0E0E;
  --ink-2: #3D3832;
  --muted: #8A8178;
  --line: #E7DFD4;
  --line-strong: #D6CABB;
  --champagne: #D1AC88;
  --champagne-hover: #CB9F74;
  --champagne-press: #B68A5E;
  --champagne-tint: #F4E9DC;
  --champagne-ink: #2A1E13;
  --lmg-gold: #D7A825;
  --lmg-navy: #002F87;
  --ok: #2F6B47; --ok-bg: #E4F0E8;
  --warn: #8A5D12; --warn-bg: #F8EDD9;
  --bad: #9B3B2F; --bad-bg: #F6E3DF;
  --ease-entrance: cubic-bezier(0, 0, 0, 1);
  --ease-emphasis: cubic-bezier(0.2, 0, 0, 1);
  --ease-standard: cubic-bezier(0.25, 1, 0.5, 1);
  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-corp: "Raleway", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  line-height: 1.5;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--champagne-press); outline-offset: 3px; border-radius: 6px; }

/* ---------- shared atoms ---------- */
.lmg {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-corp); font-weight: 300; font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.lmg::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--lmg-gold); }
.lmg.on-dark { color: rgba(255,255,255,.82); }
.eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--champagne-press); font-weight: 700; margin: 0 0 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  font: inherit; font-weight: 600; font-size: 15px; letter-spacing: .01em;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent;
  background: var(--ink); color: var(--white); cursor: pointer; text-decoration: none;
  transition: background .18s var(--ease-standard), border-color .18s var(--ease-standard), color .18s var(--ease-standard);
}
.btn:hover { background: #2A2622; }
.btn:active { background: #000; }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.champagne { background: var(--champagne); color: var(--champagne-ink); }
.btn.champagne:hover { background: var(--champagne-hover); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { background: var(--champagne-tint); border-color: var(--champagne); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; gap: 8px; }
.btn.block { width: 100%; }
.ms { width: 20px; height: 20px; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms i { display: block; }
.ms i:nth-child(1) { background: #F25022; } .ms i:nth-child(2) { background: #7FBA00; }
.ms i:nth-child(3) { background: #00A4EF; } .ms i:nth-child(4) { background: #FFB900; }
.msg { margin-top: 16px; font-size: 14px; padding: 12px 14px; border-radius: 12px; background: var(--champagne-tint); color: var(--champagne-ink); display: none; }
.msg.show { display: block; }
.msg.bad { background: var(--bad-bg); color: var(--bad); }
.fine { font-size: 13px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- entrance motion ---------- */
.rise { opacity: 0; transform: translateY(14px); animation: rise .9s var(--ease-emphasis) forwards; }
.rise.d1 { animation-delay: .12s; } .rise.d2 { animation-delay: .24s; } .rise.d3 { animation-delay: .36s; } .rise.d4 { animation-delay: .48s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- top bar (signed-in pages) ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(250,248,245,.86); backdrop-filter: saturate(1.2) blur(12px); -webkit-backdrop-filter: saturate(1.2) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brandline { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.brandline img { height: 30px; width: auto; flex: none; }
.brandline .t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brandline .t b { font-weight: 700; font-size: 15px; letter-spacing: .01em; white-space: nowrap; }
.brandline .t span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.who { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-2); }
.who .email { display: none; }
@media (min-width: 720px) { .who .email { display: inline; } }
.who a { text-decoration: none; }
.who a:hover { color: var(--champagne-press); }
.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 28px clamp(16px, 4vw, 48px) 36px; border-top: 1px solid var(--line); margin-top: 48px;
}

/* ---------- login: drifting mosaic ---------- */
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.14); } }
body.dark { background: var(--ink); color: var(--white); }
.mz { position: relative; min-height: 100vh; min-height: 100svh; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; background: #120F0C; }
.mz-field { position: absolute; inset: 0; overflow: hidden; }
.mz-tilt {
  position: absolute; inset: -12% -12%; display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); gap: clamp(8px, 1.2vw, 16px);
  transform: rotate(-4deg) scale(1.18); will-change: transform;
}
.mz-col { position: relative; overflow: hidden; }
.mz-track { display: flex; flex-direction: column; gap: clamp(8px, 1.2vw, 16px); animation: drift var(--dur, 80s) linear infinite; animation-delay: var(--delay, 0s); }
.mz-col.up .mz-track { animation-direction: reverse; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(calc(-50% - clamp(4px, .6vw, 8px))); } }
.mz-tile { margin: 0; aspect-ratio: 3 / 4; border-radius: clamp(10px, 1.2vw, 18px); overflow: hidden; background: #2A231D; animation: tileIn 1.4s var(--ease-emphasis) both; animation-delay: calc(var(--c) * 110ms + var(--i) * 70ms + 150ms); }
@keyframes tileIn { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
.mz-tile img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; animation: breathe 12s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -2.3s); }
@keyframes breathe { from { transform: scale(1); } to { transform: scale(1.07); } }
.mz-shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(14,14,14,.66) 0%, rgba(14,14,14,.10) 20%, rgba(14,14,14,.22) 38%, rgba(14,14,14,.82) 58%, rgba(14,14,14,.96) 100%);
}
@media (min-width: 900px) {
  .mz-shade { background:
    linear-gradient(90deg, rgba(14,14,14,.94) 0%, rgba(14,14,14,.84) 34%, rgba(14,14,14,.58) 54%, rgba(14,14,14,.04) 80%),
    linear-gradient(180deg, rgba(14,14,14,.45) 0%, rgba(14,14,14,0) 25%); }
}
.mz-top, .mz-copy, .mz-foot { position: relative; z-index: 2; padding-left: clamp(20px, 5vw, 72px); padding-right: clamp(20px, 5vw, 72px); }
.mz-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-top: clamp(20px, 4vw, 44px); }
.mz-logo { height: clamp(44px, 6vw, 64px); width: auto; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.mz-copy { align-self: end; padding-bottom: 8px; max-width: 820px; min-width: 0; }
@media (min-width: 900px) { .mz-copy { align-self: center; } }
.mz-eyebrow { color: var(--champagne); }
.mz-tag { margin: 0 0 clamp(22px, 3vw, 34px); font-weight: 800; letter-spacing: -.035em; line-height: .94; font-size: clamp(46px, 12vw, 104px); overflow-wrap: break-word; text-shadow: 0 4px 40px rgba(0,0,0,.35); }
.mz-tag .ln { display: block; }
.mz-tag em { font-style: normal; color: var(--champagne); }
.mz-cta { max-width: 440px; min-width: 0; }
.mz-btn { min-height: 60px; font-size: 16px; font-weight: 700; padding: 0 30px; width: 100%; box-shadow: 0 14px 40px rgba(209,172,136,.28); }
@media (min-width: 520px) { .mz-btn { width: auto; } }
.mz-btn:hover { background: #E2C3A2; }
.mz-fine { margin: 16px 0 0; font-size: 13px; color: rgba(255,255,255,.72); max-width: 44ch; }
.mz .msg a { color: inherit; }
.mz-foot { padding-top: 26px; padding-bottom: calc(clamp(20px, 3vw, 36px) + env(safe-area-inset-bottom)); }

/* ---------- library (home) ---------- */
.masthead { padding: clamp(36px, 7vw, 88px) clamp(16px, 4vw, 48px) clamp(20px, 3vw, 32px); max-width: 1280px; margin: 0 auto; }
.masthead h1 { margin: 0; font-size: clamp(40px, 7vw, 88px); line-height: .98; letter-spacing: -.03em; font-weight: 800; }
.masthead h1 em { font-style: normal; color: var(--champagne-press); }
.masthead p { margin: 18px 0 0; font-size: clamp(16px, 1.6vw, 19px); color: var(--ink-2); max-width: 54ch; }
.library { max-width: 1280px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 48px); display: grid; gap: clamp(18px, 2.4vw, 28px); grid-template-columns: 1fr; }
@media (min-width: 900px) { .library { grid-template-columns: repeat(2, 1fr); } .library .feature { grid-column: 1 / -1; } }
.bcard {
  position: relative; display: block; overflow: hidden; border-radius: 22px; text-decoration: none; color: var(--white);
  background: #1A1714; aspect-ratio: 4 / 5; isolation: isolate;
  box-shadow: 0 1px 2px rgba(42,30,19,.06), 0 24px 60px rgba(42,30,19,.12);
}
@media (min-width: 900px) { .bcard.feature { aspect-ratio: 16 / 8; } .bcard.feature img { object-position: 50% 8%; } .soon { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; justify-content: space-between; gap: 24px; } .soon .eyebrow { margin: 0; } }
.bcard img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: transform 1.4s var(--ease-entrance); z-index: -2; }
.bcard:hover img { transform: scale(1.05); }
.bcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(14,14,14,0) 35%, rgba(14,14,14,.82) 100%); }
@media (min-width: 900px) { .bcard.feature::before { background: linear-gradient(90deg, rgba(14,14,14,.80) 0%, rgba(14,14,14,.35) 45%, rgba(14,14,14,0) 70%); } }
.bcard .body { position: absolute; inset: auto 0 0 0; padding: clamp(20px, 3vw, 40px); }
@media (min-width: 900px) { .bcard.feature .body { inset: 0 auto 0 0; max-width: 560px; display: flex; flex-direction: column; justify-content: flex-end; } }
.bcard .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.24); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.chip.gold { background: var(--champagne); color: var(--champagne-ink); border-color: var(--champagne); }
.bcard h3 { margin: 0; font-size: clamp(30px, 4.4vw, 60px); line-height: .98; letter-spacing: -.025em; font-weight: 800; }
.bcard p { margin: 12px 0 0; color: rgba(255,255,255,.86); max-width: 46ch; font-size: 15px; }
.bcard .go { margin-top: 20px; display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--champagne); }
.bcard .go svg { transition: transform .3s var(--ease-standard); }
.bcard:hover .go svg { transform: translateX(4px); }
.soon { border-radius: 22px; border: 1px dashed var(--line-strong); display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(20px, 3vw, 36px); min-height: 220px; background: linear-gradient(160deg, var(--paper) 0%, var(--paper-2) 100%); }
.soon h3 { margin: 0 0 6px; font-size: 22px; }
.soon p { margin: 0; color: var(--muted); font-size: 14px; }

/* library ribbon */
.ribbon { max-width: 1280px; margin: clamp(36px, 5vw, 64px) auto 0; padding: 0 clamp(16px, 4vw, 48px); }
.ribbon-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.ribbon-h h2 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -.02em; font-weight: 800; }
.ribbon-h h2 em { font-style: normal; color: var(--champagne-press); }
.ribbon-mask { overflow: hidden; border-radius: 18px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ribbon-track { display: flex; gap: 14px; width: max-content; animation: ribbon 70s linear infinite; }
.ribbon-mask:hover .ribbon-track { animation-play-state: paused; }
.ribbon-track figure { margin: 0; width: clamp(150px, 18vw, 230px); aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: var(--paper-2); flex: none; }
.ribbon-track img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transition: transform 1s var(--ease-entrance); }
.ribbon-track figure:hover img { transform: scale(1.06); }
@keyframes ribbon { to { transform: translateX(calc(-50% - 7px)); } }
.soon { border-style: solid; border-color: var(--line); }
.soon .eyebrow { margin-bottom: 8px; }

/* ---------- request ---------- */
.calm { min-height: calc(100svh - 64px); display: grid; grid-template-columns: 1fr; }
@media (min-width: 960px) { .calm { grid-template-columns: .9fr 1.1fr; } }
.calm .pic { position: relative; min-height: 38svh; overflow: hidden; }
.calm .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; animation: kenburns 14s linear forwards; }
.calm .text { display: flex; align-items: center; padding: clamp(28px, 6vw, 80px) clamp(20px, 5vw, 72px); }
.calm .text .inner { max-width: 480px; }
.calm h1 { margin: 0 0 14px; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.02; letter-spacing: -.02em; font-weight: 800; }
.calm .lede { color: var(--ink-2); font-size: 17px; margin: 0 0 28px; }
.state { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: 16px; background: var(--white); border: 1px solid var(--line); margin-bottom: 22px; }
.state .ic { width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--champagne-tint); color: var(--champagne-press); }
.state b { display: block; font-size: 15px; }
.state span { color: var(--ink-2); font-size: 14px; }
.state.pending .ic { background: var(--warn-bg); color: var(--warn); }
.state.pending .ic::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
.state.bad .ic { background: var(--bad-bg); color: var(--bad); }

/* ---------- admin ---------- */
.admin { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px); }
.admin h1 { margin: 0 0 8px; font-size: clamp(32px, 4.6vw, 52px); letter-spacing: -.02em; line-height: 1.02; font-weight: 800; }
.admin .lede { color: var(--ink-2); margin: 0 0 28px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 34px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.stat b { display: block; font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.stat.pending b { color: var(--warn); }
.sect { margin-top: 36px; }
.sect-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sect-h h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.list { background: var(--white); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.row { display: grid; grid-template-columns: 40px 1fr; gap: 6px 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
@media (min-width: 760px) { .row { grid-template-columns: 40px 1fr auto auto; } }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--champagne-tint); color: var(--champagne-ink); grid-row: span 2; }
@media (min-width: 760px) { .avatar { grid-row: auto; } }
.row .who2 b { display: block; font-size: 15px; font-weight: 600; word-break: break-all; }
.row .who2 span { font-size: 13px; color: var(--muted); }
.row .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--champagne-tint); color: var(--champagne-ink); text-transform: capitalize; }
.pill.active { background: var(--ok-bg); color: var(--ok); }
.pill.pending { background: var(--warn-bg); color: var(--warn); }
.pill.rejected, .pill.revoked { background: var(--bad-bg); color: var(--bad); }
.pill.admin { background: var(--ink); color: var(--white); }
.empty { padding: 26px 18px; color: var(--muted); font-size: 14px; text-align: center; }
.grant { display: flex; gap: 10px; flex-wrap: wrap; padding: 18px; }
.grant input, .grant select {
  font: inherit; font-size: 15px; min-height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--paper); min-width: 0; flex: 1 1 240px; color: var(--ink);
}
.grant select { flex: 0 1 220px; }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .rise { opacity: 1; transform: none; }
  .calm .pic img, .mz-track, .mz-tile img, .ribbon-track { animation: none !important; transform: none !important; }
  .ribbon-mask { overflow-x: auto; }
  .mz-tile { animation: none !important; opacity: 1; transform: none; }
}
