/* RegScale Brand Guidelines — global styles */

:root {
  /* ── 2025 Brand Guide canonical names ───────────────────────────── */
  --rs-compliance-blue: #2E3091;
  --rs-slate-blue:      #263574;
  --rs-mid-blue:        #0070BD;
  --rs-light-blue:      #29ABE3;
  --rs-protected-purple:#9E005D;
  --rs-secure-teal:     #0DC7BF;
  --rs-slate-grey:      #2B3045;
  --rs-cyber-orange:    #F25924;
  --rs-risk-yellow:     #F2B500;
  --rs-cloud-blue:      #F7FAFD;
  --rs-white:           #FFFFFF;

  /* Legacy aliases — kept for backward-compat with existing components */
  --rs-indigo: var(--rs-compliance-blue);
  --rs-navy:   var(--rs-slate-blue);
  --rs-royal:  var(--rs-mid-blue);
  --rs-sky:    var(--rs-light-blue);
  --rs-teal:   var(--rs-secure-teal);
  --rs-slate:  var(--rs-slate-grey);
  --rs-orange: var(--rs-cyber-orange);
  --rs-magenta:var(--rs-protected-purple);
  --rs-amber:  #FBCB32;
  --rs-sunrise:#F79421;
  --rs-cyan-legacy: #00DBEE;
  --rs-cyan: var(--rs-cyan-legacy); /* kept for legacy components only */
  --rs-ink:   #0C2125;
  --rs-paper: #FFFFFF;
  --rs-fog:   #D9D9D9;

  --rs-bg: var(--rs-cloud-blue);
  --rs-bg-elev: #FFFFFF;
  --rs-border: #E6E8EF;
  --rs-text: #0C2125;
  --rs-text-muted: #5B6470;

  /* ── Canonical gradients (2025 Brand Guide) ─────────────────────── */
  --rs-grad-primary-1: linear-gradient(180deg, #0070BD 0%, #2E3091 100%);
  --rs-grad-primary-2: linear-gradient(180deg, #2E3091 0%, #F25924 100%);
  --rs-grad-primary-3: linear-gradient(180deg, #F25924 0%, #9E005D 100%);
  --rs-grad-secondary-1: linear-gradient(180deg, #0DC7BF 0%, #2E3091 100%);
  --rs-grad-secondary-2: linear-gradient(180deg, #0DC7BF 0%, #29ABE3 100%);

  /* Hero alias points to canonical primary-1 (Mid Blue → Compliance Blue) */
  --rs-grad-hero: var(--rs-grad-primary-1);
  --rs-grad-hero-teal: var(--rs-grad-secondary-1);
  --rs-grad-hero-deep: linear-gradient(180deg, #263574 24%, #2E3091 52%, #0070BD 100%);
  --rs-grad-email: var(--rs-grad-primary-1);

  /* CTA = SOLID Cyber Orange per 2025 Brand Guide. Gradient kept as decorative-only. */
  --rs-cta-fill: var(--rs-cyber-orange);
  --rs-grad-cta-decorative: linear-gradient(180deg, #F79421 0%, #F15B27 48%, #9E005D 100%);

  /* Extended (legacy) overlay — uses legacy cyan, kept for existing photography compositions */
  --rs-grad-overlay: linear-gradient(180deg, #00DBEE 2%, rgba(30,120,167,0) 64%, #263574 100%);
  --rs-grad-amber: linear-gradient(180deg, #FBCB32 0%, #F79421 69%);

  --ease-standard: cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-entrance: cubic-bezier(0.0, 0.0, 0.2, 1);
  --ease-exit: cubic-bezier(0.4, 0.0, 1, 1);
  --ease-emphasis: cubic-bezier(0.2, 0.9, 0.1, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--rs-bg);
  color: var(--rs-text);
  font-family: "Montserrat", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--rs-indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ───── Layout ───── */
.app {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0C2125;
  color: #fff;
  padding: 32px 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar .brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar .brand-mark {
  width: 32px; height: 32px;
  background: var(--rs-grad-hero);
  border-radius: 8px;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.sidebar .brand-mark::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent 60%);
}
.sidebar .brand-name { font-weight: 800; letter-spacing: 0.02em; font-size: 13px; }
.sidebar .brand-sub { font-size: 10px; opacity: 0.5; text-transform: uppercase; letter-spacing: 0.18em; }

.nav-group { margin-bottom: 24px; }
.nav-group h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.18em;
  opacity: 0.45; margin: 0 0 8px; font-weight: 700;
}
.nav-link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms var(--ease-standard), color 160ms var(--ease-standard);
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-link.active {
  background: linear-gradient(90deg, rgba(0,219,238,0.15), rgba(46,48,145,0.15));
  color: #fff;
  box-shadow: inset 2px 0 0 var(--rs-cyan);
}
.nav-link .badge {
  font-size: 9px; padding: 2px 6px; border-radius: 4px;
  background: rgba(0,219,238,0.18); color: var(--rs-cyan);
  font-weight: 700; letter-spacing: 0.05em;
}

/* ───── Content ───── */
.content {
  padding: 56px 80px 120px;
  max-width: 1280px;
}

.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.2em;
  font-weight: 700; color: var(--rs-indigo);
  margin-bottom: 12px;
}
.page-title {
  font-size: 56px; line-height: 1.05; font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  background: linear-gradient(120deg, var(--rs-ink) 30%, var(--rs-indigo) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-lede {
  font-size: 19px; line-height: 1.55; color: var(--rs-text-muted);
  max-width: 720px;
  margin: 0 0 24px;
}

.provenance {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  margin-bottom: 12px;
  border: 1px solid;
  max-width: 720px;
}
.prov-tag {
  font-weight: 700; letter-spacing: 0.04em; flex-shrink: 0;
  font-family: var(--rs-mono);
  font-size: 11.5px;
}
.prov-desc { color: var(--rs-text-muted); line-height: 1.45; }
.prov-verified    { background: rgba(16,143,110,0.06);  border-color: rgba(16,143,110,0.25); }
.prov-verified    .prov-tag { color: #0f7a5e; }
.prov-mixed       { background: rgba(0,219,238,0.06);   border-color: rgba(0,134,166,0.25); }
.prov-mixed       .prov-tag { color: #0086a6; }
.prov-recommended { background: rgba(241,148,33,0.06);  border-color: rgba(165,90,20,0.25); }
.prov-recommended .prov-tag { color: #A55A14; }

h2.section-title {
  font-size: 28px; font-weight: 700; letter-spacing: -0.005em;
  margin: 64px 0 8px;
}
h2.section-title:first-of-type { margin-top: 0; }
.section-sub {
  color: var(--rs-text-muted); font-size: 15px;
  margin: 0 0 24px;
}

.card {
  background: var(--rs-bg-elev);
  border: 1px solid var(--rs-border);
  border-radius: 16px;
  padding: 24px;
  transition: border-color 240ms var(--ease-standard), box-shadow 240ms var(--ease-standard), transform 240ms var(--ease-standard);
}
.card.interactive:hover {
  border-color: rgba(46, 48, 145, 0.3);
  box-shadow: 0 12px 32px rgba(46, 48, 145, 0.1);
  transform: translateY(-2px);
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Code blocks */
.code-block {
  background: var(--rs-ink);
  color: #E5F4F7;
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 12.5px;
  line-height: 1.65;
  overflow-x: auto;
  position: relative;
}
.code-block .tok-key { color: #00DBEE; }
.code-block .tok-val { color: #FBCB32; }
.code-block .tok-com { color: #5B6470; font-style: italic; }
.code-block .copy-btn {
  position: absolute; top: 12px; right: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #E5F4F7; font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 160ms var(--ease-standard);
}
.code-block .copy-btn:hover { background: rgba(0,219,238,0.18); color: var(--rs-cyan); }
.code-block .copy-btn.copied { background: rgba(0,219,238,0.25); color: var(--rs-cyan); }

/* Kbd */
kbd {
  display: inline-block;
  background: var(--rs-bg);
  border: 1px solid var(--rs-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
}

/* Tag */
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag.do { background: rgba(51, 190, 185, 0.14); color: #1E7E78; }
.tag.dont { background: rgba(241, 91, 39, 0.12); color: #B8431A; }
.tag.tip { background: rgba(46, 48, 145, 0.10); color: var(--rs-indigo); }

/* Asset chip */
.dl-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--rs-bg);
  border: 1px solid var(--rs-border);
  color: var(--rs-text);
  cursor: pointer;
  font-family: inherit;
  transition: all 200ms var(--ease-standard);
}
.dl-btn:hover {
  background: var(--rs-indigo);
  color: #fff;
  border-color: var(--rs-indigo);
  transform: translateY(-1px);
}
.dl-btn .ico { width: 12px; height: 12px; }

/* Skip-link & a11y */
:focus-visible { outline: 2px solid var(--rs-cyan); outline-offset: 2px; border-radius: 4px; }

/* Page transition */
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-anim { opacity: 1; animation: pageIn 360ms var(--ease-entrance) forwards; }

/* Pretty wrap on prose */
p, li { text-wrap: pretty; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(46,48,145,0.18); border-radius: 999px; border: 2px solid var(--rs-bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(46,48,145,0.32); }

/* Sidebar scrollbar (dark) */
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-color: #0C2125; }
