/*
  WCAG contrast ratios (computed with the WCAG 2.x relative-luminance formula;
  AA requires 4.5:1 for normal text and 3:1 for large text):
    Ink #0F172A on white #FFFFFF ............ 17.85:1
    Ink #0F172A on blue tint #EFF6FF ........ 16.40:1
    Ink #0F172A on lavender tint #EEF2FF .... 15.97:1
    Accent #2563EB on white #FFFFFF .........  5.17:1
    White #FFFFFF on accent #2563EB .........  5.17:1
    Accent dark #1D4ED8 on white #FFFFFF ....  6.70:1
    White #FFFFFF on accent dark #1D4ED8 ....  6.70:1
    Muted #475569 on white #FFFFFF ..........  7.58:1
    Muted #475569 on blue tint #EFF6FF ......  6.96:1
    Muted #475569 on surface #F8FAFC ........  7.24:1
    Success #15803D on #F0FDF4 ..............  4.79:1
    Warning #B45309 on #FFFBEB ..............  4.84:1
    Danger #B91C1C on #FEF2F2 ...............  5.91:1
  All text/background pairs above meet WCAG AA for normal text.
*/

:root {
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --tint-blue: #EFF6FF;
  --tint-lavender: #EEF2FF;
  --ink: #0F172A;
  --muted: #475569;
  --accent: #2563EB;
  --accent-dark: #1D4ED8;
  --border: #E2E8F0;
  --success-text: #15803D;
  --success-bg: #F0FDF4;
  --warning-text: #B45309;
  --warning-bg: #FFFBEB;
  --danger-text: #B91C1C;
  --danger-bg: #FEF2F2;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font-ui: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  word-break: break-all;
}

a { color: var(--accent-dark); }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 50;
  background: var(--surface);
  color: var(--accent-dark);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.skip-link:focus-visible { top: 12px; }

/* ---------- Layout ---------- */
.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.main-column { min-width: 0; display: flex; flex-direction: column; }

.main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 1.25rem;
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.1rem; letter-spacing: -0.01em; }
.brand-text small { color: var(--muted); font-size: 0.82rem; }

.side-nav { display: flex; flex-direction: column; gap: 6px; }

.side-nav-link {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
}
.side-nav-link:hover { background: var(--tint-blue); }
.side-nav-link.is-active { background: var(--tint-lavender); color: var(--accent-dark); }

.sidebar-card {
  background: var(--tint-blue);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.92rem;
}
.sidebar-card p { margin: 0; color: var(--ink); }
.sidebar-card-title { font-weight: 800; margin-bottom: 6px !important; }

.sidebar-foot { margin-top: auto; color: var(--muted); font-size: 0.85rem; font-weight: 600; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.topbar h1 { margin: 0; font-size: 1.55rem; letter-spacing: -0.02em; }
.topbar-eyebrow {
  margin: 0 0 2px;
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.network-badge, .preview-badge {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.network-badge { background: var(--tint-blue); color: var(--accent-dark); }
.preview-badge { background: var(--warning-bg); color: var(--warning-text); }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(120deg, var(--tint-blue), var(--tint-lavender));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 24px;
}

.hero h2 { margin: 4px 0 10px; font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.2; }
.hero-copy p { margin: 0; max-width: 56ch; }

.eyebrow {
  color: var(--accent-dark);
  font-weight: 800;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.hero-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hero-points li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero-points span { color: var(--muted); font-size: 0.92rem; }

/* ---------- Banners / notice ---------- */
.preview-banner {
  background: var(--warning-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-left: 5px solid var(--warning-text);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 0.95rem;
}

.notice {
  background: var(--tint-lavender);
  border: 1px solid var(--border);
  border-left: 5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-weight: 600;
}

/* ---------- Sections ---------- */
.section-head { margin-bottom: 16px; }
.section-head h2, .panel h2, .risk h2 { margin: 0 0 6px; font-size: 1.35rem; letter-spacing: -0.01em; }
.section-sub { margin: 0; color: var(--muted); max-width: 70ch; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
}

/* ---------- Sale cards ---------- */
.sale-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.sale-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sale-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sale-card h3 { margin: 0; font-size: 1.08rem; letter-spacing: -0.01em; }
.sale-ticker {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent-dark);
  font-size: 0.88rem;
}
.sale-line { margin: 2px 0 0; color: var(--muted); font-size: 0.93rem; }

.status-chip {
  flex: none;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.status-chip--live { background: var(--success-bg); color: var(--success-text); }
.status-chip--upcoming { background: var(--tint-blue); color: var(--accent-dark); }
.status-chip--soldout { background: var(--tint-lavender); color: var(--ink); }
.status-chip--ended { background: var(--danger-bg); color: var(--danger-text); }

.sale-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 0.9rem;
}
.sale-meta dt { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.sale-meta dd { margin: 2px 0 0; font-weight: 700; }
.mono { font-family: var(--font-mono); font-weight: 600; }

.progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.progress-label { font-size: 0.9rem; font-weight: 600; }
.progress-label .mono { color: var(--ink); }

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: var(--tint-lavender);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 900ms ease-out;
}

.sale-address { font-size: 0.85rem; color: var(--muted); margin: 0; }
.sale-address code { color: var(--ink); }

.btn-primary {
  margin-top: auto;
  appearance: none;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 800;
  padding: 12px 16px;
  cursor: pointer;
  width: 100%;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary[disabled] {
  background: var(--tint-lavender);
  color: var(--muted);
  cursor: not-allowed;
}

.noscript-note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

/* ---------- Steps ---------- */
.steps {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.step {
  background: var(--tint-blue);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.step-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 800;
  margin-bottom: 10px;
}
.step h3 { margin: 0 0 6px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* ---------- Powers ---------- */
.powers-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.powers-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.powers-card--can { background: var(--success-bg); }
.powers-card--cannot { background: var(--danger-bg); }
.powers-card h3 { margin: 0 0 10px; font-size: 1.02rem; }
.powers-card ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

.contract-note { margin: 18px 0 0; color: var(--muted); font-size: 0.92rem; }
.contract-note code { color: var(--ink); }
.contract-note span { display: block; }

/* ---------- Risk / footer ---------- */
.risk {
  background: var(--danger-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--danger-text);
  border-radius: var(--radius);
  padding: 22px 26px;
}
.risk p { margin: 0; max-width: 75ch; }

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 20px 28px 28px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer p { margin: 4px 0; max-width: 80ch; }
.footer strong { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .sale-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-card, .sidebar-foot { display: none; }

  .hero { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .powers-grid { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 32px; }
  .topbar { padding: 16px 20px; }
}

@media (max-width: 620px) {
  .sale-grid { grid-template-columns: 1fr; }
  .hero { padding: 20px; }
  .panel { padding: 20px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-fill { transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
