/* SIUC-AI Implementation Review — scoped styles */

:root {
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-head: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
}

/* ── Shell & layout ─────────────────────────────────────────── */
.siucai-body {
  color-scheme: dark;
  font-family: var(--font-body);
  background: #070a12; /* base background */
}

/* Animated liquid background */
.siucai-body::before,
.siucai-body::after {
  content: '';
  position: fixed;
  width: 200vw;
  height: 200vh;
  top: -50vh;
  left: -50vw;
  z-index: -2;
  background: radial-gradient(circle at center, rgba(124, 92, 255, 0.18) 0%, transparent 40%);
  animation: liquid-bg 25s ease-in-out infinite alternate;
  pointer-events: none;
}
.siucai-body::after {
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.12) 0%, transparent 35%);
  animation: liquid-bg-alt 30s ease-in-out infinite alternate-reverse;
}

@keyframes liquid-bg {
  0% { transform: translate(-10%, -10%) scale(1); }
  100% { transform: translate(10%, 15%) scale(1.2); }
}
@keyframes liquid-bg-alt {
  0% { transform: translate(15%, 5%) scale(1.1); }
  100% { transform: translate(-15%, -5%) scale(0.9); }
}

.cp-shell {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

/* ── Nav ────────────────────────────────────────────────────── */
.cp-nav {
  position: sticky;
  top: 16px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 48px;
  padding: 12px 18px;
  background: rgba(10, 14, 24, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.cp-nav__brand {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}

.cp-nav__dash {
  color: var(--accent2);
}

.cp-nav__links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cp-nav__links a {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.cp-nav__links a:hover,
.cp-nav__links a.is-active {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ── Hero ───────────────────────────────────────────────────── */
.cp-hero {
  margin-bottom: 48px;
}

.cp-hero__tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 16px;
}

.cp-hero__title {
  font-family: var(--font-head);
  margin: 0 0 16px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--fg);
}

.cp-hero__sub {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  max-width: 580px;
}

/* ── Source document downloads ──────────────────────────────── */
.cp-docs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.cp-docs__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.3);
  margin-right: 4px;
  flex-shrink: 0;
}

.cp-doc {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(124, 92, 255, 0.08);
  border: 1px solid rgba(124, 92, 255, 0.22);
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.cp-doc:hover {
  background: rgba(124, 92, 255, 0.15);
  border-color: rgba(124, 92, 255, 0.4);
  transform: translateY(-1px);
}

.cp-doc__icon {
  font-size: 0.85rem;
  color: var(--accent);
  flex-shrink: 0;
}

.cp-doc__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cp-doc__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1;
}

.cp-doc__meta {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.02em;
}

/* ── Stat bar ───────────────────────────────────────────────── */
.cp-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 64px;
}

@media (max-width: 560px) {
  .cp-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cp-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 22px;
  background: rgba(10, 14, 24, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  gap: 4px;
}

.cp-stat__num {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--fg);
  line-height: 1;
}

.cp-stat__label {
  font-size: 0.73rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.3;
}

/* ── Sections ───────────────────────────────────────────────── */
.cp-section {
  padding: 48px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.cp-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cp-section__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 12px;
}

.cp-section__title {
  font-family: var(--font-head);
  margin: 0 0 20px;
  font-size: clamp(1.3rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--fg);
}

.cp-section__body {
  margin: 0 0 16px;
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.75);
}

.cp-section__body:last-of-type {
  margin-bottom: 0;
}

.cp-section__body strong {
  color: var(--fg);
  font-weight: 600;
}

/* ── In-text links ──────────────────────────────────────────── */
.cp-link {
  color: var(--accent2);
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 211, 238, 0.3);
  transition: border-color 0.15s, color 0.15s;
}

.cp-link:hover {
  color: #a5f3fc;
  border-bottom-color: rgba(34, 211, 238, 0.7);
}

/* ── Flag callouts ──────────────────────────────────────────── */
.cp-flag {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.55;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.cp-flag:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cp-flag p {
  margin: 0;
  color: var(--fg);
}

.cp-flag__icon {
  flex-shrink: 0;
  font-size: 0.85rem;
  margin-top: 2px;
  font-weight: 700;
}

.cp-flag--warn {
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.cp-flag--warn .cp-flag__icon {
  color: #fbbf24;
}

.cp-flag--critical {
  background: rgba(248, 113, 113, 0.07);
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.cp-flag--critical .cp-flag__icon {
  color: #f87171;
}

.cp-flag--ok {
  background: rgba(52, 211, 153, 0.07);
  border: 1px solid rgba(52, 211, 153, 0.22);
}

.cp-flag--ok .cp-flag__icon {
  color: #34d399;
}

.cp-flag--suggest {
  background: rgba(124, 92, 255, 0.07);
  border: 1px solid rgba(124, 92, 255, 0.22);
}

.cp-flag--suggest .cp-flag__icon {
  color: var(--accent);
}

/* Stat source links */
.cp-stat__src {
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  font-size: 0.65rem;
  margin-left: 2px;
  transition: color 0.15s;
}

.cp-stat__src:hover {
  color: var(--accent2);
}

/* Chart source links */
.cp-chart__src {
  color: rgba(255, 255, 255, 0.3);
  font-size: 0.72rem;
  text-decoration: none;
  border-bottom: none;
  transition: color 0.15s;
}

.cp-chart__src:hover {
  color: var(--accent2);
}

/* ── Data caveat callout ────────────────────────────────────── */
.cp-callout {
  margin-bottom: 24px;
  padding: 14px 18px;
  border-left: 3px solid rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.05);
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
}

.cp-callout__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fbbf24;
  margin-bottom: 6px;
}

/* ── Lettered items (missing objectives) ────────────────────── */
.cp-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 4px 0 0;
}

.cp-item {
  display: flex;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cp-item:last-child {
  border-bottom: none;
}

.cp-item__marker {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.15);
  border: 1px solid rgba(124, 92, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-top: 1px;
}

.cp-item__content {
  font-size: 0.97rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

.cp-item__content strong {
  color: var(--fg);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

/* ── Goal blocks ────────────────────────────────────────────── */
.cp-goals {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 32px;
}

.cp-goal {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 560px) {
  .cp-goal {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.cp-goal__num {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 3px;
}

.cp-goal__body p {
  margin: 0 0 0;
  font-size: 0.97rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

.cp-goal__body p strong {
  color: var(--fg);
}

/* ── Cost models ────────────────────────────────────────────── */
.cp-models {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 20px 0;
}

.cp-model {
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, transform 0.2s ease;
}

.cp-model:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.cp-model__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.cp-model__name {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg);
}

.cp-model__src {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
}

.cp-model__src:hover {
  color: var(--accent2);
}

.cp-model__desc {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.65);
}

.cp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cp-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cp-table td {
  padding: 8px 10px;
  color: rgba(255, 255, 255, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: top;
  line-height: 1.4;
}

.cp-table td:nth-child(2) {
  white-space: nowrap;
  color: var(--fg);
  font-weight: 600;
}

.cp-table td:last-child {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.78rem;
}

.cp-table__total td {
  padding-top: 12px;
  border-bottom: none;
  color: var(--fg);
}

.cp-table__total td:nth-child(2) {
  color: var(--accent2);
}

/* ── Charts ─────────────────────────────────────────────────── */
.cp-chart-wrap {
  margin-top: 28px;
  padding: 20px;
  background: rgba(10, 14, 24, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 15px 35px rgba(0, 0, 0, 0.2);
}

.cp-chart-wrap canvas {
  max-width: 100%;
  height: 200px !important;
}

.cp-chart__label {
  margin: 12px 0 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
  letter-spacing: 0.04em;
}

.cp-charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

@media (max-width: 600px) {
  .cp-charts-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Peer comparison cards ──────────────────────────────────── */
.cp-peers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

@media (max-width: 720px) {
  .cp-peers {
    grid-template-columns: 1fr;
  }
}

.cp-peer {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.cp-peer:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cp-peer__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cp-peer__name {
  font-family: var(--font-head);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent2);
}

.cp-peer__srcs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.cp-peer__src {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  transition: color 0.15s, border-color 0.15s;
}

.cp-peer__src:hover {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.4);
}

.cp-peer__body {
  font-size: 0.88rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

.cp-peer__list {
  margin: 4px 0 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cp-peer__list li {
  font-size: 0.83rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.6);
  padding-left: 16px;
  position: relative;
}

.cp-peer__list li::before {
  content: '·';
  position: absolute;
  left: 4px;
  color: var(--accent);
  opacity: 0.6;
}

/* Highlight box for cross-cutting insight */
.cp-insight {
  margin-top: 28px;
  padding: 22px 24px;
  background: rgba(124, 92, 255, 0.07);
  border: 1px solid rgba(124, 92, 255, 0.22);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 10px 30px rgba(124, 92, 255, 0.1);
  transition: transform 0.2s ease;
}

.cp-insight:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 15px 40px rgba(124, 92, 255, 0.15);
}

.cp-insight__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: block;
}

.cp-insight p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin: 0 0 8px;
}

.cp-insight p:last-child {
  margin-bottom: 0;
}

/* ── Glossary tooltips ──────────────────────────────────────── */
/* Dotted-underline on jargon terms; definition appears on hover */
.cp-term {
  border-bottom: 1px dotted rgba(180, 190, 255, 0.5);
  cursor: help;
  position: relative;
  display: inline;
}

.cp-term::after {
  content: attr(data-def);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 28, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 0.75rem;
  line-height: 1.55;
  width: 270px;
  color: rgba(215, 220, 240, 0.92);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 200;
  white-space: normal;
  text-align: left;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-style: normal;
  font-weight: 400;
}

.cp-term:hover::after,
.cp-term:focus::after {
  opacity: 1;
}

/* Prevent tooltip from clipping on narrow screens */
@media (max-width: 640px) {
  .cp-term::after {
    left: 0;
    transform: none;
    width: min(270px, 90vw);
  }
}

/* ── Footer ─────────────────────────────────────────────────── */
.cp-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.25);
  letter-spacing: 0.04em;
}
