:root {
  --max-width: 1000px;
  --header-h: 10vh;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;

  /* Themed colors (light) */
  color-scheme: light;
  --bg: #fff;
  --ink: #000;
  --muted: rgba(0, 0, 0, 0.5);
  --line: rgba(0, 0, 0, 0.12);
  --grid-line: rgba(0, 0, 0, 0.04);
  --veil: 255, 255, 255; /* rgb triplet used by the header veil */
  --accent: #4a5df9; /* the ONLY non-monochrome color allowed on this site */
  --code-bg: rgba(0, 0, 0, 0.045);
  --row-hover: rgba(0, 0, 0, 0.02);
  --card-bg: var(--bg);
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 12px 32px rgba(0, 0, 0, 0.09);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b0c;
  --ink: #fff;
  --muted: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.14);
  --grid-line: rgba(255, 255, 255, 0.05);
  --veil: 11, 11, 12;
  --accent: #4a5df9;
  --code-bg: rgba(255, 255, 255, 0.06);
  --row-hover: rgba(255, 255, 255, 0.03);
  /* Shadows barely read on a dark bg — the card lifts via a lighter surface */
  --card-bg: rgba(255, 255, 255, 0.045);
  --card-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox — hide the scrollbar, keep scrolling */
  -ms-overflow-style: none; /* legacy Edge/IE */
}

/* Chrome, Safari, Edge — hide the scrollbar without disabling scroll */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Fixed full-viewport grid layer — sits behind everything and never scrolls */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: linear-gradient(
      to right,
      var(--grid-line) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ---------------------------------------------------------------------------
   Header — takes 10% of the viewport height, NINE logo centered
--------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: none; /* header is a passive overlay; only the logo is visible */
}

/* Progressive blur: several stacked backdrop-blur layers, each masked to fade
   in higher up and blur harder — strongest at the top edge, exactly zero at
   the bottom edge so content scrolling out from under the header stays crisp. */
.site-header__blur,
.site-header__tint {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.site-header__blur > div {
  position: absolute;
  inset: 0;
}

.site-header__blur > div:nth-child(1) {
  backdrop-filter: blur(0.75px);
  -webkit-backdrop-filter: blur(0.75px);
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 20%);
  mask-image: linear-gradient(to top, transparent 0%, #000 20%);
}
.site-header__blur > div:nth-child(2) {
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  -webkit-mask-image: linear-gradient(to top, transparent 20%, #000 40%);
  mask-image: linear-gradient(to top, transparent 20%, #000 40%);
}
.site-header__blur > div:nth-child(3) {
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  -webkit-mask-image: linear-gradient(to top, transparent 40%, #000 60%);
  mask-image: linear-gradient(to top, transparent 40%, #000 60%);
}
.site-header__blur > div:nth-child(4) {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-mask-image: linear-gradient(to top, transparent 60%, #000 80%);
  mask-image: linear-gradient(to top, transparent 60%, #000 80%);
}
.site-header__blur > div:nth-child(5) {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to top, transparent 80%, #000 100%);
  mask-image: linear-gradient(to top, transparent 80%, #000 100%);
}

/* White veil with a progressively decreasing opacity (opaque at the top,
   fully transparent at the bottom edge). */
.site-header__tint {
  background: linear-gradient(
    to bottom,
    rgba(var(--veil), 0.92) 0%,
    rgba(var(--veil), 0.7) 45%,
    rgba(var(--veil), 0) 100%
  );
}

.site-logo {
  position: relative;
  z-index: 1;
  display: block;
  width: 44px;
  height: 44px;
  color: #000000; 
  
  /* drives the SVG's fill: currentColor — white in both themes */
  /* The white mark reads on the light bg thanks to the drop shadow */
   /*filter: drop-shadow(0 0px 0px rgba(0, 0, 0, 0.28))
    drop-shadow(0 6px 16px rgba(0, 0, 0, 0.22));*/

  user-select: none;
  pointer-events: auto;
}

/* Top-left company links (Get verified, Press, Invest) with a 45° arrow */
.top-links {
  position: fixed;
  top: 0;
  left: 40px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  z-index: 11;
  pointer-events: auto;
}

.top-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none; /* kill the UA underline (it also tilted the arrow) */
}

.top-link__text {
  position: relative;
}

/* Underline grows left→right on hover / focus / click, like the section nav */
.top-link__text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.top-link:hover .top-link__text::after,
.top-link:focus .top-link__text::after,
.top-link:active .top-link__text::after {
  transform: scaleX(1);
}

.top-link__arrow {
  display: inline-block;
  transform: rotate(-45deg); /* a → tilted 45° → points up-right */
  transition: transform 0.2s ease;
}

.top-link:hover .top-link__arrow {
  transform: translate(1px, -1px) rotate(-45deg);
}

/* ---------------------------------------------------------------------------
   Section nav — fixed on the right, never moves while the page scrolls
--------------------------------------------------------------------------- */
.section-nav {
  position: fixed;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px; /* 17 items — tighter so the list fits small laptop screens */
  text-align: right;
  z-index: 9;
}

.section-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.15s ease;
}

/* Underline drawn as a line that grows from left to right over 200ms */
.section-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1.5px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.section-nav a:hover {
  color: var(--ink);
}

.section-nav a.is-active {
  color: var(--accent);
}

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

/* Reading-progress bar — a 3px vertical track pinned to the far left, mirroring
   the right-hand nav: vertically centered and the same height (set via JS). */
.progress {
  position: fixed;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  height: 300px; /* matched to the right nav's height in JS */
  width: 3px;
  border-radius: 3px;
  background: rgb(244, 244, 244);
  backdrop-filter: blur(100px);
  -webkit-backdrop-filter: blur(100px);
  z-index: 9;
  pointer-events: none;
}

.progress__thumb {
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px; /* size + position set by JS from scroll progress */
  border-radius: 3px;
  background: var(--accent);
  will-change: transform;
}

/* ---------------------------------------------------------------------------
   Document — single centered column, max 1000px, rendered from markdown
--------------------------------------------------------------------------- */
.doc {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--header-h) + 40px) 24px 10vh;
}

/* Company copyright — same look as soon.nine-social.com's footer copy line,
   pinned to the bottom of the viewport (does not move while the page scrolls) */
.site-footer {
  position: fixed;
  top: 0;
  right: 40px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 11;
}

.site-footer__copy {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* Text switch for light / dark mode — hidden for now, kept for later use.
   Remove this `display: none` to bring the toggle back. */
.theme-switch {
  display: none;

  position: fixed;
  left: 24px;
  bottom: 28px;
  z-index: 9;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.15s ease;
}

.theme-switch:hover {
  color: var(--ink);
}

.doc section {
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.doc h1 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  margin: 56px 0 16px;
}

.doc h2 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  margin: 36px 0 12px;
}

.doc h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 10px;
}

.doc p,
.doc li {
  font-size: 16px;
  line-height: 1.7;
}

.doc p {
  margin: 0 0 16px;
}

.doc ul,
.doc ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.doc li {
  margin: 4px 0;
}

/* Links (including emails) carry the accent — they're the "act here" signal */
.doc a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(74, 93, 249, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

.doc a:hover {
  text-decoration-color: var(--accent);
}

/* Key words / important text (**bold** in the markdown) share the accent */
.doc strong {
  font-weight: 700;
  color: var(--accent);
}

.doc em {
  font-style: italic;
  color: var(--muted);
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 40px 0;
}

.doc h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 8px;
}

.doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* Tables — wrapped so wide tables scroll inside their own box, never the page */
.table-wrap {
  overflow-x: auto;
  margin: 20px 0 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  line-height: 1.55;
}

.doc th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.doc td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  min-width: 120px;
}

.doc tbody tr:last-child td {
  border-bottom: 0;
}

.doc tbody tr:hover {
  background: var(--row-hover);
}

/* Callouts — "> [!NOTE] …" blocks: borderless cards lifted by a soft shadow.
   Monochrome on purpose; the accent is reserved for links and key words. */
.callout {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 24px 0 28px;
  box-shadow: var(--card-shadow);
}

.callout p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.65;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout__label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Plain blockquotes */
.doc blockquote {
  margin: 20px 0 24px;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--line);
}

.doc blockquote p {
  color: var(--muted);
  margin: 0 0 8px;
}

.doc blockquote p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------------------
   "Before you scroll, read this" — a short clarifying message plus a grid of
   cards that redirect the reader to the right section up front.
--------------------------------------------------------------------------- */
.intro {
  margin-bottom: 8px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.intro__headline {
  margin: 0 0 20px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.intro__lead {
  max-width: 720px;
}

.intro__lead p {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.6;
}

.intro__lead p:last-child {
  margin-bottom: 0;
}

.intro__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 32px;
  margin-top: 36px;
}

.intro__card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--card-bg);
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: var(--card-shadow);
}

.intro__card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}

.intro__card a {
  margin-top: auto;
  align-self: flex-start;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(74, 93, 249, 0.35);
  text-underline-offset: 4px;
  transition: text-decoration-color 0.15s ease;
}

.intro__card a:hover {
  text-decoration-color: var(--accent);
}

@media (max-width: 720px) {
  .intro__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Hide the fixed nav (and the mirrored progress bar) once they would start
   overlapping the 1000px column */
@media (max-width: 1320px) {
  .section-nav,
  .progress {
    display: none;
  }
}

/* ---------------------------------------------------------------------------
   Mobile nav — a fixed "Sections" button + panel, shown only when the fixed
   side nav is hidden (< 1320px). Includes a search over the page's headings.
--------------------------------------------------------------------------- */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--card-shadow);
}

.mobile-nav {
  position: fixed;
  right: 24px;
  bottom: 74px;
  z-index: 20;
  width: min(320px, calc(100vw - 48px));
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--card-shadow);
}

.mobile-nav__search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  margin-bottom: 10px;
}

.mobile-nav__search:focus {
  outline: none;
  border-color: var(--accent);
}

.mobile-nav__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav__list a {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.mobile-nav__list a:hover {
  background: var(--row-hover);
}

.mobile-nav__list a small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  margin-top: 1px;
}

.mobile-nav__empty {
  margin: 6px 4px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 1320px) {
  .mobile-nav-toggle {
    display: block;
  }
}

/* Keyboard accessibility — a visible focus ring, in the accent */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Print — clean black-on-white document, fixed chrome removed */
@media print {
  .grid-bg,
  .site-header,
  .top-links,
  .section-nav,
  .progress,
  .site-footer,
  .theme-switch,
  .mobile-nav-toggle,
  .mobile-nav {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .doc {
    max-width: 100%;
    padding: 0;
  }

  .doc a {
    color: #000;
  }

  .callout,
  .intro__card {
    box-shadow: none;
    border: 1px solid #000;
  }

  .table-wrap {
    border-color: #000;
  }
}
