/* ==========================================================================
   Boruto.fun -- Stylesheet
   Design system: dark charcoal ground, crimson + gold ink accents.
   Typographic display face (Space Grotesk) + body face (Inter).
   ========================================================================== */

:root {
  /* Color */
  --bg: #14110F;
  --bg-raised: #1B1714;
  --surface: #1F1A16;
  --surface-2: #251F19;
  --border: #322A23;
  --border-strong: #453930;
  --text: #F3ECE2;
  --text-muted: #A89C8D;
  --text-faint: #7A6E60;
  --crimson: #B4272A;
  --crimson-dim: #7E1E20;
  --crimson-tint: rgba(180, 39, 42, 0.12);
  --gold: #C1912F;
  --gold-dim: #8C6A22;
  --gold-tint: rgba(193, 145, 47, 0.12);
  --positive: #5C8F5F;
  --negative: #B4272A;

  /* Type */
  --font-display: "Space Grotesk", "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --container: 1180px;
  --radius-sm: 3px;
  --radius: 6px;
  --border-hairline: 1px solid var(--border);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, button { font-family: inherit; font-size: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid var(--crimson);
  background: transparent;
  flex-shrink: 0;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  font-family: var(--font-display);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--crimson);
  color: #F8EDE9;
  border-color: var(--crimson);
}
.btn-primary:hover { background: #9E2124; }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
  padding: 10px 14px;
}
.btn-ghost:hover { color: var(--text); }
.btn-small { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Navbar ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(20, 17, 15, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: var(--border-hairline);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}
.nav-links a {
  font-size: 14.5px;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  position: relative;
}
.nav-toggle span::before, .nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: var(--border-hairline);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .nav-links.is-open { max-height: 320px; }
  .nav-links a {
    padding: 16px 24px;
    border-top: var(--border-hairline);
  }
  .nav-toggle { display: inline-flex; }
}

/* ---- Hero ---- */
.hero {
  padding: 96px 0 64px;
  border-bottom: var(--border-hairline);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 640px) 1fr;
  gap: 48px;
  align-items: start;
}
.hero-eyebrow { margin-bottom: 22px; }
.hero h1 {
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 700;
  margin-bottom: 22px;
}
.hero h1 em { color: var(--crimson); font-style: normal; }
.hero-sub {
  font-size: 18px;
  color: var(--text-muted);
  max-width: 52ch;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats {
  display: grid;
  gap: 20px;
  padding-top: 6px;
}
.hero-stat {
  border-left: 2px solid var(--crimson);
  padding-left: 16px;
}
.hero-stat .num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
}
.hero-stat .label {
  font-size: 13px;
  color: var(--text-faint);
  margin-top: 2px;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* ---- Ticker / signature scroll ---- */
.scroll-strip {
  border-bottom: var(--border-hairline);
  background: var(--bg-raised);
  overflow: hidden;
  position: relative;
}
.scroll-strip::before, .scroll-strip::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 60px;
  z-index: 2;
  pointer-events: none;
}
.scroll-strip::before { left: 0; background: linear-gradient(90deg, var(--bg-raised), transparent); }
.scroll-strip::after { right: 0; background: linear-gradient(270deg, var(--bg-raised), transparent); }
.scroll-track {
  display: flex;
  width: max-content;
  animation: scroll-left 38s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .scroll-track { animation: none; overflow-x: auto; }
}
@keyframes scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  font-family: var(--font-display);
  font-size: 14px;
  white-space: nowrap;
  border-right: var(--border-hairline);
}
.ticker-item .sym { color: var(--text); font-weight: 600; }
.ticker-item .px { color: var(--text-muted); }
.ticker-item .chg.up { color: var(--positive); }
.ticker-item .chg.down { color: var(--crimson); }
.seal-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  flex-shrink: 0;
}

/* ---- Sections ---- */
.section { padding: 88px 0; border-bottom: var(--border-hairline); }
.section-head {
  max-width: 640px;
  margin-bottom: 52px;
}
.section-head .eyebrow { margin-bottom: 16px; }
.section-head h2 { font-size: clamp(28px, 3.4vw, 40px); margin-bottom: 14px; }
.section-head p { color: var(--text-muted); font-size: 17px; }

/* ---- Feature cards ---- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1px;
  background: var(--border);
  border: var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature-card {
  background: var(--surface);
  padding: 32px 28px;
}
.feature-card .fc-index {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 18px;
  display: block;
}
.feature-card h3 { font-size: 19px; margin-bottom: 10px; }
.feature-card p { color: var(--text-muted); font-size: 14.5px; }

/* ---- Steps ---- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.step {
  padding: 30px 26px;
  border-right: var(--border-hairline);
  background: var(--surface);
}
.step:last-child { border-right: none; }
.step .step-num {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--crimson);
  font-weight: 700;
  margin-bottom: 16px;
}
.step h3 { font-size: 16.5px; margin-bottom: 8px; }
.step p { color: var(--text-muted); font-size: 14px; }
@media (max-width: 900px) {
  .steps { grid-template-columns: 1fr 1fr; }
  .step:nth-child(2) { border-right: none; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: var(--border-hairline); }
  .step:last-child { border-bottom: none; }
}

/* ---- Chakra explainer block ---- */
.explainer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.explainer-panel {
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius);
  padding: 32px;
}
.gauge-row { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.gauge-num { font-family: var(--font-display); font-size: 52px; font-weight: 700; color: var(--crimson); }
.gauge-band { font-family: var(--font-display); font-size: 14px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.gauge-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.gauge-fill { height: 100%; background: var(--crimson); width: 62%; }
.gauge-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-faint); }
.explainer-copy h2 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 16px; }
.explainer-copy p { color: var(--text-muted); font-size: 16px; margin-bottom: 16px; }
.explainer-copy p:last-child { margin-bottom: 0; }
@media (max-width: 900px) {
  .explainer { grid-template-columns: 1fr; gap: 32px; }
}

/* ---- FAQ ---- */
.faq-list { border-top: var(--border-hairline); }
.faq-item { border-bottom: var(--border-hairline); }
.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: transparent;
  border: none;
  padding: 22px 4px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
}
.faq-q .icon { color: var(--gold); font-size: 18px; flex-shrink: 0; transition: transform 0.2s ease; }
.faq-item[data-open="true"] .icon { transform: rotate(45deg); }
.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  color: var(--text-muted);
  font-size: 15px;
  padding: 0 4px;
}
.faq-item[data-open="true"] .faq-a { padding-bottom: 22px; }

/* ---- Final CTA ---- */
.final-cta {
  padding: 96px 0;
  text-align: center;
}
.final-cta h2 { font-size: clamp(28px, 3.6vw, 42px); margin-bottom: 18px; }
.final-cta p { color: var(--text-muted); font-size: 17px; margin-bottom: 34px; max-width: 52ch; margin-left: auto; margin-right: auto; }
.final-cta .hero-actions { justify-content: center; }

/* ---- Footer ---- */
.footer { padding: 56px 0 40px; }
.footer-top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: var(--border-hairline);
  margin-bottom: 28px;
}
.footer-tagline { max-width: 380px; color: var(--text-muted); font-size: 14.5px; margin-top: 14px; }
.footer-links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.footer-col a { display: block; font-size: 14.5px; color: var(--text-muted); margin-bottom: 10px; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-faint);
}
.footer-bottom p { max-width: 620px; }

/* ==========================================================================
   App page
   ========================================================================== */
.app-shell { padding: 40px 0 100px; }
.app-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.app-head h1 { font-size: clamp(26px, 3vw, 34px); margin-bottom: 8px; }
.app-head p { color: var(--text-muted); font-size: 15px; max-width: 56ch; }

.status-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-faint); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--positive); }
.status-dot.error { background: var(--crimson); }

.chakra-card {
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
}
.chakra-title { font-family: var(--font-display); font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold); margin-bottom: 8px; }
.chakra-num-row { display: flex; align-items: baseline; gap: 10px; }
.chakra-num { font-family: var(--font-display); font-size: 40px; font-weight: 700; }
.chakra-band { font-family: var(--font-display); font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.chakra-bar-wrap { width: 100%; }
.chakra-bar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.chakra-fill { height: 100%; background: var(--crimson); width: 0%; transition: width 0.4s ease; }
.chakra-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-faint); margin-top: 6px; }
.chakra-info-btn { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 13px; }
.chakra-info-btn:hover { color: var(--text); border-color: var(--gold); }
.chakra-detail {
  grid-column: 1 / -1;
  border-top: var(--border-hairline);
  padding-top: 18px;
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
  display: none;
}
.chakra-detail.is-open { display: block; }
@media (max-width: 720px) {
  .chakra-card { grid-template-columns: 1fr; }
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: var(--border-hairline);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-faint);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab-btn.is-active { color: var(--text); border-bottom-color: var(--crimson); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.search-input {
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  min-width: 240px;
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus { border-color: var(--gold); }

.table-wrap {
  border: var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
thead th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  background: var(--surface-2);
  padding: 12px 16px;
  border-bottom: var(--border-hairline);
  cursor: pointer;
  white-space: nowrap;
}
thead th:hover { color: var(--text-muted); }
tbody td { padding: 14px 16px; border-bottom: var(--border-hairline); background: var(--surface); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
.coin-cell { display: flex; align-items: center; gap: 10px; }
.coin-cell img { width: 22px; height: 22px; border-radius: 50%; }
.coin-name { font-weight: 600; }
.coin-sym { color: var(--text-faint); font-size: 12.5px; text-transform: uppercase; }
.chg-up { color: var(--positive); }
.chg-down { color: var(--crimson); }
.star-btn { background: transparent; border: none; color: var(--text-faint); font-size: 18px; padding: 0; line-height: 1; }
.star-btn.is-active { color: var(--gold); }
.remove-btn { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 12.5px; }
.remove-btn:hover { border-color: var(--crimson); color: var(--crimson); }

.empty-state, .loading-state, .error-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius);
}
.error-state { color: var(--text); }
.error-state .btn { margin-top: 16px; }

.wallet-form {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.wallet-form input { flex: 1; min-width: 260px; }
.wallet-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--border);
  border: var(--border-hairline);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.wallet-stat { background: var(--surface); padding: 20px; }
.wallet-stat .label { font-size: 12.5px; color: var(--text-faint); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.wallet-stat .value { font-family: var(--font-display); font-size: 22px; font-weight: 700; }

.alert-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 24px;
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius);
  padding: 20px;
}
.alert-form select, .alert-form input {
  background: var(--surface-2);
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--text);
  width: 100%;
}
@media (max-width: 780px) {
  .alert-form { grid-template-columns: 1fr 1fr; }
}
.alert-list { display: grid; gap: 10px; }
.alert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  flex-wrap: wrap;
}
.alert-row .desc { font-size: 14.5px; }
.alert-row .desc strong { font-family: var(--font-display); }
.alert-row .meta { font-size: 12.5px; color: var(--text-faint); margin-top: 3px; }
.alert-banner {
  background: var(--crimson-tint);
  border: 1px solid var(--crimson);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.alert-banner button { background: transparent; border: none; color: var(--text-muted); font-size: 13px; }

.notice-inline {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 20px;
}

/* Utility */
.text-center { text-align: center; }
.mt-24 { margin-top: 24px; }
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--crimson);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
}
.skip-link:focus { left: 16px; top: 16px; }
