/* =====================================================================
   BASE DESIGN SYSTEM — shared by every site built from this template.
   Colors live as tokens on :root; config.js overrides the accent,
   radius and fonts at runtime.
   ===================================================================== */

/* ---------- tokens: light ---------- */
:root {
  --accent-light: #2563eb;
  --accent-dark: #60a5fa;
  --accent: var(--accent-light);
  --accent-ink: #ffffff;            /* text on accent */
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);

  --bg: #ffffff;
  --bg-subtle: #f7f6f3;             /* neutrals lean a touch warm to sit with bronze */
  --surface: #ffffff;
  --border: #e8e5de;
  --border-strong: #d8d3c8;

  /* hover glow (the Launchpad-style highlight used site-wide): bronze → gold */
  --glow-1: #8A6A1F;
  --glow-2: #E8C36A;
  --glow-strength: .11;
  --hover-fill: color-mix(in srgb, var(--accent) 4%, var(--surface));
  --text: #0b0b0f;
  --text-muted: #5c5c66;
  --text-faint: #8a8a94;

  --up: #15803d;
  --down: #b91c1c;

  --radius: 12px;
  --radius-sm: calc(var(--radius) * 0.6);
  --shadow: 0 1px 2px rgba(10, 10, 20, .04), 0 4px 16px rgba(10, 10, 20, .04);
  --shadow-lg: 0 2px 4px rgba(10, 10, 20, .04), 0 12px 32px rgba(10, 10, 20, .08);

  --font-heading: "Inter Tight", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --header-h: 64px;
  --maxw: 1120px;
  --gutter: 24px;

  color-scheme: light;
}

/* ---------- tokens: dark ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: var(--accent-dark);
    --accent-ink: #0b0b0f;
    --bg: #0b0a09;
    --bg-subtle: #14130f;
    --surface: #161511;
    --border: #2a271f;
    --border-strong: #3a352a;
    --glow-1: #B8892E;
    --glow-2: #F0D08A;
    --glow-strength: .12;
    --hover-fill: color-mix(in srgb, var(--accent) 6%, var(--surface));
    --text: #f4f4f6;
    --text-muted: #a1a1ab;
    --text-faint: #6e6e78;
    --up: #4ade80;
    --down: #f87171;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --accent: var(--accent-dark);
  --accent-ink: #0b0b0f;
  --bg: #0b0a09;
  --bg-subtle: #14130f;
  --surface: #161511;
  --border: #2a271f;
  --border-strong: #3a352a;
  --glow-1: #B8892E;
  --glow-2: #F0D08A;
  --glow-strength: .12;
  --hover-fill: color-mix(in srgb, var(--accent) 6%, var(--surface));
  --text: #f4f4f6;
  --text-muted: #a1a1ab;
  --text-faint: #6e6e78;
  --up: #4ade80;
  --down: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--tape-h, 0px) + 16px); }
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;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.4rem, 6vw, 4.25rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.15rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; }
.muted { color: var(--text-muted); }
.eyebrow {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--text-muted); max-width: 40em; }

/* ---------- shared header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.site-header.scrolled { border-bottom-color: var(--border); }
/* live price band under the menu (part of the sticky header, so it follows you down the page) */
:root.has-tape { --tape-h: 46px; }
.site-header .tape { height: var(--tape-h, 46px); overflow: hidden; border-top: 1px solid var(--border); }
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  min-width: 0;
}
.brand-name { overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, var(--glow-2)), var(--accent));
  color: var(--accent-ink);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
/* header icon as a logo image (config.monogramImage) */
/* round badge: the image is zoomed so a round logo fills it edge to edge (trims the file's white margin) */
.brand-mark--img {
  width: 36px; height: 36px; border-radius: 50%;
  background: transparent; padding: 0; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}
.brand-mark--img img { width: 100%; height: 100%; object-fit: contain; transform: scale(var(--mark-zoom, 1.82)); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: .9rem;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--bg-subtle); }
.nav a[aria-current="page"] { color: var(--text); background: var(--bg-subtle); font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color .15s;
}
.icon-btn:hover { border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}
.menu-btn { display: none; }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .header-inner { gap: 12px; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { display: none; }
  .menu-btn { display: grid; }
  .nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 2px;
    padding: 8px var(--gutter) 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    margin: 0;
    display: none;
  }
  .site-header.open .nav { display: flex; }
  .nav a { padding: 12px; border-radius: var(--radius-sm); font-size: 1rem; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 500;
  font-size: .95rem;
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: transform .15s, opacity .15s, background .15s, box-shadow .2s;
}
.btn:hover { box-shadow: 0 6px 20px color-mix(in srgb, var(--glow-2) 35%, transparent); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--hover-fill); border-color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: .85rem; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sections & cards ---------- */
.section { padding: clamp(56px, 9vw, 112px) 0; }
.section + .section { border-top: 1px solid var(--border); }
.section-head { margin-bottom: 40px; max-width: 640px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
a.card:hover, .card.hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* always an even 2-up */
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .grid-3 { grid-template-columns: 1fr; } }

/* small card labels ("Student-Managed Fund", "New York"…): plain bronze small caps,
   the same style as the box headings, no outline */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
/* status badges (the Markets "M", Launchpad "App") keep a small outline so they read as badges */
.em-table .tag, .fineprint .tag, .launch-tag {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-muted);
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; font-size: .875rem; color: var(--text-muted); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--text); }
.photo-credit { color: var(--text-faint); font-size: .8rem; }
.photo-credit:hover { color: var(--text); }

/* ---------- end of page: back to top + next tab (built in site.js) ---------- */
.next-up { border-top: 1px solid var(--border); padding: clamp(56px, 9vw, 104px) 0 clamp(36px, 5vw, 64px); }
.next-inner { display: grid; gap: 24px; }
.to-top {
  justify-self: start; display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 15px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  transition: border-color .2s, color .2s;
}
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top-arrow { display: inline-block; transition: transform .3s ease; }
.to-top:hover .to-top-arrow { transform: translateY(-3px); }
.next-link {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px 24px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.next-link .eyebrow { grid-column: 1 / -1; margin: 0; }
.next-name {
  font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.045em;
  font-size: clamp(2.75rem, 10vw, 7.5rem); line-height: 1.05; transition: color .25s;
}
.next-arrow { font-size: clamp(1.75rem, 5vw, 4rem); line-height: 1.05; color: var(--text-muted); transition: transform .35s ease, color .25s; }
.next-link:hover .next-name, .next-link:hover .next-arrow { color: var(--accent); }
.next-link:hover .next-arrow { transform: translateX(10px); }

/* ---------- letter roll on hover (wired in site.js) ----------
   Each letter stays in normal flow with a copy parked one line below it. clip-path
   (not overflow:hidden, which would move the text baseline) shows one line; hovering
   slides letter + copy up one line, letter by letter (--i staggers them). */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.roll { white-space: nowrap; }
.roll-ch { display: inline-block; clip-path: inset(0 -0.15em); }
.roll-in { display: inline-block; position: relative; transition: transform .5s cubic-bezier(.65, 0, .35, 1); transition-delay: calc(var(--i) * 24ms); }
.roll-copy { position: absolute; left: 0; top: 100%; }
.is-rolled .roll-in { transform: translateY(-100%); }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.reveal.done {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease, opacity .2s ease;
  transition-delay: 0s;
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.done { opacity: 1; transform: none; transition: none; }
  .roll-in { transition: none; }
  .is-rolled .roll-in { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* TradingView widgets are transparent iframes. Chrome paints a solid white backdrop behind an
   iframe whose color scheme differs from the page's, so after switching to dark mode the ticker
   band stayed white. The widget pages don't declare a scheme (light), so match it on the iframe. */
.tradingview-widget-container iframe { color-scheme: light; }
