/* === Voxtral TTS — HTML Article Styles === */

/* === Custom Properties === */
:root {
  --color-bg: #0D0F14;
  --color-surface: #161A24;
  --color-surface-alt: #1E2436;
  --color-primary: #F47B20;
  --color-accent: #FFB347;
  --color-text: #E8ECF4;
  --color-muted: #8A93A8;
  --color-line: #2C3248;
  --color-best: #FFB347;
  --color-warn: #F47B20;

  --font-heading: 'Inter', 'Helvetica Neue', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Georgia', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;

  --max-width: 900px;
  --section-pad-v: 64px;
  --section-pad-h: 32px;
  --card-radius: 12px;
  --card-border: 1px solid var(--color-line);
  --card-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 150ms ease;
}
a:hover { color: var(--color-accent); text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; }

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

/* === Navigation === */
#nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 20, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px var(--section-pad-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo { flex-shrink: 0; }
.nav-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}
.nav-subtitle {
  font-size: 11px;
  color: var(--color-muted);
  display: block;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  padding: 0;
}
.nav-links a {
  font-size: 13px;
  color: var(--color-muted);
  white-space: nowrap;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 150ms, border-color 150ms;
  text-decoration: none;
}
.nav-links a:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  text-decoration: none;
}

/* === Hero === */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--section-pad-v) var(--section-pad-h);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.6;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--color-bg) 0%, transparent 60%);
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 840px;
  width: 100%;
}

.hero-logo {
  margin: 0 auto 24px;
  width: 260px;
  animation: fadeIn 600ms ease both;
}

.hero-title {
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  animation: slideUp 700ms ease 100ms both;
}

.hero-subtitle {
  font-size: 20px;
  color: var(--color-muted);
  max-width: 640px;
  margin: 0 auto 40px;
  animation: slideUp 700ms ease 200ms both;
}
.hero-subtitle strong { color: var(--color-text); }

.hero-metrics {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  animation: slideUp 700ms ease 300ms both;
}

.metric-card {
  width: 220px;
  padding: 24px;
  background: var(--color-surface-alt);
  border: 1px solid rgba(244, 123, 32, 0.3);
  border-radius: var(--card-radius);
  text-align: center;
}
.metric-card--accent { border-color: rgba(255, 179, 71, 0.4); }

.metric-number {
  font-size: 52px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  font-family: var(--font-heading);
}
.metric-card--accent .metric-number { color: var(--color-accent); }
.metric-unit { font-size: 28px; font-weight: 700; color: var(--color-primary); }
.metric-card--accent .metric-unit { color: var(--color-accent); }

.metric-label {
  font-size: 13px;
  color: var(--color-text);
  margin-top: 8px;
  line-height: 1.4;
}
.metric-sub { color: var(--color-muted); font-size: 12px; }

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  animation: fadeIn 400ms ease 500ms both;
}

.btn {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  text-decoration: none;
  display: inline-block;
}
.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border: 2px solid var(--color-primary);
}
.btn--primary:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #000;
  text-decoration: none;
}
.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.btn--secondary:hover {
  background: rgba(244, 123, 32, 0.1);
  text-decoration: none;
}

/* === Sections === */
section { padding: var(--section-pad-v) var(--section-pad-h); }
section:nth-child(even) { background: rgba(22, 26, 36, 0.5); }

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.section-inner--narrow { max-width: 760px; }

.section-heading {
  font-size: 30px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
}

.subsection {
  margin-top: 48px;
}
.subsection h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
}

/* === Prose === */
.prose p, p.prose {
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 16px;
  max-width: 820px;
}

.pull-quote {
  font-size: 20px;
  font-style: italic;
  color: var(--color-primary);
  border-left: 4px solid var(--color-accent);
  padding: 16px 20px;
  margin: 32px 0;
  line-height: 1.5;
}

/* === Two-column layouts === */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.two-col--55-45 { grid-template-columns: 55% 45%; }
.two-col--40-60 { grid-template-columns: 40% 60%; }

@media (max-width: 768px) {
  .two-col, .two-col--55-45, .two-col--40-60 {
    grid-template-columns: 1fr;
  }
}

/* === Figures === */
figure { margin: 0; }

.figure-img {
  border-radius: 8px;
  width: 100%;
}
.figure-img--light {
  background: #fff;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.figure-img--dark {
  background: var(--color-surface);
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.figure-img--large { max-width: 780px; }

.figure-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 32px 0;
}
.figure-centered img { max-width: 780px; width: 100%; }

figcaption {
  font-size: 13px;
  color: var(--color-muted);
  margin-top: 10px;
  line-height: 1.5;
  font-style: italic;
  text-align: center;
  max-width: 780px;
}

/* === Cards === */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 768px) {
  .card-grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--color-surface);
  border: var(--card-border);
  border-radius: var(--card-radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
}
.card h3 {
  font-size: 18px;
  color: var(--color-primary);
  margin-bottom: 12px;
}
.card p { font-size: 15px; line-height: 1.7; margin-bottom: 12px; color: var(--color-text); }
.card p:last-child { margin-bottom: 0; }

/* === Feature list === */
.feature-list {
  list-style: none;
  padding: 0;
  margin-top: 8px;
}
.feature-list li {
  font-size: 15px;
  line-height: 1.6;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-line);
  padding-left: 20px;
  position: relative;
}
.feature-list li::before {
  content: '▸';
  color: var(--color-primary);
  position: absolute;
  left: 0;
  top: 8px;
}
.feature-list li:last-child { border-bottom: none; }

/* === Tables === */
.table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  margin: 8px 0 16px;
  border: var(--card-border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.4;
}

.data-table th {
  background: #252D42;
  color: var(--color-accent);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--color-line);
  white-space: nowrap;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-line);
  color: var(--color-text);
}

.data-table tbody tr:nth-child(even) { background: var(--color-surface-alt); }
.data-table tbody tr:hover { background: rgba(244, 123, 32, 0.06); }

.data-table .row-group-header td {
  background: rgba(244, 123, 32, 0.1);
  border-left: 3px solid var(--color-primary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  padding: 6px 12px;
}

.data-table .indent { padding-left: 24px; }

.data-table .highlight-row {
  background: var(--color-surface-alt) !important;
  border-left: 3px solid var(--color-primary);
}

.data-table .overall-row {
  background: rgba(255, 179, 71, 0.1) !important;
  border-top: 2px solid var(--color-line);
}
.data-table .overall-row td { font-weight: 700; color: var(--color-accent); }

.data-table .warning-row { background: rgba(244, 123, 32, 0.05) !important; }

.data-table .best {
  color: var(--color-accent);
  font-weight: 700;
}

.delta { font-size: 11px; font-weight: 500; margin-left: 2px; }
.delta.neg { color: #5CC8A0; }
.delta.pos { color: var(--color-accent); }
.delta.warn { color: #F47B20; }

.table-caption {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 8px;
  font-style: italic;
}
.table-note {
  font-size: 13px;
  color: var(--color-muted);
  font-style: italic;
  margin-top: 8px;
}

/* === Callout box === */
.callout-box {
  background: var(--color-surface-alt);
  border-left: 4px solid var(--color-primary);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  font-size: 15px;
  line-height: 1.6;
  margin: 16px 0;
  color: var(--color-text);
}
.callout-box strong { color: var(--color-accent); }

/* === Takeaway pills === */
.takeaway-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  justify-content: center;
}

.pill {
  background: var(--color-surface-alt);
  border: 1px solid rgba(244, 123, 32, 0.4);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 50px;
  white-space: nowrap;
}

/* === Section divider === */
.section-divider {
  width: 100%;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--color-primary), transparent);
  margin-bottom: 48px;
}

/* === Wave footer === */
.wave-footer {
  margin-top: 48px;
  opacity: 0.35;
  overflow: hidden;
  border-radius: 0;
  /* Break out of narrow container to fill full viewport width.
     - width: 100vw stretches to viewport width
     - left: 50% shifts right by half of parent (760px) = +380px
     - margin-left: -50vw pulls back by half viewport (-640px)
     - net from parent left edge: 380-640 = -260px → absolute x=0
     Uses margin-left (not transform) to avoid conflict with
     JS reveal animation which overrides the transform property. */
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
}
.wave-footer img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
}

/* === Footer === */
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-line);
  padding: 40px var(--section-pad-h);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-cite-label {
  font-size: 14px;
  color: var(--color-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.citation-block {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--color-surface-alt);
  border: var(--card-border);
  border-radius: 8px;
  padding: 16px 20px;
  text-align: left;
  color: var(--color-text);
  white-space: pre-wrap;
  overflow-x: auto;
  display: inline-block;
  max-width: 600px;
  width: 100%;
  margin-bottom: 24px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.footer-links a {
  font-size: 14px;
  color: var(--color-primary);
}

.footer-copyright {
  font-size: 12px;
  color: var(--color-muted);
}

/* === Scroll-reveal animations === */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* === Keyframes === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Reduced motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* === Responsive adjustments === */
@media (max-width: 600px) {
  :root {
    --section-pad-v: 40px;
    --section-pad-h: 16px;
  }
  .section-heading { font-size: 24px; }
  .nav-links { display: none; }
  .hero-metrics { gap: 12px; }
  .metric-card { width: 150px; padding: 16px; }
  .metric-number { font-size: 40px; }
}

/* AI explanation labels */
.flecto-note::before,
.flecto-callout::before,
.flecto-card::before,
.flecto-panel::before {
  content: "🤖 AI explanation";
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 0.5em;
  opacity: 0.9;
}
