/* =========================================================================
   SarjanaHerald — shared theme
   Palette, starfield and top bar are taken from the YOS Space design system
   (00-Profile/Yos-Profile-Website/yos-space): ink base, warm amber accent,
   fixed nebula sky with a canvas starfield, quiet letterspaced top bar.

   The feature sheets (draft/, items/) still speak the older role names
   (--paper, --ink, --card, ...). Those are kept at the bottom as aliases of
   the canonical tokens so nothing had to be rewritten twice.
   ========================================================================= */

:root {
  /* --- surface & text ------------------------------------------------- */
  --bg: #07070b;
  --bg-deep: #050508;
  --text: #f6f1e9;
  --text-soft: rgba(246, 241, 233, .78);
  --muted: rgba(246, 241, 233, .58);
  --dim: rgba(246, 241, 233, .42);
  --line: rgba(246, 241, 233, .13);
  --line-strong: rgba(246, 241, 233, .28);

  /* --- accents --------------------------------------------------------- */
  --amber: #ffb347;
  --copper: #c26a2e;
  --live: #6ee7a8;

  --surface: rgba(255, 255, 255, .045);
  --surface-2: rgba(255, 255, 255, .075);
  --surface-hover: rgba(255, 179, 71, .055);

  /* --- shape ----------------------------------------------------------- */
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .35);

  --font-display: "Neue Haas Unica", Inter, "Helvetica Neue", Arial, sans-serif;
  --font-body: Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* --- legacy role aliases (used by draft/style.css + items/style.css) -- */
  --paper: var(--bg);
  --paper-2: var(--surface-2);
  --card: var(--surface);
  --ink: var(--text);
  --ink-soft: var(--text-soft);
  --accent: var(--amber);
  --accent-soft: rgba(255, 179, 71, .12);
  --mark: rgba(255, 179, 71, .3);
  --good: var(--live);
  --good-soft: rgba(110, 231, 168, .14);
  --bad: #ff7a6b;
  --bad-soft: rgba(255, 122, 107, .15);
  --font-ui: var(--font-body);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Warm glow behind the content, above the starfield. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(60% 46% at 12% 0%, rgba(255, 179, 71, .13), transparent 72%),
    radial-gradient(50% 38% at 92% 6%, rgba(194, 106, 46, .1), transparent 72%);
}

/* --- starry night background -------------------------------------------
   Copied from YOS Space (assets/css/site.css). The stars themselves are
   drawn by assets/space-stars.js onto a canvas inside this layer; the
   nebula and the vignette live here. No backdrop-filter anywhere above it —
   re-blurring the canvas every frame is what makes scrolling crawl.        */

#space-stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(58% 48% at 68% 38%, rgba(255, 170, 82, .22), transparent 68%),
    radial-gradient(46% 42% at 57% 48%, rgba(45, 104, 214, .22), transparent 72%),
    radial-gradient(85% 70% at 50% 108%, rgba(255, 126, 43, .11), transparent 72%),
    linear-gradient(180deg, #07070b 0%, #08070c 55%, #050508 100%);
}

#space-stars::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 54% 46%, rgba(64, 122, 235, .18), transparent 27%),
    radial-gradient(circle at 54% 46%, rgba(255, 158, 67, .1), transparent 43%);
}

#space-stars::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(3, 3, 7, .7) 100%);
}

#space-stars canvas {
  display: block;
  width: 100%;
  height: 100%;
}

a { color: inherit; }

::selection { background: rgba(255, 179, 71, .28); }

/* ---------- layout ---------- */

.wrap {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- top bar (YOS Space, nav.css) ------------------------------- */

.yos-topbar {
  --nav-fg: #f6f1e9;
  --nav-dim: rgba(246, 241, 233, .5);
  --nav-line: rgba(246, 241, 233, .12);
  --nav-accent: #f6f1e9;

  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 84px;
  padding: 0 clamp(20px, 3.4vw, 44px);
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--nav-fg);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .8);
}

.yos-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--nav-fg);
}

.yos-topbar-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  color: var(--amber);
}

/* The mark is a drawn shield, not the letters “SH”: at 30px two mono glyphs in
   a bordered box read as a placeholder, and they cannot be reused as a
   favicon. The same silhouette ships as favicon.svg. */
.yos-topbar-mark svg {
  display: block;
  width: 27px;
  height: 27px;
  filter: drop-shadow(0 0 9px rgba(255, 179, 71, .3));
}

.yos-topbar-brand span {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .26em;
}

.yos-topbar-sep { display: none; }

.yos-topbar-space {
  font-size: 14px;
  text-decoration: none;
  color: var(--nav-fg);
  opacity: .7;
  transition: opacity .2s ease, color .2s ease;
}

.yos-topbar-space:hover,
.yos-topbar-space:focus-visible { opacity: 1; color: var(--nav-accent); }

.yos-topbar-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: 0;
}

.yos-topbar-nav a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  color: var(--nav-fg);
  text-decoration: none;
  opacity: .58;
  white-space: nowrap;
  transition: opacity .2s ease, color .2s ease;
}

.yos-topbar-nav a .num {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .1em;
  opacity: .75;
}

.yos-topbar-nav a:hover,
.yos-topbar-nav a:focus-visible { opacity: 1; }

.yos-topbar-nav a[aria-current="page"] { opacity: 1; color: var(--nav-accent); }
.yos-topbar-nav a[aria-current="page"] .num { opacity: 1; }

/* ---------- language switcher ------------------------------------------ */

.lang-switch {
  display: inline-flex;
  align-items: center;
  flex: none;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
}

.lang-switch-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  padding: 5px 10px;
  cursor: pointer;
  transition: color .2s ease, background .2s ease;
}

.lang-switch-btn:hover { color: var(--text); }

.lang-switch-btn[aria-pressed="true"] {
  background: rgba(255, 179, 71, .13);
  color: var(--amber);
}

/* ---------- type ---------- */

.eyebrow {
  margin: 0 0 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--amber);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.9rem);
  font-weight: 400;
  letter-spacing: -.03em;
  line-height: .98;
}

mark,
.mark {
  background: linear-gradient(transparent 64%, rgba(255, 179, 71, .26) 64%);
  color: inherit;
}

.lede {
  margin: 24px 0 0;
  max-width: 62ch;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- page header (feature pages) ---------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.page-head .eyebrow { margin-bottom: 14px; }

.page-head .display {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.02;
}

.page-head .lede { margin: 16px 0 0; }

.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- buttons ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill, 999px);
  background: var(--amber);
  color: #0a090f;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.btn:hover { box-shadow: 0 10px 28px rgba(255, 179, 71, .22); }
.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-soft);
}

.btn--ghost:hover {
  border-color: rgba(255, 179, 71, .5);
  color: var(--text);
  box-shadow: none;
}

.btn--accent { background: var(--amber); color: #0a090f; }
.btn--sm { padding: 7px 13px; font-size: 12px; }

.btn[disabled] { opacity: .38; cursor: not-allowed; box-shadow: none; transform: none; }

.btn[hidden],
[hidden] { display: none !important; }

/* ---------- chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  appearance: none;
  padding: 6px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.chip:hover { color: var(--text); border-color: var(--line-strong); }

.chip[aria-pressed="true"] {
  background: rgba(255, 179, 71, .13);
  border-color: rgba(255, 179, 71, .55);
  color: var(--amber);
}

.chips--sm .chip { padding: 4px 10px; font-size: 11.5px; }

/* ---------- card / misc ---------- */

.card {
  background: linear-gradient(160deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.empty {
  padding: 44px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .02);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text);
}

kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .05);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-soft);
}

code {
  font-family: var(--font-mono);
  font-size: .92em;
  color: var(--amber);
}

.foot {
  position: relative;
  z-index: 1;
  margin-top: 56px;
  padding: 22px 0 56px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  line-height: 1.9;
  color: var(--dim);
  text-transform: uppercase;
}

.foot a { color: var(--text-soft); }

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
  .yos-topbar-brand { flex: 0 0 auto; }

  .yos-topbar-nav {
    flex: 1 1 auto;
    min-width: 0;
    gap: 18px;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%);
  }

  .yos-topbar-nav::-webkit-scrollbar { display: none; }
}

@media (max-width: 760px) {
  .yos-topbar {
    /* On a phone the bar scrolls away with the hero — pinning a transparent
       bar over the copy reads worse than losing the links. */
    position: relative;
    min-height: 68px;
    gap: 12px;
    padding: 0 18px;
  }

  .yos-topbar-space { display: none; }

  .yos-topbar-nav { gap: 14px; }
  .yos-topbar-nav a { font-size: 12px; }
  .yos-topbar-nav a .num { display: none; }

  .lang-switch { font-size: 9px; }
  .lang-switch-btn { padding: 4px 8px; }

  .wrap { width: min(1180px, calc(100% - 32px)); }
}

@media (max-width: 420px) {
  .yos-topbar-nav { gap: 10px; }
  .yos-topbar-nav a { font-size: 11px; }
}
