:root {
  --paper: #ffffff;
  --paper-2: #f7f7f7;
  --ink: #222222;
  --ink-2: #4a4a4a;
  --ink-3: #919191;
  --rule: #e9e9e9;
  --header: #ffffff;
  --gold: #f4b76c;
  --gold-dk: #c48a3a;
  --navy: #1e2a5a;
  --navy-dk: #151d40;
  --link: #085e7d;
  --sidebar: 240px;
  --header-h: 52px;
  --r: 4px;
  --font-ui: Inter, Arial, Helvetica, sans-serif;
  --font-serif: Newsreader, Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--link);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 0.75rem;
  top: 0.75rem;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 0.7rem 1.1rem;
}

.d-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.15rem;
  background: var(--header);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.header-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.header-logo img {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.btn-x {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  font-size: 0.8125rem;
  font-weight: 650;
  padding: 0.38rem 0.75rem;
  border-radius: var(--r);
  text-decoration: none;
}

.btn-x svg {
  width: 12px;
  height: 12px;
}

.btn-x:hover {
  background: var(--paper-2);
}

.btn-open {
  display: inline-block;
  background: var(--gold);
  color: #1a1408;
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.55rem 1.05rem;
  border-radius: var(--r);
  text-decoration: none;
  white-space: nowrap;
}

.btn-open:hover {
  background: #ffc57a;
}

.btn-lg {
  font-size: 0.95rem;
  padding: 0.7rem 1.25rem;
}

.btn-ghost {
  display: inline-block;
  color: var(--link);
  font-size: 0.95rem;
  font-weight: 560;
  text-decoration: none;
  padding: 0.7rem 0;
  border-bottom: 1.5px solid transparent;
}

.btn-ghost:hover {
  border-bottom-color: var(--gold);
}

.wrap {
  display: flex;
  align-items: flex-start;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  position: sticky;
  top: var(--header-h);
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  height: calc(100vh - var(--header-h));
  padding: 1rem 0.85rem 1.5rem;
  border-right: 1px solid var(--rule);
  background: var(--paper);
  overflow: auto;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark img {
  width: auto;
  height: 28px;
  object-fit: contain;
}

.side-nav {
  margin-top: 1.15rem;
}

.side-group {
  margin-bottom: 1.15rem;
}

.side-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-label {
  margin: 0 0 0.35rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.5rem;
  border-radius: var(--r);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.side-nav a:hover {
  background: var(--paper-2);
  color: var(--ink);
}

.side-nav a.is-active {
  background: #ececec;
  color: var(--ink);
  font-weight: 650;
}

.side-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  flex: 0 0 16px;
}

.side-icon svg {
  width: 15px;
  height: 15px;
}

.cat-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 2px;
}

.frame {
  flex: 1;
  min-width: 0;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 1.35rem 2rem 0;
}

.thread {
  max-width: 820px;
  padding-bottom: 2rem;
}

.thread-head {
  padding-bottom: 0.85rem;
}

.fancy-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.05rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.012em;
}

.topic-category {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.55rem;
}

.badge-category {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8125rem;
  font-weight: 650;
  color: var(--ink-2);
}

.badge-category::before {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--navy);
}

.thread-pages {
  margin-left: auto;
}

.thread-pages .is-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.55rem;
  height: 1.55rem;
  background: var(--gold);
  color: #1a1408;
  font-weight: 700;
  font-size: 0.78rem;
  border-radius: 2px;
}

.post {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 0.75rem 1rem;
  margin-top: 0.35rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

.topic-avatar img {
  width: 45px;
  height: auto;
  object-fit: contain;
}

.topic-meta {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
  font-size: 0.9rem;
}

.username {
  font-weight: 700;
}

.post-note {
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.cooked {
  font-family: var(--font-serif);
  font-optical-sizing: auto;
  font-size: 1.0625rem;
  line-height: 1.62;
}

.dek {
  margin: 0 0 1.15rem;
  max-width: 62ch;
  font-size: 1.08rem;
  line-height: 1.62;
  color: var(--ink-2);
}

.pitch-actions {
  margin: 0 0 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}

.equation {
  background: var(--navy-dk);
  color: #f4efe4;
  border-radius: var(--r);
  padding: 1.1rem 1.15rem;
  margin: 0 0 1.8rem;
  overflow-x: auto;
}

.equation code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.92rem;
  line-height: 1.75;
  white-space: pre;
}

.band {
  padding-block: 2.4rem;
}

.band + .band {
  border-top: 1px solid var(--rule);
}

.sec-h {
  margin: 0 0 0.75rem;
  font-family: var(--font-ui);
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sec-lede {
  margin: 0 0 1.6rem;
  max-width: 60ch;
  font-size: 1.05rem;
  color: var(--ink-2);
}

.statement {
  margin: 0;
  max-width: 38ch;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.28;
  font-weight: 400;
  letter-spacing: -0.012em;
}

.launch-facts {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 1.6rem;
  border-top: 1px solid var(--rule);
}

.launch-facts li {
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.launch-facts strong {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
}

.launch-facts span {
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.45;
}

.steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
  border-top: 1px solid var(--rule);
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 12rem) minmax(0, 1fr);
  gap: 1rem 1.3rem;
  align-items: baseline;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}

.steps li::before {
  content: counter(step);
  font-family: var(--font-ui);
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 1.05rem;
  font-weight: 700;
}

.steps p {
  margin: 0;
  max-width: 58ch;
  color: var(--ink-2);
}

.aside {
  margin-top: 2rem;
  border-left: 3px solid var(--gold);
  padding: 0.1rem 0 0.1rem 1.15rem;
  max-width: 68ch;
}

.aside h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-ui);
  font-size: 1.02rem;
}

.aside p {
  margin: 0;
  color: var(--ink-2);
}

.essay {
  max-width: 62ch;
}

.essay p {
  margin: 0 0 1.1rem;
  font-size: 1.0625rem;
  line-height: 1.65;
}

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

.params {
  width: 100%;
  max-width: 820px;
  border-collapse: collapse;
  font-size: 0.95rem;
  font-family: var(--font-ui);
}

.params th,
.params td {
  text-align: left;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: baseline;
}

.params th {
  font-weight: 600;
  width: 16rem;
}

.params td {
  color: var(--ink-2);
}

.params .none {
  font-weight: 680;
  font-size: 0.88rem;
  color: var(--navy);
}

.params tr:first-child th,
.params tr:first-child td {
  border-top: 1px solid var(--rule);
}

.risks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.6rem 2.4rem;
}

.risks h3 {
  margin: 0;
  font-family: var(--font-ui);
  padding-bottom: 0.35rem;
  border-bottom: 1.5px solid var(--ink);
  display: inline-block;
}

.risks p {
  margin: 0.5rem 0 0;
  color: var(--ink-2);
  font-size: 1rem;
}

.credit {
  max-width: 62ch;
}

.cite {
  font-family: var(--font-ui);
  font-weight: 650;
  font-size: 1rem;
  color: var(--link);
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 1px;
}

.cite:hover {
  background: var(--gold);
  color: var(--ink);
}

.cite-sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.85rem;
  color: var(--ink-3);
}

.disclaim {
  font-size: 0.9rem;
  color: var(--ink-3);
  max-width: 60ch;
}

.foot {
  display: flex;
  gap: 1.5rem;
  align-items: baseline;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
  padding: 1.25rem 2rem 1.8rem;
  margin-top: 1.5rem;
}

.foot-note {
  font-size: 0.8125rem;
  color: var(--ink-3);
  margin-left: auto;
}

[id] {
  scroll-margin-top: 72px;
}

@media (max-width: 820px) {
  .launch-facts,
  .risks {
    grid-template-columns: 1fr;
  }

  .steps li {
    grid-template-columns: 2.2rem minmax(0, 1fr);
  }

  .steps p {
    grid-column: 2;
  }
}

@media (max-width: 860px) {
  .wrap {
    display: block;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 0.85rem 1.1rem 1rem;
  }

  .side-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.4rem;
    margin-top: 0.7rem;
  }

  .side-group {
    margin-bottom: 0.35rem;
  }

  main,
  .foot {
    padding-inline: 1.1rem;
  }
}

@media (max-width: 620px) {
  .post {
    grid-template-columns: 1fr;
  }

  .topic-avatar,
  .post-note {
    display: none;
  }
}
