/* ==========================================================================
   Aurora — visual system, extending JBI tokens.

   Aurora is the data-driven, "system" face of JBI: monospace numerals,
   fine hairline grids, indigo + orange + ink. Editorial JP serif headlines
   carry over from the parent brand.
   ========================================================================== */

@import url("./jbi-tokens.css");
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap");

:root {
  /* Aurora-specific aliases */
  --aurora-bg: var(--jbi-paper);
  --aurora-bg-deep: var(--jbi-paper-deep);
  --aurora-surface: var(--jbi-surface);
  --aurora-ink: var(--jbi-ink);
  --aurora-orange: var(--jbi-orange);
  --aurora-indigo: var(--jbi-indigo);
  --aurora-line: var(--jbi-paper-line);
  --aurora-line-strong: #C9BFA6;
  --aurora-mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* Status hues for live ticker / settlement states */
  --aurora-live: #2F7A4F;      /* settled / received */
  --aurora-pending: #C18213;   /* waiting on chain */
  --aurora-danger: #B23227;
}

/* ---------- Page chrome ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--aurora-bg);
  color: var(--aurora-ink);
  font-family: var(--font-sans-jp);
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Site-wide chrome ---------- */
.au-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 237, 224, 0.96);
  backdrop-filter: saturate(120%) blur(6px);
  border-bottom: 1px solid transparent;
  transition: border-color 240ms var(--ease-out);
}
.au-header.scrolled { border-bottom-color: var(--aurora-line); }
.au-header__inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.au-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.au-brand__mark {
  width: 28px;
  height: 28px;
  position: relative;
  display: inline-block;
}
.au-brand__mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--aurora-orange);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}
.au-brand__mark::after {
  content: "";
  position: absolute;
  left: 7px; top: 4px;
  width: 14px; height: 20px;
  background: var(--aurora-ink);
  clip-path: polygon(40% 0, 100% 0, 60% 45%, 100% 45%, 0 100%, 40% 55%, 0 55%);
}
.au-brand__wordmark {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--aurora-ink);
}
.au-brand__wordmark em {
  font-style: normal;
  color: var(--aurora-orange);
}
.au-brand__suffix {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 12px;
  color: var(--jbi-ink-muted);
  margin-left: 4px;
  letter-spacing: 0.08em;
}
.au-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}
.au-nav__link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--aurora-ink);
  letter-spacing: 0.02em;
  padding: 8px 0;
  position: relative;
}
.au-nav__link:hover { color: var(--aurora-orange); }
.au-nav__link--en {
  font-family: var(--font-serif-en);
  font-style: italic;
  letter-spacing: 0.14em;
  color: var(--aurora-orange);
  font-size: 12.5px;
}
.au-nav__cta {
  background: var(--aurora-ink);
  color: var(--jbi-paper);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 200ms var(--ease-out);
}
.au-nav__cta:hover { background: var(--aurora-orange); color: #fff; }

/* ---------- Footer ---------- */
.au-footer {
  background: var(--aurora-ink);
  color: var(--jbi-paper-warm);
  padding: 80px 40px 40px;
}
.au-footer__inner {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 60px;
}
.au-footer__brand {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 16px;
}
.au-footer__brand em {
  color: var(--aurora-orange);
  font-style: normal;
}
.au-footer__tagline {
  font-size: 13px;
  color: rgba(244, 237, 224, 0.6);
  line-height: 1.8;
  max-width: 280px;
}
.au-footer__heading {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aurora-orange);
  margin-bottom: 16px;
  font-weight: 500;
}
.au-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.au-footer__list a {
  font-size: 13.5px;
  color: rgba(244, 237, 224, 0.85);
  transition: color 200ms var(--ease-out);
}
.au-footer__list a:hover { color: var(--aurora-orange); }
.au-footer__legal {
  max-width: 1320px;
  margin: 60px auto 0;
  padding-top: 28px;
  border-top: 1px solid rgba(244, 237, 224, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: rgba(244, 237, 224, 0.5);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---------- Layout atoms ---------- */
.au-section {
  padding: 120px 40px;
}
.au-section--tight { padding: 72px 40px; }
.au-section--deep { background: var(--aurora-bg-deep); }
.au-section--ink { background: var(--aurora-ink); color: var(--jbi-paper-warm); }
.au-section__inner {
  max-width: 1280px;
  margin: 0 auto;
}
.au-overline {
  display: inline-block;
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aurora-orange);
  font-weight: 500;
}
.au-overline--mono {
  font-family: var(--font-mono);
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--jbi-ink-muted);
}
.au-section--ink .au-overline--mono { color: rgba(244, 237, 224, 0.5); }

.au-h1 {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: clamp(48px, 6.2vw, 84px);
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0;
}
.au-h2 {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: clamp(36px, 4vw, 56px);
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0;
}
.au-h3 {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}
.au-highlight { color: var(--aurora-orange); }
.au-subhead-en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 18px;
  color: var(--jbi-ink-muted);
  margin: 18px 0 0;
}
.au-lead {
  font-size: 17px;
  line-height: 1.95;
  color: var(--jbi-ink-soft);
  max-width: 640px;
  margin: 0;
}

/* ---------- Buttons ---------- */
.au-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 0;
  border-radius: 0;
  transition: all 200ms var(--ease-out);
}
.au-btn--primary { background: var(--aurora-ink); color: var(--jbi-paper); }
.au-btn--primary:hover { background: var(--aurora-orange); color: #fff; }
.au-btn--accent { background: var(--aurora-orange); color: #fff; }
.au-btn--accent:hover { background: var(--jbi-orange-600); }
.au-btn--ghost {
  background: transparent;
  color: var(--aurora-ink);
  border: 1px solid var(--aurora-ink);
}
.au-btn--ghost:hover { background: var(--aurora-ink); color: var(--jbi-paper); }
.au-btn--ink-ghost {
  background: transparent;
  color: var(--jbi-paper-warm);
  border: 1px solid rgba(244, 237, 224, 0.4);
}
.au-btn--ink-ghost:hover { background: var(--jbi-paper-warm); color: var(--aurora-ink); }
.au-btn__arrow {
  display: inline-block;
  width: 16px;
  height: 1px;
  background: currentColor;
  position: relative;
  transition: transform 200ms var(--ease-out);
}
.au-btn__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 8px;
  height: 8px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}
.au-btn:hover .au-btn__arrow { transform: translateX(4px); }

/* ---------- Stat / data atoms ---------- */
.au-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.au-stat__num {
  font-family: var(--font-serif-jp);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--aurora-ink);
}
.au-stat__num--mono {
  font-family: var(--font-mono);
  font-weight: 600;
}
.au-stat__unit {
  font-size: 24px;
  font-weight: 600;
  margin-left: 6px;
  color: var(--jbi-ink-muted);
}
.au-stat__label {
  font-size: 13px;
  color: var(--jbi-ink-muted);
  letter-spacing: 0.02em;
  line-height: 1.5;
}
.au-stat__label em {
  font-family: var(--font-serif-en);
  font-style: italic;
  color: var(--aurora-orange);
  letter-spacing: 0.06em;
  font-size: 12px;
  margin-right: 6px;
}

/* ---------- Mono tag / chip ---------- */
.au-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
  background: var(--aurora-surface);
  border: 1px solid var(--aurora-line);
  color: var(--jbi-ink-soft);
}
.au-tag--ink {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.15);
  color: var(--jbi-paper-warm);
}
.au-tag--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--aurora-live);
  box-shadow: 0 0 0 0 rgba(47, 122, 79, 0.5);
  animation: aurora-pulse 1.6s infinite;
}
@keyframes aurora-pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 122, 79, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(47, 122, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 122, 79, 0); }
}

/* ---------- Card surfaces ---------- */
.au-card {
  background: var(--aurora-surface);
  border: 1px solid var(--aurora-line);
  padding: 32px;
}
.au-card--inset {
  background: var(--jbi-surface-tint);
  border: 1px solid var(--aurora-line);
}

/* ---------- Tables ---------- */
.au-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.au-table th, .au-table td {
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid var(--aurora-line);
  vertical-align: top;
}
.au-table th {
  font-weight: 600;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--jbi-ink-muted);
  background: var(--jbi-surface-tint);
  border-bottom-color: var(--aurora-line-strong);
}
.au-table tr:last-child td { border-bottom: 0; }
.au-table td .au-cell-mono {
  font-family: var(--font-mono);
  font-size: 13px;
}
.au-table .good { color: var(--aurora-live); font-weight: 600; }
.au-table .bad { color: var(--aurora-danger); font-weight: 600; }
.au-table .meh { color: var(--aurora-pending); font-weight: 600; }

/* ---------- Mark / annotation badges ---------- */
.au-check, .au-cross, .au-tilde {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  margin-right: 8px;
  vertical-align: -3px;
}
.au-check { color: var(--aurora-live); }
.au-check::before { content: "✓"; }
.au-cross { color: var(--aurora-danger); }
.au-cross::before { content: "✗"; }
.au-tilde { color: var(--aurora-pending); }
.au-tilde::before { content: "〜"; }

/* ---------- Construction-state banner ---------- */
.au-construction {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(232, 154, 44, 0.12);
  border: 1px solid var(--aurora-orange);
  color: var(--jbi-orange-700);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.au-construction::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--aurora-orange);
  display: inline-block;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .au-section { padding: 80px 24px; }
  .au-header__inner { padding: 14px 20px; }
  .au-nav { display: none; }
  .au-footer__inner { grid-template-columns: 1fr 1fr; gap: 40px; }
}
