:root {
  --bg: #0b0f19;
  --bg-2: #111827;
  --card: #1a2332;
  --card-2: #202b3c;
  --accent: #38bdf8;
  --accent-2: #f472b6;
  --accent-3: #a78bfa;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: #334155;
  --success: #4ade80;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

nav .brand {
  font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  white-space: nowrap;
}

nav .links {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav .links a {
  color: var(--muted);
  transition: color 0.2s;
}

nav .links a:hover {
  color: var(--text);
  text-decoration: none;
}

.hero {
  padding: 5rem 1.5rem 3rem;
  text-align: center;
  background: radial-gradient(ellipse at top, #172033 0%, var(--bg) 70%);
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: 0 0 0.75rem;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 700px;
  margin: 0 auto 2rem;
}

#hero-chart {
  max-width: 900px;
  margin: 0 auto;
  min-height: 360px;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

section {
  margin-bottom: 4rem;
  scroll-margin-top: 80px;
}

h2 {
  font-size: 1.8rem;
  margin: 0 0 0.75rem;
  color: var(--accent);
}

h3 {
  font-size: 1.25rem;
  color: var(--accent-2);
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}

p {
  margin: 0.9rem 0;
  color: var(--text);
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

.card h3:first-child {
  margin-top: 0;
}

.callout {
  background: var(--card-2);
  border-left: 4px solid var(--accent);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.callout.warn {
  border-left-color: var(--accent-2);
}

.callout.ok {
  border-left-color: var(--success);
}

.chart-wrap {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  margin: 1rem 0;
  min-height: 380px;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

.control {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 120px;
  flex: 1;
}

.control label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.control .value {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--accent);
}

.coin-pair {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  flex: 1;
  min-width: 220px;
}

.coin-pair h4 {
  margin: 0 0 0.75rem;
  color: var(--accent-3);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

button, .btn {
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  color: #0b0f19;
  border: none;
  border-radius: 0.4rem;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: opacity 0.2s, transform 0.1s;
}

button:hover, .btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

button:active, .btn:active {
  transform: translateY(1px);
}

.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  background: var(--card);
  border-radius: 0.5rem;
  overflow: hidden;
}

th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

code {
  font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  background: rgba(15, 23, 42, 0.6);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.92em;
}

.math {
  display: block;
  overflow-x: auto;
  padding: 0.85rem 1rem;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: 1rem;
  margin: 1rem 0;
}

ul, ol {
  padding-left: 1.3rem;
}

li {
  margin: 0.5rem 0;
}

.verdict {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.12), rgba(244, 114, 182, 0.12));
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 0.75rem;
}

.muted {
  color: var(--muted);
}

footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.scroll-hint {
  color: var(--accent-3);
  font-size: 0.9rem;
  margin: 0.5rem 0 1rem;
}

.scroll-hint::before {
  content: "Scroll-activated demo: ";
  color: var(--muted);
}

.slice-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
}

.showcase-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  transition: box-shadow 0.3s, border-color 0.3s;
}

.enfsi-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.enfsi-table th,
.enfsi-table td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.enfsi-table th {
  background: var(--card-2);
  color: var(--accent-2);
  font-weight: 600;
}

.enfsi-table tr:nth-child(even) {
  background: var(--bg-2);
}

.citation {
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  nav .links {
    display: none;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
}
