/* =============================================
   Intern-S1-Pro Paper HTML — styles.css
   Palette: ocean_depths — navy + teal
   ============================================= */

:root {
  --bg: #EDF2F7;
  --surface: #FFFFFF;
  --primary: #0D3B66;
  --secondary: #1B6B93;
  --accent: #14919B;
  --text: #0A1628;
  --muted: #6B8299;
  --line: #C8D6E0;
  --hero-bg: #081D35;
  --card-bg: #F7FAFD;
  --highlight: #E6F4F6;
  --font-heading: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  --font-body: Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --max-w: 960px;
  --section-gap: 80px;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(13,59,102,0.09);
}

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

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

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

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

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

p { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }

/* =============================================
   NAVIGATION
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(13,59,102,0.06);
  transition: transform 0.3s ease;
}

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

.nav-logos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary);
  transition: color 0.2s;
}

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

.nav-links a.active {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--primary);
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  background: var(--hero-bg);
  color: #FFFFFF;
  padding: 80px 24px 60px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero-badges {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 16px;
  letter-spacing: 0.02em;
}

.badge-arxiv {
  background: rgba(20,145,155,0.25);
  color: #7ADDE4;
  border: 1px solid rgba(20,145,155,0.4);
}

.badge-date {
  background: rgba(255,255,255,0.1);
  color: #94B4CC;
  border: 1px solid rgba(255,255,255,0.2);
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  margin-bottom: 16px;
  max-width: 820px;
}

.hero-authors {
  font-family: var(--font-heading);
  font-size: 1rem;
  color: #94B4CC;
  margin-bottom: 16px;
}

.hero-link {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 18px;
  border-radius: 6px;
  margin-bottom: 48px;
  transition: background 0.2s, color 0.2s;
}

.hero-link:hover {
  background: var(--accent);
  color: white;
  text-decoration: none;
}

/* Stat Cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 20px 20px 18px;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.stat-desc {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  color: #94B4CC;
  line-height: 1.4;
}

/* =============================================
   CONTENT SECTIONS
   ============================================= */
.content-section {
  padding: 64px 24px;
  position: relative;
}

.content-section:nth-child(even) {
  background: var(--surface);
}

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

.section-heading {
  font-family: var(--font-heading);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 32px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
  letter-spacing: -0.01em;
}

.subsection-heading {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 20px;
  margin-top: 40px;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--secondary);
  margin-bottom: 40px;
  font-style: italic;
}

/* Abstract */
.abstract-block {
  background: #F0FAFB;
  border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 32px 36px;
  font-size: 1.05rem;
  line-height: 1.8;
}

/* =============================================
   TWO-COLUMN LAYOUT
   ============================================= */
.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

.col-side {
  position: sticky;
  top: 84px;
}

/* =============================================
   FIGURES
   ============================================= */
.paper-figure {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.paper-figure img {
  border-radius: 4px;
  width: 100%;
}

.paper-figure figcaption {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

.paper-figure-wide {
  margin: 24px 0;
}

.figure-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 32px 0;
}

/* =============================================
   ARCHITECTURE SECTION
   ============================================= */
.section-arch {
  background: var(--card-bg);
}

.arch-bg-deco {
  position: absolute;
  inset: 0;
  background-size: 50%;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

.section-arch .section-container {
  position: relative;
  z-index: 1;
}

.subsection {
  margin-top: 48px;
}

.subsection h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 20px;
  margin-top: 0;
}

.subsection h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  margin-top: 24px;
}

/* Math blocks */
.math-block {
  background: var(--highlight);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin: 20px 0;
  overflow-x: auto;
  line-height: 1.6;
  color: var(--primary);
}

.math-inline {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--highlight);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--primary);
}

/* Feature list */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.feature-list li {
  padding: 12px 16px 12px 20px;
  border-left: 3px solid var(--accent);
  margin-bottom: 12px;
  background: var(--card-bg);
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
}

/* =============================================
   PRE-TRAINING STRATEGY CARDS
   ============================================= */
.strategy-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}

.strategy-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.strategy-num {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 900;
  color: var(--line);
  margin-bottom: 8px;
  line-height: 1;
}

.strategy-card h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}

.strategy-card p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text);
}

/* =============================================
   TABLES
   ============================================= */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-heading);
  font-size: 0.875rem;
}

.data-table caption {
  text-align: left;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 10px;
  font-size: 0.85rem;
  caption-side: top;
}

.data-table th {
  background: var(--primary);
  color: white;
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.data-table td:first-child {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background: var(--card-bg);
}

.data-table tbody tr:hover {
  background: var(--highlight);
}

.data-table .section-row td {
  background: var(--secondary);
  color: white;
  font-weight: 700;
  text-align: left;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.col-ours {
  background: #F0FAFB !important;
  font-weight: 600;
  color: var(--secondary);
}

.score-best {
  font-weight: 800;
  background: var(--highlight) !important;
  color: #0A5E6A;
}

.highlight-row td {
  background: var(--highlight) !important;
  font-weight: 700;
}

.avg-row td {
  background: var(--highlight) !important;
  font-weight: 700;
  border-top: 2px solid var(--accent);
}

.desc {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
}

.config-table {
  max-width: 480px;
}

/* Benchmark pills */
.bench-group {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bench-label {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  padding-top: 4px;
  min-width: 72px;
}

.bench-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 16px;
  cursor: default;
  transition: transform 0.15s;
}

.pill:hover {
  transform: translateY(-1px);
}

.pill-science {
  background: var(--highlight);
  color: #0A5E6A;
  border: 1px solid var(--accent);
}

.pill-general {
  background: #EDF2F7;
  color: var(--primary);
  border: 1px solid #B0C4D6;
}

/* Callout box */
.callout-box {
  background: var(--accent);
  color: white;
  padding: 18px 24px;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-top: 20px;
}

/* =============================================
   CONCLUSION
   ============================================= */
.section-conclusion {
  background: #F0FAFB;
}

.conclusion-text {
  max-width: 800px;
  margin: 0 auto 48px;
  padding: 40px 44px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 1.05rem;
  line-height: 1.8;
}

.contribution-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}

.contribution-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
}

.contrib-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
}

.contrib-content h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 6px;
}

.contrib-content p {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text);
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer-bottom {
  background: var(--hero-bg);
  color: #94B4CC;
  padding: 48px 24px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.footer-cite h3,
.footer-links h3 {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  margin-bottom: 14px;
}

.bibtex {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: #CBD8E8;
  overflow-x: auto;
  white-space: pre;
}

.copy-btn {
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.copy-btn:hover {
  background: var(--accent);
  color: white;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #7ADDE4;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
  text-decoration: none;
}

.footer-copy {
  margin-top: 28px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  line-height: 1.7;
  color: rgba(148,180,204,0.65);
}

/* =============================================
   SCROLL REVEAL ANIMATIONS
   ============================================= */
.reveal,
.reveal-stagger {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 16px 24px;
    border-bottom: 1px solid var(--line);
    gap: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 48px 20px 40px;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col-layout {
    grid-template-columns: 1fr;
  }

  .col-side {
    position: static;
  }

  .figure-row {
    grid-template-columns: 1fr;
  }

  .strategy-cards {
    grid-template-columns: 1fr;
  }

  .contribution-cards {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .bench-group {
    flex-direction: column;
    gap: 8px;
  }

  .section-heading {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .conclusion-text {
    padding: 24px 20px;
  }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger {
    opacity: 1;
    transform: none;
    transition: none;
  }

  html { scroll-behavior: auto; }
}

/* AI Explanation UI */
.flecto-note, .flecto-callout, .flecto-card, .flecto-panel {
  position: relative;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.flecto-note::before, .flecto-callout::before, .flecto-card::before, .flecto-panel::before {
  content: "🤖 AI explanation";
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #60a5fa;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.5em;
}
.flecto-note {
  border-left: 3px solid #60a5fa;
  background: rgba(96, 165, 250, 0.08);
}
.flecto-callout {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.flecto-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.flecto-panel {
  background: rgba(30,30,50,0.8);
  border: 1px solid rgba(100,100,200,0.3);
}
.flecto-note h4, .flecto-callout h4, .flecto-card h4, .flecto-panel h4 {
  margin: 0.5em 0 0.3em;
  font-size: 1rem;
  color: #0D3B66;
}
.flecto-card ul, .flecto-panel ul { padding-left: 1.5em; }
