/* === RESET & ROOT === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  --bg: #0b1326;
  --surface: #131b2e;
  --surface-high: #222a3d;
  --surface-highest: #2d3449;
  --primary: #d3bbff;
  --primary-container: #6d28d9;
  --secondary: #a4c9ff;
  --secondary-container: #0267b8;
  --accent: #6d28d9;
  --text: #dae2fd;
  --muted: #ccc3d7;
  --line: #4a4455;
  --on-primary: #3f008d;
  --outline: #958da1;
  --font-heading: 'Noto Serif', Georgia, serif;
  --font-body: 'Inter', 'Noto Sans JP', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

/* === CONTAINER === */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* === HERO === */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('./assets/bg_hero.png') center/cover no-repeat;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(11, 19, 38, 0.75) 0%,
    rgba(46, 16, 101, 0.5) 50%,
    rgba(11, 19, 38, 0.9) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  padding: 6rem 2rem;
  text-align: center;
}

.hero-label {
  display: inline-block;
  background: var(--secondary-container);
  color: #d6e5ff;
  padding: 0.3rem 1rem;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-authors {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.hero-date {
  color: var(--outline);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.hero-abstract {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto 2rem;
}

.hero-metrics {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.metric-badge {
  background: rgba(109, 40, 217, 0.25);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(211, 187, 255, 0.2);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  text-align: center;
  min-width: 160px;
}

.metric-value {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.metric-label {
  display: block;
  font-size: 0.8rem;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-container));
  color: #fff;
  border: none;
}

.btn-outline {
  background: transparent;
  border: 2px solid rgba(211, 187, 255, 0.3);
  color: var(--secondary);
}

/* === SECTIONS === */
.content-section {
  padding: 5rem 0;
}

.content-section.alt-bg {
  background: var(--surface);
}

.content-section h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  color: var(--primary);
  border-left: 3px solid var(--accent);
  padding-left: 0.75rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.content-section h3 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--secondary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
}

.content-section h4 {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.content-section p {
  margin-bottom: 1.2em;
  color: var(--text);
}

.content-section ul, .content-section ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.content-section li {
  margin-bottom: 0.75rem;
  color: var(--text);
}

/* === FIGURES === */
figure {
  margin: 2.5rem 0;
}

figure img {
  border-radius: 12px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  background: var(--surface-highest);
  padding: 0.5rem;
}

figcaption {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  margin-top: 0.75em;
  font-style: italic;
}

.dark-figure img {
  background: var(--surface-highest);
  border: 1px solid var(--line);
  padding: 1rem;
}

/* === CARD GRID (Key Insights) === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.glass-card {
  background: rgba(34, 42, 61, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 12px;
  padding: 2rem;
  transition: background 0.2s ease;
}

.glass-card:hover {
  background: rgba(49, 57, 77, 0.7);
}

.card-icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.glass-card h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.glass-card p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
}

/* === RESULTS CARDS === */
.results-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.result-card {
  background: var(--surface-high);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.result-card h4 {
  color: var(--secondary);
}

.result-card p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* === TABLE === */
.table-wrapper {
  overflow-x: auto;
  margin: 2rem 0;
  border-radius: 12px;
  background: var(--surface-high);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

thead th {
  background: var(--surface-highest);
  font-weight: 600;
  color: var(--secondary);
  padding: 0.75rem 1rem;
  text-align: left;
  white-space: nowrap;
}

tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid rgba(74, 68, 85, 0.3);
  color: var(--text);
}

tbody tr:hover {
  background: rgba(109, 40, 217, 0.08);
}

.table-caption {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* === CONCLUSION CARD === */
.conclusion-card {
  background: var(--surface-high);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.conclusion-card h3 {
  color: var(--primary);
  margin-top: 0;
}

/* === REFERENCES === */
details {
  background: var(--surface-high);
  border-radius: 12px;
  padding: 1.5rem;
}

summary {
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
}

summary::before {
  content: '\25B6\00a0';
  font-size: 0.8em;
}

details[open] summary::before {
  content: '\25BC\00a0';
}

.references-list {
  margin-top: 1rem;
  padding-left: 1.5rem;
}

.references-list li {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* === KEYWORDS / CHIPS === */
.keywords-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 2rem 0;
}

.chip {
  display: inline-block;
  background: var(--secondary-container);
  color: #d6e5ff;
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* === FLECTO EXPLANATION UI === */
.flecto-note,
.flecto-callout,
.flecto-card,
.flecto-panel {
  margin: 1.5rem 0;
  border-radius: 12px;
  position: relative;
}

.flecto-note::before,
.flecto-callout::before,
.flecto-card::before,
.flecto-panel::before {
  content: '\1F916 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 {
  background: rgba(109, 40, 217, 0.1);
  border-left: 3px solid var(--primary-container);
  padding: 1rem 1.25rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.flecto-callout {
  background: rgba(2, 103, 184, 0.12);
  border-left: 3px solid var(--secondary-container);
  padding: 1.25rem 1.5rem;
  color: var(--text);
}

.flecto-card {
  background: var(--surface-high);
  padding: 1.5rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(74, 68, 85, 0.3);
}

.flecto-card h4, .flecto-panel h4 {
  color: var(--secondary);
  margin-bottom: 0.5rem;
}

.flecto-panel {
  background: var(--surface-high);
  padding: 2rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(74, 68, 85, 0.2);
}

.flecto-panel h4 {
  font-size: 1.1rem;
}

.flecto-note p, .flecto-callout p, .flecto-card p, .flecto-panel p {
  margin-bottom: 0.75em;
}

.flecto-note ul, .flecto-callout ul, .flecto-card ul, .flecto-panel ul {
  padding-left: 1.2rem;
  margin-bottom: 0.75em;
}

/* === SCROLL REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .hero-content {
    padding: 4rem 1rem;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.4rem);
  }

  .hero-metrics {
    flex-direction: column;
    align-items: center;
  }

  .metric-badge {
    min-width: 200px;
  }

  .card-grid, .results-cards {
    grid-template-columns: 1fr;
  }

  .content-section {
    padding: 3rem 0;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  table {
    font-size: 0.8rem;
  }

  thead th, tbody td {
    padding: 0.5rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .content-section h2 {
    font-size: 1.3rem;
  }
}
