/* Ouroboros — Apple-minimalist with depth */
:root {
  --text: #1d1d1f;
  --text-secondary: #86868b;
  --bg: #fbfbfd;
  --surface: #fff;
  --card-bg: rgba(255,255,255,0.72);
  --card-border: rgba(0,0,0,0.06);
  --accent: #0071e3;
  --accent-light: #e8f2ff;
  --green: #34c759;
  --green-light: #d1fae5;
  --amber: #ff9f0a;
  --amber-light: #fef3c7;
  --indigo: #5856d6;
  --indigo-light: #e0e7ff;
  --border: #e5e5ea;
  --radius: 16px;
  --radius-sm: 10px;
  --max-w: 980px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Hero ─── */
.hero {
  text-align: center;
  padding: 72px 0 48px;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(0,113,227,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero > * { position: relative; z-index: 1; }

.hero-logo {
  width: 88px;
  height: 88px;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.08));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--text) 0%, #555 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero .subtitle {
  color: var(--text-secondary);
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 400;
}

.hero .tagline {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 12px;
  font-style: italic;
  opacity: 0.7;
}

/* ─── Navigation ─── */
nav {
  text-align: center;
  padding: 14px 0;
  margin-bottom: 48px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(251,251,253,0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  margin: 0 16px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover { color: var(--accent); }

/* ─── Stats bar ─── */
.stats {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.stat {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  flex: 1;
  min-width: 140px;
}

.stat .number {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
}

.stat .label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ─── Section headers ─── */
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

section {
  margin-bottom: 56px;
}

section > p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 640px;
  line-height: 1.7;
}

/* ─── Cards ─── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 56px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  margin-top: 14px;
  letter-spacing: 0.01em;
}

.badge.active { background: var(--green-light); color: #065f46; }
.badge.bootstrap { background: var(--indigo-light); color: #3730a3; }
.badge.eval { background: var(--amber-light); color: #92400e; }

/* ─── Metric cards (dashboard) ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 56px;
}

.metric-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.metric-card:hover { transform: translateY(-2px); }

.metric-card .value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.metric-card .metric-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
}

/* Accent colored values */
.metric-card.accent-blue .value { color: var(--accent); }
.metric-card.accent-green .value { color: var(--green); }
.metric-card.accent-amber .value { color: var(--amber); }
.metric-card.accent-indigo .value { color: var(--indigo); }

/* ─── Dashboard charts (CSS-only) ─── */
.dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 56px;
}

.chart-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
}

.chart-card h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Progress ring */
.ring-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.ring {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}

.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 251.3;
  stroke-dashoffset: 251.3;
  transition: stroke-dashoffset 1.5s ease;
}

.ring-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.ring-details {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.ring-details strong {
  color: var(--text);
  font-weight: 600;
}

/* Bar chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 80px;
  padding-top: 8px;
}

.bar {
  flex: 1;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  transition: height 0.8s ease;
  opacity: 0.8;
}

.bar:hover {
  opacity: 1;
}

.bar-labels {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.bar-labels span {
  flex: 1;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-secondary);
}

/* Horizontal bars */
.h-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.h-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.h-bar-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.h-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.h-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease;
}

.h-bar-fill.blue { background: var(--accent); }
.h-bar-fill.green { background: var(--green); }
.h-bar-fill.amber { background: var(--amber); }
.h-bar-fill.indigo { background: var(--indigo); }

.h-bar-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  width: 40px;
  flex-shrink: 0;
}

/* ─── Tables ─── */
.table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 56px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 14px 20px;
  font-size: 0.88rem;
}

tr + tr td, tr + tr th {
  border-top: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(0,0,0,0.02);
}

td { color: var(--text); }

/* Status pill in tables */
.status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
}

.status-pill.green { background: var(--green-light); color: #065f46; }
.status-pill.amber { background: var(--amber-light); color: #92400e; }
.status-pill.indigo { background: var(--indigo-light); color: #3730a3; }

/* ─── Timeline ─── */
.timeline {
  position: relative;
  padding-left: 32px;
  margin-bottom: 56px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border));
  border-radius: 1px;
}

.timeline-entry {
  position: relative;
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeUp 0.5s ease forwards;
}

.timeline-entry:nth-child(1) { animation-delay: 0s; }
.timeline-entry:nth-child(2) { animation-delay: 0.05s; }
.timeline-entry:nth-child(3) { animation-delay: 0.1s; }
.timeline-entry:nth-child(4) { animation-delay: 0.15s; }
.timeline-entry:nth-child(5) { animation-delay: 0.2s; }
.timeline-entry:nth-child(6) { animation-delay: 0.25s; }
.timeline-entry:nth-child(7) { animation-delay: 0.3s; }
.timeline-entry:nth-child(8) { animation-delay: 0.35s; }
.timeline-entry:nth-child(9) { animation-delay: 0.4s; }
.timeline-entry:nth-child(10) { animation-delay: 0.45s; }

@keyframes fadeUp {
  to { opacity: 1; transform: translateY(0); }
}

.timeline-entry:last-child {
  margin-bottom: 0;
}

.timeline-entry::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-secondary);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-entry.milestone::before {
  width: 10px;
  height: 10px;
  left: -28px;
  top: 7px;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,0.2);
}

.timeline-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
}

.timeline-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.timeline-tag.finding { background: #dbeafe; color: #1e40af; }
.timeline-tag.milestone { background: var(--green-light); color: #065f46; }
.timeline-tag.status { background: var(--amber-light); color: #92400e; }

/* ─── Architecture diagram ─── */
.arch-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 32px 16px;
  margin-bottom: 56px;
  overflow-x: auto;
}

.arch-node {
  text-align: center;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  min-width: 120px;
  flex-shrink: 0;
}

.arch-node .arch-icon {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.arch-node .arch-name {
  font-size: 0.8rem;
  font-weight: 600;
}

.arch-node .arch-detail {
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.arch-arrow {
  font-size: 1.2rem;
  color: var(--text-secondary);
  padding: 0 8px;
  flex-shrink: 0;
}

/* ─── Principles ─── */
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 56px;
}

.principle {
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.principle-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  width: 24px;
}

.principle-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.principle-text strong {
  color: var(--text);
  font-weight: 600;
}

/* ─── Links ─── */
.links {
  list-style: none;
  margin-bottom: 56px;
}

.links li {
  margin-bottom: 8px;
}

.links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: opacity 0.2s;
}

.links a:hover { opacity: 0.7; }

/* ─── Footer ─── */
footer {
  text-align: center;
  padding: 48px 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

/* ─── Scroll reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Heatmap grid ─── */
#heatmap {
  grid-template-rows: repeat(auto-fill, 1fr);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard { grid-template-columns: 1fr; }
  .arch-diagram { flex-wrap: wrap; gap: 8px; }
  .arch-arrow { display: none; }
}

@media (max-width: 500px) {
  .hero { padding: 48px 0 32px; }
  .hero h1 { font-size: 1.5rem; }
  .stats { flex-direction: column; gap: 8px; }
  .stat { padding: 16px; }
  .card-grid { grid-template-columns: 1fr; }
  .principles-grid { grid-template-columns: 1fr; }
  nav a { margin: 0 10px; font-size: 0.82rem; }
}
