/* =========================================================
   Design tokens — light + true-black dark
   ========================================================= */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-card-light: 0 1px 2px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-dark: 0 1px 2px rgba(0, 0, 0, 0.6),
    0 8px 24px rgba(0, 0, 0, 0.5);

  --max-w: 1200px;
  --max-w-narrow: 760px;
  --nav-h: 52px;
  --ticker-h: 48px;
}

/* Light palette */
:root,
html[data-theme="light"] {
  --bg: #ffffff;
  --bg-elev: #fafafa;
  --bg-subtle: #f5f5f7;
  --card: #ffffff;
  --card-hover: #f5f5f7;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.14);
  --text: #1d1d1f;
  --text-muted: #6e6e73;
  --text-dim: #86868b;
  --accent: #0071e3; /* Apple blue */
  --accent-hover: #0077ed;
  --accent-contrast: #ffffff;
  --nav-bg: rgba(255, 255, 255, 0.72);
  --nav-border: rgba(0, 0, 0, 0.08);
  --shadow-card: var(--shadow-card-light);
  --chart-line: #0071e3;
  --chart-fill-top: rgba(0, 113, 227, 0.22);
  --chart-fill-bot: rgba(0, 113, 227, 0);
}

/* True-black dark — #000 background so OLED goes off */
html[data-theme="dark"] {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-subtle: #0d0d0d;
  --card: #0c0c0c;
  --card-hover: #141414;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --text-muted: #a1a1a6;
  --text-dim: #6e6e73;
  --accent: #2997ff; /* Apple blue on dark */
  --accent-hover: #47a6ff;
  --accent-contrast: #000000;
  --nav-bg: rgba(0, 0, 0, 0.72);
  --nav-border: rgba(255, 255, 255, 0.08);
  --shadow-card: var(--shadow-card-dark);
  --chart-line: #2997ff;
  --chart-fill-top: rgba(41, 151, 255, 0.25);
  --chart-fill-bot: rgba(41, 151, 255, 0);
}

/* =========================================================
   Reset / base
   ========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--ticker-h) + 8px);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.35s var(--ease-out-smooth),
    color 0.35s var(--ease-out-smooth);
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

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

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  left: -10000px;
  top: 8px;
  background: var(--text);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  z-index: 1000;
}
.skip-link:focus {
  left: 12px;
}

/* =========================================================
   Top nav
   ========================================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--nav-border);
}

.nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav__mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.nav__links {
  margin-left: auto;
  display: flex;
  gap: 22px;
  font-size: 13px;
  color: var(--text-muted);
}

.nav__links a {
  transition: color 0.2s var(--ease-out-smooth);
}

.nav__links a:hover {
  color: var(--text);
}

.theme-toggle {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  transition: background-color 0.2s var(--ease-out-smooth),
    color 0.2s var(--ease-out-smooth);
}

.theme-toggle:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
}

.theme-toggle .icon-moon {
  display: none;
}
html[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}
html[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

@media (max-width: 520px) {
  .nav__links {
    display: none;
  }
}

/* =========================================================
   Ticker strip — sticky, under nav
   ========================================================= */
.ticker {
  position: sticky;
  top: var(--nav-h);
  z-index: 40;
  height: var(--ticker-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.ticker .tradingview-widget-container,
.ticker .tradingview-widget-container__widget {
  height: 100%;
}

/* =========================================================
   Generic section shell
   ========================================================= */
.section {
  padding: clamp(72px, 10vw, 140px) 22px;
}

.section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section__inner--narrow {
  max-width: var(--max-w-narrow);
}

.section__head {
  text-align: center;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section__head--left {
  text-align: left;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(32px, 4.4vw, 56px);
  line-height: 1.08;
  margin: 0 0 16px;
}

.section__sub {
  color: var(--text-muted);
  font-size: clamp(16px, 1.6vw, 19px);
  max-width: 640px;
  margin: 0 auto;
}

.section__head--left .section__sub {
  margin: 0;
}

/* =========================================================
   Hero
   ========================================================= */
.hero {
  position: relative;
  min-height: calc(100dvh - var(--nav-h) - var(--ticker-h));
  padding: clamp(72px, 12vw, 140px) 22px clamp(64px, 10vw, 120px);
  overflow: hidden;
  text-align: center;
  display: grid;
  place-items: center;
}

.hero__inner {
  max-width: 920px;
  margin: 0 auto;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: clamp(30px, 7.6vw, 96px);
  line-height: 1;
  margin: 0 0 22px;
  color: var(--text);
  text-wrap: balance;
}

.hero__suffix {
  font-weight: 500;
  color: var(--text);
}

.hero__lede {
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 32px;
}

.hero__cta {
  display: inline-flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* =========================================================
   Buttons
   ========================================================= */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  transition: transform 0.2s var(--ease-out-expo),
    background-color 0.2s var(--ease-out-smooth),
    color 0.2s var(--ease-out-smooth),
    border-color 0.2s var(--ease-out-smooth);
  will-change: transform;
}

.button:active {
  transform: scale(0.97);
}

.button--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.button--primary:hover {
  background: var(--accent-hover);
}

.button--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.button--ghost:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
}

/* =========================================================
   Markets — mini card grid
   ========================================================= */
.mini-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.mini-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.35s var(--ease-out-expo),
    border-color 0.35s var(--ease-out-smooth),
    background-color 0.35s var(--ease-out-smooth),
    box-shadow 0.35s var(--ease-out-smooth);
  overflow: hidden;
  isolation: isolate;
}

.mini-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  background: var(--card-hover);
}

.mini-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mini-card__symbol {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.mini-card__name {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mini-card__chev {
  color: var(--text-dim);
  font-size: 18px;
  transition: color 0.2s var(--ease-out-smooth),
    transform 0.3s var(--ease-out-expo);
}

.mini-card:hover .mini-card__chev {
  color: var(--accent);
  transform: translate(2px, -2px);
}

.mini-card__chart {
  position: relative;
  min-height: 200px;
  margin: 0 -18px;
}

.mini-card__chart iframe {
  width: 100% !important;
  border: 0;
  display: block;
}

/* =========================================================
   About
   ========================================================= */
.about {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.prose p {
  font-size: clamp(17px, 1.8vw, 20px);
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 18px;
}

.prose p + p {
  color: var(--text-muted);
}

/* =========================================================
   Connect — social cards
   ========================================================= */
.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.social-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform 0.3s var(--ease-out-expo),
    background-color 0.2s var(--ease-out-smooth),
    border-color 0.2s var(--ease-out-smooth);
}

.social-card:hover {
  transform: translateY(-2px);
  background: var(--card-hover);
  border-color: var(--border-strong);
}

.social-card svg {
  width: 22px;
  height: 22px;
  color: var(--text);
  flex-shrink: 0;
}

.social-card__label {
  font-size: 15px;
  font-weight: 500;
}

.social-card__handle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 1px;
}

.social-card__chev {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 16px;
  transition: color 0.2s var(--ease-out-smooth),
    transform 0.3s var(--ease-out-expo);
}

.social-card:hover .social-card__chev {
  color: var(--accent);
  transform: translate(2px, -2px);
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 22px;
  background: var(--bg);
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-dim);
}

.footer__disclaimer {
  max-width: 520px;
  margin: 0;
  text-align: right;
}

.footer__line {
  margin: 0;
}

@media (max-width: 640px) {
  .footer__inner {
    flex-direction: column;
  }
  .footer__disclaimer {
    text-align: left;
  }
}
