/* Oblivion Static Site — NEC Brand Palette */
:root {
  --nec-blue:     #0F1ED2;
  --gray-1:       #EFF2F6;
  --gray-2:       #D9DFE9;
  --gray-3:       #C5CCD9;
  --gray-4:       #A7AFC1;
  --gray-5:       #8F98AC;
  --gray-6:       #7D869A;
  --gray-7:       #6B7387;
  --gray-8:       #535A6E;
  --gray-9:       #3C4155;
  --gray-10:      #282D3C;
  --accent:       #0F1ED2;
  --accent-light: #E8EAFF;
  --white:        #FFFFFF;
  --content-max:  960px;
  --nav-height:   52px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-height) + 16px); }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--gray-8);
  background: var(--white);
}

/* Navigation */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 28px;
  height: var(--nav-height);
  padding: 0 24px;
  background: var(--gray-10);
  font-size: 15px;
}
.site-nav a {
  color: var(--gray-3);
  text-decoration: none;
  transition: color .15s;
  font-size: 15px;
}
.site-nav a:hover,
.site-nav a.active { color: var(--white); }
.site-nav .brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--white);
  margin-right: auto;
  letter-spacing: .3px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Main content wrapper */
.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* Typography */
h1, h2, h3, h4 { color: var(--gray-10); font-weight: 600; }
h1 { font-size: 32px; margin-bottom: 14px; line-height: 1.3; }
h2 { font-size: 20px; margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--gray-2); }
h3 { font-size: 17px; margin: 24px 0 8px; }
h4 { font-size: 15px; margin: 18px 0 6px; }
p { margin-bottom: 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: italic; }
strong { font-weight: 600; color: var(--gray-10); }

/* Small caps for "Oblivion" branding — mirrors LaTeX \textsc{} */
.sc {
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: .5px;
}

/* Logos: Japanese 憶 | Sanskrit स्मृ — boxed */
.logo-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid rgba(255,255,255,.45);
  border-radius: 5px;
  padding: 2px 8px;
  line-height: 1.2;
}
.logo-box .jp { font-family: "Noto Sans JP", "Hiragino Kaku Gothic Pro", sans-serif; }
.logo-box .sk { font-family: "Noto Sans Devanagari", "Devanagari Sangam MN", sans-serif; }
.logo-box .pipe { opacity: 0.5; font-weight: 300; }

/* Hero logo box (homepage) */
.logo-box-hero {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--gray-3);
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 36px;
  letter-spacing: 3px;
  opacity: 0.85;
  line-height: 1.2;
}
.logo-box-hero .jp { font-family: "Noto Sans JP", "Hiragino Kaku Gothic Pro", sans-serif; }
.logo-box-hero .sk { font-family: "Noto Sans Devanagari", "Devanagari Sangam MN", sans-serif; }
.logo-box-hero .pipe { opacity: 0.4; font-weight: 200; }

/* Collapsible logo meaning */
.logo-hero-wrapper { user-select: none; }
.logo-expand-hint {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
  color: var(--gray-4);
  transition: transform 0.5s cubic-bezier(.4,0,.2,1), color 0.3s;
}
.logo-hero-wrapper:hover .logo-expand-hint { color: var(--accent); }
.logo-hero-wrapper.expanded .logo-expand-hint {
  transform: rotate(180deg);
  color: var(--gray-5);
}
.logo-meaning {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.5s ease-in-out, opacity 0.4s ease;
}
.logo-hero-wrapper.expanded .logo-meaning {
  max-height: 200px;
  opacity: 1;
}

/* Pronunciation line below hero logo */
.logo-pronunciation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--gray-5);
  letter-spacing: 0.3px;
}
.logo-pronunciation em {
  font-style: italic;
}
.logo-pronunciation .pronunciation-pipe {
  opacity: 0.4;
  font-weight: 200;
}
.logo-pronunciation .summary-highlight {
  color: var(--gray-5);
  font-size: 13px;
  letter-spacing: 0.5px;
}
.logo-pronunciation .summary-tagline {
  display: block;
  margin-top: 1px;
  font-weight: 600;
  letter-spacing: 0.4px;
}

/* Author block */
.authors {
  text-align: center;
  margin: 8px 0 20px;
  color: var(--gray-7);
  font-size: 14px;
  line-height: 1.6;
}
.authors .name { color: var(--gray-10); font-weight: 500; }
.authors sup { font-size: 10px; }
.authors .note {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-5);
}
.authors .affiliation {
  display: block;
  font-size: 13px;
  color: var(--gray-6);
  margin-top: 2px;
}
.authors .email {
  display: block;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12px;
  color: var(--gray-5);
}

/* Button row */
.btn-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 28px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: 1.5px solid var(--accent);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  transition: background .15s, color .15s;
}
.btn:hover { background: var(--accent); color: var(--white); text-decoration: none; }

/* Abstract */
.abstract {
  background: var(--gray-1);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 6px 6px 0;
  font-size: 14.5px;
  line-height: 1.7;
}

/* Figures */
.figure {
  margin: 28px 0;
  text-align: center;
}
.figure img {
  width: 90%;
  max-width: 960px;
  height: auto;
  border-radius: 4px;
}
.figure .crop-wrap {
  display: inline-block;
  overflow: hidden;
  border-radius: 4px;
  line-height: 0;
}
.figure .crop-wrap img {
  margin: -5% 0 -5% 0;
  width: 100%;
  max-width: none;
}
.figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  color: var(--gray-6);
  line-height: 1.55;
  max-width: 90%;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

/* Citation block */
.citation-block {
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-radius: 6px;
  padding: 14px 18px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  color: var(--gray-8);
}

/* Code blocks */
pre {
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-radius: 6px;
  padding: 14px 18px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  margin: 12px 0;
  color: var(--gray-9);
}
code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  background: var(--accent-light);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--gray-9);
}
pre code { background: none; padding: 0; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14px;
}
th, td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--gray-2);
}
th { background: var(--gray-1); font-weight: 600; color: var(--gray-10); }
tr:hover td { background: var(--accent-light); }

/* Lists */
ul, ol { padding-left: 24px; margin-bottom: 12px; }
li { margin-bottom: 4px; }

/* Card grid for documentation hub */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 20px 0;
}
.card-grid > a {
  display: flex;
  text-decoration: none;
}
.card-grid > a:hover { text-decoration: none; }
.card {
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-radius: 8px;
  padding: 18px 20px;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  width: 100%;
}
.card:hover { border-color: var(--accent); box-shadow: 0 2px 12px rgba(15,30,210,.08); }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card p { font-size: 13.5px; color: var(--gray-6); margin: 0; }
@media (max-width: 768px) { .card-grid { grid-template-columns: 1fr; } }

/* Footer */
.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 12.5px;
  color: var(--gray-5);
  border-top: 1px solid var(--gray-2);
  margin-top: 48px;
}

/* Workflow page styles */
.step-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.step-controls button {
  padding: 6px 16px;
  border: 1.5px solid var(--accent);
  border-radius: 5px;
  background: var(--white);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.step-controls button:hover { background: var(--accent); color: var(--white); }
.step-controls button:disabled { opacity: .4; cursor: default; }
.step-controls .step-label { font-size: 14px; color: var(--gray-6); }

.workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 16px 0;
}
@media (max-width: 768px) { .workflow-grid { grid-template-columns: 1fr; } }

.workflow-panel {
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-radius: 8px;
  padding: 16px;
  max-height: 520px;
  overflow-y: auto;
}
.workflow-panel h4 {
  margin: 0 0 10px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-5);
}

.chat-msg {
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
}
.chat-msg.human { background: var(--accent-light); border-left: 3px solid var(--accent); }
.chat-msg.agent { background: var(--white); border: 1px solid var(--gray-2); }
.chat-msg .role {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-5);
  margin-bottom: 4px;
}
.chat-msg.highlight { outline: 2px solid var(--accent); outline-offset: 2px; }

.metric-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--gray-2);
}
.metric-row .label { color: var(--gray-6); }
.metric-row .value { color: var(--gray-10); font-weight: 500; font-family: "SF Mono", monospace; font-size: 12px; }

.module-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .2px;
  margin-right: 3px;
  white-space: nowrap;
}
.module-badge.active { background: #D4EDDA; color: #155724; }
.module-badge.skipped { background: var(--gray-2); color: var(--gray-6); }

.detail-toggle {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
}
.detail-toggle:hover { text-decoration: underline; }
.detail-content { display: none; margin-top: 8px; }
.detail-content.open { display: block; }

/* Charts */
.chart-section { margin: 32px 0; }
.chart-section h3 { margin-bottom: 12px; }
.chart-container {
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}
.chart-container canvas { width: 100% !important; }

/* Collapsible chart wrappers */
.chart-collapse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding: 10px 14px;
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-radius: 8px;
  margin-bottom: 0;
  transition: background 0.2s;
}
.chart-collapse-header:hover { background: var(--gray-2); }
.chart-collapse-header h3 { margin: 0; font-size: 15px; color: var(--gray-9); }
.chart-collapse-chevron {
  font-size: 14px;
  color: var(--gray-5);
  transition: transform 0.4s cubic-bezier(.4,0,.2,1);
}
.chart-collapse-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(.4,0,.2,1), opacity 0.4s ease;
  opacity: 0;
}
.chart-collapse-body.open {
  max-height: 2000px;
  opacity: 1;
}
.chart-collapse-header.open { border-radius: 8px 8px 0 0; margin-bottom: 0; border-bottom: none; }
.chart-collapse-header.open + .chart-collapse-body { border: 1px solid var(--gray-2); border-top: none; border-radius: 0 0 8px 8px; }
.chart-collapse-header.open .chart-collapse-chevron { transform: rotate(180deg); }

/* Aggregated metrics table */
.agg-metrics-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0 16px; }
.agg-metrics-table th { text-align: left; padding: 6px 10px; background: var(--gray-2); color: var(--gray-9); font-weight: 600; border-bottom: 2px solid var(--gray-3); }
.agg-metrics-table td { padding: 5px 10px; border-bottom: 1px solid var(--gray-2); color: var(--gray-8); }
.agg-metrics-table tr:hover td { background: var(--gray-1); }
.agg-metrics-table .group-header td { font-weight: 600; background: var(--accent-light); color: var(--accent); }

/* Mermaid diagram standardization */
.mermaid { font-size: 14px !important; }
.mermaid svg { max-width: 100%; height: auto; }
#md-content .mermaid { margin: 16px 0; }

/* License pre */
.license-text {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.6;
  max-height: none;
}

/* Mermaid diagrams */
.mermaid-diagram {
  margin: 20px 0;
  text-align: center;
  overflow-x: auto;
}
.mermaid-diagram svg { max-width: 100%; height: auto; }

/* Responsive */
@media (max-width: 600px) {
  .content { padding: 20px 16px 48px; }
  h1 { font-size: 22px; }
  .figure img { width: 95%; }
  .figure figcaption { max-width: 95%; }
}
