/* ============================================================
   REWIND — STARK DESIGN SYSTEM  (design/tokens.css)
   Lifted verbatim from design/mocks/.  Source mocks:
     dashboard.html · calendar.html · theme-preview.html
   DO NOT approximate — if it diverges from the mocks the
   workstream has failed.  All seven mocks share this system.
   ============================================================ */


/* ----------------------------------------------------------
   1. THEME TOKENS
   ---------------------------------------------------------- */

/* Default / Grey — from dashboard.html + calendar.html */
:root {
  --bg:          #1C1D20;
  --ink:         #F2F2F0;
  --ink70:       rgba(242,242,240,.9);
  --ink45:       rgba(242,242,240,.68);
  --hair:        rgba(242,242,240,.12);
  --hair2:       rgba(242,242,240,.22);
  --gold:        #D8B26A;
  --gold-deep:   #A8843E;
  --gold-grad:   linear-gradient(160deg,#F2DCA4 0%,#D8B26A 45%,#A8843E 100%);
  --gold-soft:   rgba(216,178,106,.55);
  --panel:       rgba(255,255,255,.045);
  --panel-border:rgba(255,255,255,.22);
  --win:         #2FAE78;
  --win-text:    #7BE8B8;
  --loss:        #C96A6A;
  --loss-text:   #E8A0A0;
  --spec:        rgba(255,255,255,.18);
  --btn-ink:     #101010;
}

/* from theme-preview.html */
[data-theme="dark"] {
  --bg:          #070708;
  --ink:         #F4F4F2;
  --ink70:       rgba(244,244,242,.88);
  --ink45:       rgba(244,244,242,.66);
  --hair:        rgba(244,244,242,.1);
  --hair2:       rgba(244,244,242,.2);
  --gold:        #D9A92F;
  --gold-deep:   #9E7710;
  --gold-grad:   linear-gradient(160deg,#F5DE84 0%,#D9A92F 45%,#9E7710 100%);
  --gold-soft:   rgba(217,169,47,.55);
  --panel:       rgba(255,255,255,.028);
  --panel-border:rgba(255,255,255,.13);
  --win:         #3FA577;
  --win-text:    #5ED1A0;
  --loss:        #C96A6A;
  --loss-text:   #DE8C8C;
  --spec:        rgba(255,255,255,.16);
  --btn-ink:     #0A0A0A;
}

[data-theme="grey"] {
  --bg:          #1C1D20;
  --ink:         #F2F2F0;
  --ink70:       rgba(242,242,240,.9);
  --ink45:       rgba(242,242,240,.68);
  --hair:        rgba(242,242,240,.12);
  --hair2:       rgba(242,242,240,.22);
  --gold:        #D8B26A;
  --gold-deep:   #A8843E;
  --gold-grad:   linear-gradient(160deg,#F2DCA4 0%,#D8B26A 45%,#A8843E 100%);
  --gold-soft:   rgba(216,178,106,.55);
  --panel:       rgba(255,255,255,.04);
  --panel-border:rgba(255,255,255,.16);
  --win:         #2FAE78;
  --win-text:    #7BE8B8;
  --loss:        #C96A6A;
  --loss-text:   #E8A0A0;
  --spec:        rgba(255,255,255,.18);
  --btn-ink:     #101010;
}

[data-theme="light"] {
  --bg:          #F7F6F3;
  --ink:         #141414;
  --ink70:       rgba(20,20,20,.88);
  --ink45:       rgba(20,20,20,.66);
  --hair:        rgba(20,20,20,.1);
  --hair2:       rgba(20,20,20,.2);
  --gold:        #B8860B;
  --gold-deep:   #7A5800;
  --gold-grad:   linear-gradient(160deg,#E8C84A 0%,#B8860B 45%,#7A5800 100%);
  --gold-soft:   rgba(184,134,11,.55);
  --panel:       rgba(20,20,20,.025);
  --panel-border:rgba(20,20,20,.12);
  --win:         #1E7A52;
  --win-text:    #1E7A52;
  --loss:        #B04A4A;
  --loss-text:   #B04A4A;
  --spec:        rgba(255,255,255,.65);
  --btn-ink:     #FFFFFF;
}


/* ----------------------------------------------------------
   2. BASE RESET + TYPOGRAPHY
   ---------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0 }
a { text-decoration: none; color: inherit }

/* Display/brand — weight 900, stretch 125% */
.disp {
  font-family: 'Archivo', sans-serif;
  font-weight: 900; font-style: italic; font-stretch: 125%;
  letter-spacing: 0;
}


/* ----------------------------------------------------------
   3. BODY — jewelry-lighting ground + 100vh lock
   ---------------------------------------------------------- */

html, body { height: 100% }

body {
  height: 100vh;
  overflow: hidden;
  font-variant-numeric: tabular-nums;

  /* Verbatim from dashboard.html — 5-layer radial-gradient ground */
  background:
    radial-gradient(1200px 500px at 50%  -8%, rgba(255,255,255,.05),        transparent 60%),
    radial-gradient(520px  360px at 16%  30%, rgba(216,178,106,.055),       transparent 70%),
    radial-gradient(620px  420px at 55%  85%, rgba(63,165,119,.04),         transparent 70%),
    radial-gradient(480px  320px at 88%  15%, rgba(216,178,106,.04),        transparent 70%),
    radial-gradient(140%   110%  at 50%  50%, transparent 55%, rgba(0,0,0,.4) 100%),
    var(--bg);

  color: var(--ink);
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 600;
  font-style: italic;
  font-stretch: 108%;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}


/* ----------------------------------------------------------
   4. WATERMARK  (REWIND × ARK)
   ---------------------------------------------------------- */

.wm {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 2vw; padding: 0 2vw;
  z-index: 0; pointer-events: none; user-select: none;
  font-family: 'Archivo', sans-serif;
  font-weight: 900; font-style: italic; font-stretch: 125%;
  font-size: clamp(64px, 9.5vw, 150px);
  letter-spacing: -.01em; text-transform: uppercase;
  color: rgba(242,242,240,.045); white-space: nowrap;
}
.wm i { font-style: italic; color: rgba(216,178,106,.07); font-size: .55em }

/* Everything after the watermark sits above it */
.wm ~ * { position: relative; z-index: 1 }


/* ----------------------------------------------------------
   5. LIQUID GLASS MATERIAL  (.glass utility)
   ---------------------------------------------------------- */

.glass {
  backdrop-filter: blur(11px) saturate(1.85) brightness(1.1);
  -webkit-backdrop-filter: blur(11px) saturate(1.85) brightness(1.1);
  /* liquidLens SVG filter must be present in the DOM (see app HTML) */
  backdrop-filter: blur(1.5px) url(#liquidLens) saturate(1.85) brightness(1.12);
  background: var(--panel) !important;
  border: 1px solid var(--panel-border) !important;
  box-shadow:
    inset 0  1.5px 0    var(--spec),
    inset 0  0     0    1.5px rgba(255,255,255,.06),
    inset 0 -2px   3px  rgba(255,255,255,.1),
    inset 0 -16px  28px -18px rgba(0,0,0,.55),
    inset 0  14px  24px -18px rgba(255,255,255,.12),
    0 22px 44px -22px rgba(0,0,0,.8),
    0  2px  8px  -2px rgba(0,0,0,.4) !important;
}

/* HUD corner brackets (gold, shared by panels that use them) */
.gold-brackets::before,
.gold-brackets::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  pointer-events: none;
  border-color: var(--gold-soft);
  border-style: solid;
}
.gold-brackets::before { top: 7px; left: 7px; border-width: 1px 0 0 1px; border-radius: 3px 0 0 0 }
.gold-brackets::after  { bottom: 7px; right: 7px; border-width: 0 1px 1px 0; border-radius: 0 0 3px 0 }


/* ----------------------------------------------------------
   6. TOP BAR  (shared across all pages)
   Verbatim from calendar.html — the most refined version.
   ---------------------------------------------------------- */

#stark-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 56px;
  padding: 0 26px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--hair);
  background: rgba(255,255,255,.02);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  position: relative;
  z-index: 10;
}

/* gold hairline glow */
#stark-topbar::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(216,178,106,.35) 50%, transparent 100%);
}

/* «REWIND brand */
.stark-brand {
  font-family: 'Archivo', sans-serif;
  font-weight: 900; font-style: italic; font-stretch: 125%;
  font-size: 19px; letter-spacing: -.03em;
  text-transform: uppercase; color: var(--ink);
}
.stark-brand-chevron {
  color: var(--gold);
  font-size: .8em; margin-right: 2px;
}

/* centered nav */
.stark-nav {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: stretch;
}
.stark-nav-item {
  font-family: 'Archivo', sans-serif;
  font-weight: 600; font-style: italic; font-stretch: 108%;
  font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink45);
  background: none; border: none; cursor: pointer;
  padding: 20px 0 17px;
  border-bottom: 2px solid transparent;
  transition: color .2s;
  position: relative;
}
.stark-nav-item:hover { color: var(--ink) }
.stark-nav-item.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

/* right side */
.stark-topbar-right {
  display: flex; align-items: center; gap: 12px; justify-content: flex-end;
}

/* + Log Trade — gold-gradient pill (from calendar.html) */
.stark-log-btn {
  font-family: 'Archivo', sans-serif;
  font-weight: 500; font-style: italic; font-stretch: 108%;
  font-size: 10.5px; letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--btn-ink);
  background: var(--gold-grad);
  border: 1px solid rgba(255,235,180,.5);
  border-radius: 8px; padding: 9px 17px;
  cursor: pointer;
  transition: filter .2s, transform .15s;
  box-shadow: inset 0 1px 0 rgba(255,250,230,.6), 0 6px 16px -8px rgba(216,178,106,.5);
}
.stark-log-btn:hover { filter: brightness(1.07); transform: translateY(-1px) }

/* avatar circle */
.stark-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(216,178,106,.45);
  color: var(--ink70);
  font-family: 'Archivo', sans-serif;
  font-weight: 600; font-style: italic; font-stretch: 108%;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  /* remove old gold background from previous build */
  background: transparent;
}


/* ----------------------------------------------------------
   7. RESPONSIVE STACK  (<1080px)
   ---------------------------------------------------------- */

@media (max-width: 1080px) {
  body { overflow: auto; height: auto }
  .stark-nav { display: none }
}
