/* ===========================================================================
   BASED OPS — design tokens.

   These are not invented. Every value below was read off basedstudio.co so
   this sits next to STUDIO as the same product: same ground, same card, same
   tan, same vivid data colours, same face.

     ground   #0C0C0E
     card     rgba(23,24,27,.5)   radius 16   border rgba(74,74,82,.5)
     input    #17181B             radius 8    border #65656F
     nav      rgba(12,12,14,.6)   65px        border-bottom #222225
     text     #FFFFFF   ·  labels #C6AE7B  ·  nav active #CDA53A
     face     Plus Jakarta Sans, 16px base
   =========================================================================== */

:root {
  /* grounds */
  --ground:     #0B0C0E;
  --card:       #141619;
  --card-solid: #181A1E;
  --raised:     #202329;
  --line:       rgba(132, 139, 150, 0.24);
  --line-hard:  rgba(132, 139, 150, 0.16);
  --line-input: rgba(163, 169, 181, 0.44);

  /* ink */
  --ink:      #FFFFFF;
  --tan:      #CDBB91;   /* warm secondary text, kept restrained */
  --tan-dim:  rgba(205, 187, 145, 0.56);
  --grey:     #9398A2;

  /* brand accent */
  --gold:      #D2AD49;
  --gold-soft: #E8CD84;
  --gold-wash: rgba(210, 173, 73, 0.10);
  --gold-edge: rgba(210, 173, 73, 0.34);

  /* the STUDIO data palette — one saturated colour per meaning */
  --blue:    #4979FA;
  --blue-lt: #8FABFF;
  --green:   #21C17B;
  --yellow:  #F0CD33;
  --pink:    #FD77F6;
  --coral:   #FF5F7E;

  /* semantic aliases, so a status never picks a colour by hand */
  --st-new:   var(--yellow);
  --st-work:  var(--blue-lt);
  --st-good:  var(--green);
  --st-dead:  var(--grey);
  --st-hot:   var(--coral);

  --st-new-w:  rgba(240, 205, 51, 0.13);
  --st-work-w: rgba(143, 171, 255, 0.13);
  --st-good-w: rgba(33, 193, 123, 0.13);
  --st-dead-w: rgba(138, 138, 147, 0.13);
  --st-hot-w:  rgba(255, 95, 126, 0.13);

  /* type */
  --f-ui: "Plus Jakarta Sans", Inter, -apple-system, "Helvetica Neue", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* metrics */
  --nav-h:   68px;
  --r:       7px;    /* inputs, buttons, chips */
  --r-card:  12px;   /* every panel and card */
  --r-pill:  999px;

  color-scheme: dark;
}

/* ---------------------------------------------------------------------------
   BASE
   --------------------------------------------------------------------------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -20%, rgba(210, 173, 73, .055), transparent 34rem),
    var(--ground);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold-edge); color: #fff; }

* { scrollbar-width: thin; scrollbar-color: #33343a transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #33343a; border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------------------
   TYPE ROLES
   --------------------------------------------------------------------------- */

/* The STUDIO label: 11px, uppercase, faint tracking, tan. Used everywhere. */
.label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  color: var(--tan);
}

/* The section eyebrow above a card grid — "CREATORS 18" */
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tan);
}

.mono { font-family: var(--f-mono); font-size: 13px; font-variant-numeric: tabular-nums; }
/* Digits that line up in a column, in the UI face rather than a mono one —
   STUDIO never drops into monospace. */
.tnum { font-variant-numeric: tabular-nums; font-weight: 500; }
.hnd  { font-weight: 500; color: var(--tan); }
.tmpl { font-weight: 700; letter-spacing: 0.02em; }
.num  { font-variant-numeric: tabular-nums; }

.dim   { color: var(--tan); }
.faint { color: var(--tan-dim); }
.grey  { color: var(--grey); }

/* A big figure. STUDIO sets these at 24-28px / 800 and colours them. */
.figure {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   MARKS — chevrons, never arrows.
   --------------------------------------------------------------------------- */
.chev {
  display: inline-block;
  width: 0.4em; height: 0.4em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  vertical-align: middle;
  flex: none;
}
.chev.down { transform: rotate(45deg)   translate(-0.1em, -0.1em); }
.chev.up   { transform: rotate(-135deg) translate(-0.1em, -0.1em); }
.chev.left { transform: rotate(135deg); }

/* ---------------------------------------------------------------------------
   SHELL — top nav, like STUDIO. No left rail.
   --------------------------------------------------------------------------- */
.app { display: flex; flex-direction: column; height: 100%; }

.nav {
  height: var(--nav-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  background: rgba(11, 12, 14, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line-hard);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-logo { display: flex; align-items: center; flex: none; }
.nav-logo img { height: 38px; width: auto; display: block; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 auto;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  background: none;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(225, 222, 214, 0.64);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  outline: none;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}
.nav-item:hover { color: var(--ink); background: rgba(255, 255, 255, 0.055); }
.nav-item[aria-current="page"] {
  color: #15120b;
  background: var(--gold);
  border-color: rgba(255, 236, 174, 0.34);
  box-shadow: 0 1px 7px rgba(213, 177, 75, 0.16);
}
.nav-item:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }

.nav-item .count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.09);
  color: var(--tan);
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.nav-item .count:empty { display: none; }
.nav-item[aria-current="page"] .count { background: rgba(21, 18, 11, 0.2); color: #15120b; }
.nav-item .count.hot { background: var(--coral); color: #1a0308; }

.nav-right { display: flex; align-items: center; gap: 10px; flex: none; }

/* ---------------------------------------------------------------------------
   PAGE
   --------------------------------------------------------------------------- */
.view {
  flex: 1;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  min-height: 0;
  overflow: auto;
  padding: 34px clamp(18px, 3vw, 42px) 72px;
}

.view-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.view-head h1 {
  font-size: clamp(28px, 2.3vw, 36px);
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.04em;
}
/* STUDIO puts the second word of the title in gold. */
.view-head h1 em { font-style: normal; color: var(--gold); }
.view-head .sub {
  color: var(--grey);
  font-size: 13px;
  margin-top: 8px;
  max-width: 70ch;
}

/* ---------------------------------------------------------------------------
   CARDS — the STUDIO panel: 16px radius, half-opacity fill, hairline border.
   --------------------------------------------------------------------------- */
.panel, .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  min-width: 0;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .13);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-hard);
}
.panel-head h2 {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 16px; }
.panel-body.flush { padding: 0; }

/* ---------------------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  background: #1B1E22;
  border: 1px solid var(--line);
  border-radius: var(--r);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
.btn:hover { background: #23272D; border-color: rgba(255, 255, 255, 0.2); }
.btn:active { transform: translateY(0.5px); }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn[disabled]:hover { background: rgba(255, 255, 255, 0.05); border-color: var(--line); }

.btn.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #15120A;
  font-weight: 700;
}
.btn.primary:hover { background: #E0BC59; border-color: #E0BC59; }

.btn.ghost { background: none; border-color: transparent; color: var(--tan); }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.06); border-color: transparent; color: var(--ink); }

.btn.sm { height: 30px; padding: 0 11px; font-size: 11px; }
.btn.icon { padding: 0; width: 36px; }
.btn.sm.icon { width: 30px; }

/* ---------------------------------------------------------------------------
   FIELDS
   --------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.input, .select, .textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  background: #101215;
  border: 1px solid var(--line-input);
  border-radius: var(--r);
  color: var(--ink);
  font-size: 13px;
}
.input::placeholder, .textarea::placeholder { color: var(--tan-dim); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
}
.textarea { resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: 30px; cursor: pointer; }
.select-wrap { position: relative; display: block; }
.select-wrap .chev {
  position: absolute; right: 12px; top: 15px;
  color: var(--tan); pointer-events: none;
}

/* ---------------------------------------------------------------------------
   CHIPS / TAGS — STUDIO's are pill-ish, quiet, on a tinted ground.
   --------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.05);
  color: var(--tan);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.chip.plain::before { display: none; }

.chip.s-new  { color: var(--st-new);  background: var(--st-new-w);  border-color: color-mix(in srgb, var(--st-new) 30%, transparent); }
.chip.s-work { color: var(--st-work); background: var(--st-work-w); border-color: color-mix(in srgb, var(--st-work) 30%, transparent); }
.chip.s-good { color: var(--st-good); background: var(--st-good-w); border-color: color-mix(in srgb, var(--st-good) 30%, transparent); }
.chip.s-dead { color: var(--st-dead); background: var(--st-dead-w); border-color: color-mix(in srgb, var(--st-dead) 30%, transparent); }
.chip.s-hot  { color: var(--st-hot);  background: var(--st-hot-w);  border-color: color-mix(in srgb, var(--st-hot) 30%, transparent); }

/* ---------------------------------------------------------------------------
   TABLES — kept for Numbers, but dressed as a STUDIO card.
   --------------------------------------------------------------------------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  position: sticky; top: 0; z-index: 2;
  text-align: left;
  padding: 12px 16px;
  background: #111316;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  white-space: nowrap;
}
.tbl td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(74, 74, 82, 0.22);
  vertical-align: middle;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background 100ms ease; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.tbl .r { text-align: right; }
.tbl-wrap { overflow: auto; border-radius: var(--r-card); }

/* ---------------------------------------------------------------------------
   EMPTY STATE
   --------------------------------------------------------------------------- */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--tan);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty .k { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tan); }
.empty .t { color: var(--grey); font-size: 13.5px; max-width: 44ch; }

/* ---------------------------------------------------------------------------
   MOTION
   --------------------------------------------------------------------------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.rise { animation: riseIn 180ms ease-out both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
