/* Trade Like Shrimp: base styles and shared components (load after tls-tokens.css).
   Each site's own stylesheet adds its layout on top. */

/* ---------- reset ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- text helpers ---------- */
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.pos { color: var(--good); } .neg { color: var(--bad); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--gold-hi); }

/* ---------- buttons ----------
   Press: scales to --press and lightens (an overlay's opacity), eases back over --t-fast.
   Size is set per site with --btn-h / --btn-py / --btn-px / --btn-fs. */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--btn-h, 44px); padding: var(--btn-py, 10px) var(--btn-px, 14px); border-radius: var(--r-btn);
  border: 1px solid var(--line-2); background: var(--surface-2); font-weight: 600; font-size: var(--btn-fs, 14px); text-decoration: none;
  transition: transform var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out); }
.btn::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: rgba(255, 255, 255, .06); opacity: 0; transition: opacity var(--t-fast) var(--ease-out); }
@media (hover: hover) { .btn:hover::before { opacity: .6; } }
.btn:active { transform: scale(var(--press)); transition-duration: 60ms; }
.btn:active::before { opacity: 1; transition-duration: 0s; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.gold { background: linear-gradient(180deg, #DDB663, var(--gold)); color: var(--gold-ink); border-color: transparent; }
.btn.gold::before { background: rgba(255, 255, 255, .18); }
.btn.ghost { background: transparent; color: var(--fg-2); }
.btn.outline { background: transparent; border-color: rgba(212, 168, 75, .55); color: var(--gold-hi); }
.btn.danger-o { border-color: rgba(217, 68, 58, .5); color: var(--bad); }
.btn.block { display: flex; width: 100%; }
.btn-sm { --btn-h: 44px; --btn-py: 8px; --btn-px: 14px; --btn-fs: 14px; }
/* Sending: a gold ring that breathes (opacity only). */
.busy::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid var(--gold);
  pointer-events: none; animation: tls-busy 1s var(--ease-in-out) infinite; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--card-pad, var(--s4)); }

/* ---------- chips (filters) ---------- */
.chip { flex: none; min-height: 44px; padding: 8px 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface);
  color: var(--fg-2); font-size: 14px; font-weight: 500; transition: transform var(--t-fast) var(--ease-out); }
.chip:active { transform: scale(var(--press)); }
.chip[aria-pressed="true"] { border-color: rgba(212, 168, 75, .6); color: var(--gold-hi); background: rgba(212, 168, 75, .08); }

/* ---------- segmented control: one pill slides between options ---------- */
.seg { --i: 0; --n: 2; position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px;
  background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--r-btn); }
.seg3 { --n: 3; } .seg4 { --n: 4; } .seg5 { --n: 5; } .seg6 { --n: 6; }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / var(--n)); border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line-2);
  transform: translateX(calc(var(--i) * 100%)); transition: transform var(--t-slow) var(--ease-out), opacity var(--t-base) var(--ease-out); }
.seg.none .seg-pill { opacity: 0; }
.seg button { position: relative; z-index: 1; min-height: 40px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 13px;
  transition: transform var(--t-fast) var(--ease-out); }
.seg button:active { transform: scale(var(--press)); transition-duration: 60ms; }
.seg button.on { color: var(--gold-hi); }
/* touch screens: every segment is a full 44 px target */
@media (pointer: coarse) { .seg button { min-height: 44px; } }

/* ---------- loading skeletons ---------- */
.skel { position: relative; overflow: hidden; color: transparent !important; border-radius: 6px; background: var(--surface-2); }
.skel-list { display: flex; flex-direction: column; gap: var(--s2); }
.skel-row { position: relative; overflow: hidden; height: 64px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); }
.skel::after, .skel-row::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .055), transparent); animation: tls-shimmer 1.4s var(--ease-in-out) infinite; }

/* ---------- scroll entrances: fade + rise, once (js adds .on) ---------- */
.js .reveal { opacity: 0; transform: translate3d(var(--reveal-x, 0px), var(--rise), 0);
  transition: opacity var(--t-reveal) var(--ease-out), transform var(--t-reveal) var(--ease-out);
  transition-delay: calc(var(--d, 0) * var(--stagger)); }
.js .reveal.on { opacity: 1; transform: none; }

/* ---------- keyframes ---------- */
@keyframes tls-rise { from { opacity: 0; transform: translate3d(0, var(--rise), 0); } }
@keyframes tls-rise-sm { from { opacity: 0; transform: translate3d(0, var(--rise-sm), 0); } }
@keyframes tls-fade { from { opacity: 0; } }
@keyframes tls-shimmer { to { transform: translateX(100%); } }
@keyframes tls-spin { to { transform: rotate(360deg); } }
@keyframes tls-ping { from { transform: scale(1); opacity: .55; } 70%, to { transform: scale(2.8); opacity: 0; } }
@keyframes tls-busy { 50% { opacity: .15; } }

/* ---------- reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skel::after, .skel-row::after, .busy::after { animation: none; }
  .js .reveal { transition-property: opacity; }
}
