/* ==========================================================================
   assasen11.xyz — shared design system
   TWO THEMES via a themeable --accent (+ surfaces):
     · GLOBAL "cosmic blue" (default :root) — Home/Videos/Commands: royal blue,
       icy near-white ink, a sparse white starfield. The channel's vibe.
     · LOOT "forge" (body[data-theme="loot"]) — the Inventory section only:
       bronze/gold + parchment + ember glow, home of the item economy.
   Signature (loot only): the "loot slot" — items sit in a rarity-lit cell.
   Type: Chakra Petch (display), IBM Plex Sans (body), IBM Plex Mono (data).
   ========================================================================== */

:root {
  /* surface / ink — global "cosmic blue" theme (the channel's blue+starlight vibe) */
  --bg:        #132444;   /* deep royal blue — alive, not night-black, not washed out */
  --bg-2:      #1a3057;   /* raised panel */
  --bg-3:      #21396b;   /* input well */
  --line:      #37518c;   /* hairline */
  --line-soft: #294276;
  --ink:       #eaf1fd;   /* near-white */
  --ink-dim:   #adc0e6;
  --ink-faint: #7789b6;

  /* themeable accent — the Inventory section overrides these to bronze/gold */
  --accent:     #5b9dff;  /* bright azure */
  --accent-lit: #a7cbff;  /* icy highlight */
  --accent-2:   #316fd4;  /* deeper azure (gradients) */
  --accent-ink: #08162f;  /* text on an accent fill */

  /* rarity (loot convention: grey→green→blue→purple→gold) */
  --r-common:    #9a9384;
  --r-uncommon:  #58b06a;
  --r-rare:      #4d90d6;
  --r-epic:      #a862e0;
  --r-legendary: #e8a63a;

  --radius:   4px;
  --radius-lg: 8px;
  --gap:      clamp(14px, 2.4vw, 24px);
  --maxw:     1180px;

  --shadow:   0 2px 8px rgba(0,0,0,.35);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.55);

  --font-display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

/* ---- reset-ish ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* sparse starlight over a soft blue glow — not a full night sky, not washed out */
  background-image:
    radial-gradient(1100px 560px at 50% -10%, rgba(120,170,255,.16), transparent 60%),
    radial-gradient(820px 520px at 86% 2%, rgba(90,120,220,.10), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='440' height='440'%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='115' cy='105' r='1.0' opacity='0.46'/%3E%3Ccircle cx='76' cy='190' r='1.2' opacity='0.21'/%3E%3Ccircle cx='262' cy='99' r='0.7' opacity='0.51'/%3E%3Ccircle cx='177' cy='341' r='0.7' opacity='0.34'/%3E%3Ccircle cx='327' cy='293' r='0.9' opacity='0.53'/%3E%3Ccircle cx='25' cy='194' r='1.2' opacity='0.29'/%3E%3Ccircle cx='163' cy='115' r='0.9' opacity='0.55'/%3E%3Ccircle cx='271' cy='303' r='1.2' opacity='0.54'/%3E%3Ccircle cx='225' cy='65' r='1.2' opacity='0.4'/%3E%3Ccircle cx='9' cy='232' r='1.0' opacity='0.26'/%3E%3Ccircle cx='73' cy='235' r='0.9' opacity='0.38'/%3E%3Ccircle cx='348' cy='19' r='0.9' opacity='0.49'/%3E%3Ccircle cx='366' cy='105' r='1.2' opacity='0.52'/%3E%3Ccircle cx='87' cy='193' r='1.5' opacity='0.41'/%3E%3Ccircle cx='265' cy='291' r='0.9' opacity='0.42'/%3E%3Ccircle cx='332' cy='346' r='1.0' opacity='0.24'/%3E%3Ccircle cx='241' cy='238' r='1.2' opacity='0.4'/%3E%3Ccircle cx='131' cy='140' r='0.7' opacity='0.53'/%3E%3Ccircle cx='363' cy='128' r='0.9' opacity='0.27'/%3E%3Ccircle cx='395' cy='417' r='1.2' opacity='0.29'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat, repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

/* ---- Inventory keeps the forge / loot vibe (scoped theme override) ------- */
body[data-theme="loot"] {
  --bg:        #14100c;
  --bg-2:      #1b1611;
  --bg-3:      #241d16;
  --line:      #3a2f24;
  --line-soft: #2a221a;
  --ink:       #ece2d1;
  --ink-dim:   #ac9f8b;
  --ink-faint: #7c7160;
  --accent:     #d8a83a;
  --accent-lit: #f0c65a;
  --accent-2:   #b87333;
  --accent-ink: #1a1208;
  /* ember glow, no stars */
  background-image:
    radial-gradient(1200px 520px at 50% -8%, rgba(216,168,58,.10), transparent 60%),
    radial-gradient(900px 600px at 88% 4%, rgba(184,115,51,.06), transparent 55%);
  background-repeat: no-repeat, no-repeat;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; letter-spacing: .01em; }
[x-cloak] { display: none !important; }

/* ---- layout ------------------------------------------------------------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.section { padding-block: clamp(40px, 7vw, 84px); }
.stack > * + * { margin-top: var(--gap); }

/* ---- eyebrow / headings ------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 .5rem;
}
.h-xl { font-size: clamp(2.4rem, 6vw, 4.4rem); }
.h-lg { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.lead { color: var(--ink-dim); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 60ch; }
.muted { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }

/* ---- top navigation ----------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.nav__row { display: flex; align-items: center; gap: 20px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; letter-spacing: .04em; }
.brand__mark {
  width: 26px; height: 26px; border-radius: 5px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: var(--accent-ink); font-weight: 700; font-size: .95rem; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.brand__word { white-space: nowrap; }
.brand em { color: var(--accent); font-style: normal; }
.nav__links { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav__links a {
  font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em;
  padding: 8px 12px; border-radius: var(--radius); color: var(--ink-dim);
  transition: color .15s, background .15s;
}
.nav__links a:hover { color: var(--ink); background: var(--bg-3); }
.nav__links a[aria-current="page"] { color: var(--accent); background: rgba(216,168,58,.10); }
.nav__live {
  display: none; align-items: center; gap: 7px; font-family: var(--font-mono);
  font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: #ff6b6b;
  padding: 6px 11px; border: 1px solid rgba(255,107,107,.35); border-radius: 999px; margin-left: 6px;
}
.nav__live.is-live { display: inline-flex; }
.nav__live::before { content:""; width: 8px; height: 8px; border-radius: 50%; background: #ff5252; box-shadow: 0 0 0 0 rgba(255,82,82,.55); animation: pulse 1.8s infinite; }

/* ---- buttons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: .04em;
  padding: 11px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg-3); color: var(--ink);
  transition: border-color .15s, transform .1s, background .15s;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn--gold { background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn--gold:hover { filter: brightness(1.07); border-color: transparent; }
.btn--ghost { background: transparent; }

/* ---- inputs / search ---------------------------------------------------- */
.field {
  width: 100%; font-family: var(--font-mono); font-size: .95rem;
  padding: 13px 15px 13px 42px; color: var(--ink);
  background: var(--bg-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23ac9f8b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.2-3.2'/%3E%3C/svg%3E") no-repeat 14px center;
  border: 1px solid var(--line); border-radius: var(--radius); outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216,168,58,.16); }
.field::placeholder { color: var(--ink-faint); }
.field--plain { padding-left: 15px; background-image: none; }

/* filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .03em;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: transparent; color: var(--ink-dim); text-transform: capitalize;
  transition: all .13s;
}
.chip:hover { color: var(--ink); border-color: var(--ink-faint); }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: transparent; font-weight: 600; }

/* ---- panels ------------------------------------------------------------- */
.panel {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel--pad { padding: clamp(18px, 3vw, 30px); }

/* ==========================================================================
   SIGNATURE — the loot slot
   ========================================================================== */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.slot {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 12px; text-align: left;
  background:
    linear-gradient(180deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  transition: transform .12s ease, border-color .12s, box-shadow .12s;
  overflow: hidden;
}
/* rarity edge: a lit inner corner, not a loud full border */
.slot::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 1px var(--rc, transparent), inset 0 22px 30px -26px var(--rc, transparent);
  opacity: .9;
}
.slot::after {
  content: ""; position: absolute; top: 0; left: 0; width: 34px; height: 34px; pointer-events: none;
  background: radial-gradient(circle at top left, var(--rc, transparent), transparent 70%);
  opacity: .5;
}
.slot:hover { transform: translateY(-3px); border-color: var(--rc, var(--accent)); box-shadow: 0 10px 26px -12px var(--rc, rgba(0,0,0,.6)); }
.slot__icon {
  width: 46px; height: 46px; border-radius: var(--radius); display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: var(--rc, var(--ink));
  background: rgba(0,0,0,.28); border: 1px solid color-mix(in srgb, var(--rc, var(--line)) 45%, transparent);
}
.slot__name { font-family: var(--font-display); font-weight: 600; font-size: .98rem; line-height: 1.15; }
.slot__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em; color: var(--ink-faint); text-transform: uppercase; }
.slot__qty { position: absolute; top: 8px; right: 10px; font-family: var(--font-mono); font-size: .8rem; color: var(--accent-lit); text-shadow: 0 1px 2px #000; }

/* rarity binding — set --rc on any element */
.r-common    { --rc: var(--r-common); }
.r-uncommon  { --rc: var(--r-uncommon); }
.r-rare      { --rc: var(--r-rare); }
.r-epic      { --rc: var(--r-epic); }
.r-legendary { --rc: var(--r-legendary); }

.rarity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc, var(--r-common)); display: inline-block; flex: none; }
.rarity-tag {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--rc); border: 1px solid color-mix(in srgb, var(--rc) 50%, transparent);
  padding: 3px 8px; border-radius: 999px;
}

/* ---- generic badges ----------------------------------------------------- */
.badge {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-dim);
}
.badge--anyone { color: var(--r-uncommon); border-color: color-mix(in srgb, var(--r-uncommon) 45%, transparent); }
.badge--mod    { color: var(--r-rare);     border-color: color-mix(in srgb, var(--r-rare) 45%, transparent); }
.badge--owner  { color: var(--r-legendary);border-color: color-mix(in srgb, var(--r-legendary) 45%, transparent); }

/* ---- key caps (commands / hotkeys) ------------------------------------- */
.kbd {
  font-family: var(--font-mono); font-size: .9rem; color: var(--accent-lit);
  background: rgba(0,0,0,.32); border: 1px solid var(--line); border-bottom-width: 2px;
  padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}

/* ---- modal / drawer ----------------------------------------------------- */
.scrim { position: fixed; inset: 0; background: rgba(8,6,4,.72); backdrop-filter: blur(3px); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow: auto;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border: 1px solid var(--line); border-top: 3px solid var(--rc, var(--accent));
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: clamp(20px, 4vw, 30px);
}
.modal__close { position: absolute; top: 14px; right: 16px; }
.close-x {
  width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg-3); display: grid; place-items: center; font-size: 1.1rem; color: var(--ink-dim);
}
.close-x:hover { color: var(--ink); border-color: var(--accent); }

/* ---- meta rows / stats -------------------------------------------------- */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-family: var(--font-mono); font-size: .85rem; }
.kv dt { color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; align-self: center; }
.kv dd { margin: 0; color: var(--ink); }

.usebox { border-left: 2px solid var(--accent); padding: 4px 0 4px 14px; }
.usebox li { margin: 4px 0; }

/* ---- empty / loading ---------------------------------------------------- */
.state { text-align: center; padding: clamp(40px, 8vw, 90px) 16px; color: var(--ink-dim); }
.state__glyph { font-size: 2.4rem; margin-bottom: 10px; opacity: .5; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }

/* ---- video cards (shared: home + videos) -------------------------------- */
.vcard { display: flex; flex-direction: column; gap: 8px; }
.vcard__t { font-family: var(--font-display); font-weight: 600; font-size: .98rem; line-height: 1.25; }
.vcard__d { font-family: var(--font-mono); font-size: .75rem; color: var(--ink-faint); }
.thumb { position: relative; display: block; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); border: 1px solid var(--line-soft); }
.thumb--v { aspect-ratio: 9/16; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.vcard:hover .thumb img { transform: scale(1.05); }
.vcard:hover .thumb { border-color: var(--accent); }
.thumb .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.6rem; color: #fff; background: rgba(0,0,0,.25); opacity: 0; transition: opacity .2s; text-shadow: 0 2px 8px #000; }
.vcard:hover .thumb .play { opacity: 1; }
.thumb .dur { position: absolute; bottom: 8px; right: 8px; font-family: var(--font-mono); font-size: .72rem; background: rgba(0,0,0,.8); color: #fff; padding: 2px 6px; border-radius: 3px; }

/* ---- socials (shared: home) --------------------------------------------- */
.socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; }
.social { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, transform .12s; align-items: center; text-align: center; justify-content: center; }
.social:hover { border-color: var(--accent); transform: translateY(-2px); }
.social__name { font-family: var(--font-display); font-weight: 600; }
.social__at { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-faint); }
.social.is-todo { opacity: .5; }
.social.is-todo:hover { opacity: .75; }
/* one tile split into two halves (YouTube main | archive) — the two halves fill
   the whole rectangle, a divider down the middle, each half highlights on hover */
.social--yt { padding: 0; flex-direction: row; overflow: hidden; }
.social--yt:hover { transform: none; border-color: var(--line); }
.yt-half { flex: 1; display: flex; flex-direction: column; gap: 3px; justify-content: center; align-items: center; text-align: center; padding: 16px 18px; transition: background .13s; }
.yt-half + .yt-half { border-left: 1px solid var(--line); }
.yt-half:hover { background: var(--bg-2); }
.yt-half:hover .social__name { color: var(--accent); }

/* ---- footer ------------------------------------------------------------- */
.foot { border-top: 1px solid var(--line-soft); margin-top: 40px; }
.foot__row { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; padding-block: 26px; font-family: var(--font-mono); font-size: .8rem; color: var(--ink-faint); }
.foot__row a:hover { color: var(--accent); }

/* ---- utility ------------------------------------------------------------ */
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.count { font-family: var(--font-mono); font-size: .8rem; color: var(--ink-faint); }
.divider { height: 1px; background: var(--line-soft); border: 0; margin: 0; }
.tabular { font-variant-numeric: tabular-nums; }

/* ---- animation ---------------------------------------------------------- */
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(255,82,82,.55)} 70%{box-shadow:0 0 0 7px rgba(255,82,82,0)} 100%{box-shadow:0 0 0 0 rgba(255,82,82,0)} }
@keyframes rise  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .4s ease both; }

/* ---- a11y / motion ------------------------------------------------------ */
:focus-visible { outline: 2px solid var(--accent-lit); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 640px) {
  .nav__links a { padding: 7px 9px; font-size: .78rem; }
  .slot-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
}
