:root {
  /* Cohesive cobalt hue scale — everything derives from one hue (~221deg),
     now on a light paper ground instead of near-black for daily readability. */
  --bg: #f5f7fb;
  --bg-1: #eef1f8;
  --bg-2: #e4e9f3;
  --bg-raised: #ffffff;
  --line: #d7dcea;
  --line-soft: #e2e6f0;

  --ink: #161b28;
  --ink-soft: #4c5670;
  --ink-faint: #757f97;

  --blue-950: #0c1830;
  --blue-800: #dbe4fa;
  --blue-600: #2c55b8;
  --blue-500: #2a51ad;
  --blue-400: #3059c9;
  --blue-300: #17348a;
  --blue-glow: rgba(48, 89, 201, 0.22);

  --up: #1a9c78;
  --down: #cf3b4c;

  /* Bright ANSI-style terminal colors, used only in the (intentionally dark) console-bar */
  --term-green: #3cff5e;
  --term-blue: #4dd2ff;

  --mono: "SF Mono", "IBM Plex Mono", Menlo, Consolas, monospace;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  position: relative;
  isolation: isolate;
}

/* Full-page backdrop: just a faint grid, fixed behind all content and never
   competing with it for attention. */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 100% 64px, 64px 100%;
  opacity: 0.22;
}

/* Same constellation network as the digital business card's page background,
   just far fainter and sparser so it reads as texture, not a focal element. */
.site-network {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, var(--bg) 0%, rgba(245, 247, 251, 0) 14%, rgba(245, 247, 251, 0) 78%, var(--bg) 100%);
}

.console-bar,
.wrap {
  position: relative;
  z-index: 1;
}

@media (max-width: 520px) {
  .site-footer { padding-bottom: 60px; }
}

/* Console bar: a terminal-style header line that types out a rotating
   set of research/career facts, in place of a stock-ticker strip. */
.console-bar {
  background: #10141f;
  border-bottom: 1px solid #232d47;
  overflow: hidden;
  white-space: nowrap;
  padding: 9px 24px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #f3f5fa;
}

.console-prompt {
  flex: none;
}

.console-user {
  color: var(--term-green);
  font-weight: 700;
}

.console-sep {
  color: #f3f5fa;
}

.console-path {
  color: var(--term-blue);
  font-weight: 700;
}

.console-text {
  color: #f3f5fa;
  overflow: hidden;
  text-overflow: ellipsis;
}

.console-caret {
  color: #f3f5fa;
  font-size: 9px;
  animation: blink 1s steps(1) infinite;
  flex: none;
}

@media (max-width: 560px) {
  .console-bar { padding: 8px 16px; font-size: 11px; }
  .console-prompt { display: none; }
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Reading pane: a soft glass panel behind the content column so body copy stays
   legible over the moving chart, while the chart still shows through the margins. */
main {
  position: relative;
  z-index: 1;
}

main::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -8px;
  bottom: -8px;
  left: -16px;
  right: -16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74) 0%, rgba(255, 255, 255, 0.82) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  box-shadow: 0 30px 70px -40px rgba(22, 27, 40, 0.18);
  mask-image: linear-gradient(180deg, transparent 0, black 28px, black calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, black 28px, black calc(100% - 28px), transparent 100%);
}

/* Header */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 44px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0;
  position: sticky;
  top: 0;
  z-index: 45;
  transition: padding 0.22s ease, background-color 0.22s ease, box-shadow 0.22s ease, backdrop-filter 0.22s ease;
}

.site-header.is-stuck {
  padding: 12px 16px;
  margin: 0 -16px;
  width: calc(100% + 32px);
  background: rgba(245, 247, 251, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: transparent;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-radius: 0 0 14px 14px;
  box-shadow: 0 12px 30px -20px rgba(22, 27, 40, 0.4);
}

.site-header.is-stuck .site-title {
  font-size: 16px;
}

.site-title {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  opacity: 0.92;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.site-title:hover {
  color: var(--blue-400);
  opacity: 1;
}

.cursor {
  color: var(--blue-400);
  animation: blink 1.1s steps(1) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.site-nav {
  font-family: var(--mono);
  font-size: 13px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
}

.site-nav a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  padding-bottom: 4px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--blue-400);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--blue-300);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.nav-item {
  display: flex;
  align-items: center;
}

.nav-has-dropdown {
  position: relative;
}

.nav-has-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 20px;
}

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -6px);
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  min-width: 190px;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 14px 32px rgba(12, 24, 48, 0.14);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 30;
}

.nav-has-dropdown:hover .nav-dropdown,
.nav-has-dropdown:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.nav-dropdown a {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  white-space: nowrap;
}

.nav-dropdown a::after {
  display: none;
}

.nav-dropdown a:hover {
  background: var(--bg-1);
  color: var(--blue-300);
}

@media (max-width: 680px) {
  .nav-has-dropdown::after {
    content: none;
  }

  .nav-has-dropdown {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    background: none;
    padding: 0 0 0 14px;
    margin-top: 4px;
  }

  .nav-dropdown a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 2px;
    color: var(--ink-faint);
  }
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  z-index: 41;
  position: relative;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink-soft);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 680px) {
  .site-header {
    align-items: center;
    position: relative;
    z-index: 40;
  }
  .nav-toggle { display: flex; }

  .site-nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    order: 3;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-left: 12px;
    padding-right: 12px;
    border-top: 0 solid var(--line);
    border-radius: 10px;
    transition: max-height 0.28s ease, opacity 0.2s ease, margin-top 0.28s ease, padding-top 0.28s ease, background-color 0.2s ease;
  }

  .site-nav.open {
    max-height: 420px;
    opacity: 1;
    margin-top: 16px;
    padding-top: 8px;
    padding-bottom: 4px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px -20px rgba(22, 27, 40, 0.35);
  }

  .site-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
    border-bottom: 1px solid var(--line-soft);
    font-size: 14px;
  }

  .site-nav a:active { background: var(--bg-1); }

  .site-nav a::after { display: none; }

  .nav-item.nav-has-dropdown {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-dropdown a {
    min-height: 40px;
    padding-left: 16px;
    border-bottom: 1px solid var(--line-soft);
  }
}

/* Profile cover: a full-width 16:9 banner photo, bleeding out of the reading
   column the same way the hero does, with the name/tagline/intro following
   directly underneath it rather than squeezed alongside. */
.profile-cover {
  position: relative;
  margin: 16px -16px 24px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px -30px rgba(22, 27, 40, 0.45);
}

.profile-cover img {
  display: block;
  width: 100%;
  height: 320px;
  object-fit: cover;
  object-position: 50% calc(50% + 40px);
}

.profile-cover img.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.profile-cover img.slide:first-child {
  position: relative;
}

.profile-cover img.slide.is-active {
  opacity: 1;
  z-index: 1;
}

.profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 16, 26, 0.16) 0%, rgba(12, 16, 26, 0.04) 100%);
  pointer-events: none;
}

.profile-intro { margin-bottom: 4px; }

@media (max-width: 640px) {
  .profile-cover { margin: 12px -16px 20px; }
  .profile-cover img { height: 320px; }
}

/* Typography */
h1 {
  font-size: 30px;
  line-height: 1.25;
  margin: 0 0 6px;
  color: var(--ink);
}

h2 {
  position: relative;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--blue-400);
  margin: 52px 0 20px;
  padding: 0 0 10px 16px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 88px;
}

h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  bottom: 10px;
  width: 3px;
  border-radius: 2px;
  background: var(--blue-400);
}

h3 {
  font-size: 18px;
  margin: 0 0 2px;
  color: var(--ink);
}

/* Compact sub-subheading, e.g. "Talks" / "Workshops" nested under an
   Upcoming/Past h3 — same faint mono label style as .readme h4, just not
   scoped to the collapsible project blocks. */
h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 24px 0 10px;
  scroll-margin-top: 88px;
}

.entry-head h3 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.entry-head h3 a:hover {
  color: var(--blue-400);
  border-bottom-color: var(--blue-400);
}

.supplement-note {
  font-style: italic;
}

p { margin: 0 0 16px; color: var(--ink); }

a {
  color: var(--blue-400);
  text-decoration-color: var(--blue-600);
}

a:hover { color: var(--blue-300); }

.tagline {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 28px;
}

.lede {
  font-size: 18px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

/* Entry blocks (experience / education / projects) */
.entry {
  position: relative;
  margin-bottom: 20px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.entry:hover {
  border-color: var(--blue-600);
  border-left-color: var(--blue-400);
  transform: translateX(2px);
  box-shadow: 0 0 0 1px rgba(53, 104, 224, 0.15), 0 10px 30px -14px var(--blue-glow);
}

.entry-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.entry-org {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
}

.entry-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: color 0.2s ease;
}

.entry:hover .entry-date { color: var(--blue-400); }

.entry ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.entry li {
  margin-bottom: 6px;
  color: var(--ink-soft);
}

.entry li::marker { color: var(--blue-600); }

.tags {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue-400);
  margin: 10px 0 0;
}

/* Expandable README-style detail within an entry. A plain button + CSS grid
   height trick instead of native <details>, so the expand/collapse is a
   single browser-driven transition rather than a JS-measured animation
   racing the UA's own open/closed rendering. */
.readme-toggle {
  margin-top: 10px;
}

.readme-summary {
  display: block;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--blue-400);
  background: none;
  border: none;
  padding: 0;
  outline: none;
  user-select: none;
  text-align: left;
}

.readme-summary .label-close { display: none; }
.readme-toggle.is-open .readme-summary .label-open { display: none; }
.readme-toggle.is-open .readme-summary .label-close { display: inline; }

.readme-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 480ms cubic-bezier(0.65, 0, 0.35, 1);
}

.readme-toggle.is-open .readme-collapse {
  grid-template-rows: 1fr;
}

.readme-collapse > .readme {
  overflow: hidden;
  min-height: 0;
}

.readme {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

@media (prefers-reduced-motion: reduce) {
  .readme-collapse { transition: none; }
}

.readme p { font-size: 15px; color: var(--ink-soft); }

.katex-display {
  margin: 12px 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.readme h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin: 14px 0 6px;
}

.readme h4:first-child { margin-top: 0; }

/* GitHub Dark default theme palette, for code blocks specifically */
pre.code-block {
  position: relative;
  margin: 6px 0 0;
  padding: 20px 14px 12px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  overflow-x: auto;
  font-family: ui-monospace, var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  text-shadow: none;
}

pre.code-block[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 6px;
  right: 12px;
  font-size: 10px;
  color: #6e7681;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

pre.code-block code {
  background: none;
  padding: 0;
  color: #c9d1d9;
  font-size: 1em;
  text-shadow: none;
}

.entry-figure {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  border: 1px solid #232d47;
  border-radius: 8px;
}

.tok-comment { color: #8b949e; }
.tok-string { color: #a5d6ff; }
.tok-number { color: #79c0ff; }
.tok-func { color: #d2a8ff; }
.tok-keyword { color: #ff7b72; }

/* Live market widget: a contained, dark "terminal" card (same treatment as the
   code blocks above) showing a small live BTC/ETH options chain. Scoped to this
   one card on purpose — it's a demo artifact, not site chrome. */
.market-widget {
  position: relative;
  margin-top: 12px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #30363d;
  background: #0b0f18;
}

.market-widget canvas {
  display: block;
  width: 100%;
  height: 300px;
}

@media (max-width: 560px) {
  .market-widget canvas { height: 360px; }
}

/* Landing-page hero: the same live options chain as a full-bleed backdrop,
   with a short line of intro copy faded in on a light scrim so the chain
   itself stays the dominant, legible element. */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  margin: 16px -16px 40px;
  min-height: 320px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid #232d47;
  background: #0b0f18;
  box-shadow: 0 30px 70px -36px rgba(10, 14, 24, 0.55);
}

.hero #market-widget-canvas,
.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
  filter: brightness(1.2) contrast(1.05);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  opacity: 1;
  filter: brightness(1.55) contrast(1.05);
}

.hero-fade.hero-fade-soft {
  background:
    linear-gradient(100deg, rgba(11, 15, 24, 0.6) 0%, rgba(11, 15, 24, 0.42) 28%, rgba(11, 15, 24, 0.16) 52%, rgba(11, 15, 24, 0.04) 72%);
}

/* Higher-specificity (.hero-fade.hero-fade-flip) so this reliably beats the
   base .hero-fade rule regardless of the two rules' order in this file. */
.hero-fade.hero-fade-flip {
  background:
    linear-gradient(to left, rgba(11, 15, 24, 0.9) 0%, rgba(11, 15, 24, 0.74) 28%, rgba(11, 15, 24, 0.22) 52%, rgba(11, 15, 24, 0.02) 72%);
}

@media (max-width: 640px) {
  .hero-fade.hero-fade-flip {
    background:
      linear-gradient(100deg, rgba(11, 15, 24, 0.9) 0%, rgba(11, 15, 24, 0.74) 28%, rgba(11, 15, 24, 0.22) 52%, rgba(11, 15, 24, 0.02) 72%);
  }
}

.hero-fade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(11, 15, 24, 0.9) 0%, rgba(11, 15, 24, 0.74) 28%, rgba(11, 15, 24, 0.22) 52%, rgba(11, 15, 24, 0.02) 72%);
}

/* Order-book hero: the dark scrim needs to carry further right so the
   hero copy stays legible over the price-ladder panels, without darkening
   the far-right edge any more than the default fade already does. */
.hero-fade.hero-fade-long {
  background:
    linear-gradient(100deg, rgba(11, 15, 24, 0.9) 0%, rgba(11, 15, 24, 0.78) 40%, rgba(11, 15, 24, 0.4) 58%, rgba(11, 15, 24, 0.02) 72%);
}

.hero-content {
  position: relative;
  max-width: 460px;
  padding: 32px 40px;
  animation: hero-fade-in 900ms ease both;
}

.hero-content-right {
  margin-left: auto;
  text-align: right;
}

.hero-content-right .hero-links { justify-content: flex-end; }

@media (max-width: 640px) {
  .hero-content-right { margin-left: 0; text-align: left; }
  .hero-content-right .hero-links { justify-content: flex-start; }
}

@keyframes hero-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--term-blue);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .hero-eyebrow-extra { display: none; }
}

.hero-name {
  margin: 8px 0 10px;
  font-size: 38px;
  line-height: 1.1;
  color: #f6f8fc;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.85);
}

.hero-name .cursor { color: var(--term-green); }

.hero-lede {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  color: rgba(243, 245, 250, 0.92);
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.8);
  margin-bottom: 20px;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
}

.hero-links a,
.hero-links .copy-email {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(243, 245, 250, 0.85);
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.hero-links a:hover,
.hero-links .copy-email:hover { color: var(--term-blue); }

.hero-links .icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.hero-links .copy-email {
  position: relative;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}

.copy-toast {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 4px);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #06110c;
  background: var(--term-green);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  text-shadow: none;
}

.copy-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .hero { margin: 12px -16px 32px; min-height: 320px; }
  .hero-content { max-width: none; padding: 28px 20px; }
  .hero-name { font-size: 32px; }
  .hero-fade {
    background:
      linear-gradient(180deg, rgba(11, 15, 24, 0.92) 0%, rgba(11, 15, 24, 0.78) 50%, rgba(11, 15, 24, 0.35) 100%);
  }

  /* Research hero: instead of dropping trade-tape panels on narrow
     screens, let the hero itself scroll horizontally so all three tables
     stay reachable. hero-content is pinned to the left edge as it scrolls. */
  .hero-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hero-scroll .hero-content { position: sticky; left: 0; z-index: 2; }
}

/* Contact form */
.contact-form {
  padding: 28px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form:focus-within {
  border-color: var(--blue-600);
  border-left-color: var(--blue-400);
  box-shadow: 0 0 0 1px rgba(53, 104, 224, 0.15), 0 10px 30px -14px var(--blue-glow);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.field {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.contact-form label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form select,
.contact-form textarea {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  resize: vertical;
  width: 100%;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--ink-faint);
}

.contact-form select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c8bff' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--blue-500);
  background: var(--bg-2);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-hint {
  font-size: 13px;
  color: var(--ink-faint);
}

.contact-form button {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--blue-400);
  border: none;
  border-radius: 4px;
  padding: 11px 22px;
  cursor: pointer;
  text-shadow: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.contact-form button:hover {
  background: var(--blue-300);
  transform: translateY(-1px);
}

.cta-button {
  display: inline-block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--bg);
  background: var(--blue-400);
  border: none;
  border-radius: 4px;
  padding: 11px 22px;
  text-decoration: none;
  text-shadow: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.cta-button:hover {
  background: var(--blue-300);
  transform: translateY(-1px);
  color: var(--bg);
}

.sent-note {
  display: none;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--up);
}

.sent-note.visible { display: block; }

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .form-footer { flex-direction: column; align-items: flex-start; }
}

/* Links list */
.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  font-family: var(--mono);
  font-size: 13px;
  margin-bottom: 24px;
}

.links a {
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.links a:hover {
  color: var(--blue-300);
  border-bottom-color: var(--blue-400);
}

.links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: currentColor;
}

/* Explore / quick-nav cards */
.nav-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.nav-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-card:hover {
  border-color: var(--blue-600);
  border-left-color: var(--blue-400);
  transform: translateX(2px);
  box-shadow: 0 0 0 1px rgba(53, 104, 224, 0.15), 0 10px 30px -14px var(--blue-glow);
}

.nav-card-title {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.nav-card-hint {
  font-size: 14px;
  color: var(--ink-soft);
}

@media (max-width: 560px) {
  .nav-cards { grid-template-columns: 1fr; }
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--blue-300);
  background: rgba(53, 104, 224, 0.12);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Footer */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 44;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px -16px rgba(22, 27, 40, 0.45);
  color: var(--ink-soft);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  border-color: var(--blue-400);
  color: var(--blue-400);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 520px) {
  .back-to-top { right: 14px; bottom: 14px; width: 38px; height: 38px; }
}

.site-footer {
  margin-top: 72px;
  padding: 32px 0 60px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
  width: 100%;
}

.footer-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  text-transform: lowercase;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.footer-nav a:hover { color: var(--blue-400); }

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links .icon {
  width: 12px;
  height: 12px;
}

.footer-links a:hover { color: var(--blue-300); }

.footer-note {
  font-size: 11px;
  opacity: 0.7;
}

@media (max-width: 520px) {
  .site-header { padding-top: 32px; }
  h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .console-caret { animation: none; }
  .cursor { animation: none; }
}
