/* ============================================================
   IRINITY STONES — docs site design system
   Zero-dependency. Dark cosmic ground, six gem accents.
   Shape rule: panels 14px, code 10px, interactive chips pills.
   ============================================================ */

:root {
  /* Bridge irinity.com: void, surface, signal, fire, verified, steel */
  --ground: #04060b;
  --ground-2: #090d14;
  --panel: #0b1018;
  --panel-2: #101620;
  --hairline: rgba(174, 183, 196, 0.14);
  --hairline-strong: rgba(174, 183, 196, 0.28);
  --ink: #eef2f8;
  --ink-2: #aeb7c4;
  --ink-3: #6e7a8f;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, Helvetica, Arial, sans-serif;

  /* mineral gem tones (not candy) — aligned to main-site signal/fire/verified */
  --time: #4fa583;      /* verified green */
  --mind: #c49a58;      /* fire brass */
  --space: #7f9bc4;     /* signal steel-blue */
  --power: #9b8ec4;     /* muted amethyst steel */
  --soul: #b8896a;      /* copper */
  --reality: #aeb7c4;   /* steel */

  /* per-page stone accent, default = space / signal */
  --stone: var(--space);
  --stone-soft: rgba(127, 155, 196, 0.12);
  --stone-line: rgba(127, 155, 196, 0.42);

  --radius-panel: 12px;
  --radius-code: 8px;
  --measure: 72ch;
}

[data-stone="sentinel"]  { --stone: var(--time);   --stone-soft: rgba(79, 165, 131, 0.12); --stone-line: rgba(79, 165, 131, 0.42); }
[data-stone="council"]   { --stone: var(--mind);   --stone-soft: rgba(196, 154, 88, 0.12);  --stone-line: rgba(196, 154, 88, 0.42); }
[data-stone="gateway"]   { --stone: var(--space);  --stone-soft: rgba(127, 155, 196, 0.12); --stone-line: rgba(127, 155, 196, 0.42); }
[data-stone="worker"]    { --stone: var(--power);  --stone-soft: rgba(155, 142, 196, 0.12); --stone-line: rgba(155, 142, 196, 0.42); }
[data-stone="librarian"] { --stone: var(--soul);   --stone-soft: rgba(184, 137, 106, 0.12); --stone-line: rgba(184, 137, 106, 0.42); }
[data-stone="reality"]   { --stone: var(--reality); --stone-soft: rgba(174, 183, 196, 0.10); --stone-line: rgba(174, 183, 196, 0.36); }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}

#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page { position: relative; z-index: 1; }

::selection { background: var(--stone-line); color: var(--ground); }

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 44px);
}

section { padding: clamp(48px, 8vh, 88px) 0; }
section + section { border-top: 1px solid var(--hairline); }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(5, 7, 13, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 44px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 13px;
  white-space: nowrap;
}

.brand small {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--ink-3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 11px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover { color: var(--ink); background: rgba(151, 166, 196, 0.1); }
.nav-links a[aria-current="page"] { color: var(--ground); background: var(--stone); font-weight: 600; }

.nav-links a:focus-visible, .brand:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--stone);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- gem sigils (hex crystal + instrument glyph) ---------- */

.sigil-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

svg.gem {
  display: block;
  flex: none;
  width: 1em;
  height: 1em;
  overflow: visible;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.gem-time    { color: var(--time); }
.gem-mind    { color: var(--mind); }
.gem-space   { color: var(--space); }
.gem-power   { color: var(--power); }
.gem-soul    { color: var(--soul); }
.gem-reality { color: var(--reality); }
.gem-dim     { color: #6e7a8f; }

/* ---------- hero (landing) ---------- */

.hero {
  min-height: min(88vh, 780px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding-top: clamp(36px, 7vh, 72px);
}

.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 18px;
}

.hero h1 {
  font-size: clamp(38px, 6.2vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
  font-weight: 800;
}

.hero h1 .verb { color: var(--stone); }

.lede {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--ink-2);
  max-width: 52ch;
  margin: 0 0 30px;
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--stone); color: var(--ground); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border-color: var(--hairline-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--stone-line); background: var(--stone-soft); }

/* reference pages: single-column compact hero */
.hero.plain { grid-template-columns: 1fr; min-height: 0; padding-bottom: 24px; }

/* gauntlet visual: arc of five gems + one empty slot */
.gauntlet {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px clamp(14px, 2.4vw, 26px);
  justify-items: center;
  align-content: center;
}

.gauntlet a.gslot, .gauntlet .gslot {
  position: relative;
  width: clamp(76px, 8.6vw, 124px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(174, 183, 196, 0.28);
  background:
    radial-gradient(circle at 50% 36%, rgba(127, 155, 196, 0.10), transparent 55%),
    radial-gradient(circle at 50% 42%, var(--panel-2), var(--panel) 74%);
  box-shadow:
    inset 0 1px 0 rgba(238, 242, 248, 0.06),
    0 0 0 1px rgba(4, 6, 11, 0.6),
    0 10px 28px rgba(0, 0, 0, 0.35);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s, box-shadow 0.25s;
}
.gauntlet a.gslot:hover {
  transform: translateY(-4px);
  border-color: var(--stone-line);
  box-shadow:
    inset 0 1px 0 rgba(238, 242, 248, 0.08),
    0 0 0 1px rgba(4, 6, 11, 0.5),
    0 14px 36px rgba(0, 0, 0, 0.4),
    0 0 24px var(--stone-soft);
}
.gauntlet .gslot .gem { width: 58%; height: 58%; }

.gslot .glabel {
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}
.gauntlet a.gslot:hover .glabel { color: var(--ink); }

.gslot.reserved {
  border-style: dashed;
  border-color: rgba(174, 183, 196, 0.32);
  background: radial-gradient(circle at 50% 42%, rgba(174, 183, 196, 0.04), transparent 70%);
  box-shadow: none;
}
.gslot.reserved .gem { opacity: 0.85; filter: none; }

.gauntlet-note {
  grid-column: 1 / -1;
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  text-align: center;
}

/* ---------- stone page hero ---------- */

.stone-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: center;
  padding: clamp(40px, 7vh, 72px) 0 clamp(28px, 5vh, 48px);
}

.stone-hero .gem-big {
  width: clamp(100px, 14vw, 172px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--stone-line);
  background:
    radial-gradient(circle at 50% 34%, var(--stone-soft), transparent 58%),
    radial-gradient(circle at 50% 42%, var(--panel-2), var(--panel) 76%);
  box-shadow:
    inset 0 1px 0 rgba(238, 242, 248, 0.06),
    0 0 40px var(--stone-soft),
    0 16px 40px rgba(0, 0, 0, 0.35);
}
.stone-hero .gem-big .gem { width: 60%; height: 60%; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }

.stone-hero h1 {
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.025em;
  line-height: 1.04;
  margin: 0 0 10px;
  font-weight: 800;
}
.stone-hero .stone-alias {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 14px;
}
.stone-hero .creed {
  font-size: clamp(16px, 1.7vw, 20px);
  color: var(--ink-2);
  margin: 0 0 22px;
  max-width: 56ch;
}
.stone-hero .creed strong { color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 12px;
  background: var(--panel);
}
.chip b { color: var(--stone); font-weight: 600; }

/* ---------- headings & prose ---------- */

h2.sec {
  font-size: clamp(24px, 3.2vw, 34px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 14px;
  font-weight: 750;
}
h3 { font-size: 18px; margin: 34px 0 10px; letter-spacing: -0.01em; }
h4 { font-size: 15px; margin: 24px 0 8px; color: var(--ink); }

.sec-intro { color: var(--ink-2); max-width: var(--measure); margin: 0 0 28px; }

p { max-width: var(--measure); }
.prose p { margin: 0 0 14px; color: var(--ink-2); }
.prose strong, .prose b { color: var(--ink); }
.prose a { color: var(--stone); }

ul.tight { margin: 8px 0 16px; padding-left: 20px; color: var(--ink-2); max-width: var(--measure); }
ul.tight li { margin-bottom: 6px; }
ul.tight li::marker { color: var(--stone); }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--panel-2);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 1px 6px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---------- command rows ---------- */

.cmd {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-code);
  background: var(--panel);
  margin-bottom: 10px;
}

.cmd .cmd-body { flex: 1; min-width: 0; }
.cmd pre {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cmd pre .c { color: var(--ink-3); }
.cmd .cmd-why { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.cmd .cmd-why .tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin-right: 8px;
}

.copy {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  background: var(--panel-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.copy:hover { color: var(--stone); border-color: var(--stone-line); }
.copy.done { color: var(--time); border-color: rgba(74, 222, 128, 0.5); }

/* ---------- definition tables (env vars, endpoints, flags) ---------- */

.kv {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  overflow: hidden;
  margin: 0 0 28px;
  background: var(--panel);
}

.kv-row {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  gap: 16px;
  padding: 13px 18px;
}
.kv-row + .kv-row { border-top: 1px solid var(--hairline); }
.kv-row.head {
  background: var(--panel-2);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 9px 18px;
}
.kv-key {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--stone);
  overflow-wrap: anywhere;
  align-self: start;
}
.kv-key .def { display: block; color: var(--ink-3); font-size: 11px; margin-top: 3px; }
.kv-val { font-size: 13.5px; color: var(--ink-2); align-self: start; }
.kv-val code { font-size: 12px; }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}

.card {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--panel);
  padding: 22px;
  position: relative;
  transition: border-color 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
a.card { text-decoration: none; color: inherit; display: block; }
a.card:hover { border-color: var(--stone-line); transform: translateY(-3px); }

.card .card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card .card-top .gem { width: 30px; height: 30px; }
.card h3 { margin: 0; font-size: 17px; }
.card .card-stone {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.card p { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.card p:last-child { margin-bottom: 0; }
.card .card-verb {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--stone);
  letter-spacing: 0.06em;
}

.card.ghost {
  border-style: dashed;
  background: transparent;
}

/* per-card stone tint */
.card[data-gem="time"]    { --stone: var(--time);   --stone-line: rgba(79,165,131,0.42); }
.card[data-gem="mind"]    { --stone: var(--mind);   --stone-line: rgba(196,154,88,0.42); }
.card[data-gem="space"]   { --stone: var(--space);  --stone-line: rgba(127,155,196,0.42); }
.card[data-gem="power"]   { --stone: var(--power);  --stone-line: rgba(155,142,196,0.42); }
.card[data-gem="soul"]    { --stone: var(--soul);   --stone-line: rgba(184,137,106,0.42); }
.card[data-gem="reality"] { --stone: var(--reality); --stone-line: rgba(174,183,196,0.36); }

/* ---------- signal chain ---------- */

.chain {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 8px 2px 16px;
  scrollbar-width: thin;
}
.chain .node {
  flex: none;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--panel);
  padding: 14px 18px;
  min-width: 150px;
}
.chain .node b { display: block; font-size: 14px; letter-spacing: 0.02em; }
.chain .node span { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); letter-spacing: 0.08em; }
.chain .node.hl { border-color: var(--stone-line); background: var(--stone-soft); color: var(--ink); }
.chain .link {
  flex: none;
  align-self: center;
  width: 44px;
  height: 1px;
  background: var(--hairline-strong);
  position: relative;
}
.chain .link::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3.5px;
  border: 4px solid transparent;
  border-left-color: var(--hairline-strong);
}
.chain .link.dashed { background: repeating-linear-gradient(90deg, var(--hairline-strong) 0 5px, transparent 5px 10px); }
.chain .link.dashed::after { border-left-color: var(--ink-3); }

/* ---------- callouts & fine print ---------- */

.note, .warn, .fineprint {
  border-radius: var(--radius-panel);
  padding: 16px 20px;
  margin: 22px 0;
  font-size: 14px;
  max-width: var(--measure);
}
.note { border: 1px solid var(--stone-line); background: var(--stone-soft); color: var(--ink); }
.warn { border: 1px solid rgba(250, 204, 21, 0.4); background: rgba(250, 204, 21, 0.08); color: var(--ink); }
.fineprint {
  border: 1px dashed var(--hairline-strong);
  background: transparent;
  color: var(--ink-2);
}
.fineprint h3, .note h3, .warn h3 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stone);
}
.warn h3 { color: var(--mind); }
.fineprint ul, .note ul, .warn ul { margin: 8px 0 0; padding-left: 18px; }
.fineprint li, .note li, .warn li { margin-bottom: 6px; }

/* ---------- media ---------- */

figure.shot {
  margin: 26px 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  overflow: hidden;
  background: var(--panel);
}
figure.shot img, figure.shot video { display: block; width: 100%; height: auto; }
figure.shot figcaption {
  padding: 10px 16px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  border-top: 1px solid var(--hairline);
}

/* ---------- prev / next pager ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 40px;
}
.pager a {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  padding: 16px 20px;
  text-decoration: none;
  color: var(--ink-2);
  background: var(--panel);
  transition: border-color 0.2s;
  font-size: 13px;
}
.pager a:hover { border-color: var(--stone-line); color: var(--ink); }
.pager a b { display: block; color: var(--ink); font-size: 15px; margin-top: 4px; }
.pager a.next { text-align: right; }

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 56px;
  color: var(--ink-3);
  font-size: 13px;
}
footer .foot-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 40px;
  justify-content: space-between;
  align-items: flex-start;
}
footer a { color: var(--ink-2); }
footer .foot-line { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; margin-top: 20px; }
footer .foot-line .rc { color: var(--reality); }

/* ---------- reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
  .reveal.in { opacity: 1; transform: none; }
}

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

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 44px; }
  .gauntlet { max-width: 420px; margin: 8px auto 30px; }
  .stone-hero { grid-template-columns: 1fr; text-align: left; }
  .kv-row { grid-template-columns: 1fr; gap: 4px; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { text-align: left; }
}
