/* ================================================================
   Charts & Parts — Risk OS
   Design System v2 — Institutional / Digital / Copper
   ================================================================ */

:root {
  /* Surfaces */
  --bg:         #14100E;
  --bg-elev:    #1C1613;
  --bg-panel:   #241C18;
  --bg-hi:      #2E231E;
  --bg-deep:    #0C0908;

  /* Rules */
  --rule:       #32261F;
  --rule-bright:#4A392F;
  --rule-copper:rgba(194, 90, 31, 0.28);

  /* Ink */
  --ink:        #F2E9DE;
  --ink-soft:   #CBBDAD;
  --ink-muted:  #8C7B6D;
  --ink-dim:    #5E5046;

  /* Copper — signal */
  --copper:        #C25A1F;
  --copper-bright: #E07A2F;
  --copper-deep:   #8B3A10;
  --amber:         #E89B3C;
  --ember:         #F0A868;

  /* Status */
  --live:       #7BAE6F;
  --warn:       #E89B3C;
  --alert:      #D6553C;

  /* Fonts */
  --serif: "Fraunces", "Instrument Serif", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SF Mono, Menlo, monospace;

  /* Rhythm */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-card: 0 1px 0 rgba(255,255,255,0.02) inset,
                 0 20px 40px -24px rgba(0,0,0,0.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding-top: 96px;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(194,90,31,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(139,58,16,0.05), transparent 60%);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--copper); color: #fff; }

/* ---------------- Type utilities ---------------- */
.serif   { font-family: var(--serif); letter-spacing: -0.015em; }
.mono    { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 500;
}
.eyebrow .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--copper); margin-right: 8px; vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(194,90,31,0.18);
}
.eyebrow.live .dot { background: var(--live); box-shadow: 0 0 0 3px rgba(123,174,111,0.22); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------------- Navigation ---------------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(20,16,14,0.82);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  max-width: 1400px; margin: 0 auto; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif); font-weight: 500; font-size: 18px;
  letter-spacing: -0.01em; color: var(--ink);
}
.brand-mark {
  width: 32px; height: 32px; display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--bg-panel); border: 1px solid var(--rule-bright);
  border-radius: 6px; overflow: hidden;
}
.brand-mark img { width: 22px; height: 22px; object-fit: contain; filter: hue-rotate(15deg) saturate(0.9); }
.brand-meta {
  display: flex; flex-direction: column; line-height: 1;
}
.brand-meta .brand-name { font-family: var(--serif); font-size: 17px; font-weight: 500; }
.brand-meta .brand-sub {
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--copper-bright); margin-top: 3px;
}

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em;
  text-transform: uppercase; font-weight: 500; color: var(--ink-soft);
  padding: 6px 0; position: relative; transition: color .2s ease;
}
.nav-links a:hover { color: var(--copper-bright); }
.nav-links a.active { color: var(--copper-bright); }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--copper); transform: scaleX(0); transform-origin: left;
  transition: transform .25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--mono); font-weight: 500; font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase;
  padding: 12px 22px; border-radius: var(--radius-sm);
  border: 1px solid var(--copper); background: var(--copper); color: #fff;
  cursor: pointer; transition: all 0.2s ease;
}
.btn:hover { background: var(--copper-bright); border-color: var(--copper-bright); transform: translateY(-1px); }
.btn .arrow { display: inline-block; transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-bright); }
.btn.ghost:hover { background: var(--bg-panel); border-color: var(--copper); color: var(--copper-bright); }

.btn.lg { padding: 16px 30px; font-size: 12px; }
.btn.solid-ink { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.solid-ink:hover { background: var(--copper); border-color: var(--copper); color: #fff; }

/* ---------------- Layout primitives ---------------- */
.shell { max-width: 1400px; margin: 0 auto; padding: 0 28px; }
.shell-tight { max-width: 1080px; margin: 0 auto; padding: 0 28px; }
.shell-narrow { max-width: 820px; margin: 0 auto; padding: 0 28px; }

.section { padding: 96px 0; }
.section-tight { padding: 64px 0; }

.rule-hr {
  height: 1px; background: var(--rule); width: 100%; border: none; margin: 0;
}

/* Section header pattern — copper eyebrow + serif title + hairline */
.sec-head { display: grid; gap: 18px; margin-bottom: 48px; }
.sec-head .tag-row {
  display: flex; align-items: center; gap: 14px;
}
.sec-head .tag-row::after {
  content: ""; flex: 1; height: 1px; background: var(--rule);
}
.sec-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(36px, 5vw, 64px); line-height: 1.02;
  letter-spacing: -0.025em; color: var(--ink);
}
.sec-head .sec-sub {
  font-family: var(--sans); font-weight: 300;
  font-size: clamp(16px, 1.3vw, 19px); color: var(--ink-soft);
  max-width: 62ch; line-height: 1.55;
}

/* Panel / card primitive */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  position: relative;
  transition: border-color .25s ease, transform .25s ease;
}
.panel:hover { border-color: var(--rule-bright); }
.panel.copper:hover { border-color: var(--copper); }

/* Data-label row — feels like a terminal header */
.data-row {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-muted);
  padding-bottom: 10px; border-bottom: 1px solid var(--rule);
  margin-bottom: 20px;
}
.data-row .sep { width: 1px; height: 10px; background: var(--rule-bright); }

/* Pill / chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; font-weight: 500;
  padding: 5px 10px; border-radius: var(--radius-sm);
  background: var(--bg-panel); color: var(--ink-soft);
  border: 1px solid var(--rule);
}
.chip.copper { color: var(--copper-bright); border-color: var(--rule-copper); background: rgba(194,90,31,0.06); }
.chip.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 3px rgba(123,174,111,0.22); }
.chip.dev::before  { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }

/* ---------------- Ticker strip ---------------- */
.ticker {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-deep);
  overflow: hidden;
}
.ticker-inner {
  display: flex; gap: 48px; padding: 14px 28px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-muted);
  white-space: nowrap; animation: tick 60s linear infinite;
}
.ticker-inner span { display: inline-flex; align-items: center; gap: 8px; }
.ticker-inner b { font-weight: 600; color: var(--copper-bright); }
.ticker-inner .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--copper); }
@keyframes tick {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------------- Footer ---------------- */
footer.cp-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--rule);
  padding: 64px 0 28px;
}
.footer-grid {
  max-width: 1400px; margin: 0 auto; padding: 0 28px;
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px;
}
.footer-col h4 {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--copper-bright);
  margin-bottom: 18px; font-weight: 600;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-col a {
  font-size: 13px; color: var(--ink-soft); transition: color .2s ease;
}
.footer-col a:hover { color: var(--copper-bright); }
.footer-brand p {
  font-size: 13px; color: var(--ink-muted); margin-top: 14px;
  line-height: 1.6; max-width: 38ch;
}
.footer-brand .brand { margin-bottom: 6px; }

.footer-bottom {
  max-width: 1400px; margin: 64px auto 0; padding: 24px 28px 0;
  border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-muted);
}
.footer-socials { display: flex; gap: 14px; }
.footer-socials a {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--rule); border-radius: var(--radius-sm);
  color: var(--ink-soft); transition: all .2s ease;
}
.footer-socials a:hover { border-color: var(--copper); color: var(--copper-bright); }
.footer-socials svg { width: 14px; height: 14px; fill: currentColor; }

/* ---------------- Breadcrumb ---------------- */
.breadcrumb {
  max-width: 1400px; margin: 0 auto; padding: 20px 28px 0;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-dim);
}
.breadcrumb a { color: var(--ink-muted); transition: color .2s ease; }
.breadcrumb a:hover { color: var(--copper-bright); }
.breadcrumb .sep { margin: 0 10px; color: var(--ink-dim); }
.breadcrumb .current { color: var(--ink-soft); }

/* ---------------- Motion ---------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { opacity: 0; animation: rise .8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards; }
.d-1 { animation-delay: .05s; }
.d-2 { animation-delay: .16s; }
.d-3 { animation-delay: .28s; }
.d-4 { animation-delay: .42s; }
.d-5 { animation-delay: .56s; }
.d-6 { animation-delay: .70s; }

/* ---------------- Responsive ---------------- */
@media (max-width: 960px) {
  body { padding-top: 80px; }
  .nav-inner { padding: 12px 18px; gap: 16px; }
  .nav-links { display: none; }
  .section { padding: 64px 0; }
  .section-tight { padding: 44px 0; }
  .shell, .shell-tight, .shell-narrow { padding: 0 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .sec-head h2 { font-size: clamp(28px, 8vw, 44px); }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand-meta .brand-name { font-size: 15px; }
}
