/* Raeto brand layer: shared by every public page and loaded after each page's own styles.
   Paper and ink, a serif display face with a green italic accent, Geist for text and Geist Mono for figures.
   The same system as the X banner and post images, so the site and the feed read as one brand. */

:root {
  /* colour */
  --bg: #F4F1EA;            /* paper */
  --panel: #FBFAF6;         /* card */
  --soft: #ECE7DC;          /* wash, inputs, table heads */
  --ink: #1B1914;
  --ink-2: #3A362E;
  --muted: #625D53;         /* 5.9:1 on paper */
  --line: #DED8CC;
  --line-strong: #CBC3B3;
  --accent: #2E6B47;        /* Raeto green */
  --accent-ink: #23553A;
  --accent-wash: #E4ECE3;
  --fast: #2E6B47;
  --mid: #8C6418;           /* darker amber so small labels pass AA */
  --top: #A8432E;
  --code-bg: #1C1A16;
  --code-ink: #EDE8DD;
  --code-dim: #9A9487;
  --code-str: #A9C98F;

  /* type */
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Geist", "Inter", -apple-system, "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-mono: "Geist Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --fs-display: clamp(46px, 6.2vw, 86px);
  --fs-h2: clamp(34px, 4.4vw, 58px);
  --fs-h3: 26px;
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-label: 11.5px;

  /* shape and depth */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(40, 32, 18, 0.06);
  --shadow-2: 0 1px 2px rgba(40, 32, 18, 0.05), 0 24px 48px -30px rgba(40, 32, 18, 0.32);
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* rhythm */
  --gutter: 24px;
  --section-gap: 136px;
  color-scheme: light;
}
@media (max-width: 720px) { :root { --gutter: 16px; --section-gap: 88px; --fs-h3: 24px; } }

html { font-synthesis-weight: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body { font-family: var(--font-body); font-size: var(--fs-body); line-height: 1.6; letter-spacing: -0.003em;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
::selection { background: var(--accent-wash); color: var(--ink); }
.wrap { gap: var(--section-gap); }
.mono, code, pre { font-feature-settings: "zero" 0; }

/* ---------- headings: serif, regular weight, italic green accent ---------- */
h1, .h2, h2.h2 { font-family: var(--font-display); font-weight: 400; }
.hero h1, .rhero h1 { font: 400 var(--fs-display)/0.98 var(--font-display); letter-spacing: -0.012em; margin-top: 22px; }
.hero h1 em, .rhero h1 em, .h2 em, .closing .h2 em { font-style: italic; color: var(--accent); }
.h2 { font-size: var(--fs-h2); line-height: 1.02; letter-spacing: -0.01em; max-width: 20ch; }
.lead, .lede-sm { color: var(--muted); }
.lead { font-size: var(--fs-lead); line-height: 1.6; }
.line h3, .stack h3, .calc-head h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.005em; }
.line h3 { font-size: var(--fs-h3); line-height: 1.1; }
.stack h3 { font-size: 25px; }

/* labels */
.eyebrow { font: 500 var(--fs-label)/1 var(--font-mono); letter-spacing: 0.12em; color: var(--muted); }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); display: inline-block; }
section > .eyebrow, .split > div > .eyebrow { margin-bottom: 20px; }

/* ---------- navigation ---------- */
nav.site .links a:not(.btn):not(.keep) { display: inline-block; }
@media (max-width: 1000px) { nav.site .links a:not(.btn):not(.keep) { display: none; } }
nav.site { display: block; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  margin-inline: calc(-1 * max(var(--gutter), env(safe-area-inset-left, 0px))); padding: 0 max(var(--gutter), env(safe-area-inset-left, 0px)); border-bottom: 1px solid transparent; transition: border-color .25s var(--ease); }
nav.site.scrolled { border-bottom-color: var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 31; }
nav.site { top: env(safe-area-inset-top, 0px); }
.nav-in { max-width: 1160px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
nav.site + .wrap { margin-top: 0; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font: 400 29px/1 var(--font-display); letter-spacing: -0.01em; color: var(--ink); }
.brand svg { width: 28px; height: 28px; flex: none; }
.links { display: flex; align-items: center; gap: 4px; font-size: 14.5px; flex-wrap: nowrap; }
.links a { text-decoration: none; }
.links a:not(.btn) { padding: 7px 12px; border-radius: var(--r-pill); color: var(--muted); transition: color .2s var(--ease), background-color .2s var(--ease); white-space: nowrap; }
.links a:not(.btn):hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.links a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.links a.btn { white-space: nowrap; margin-left: 8px; padding: 9px 18px; font-size: 14.5px; color: var(--bg); }
@media (max-width: 640px) { .links a:not(.btn) { padding: 6px 8px; font-size: 14px; } .links a.btn { margin-left: 4px; padding: 8px 14px; } .brand { font-size: 26px; } .brand svg { width: 25px; height: 25px; } }
/* mobile: the primary button stays, every other link moves into a menu (brand.js adds the button and the panel) */
.menu-btn { display: none; }
@media (max-width: 1000px) {
  nav.site .links a:not(.btn) { display: none !important; }
  .menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: 6px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: transparent; color: var(--ink); cursor: pointer; flex: none; }
  .menu-btn:hover { background: var(--panel); }
  .menu-btn svg { width: 18px; height: 18px; }
  .menu-btn .x { display: none; }
  nav.site.open .menu-btn .bars { display: none; }
  nav.site.open .menu-btn .x { display: block; }
}
.menu-panel { display: none; }
nav.site.open .menu-panel { display: grid; gap: 2px; max-width: 1160px; margin-inline: auto; padding: 4px 0 18px; border-top: 1px solid var(--line); }
.menu-panel a { display: block; padding: 14px 4px; text-decoration: none; color: var(--ink); font-size: 17px; border-bottom: 1px solid var(--line); }
.menu-panel a:last-child { border-bottom: 0; }
.menu-panel a:hover { color: var(--accent); }
nav.site.open { border-bottom-color: var(--line); }
@media (min-width: 1001px) { nav.site.open .menu-panel { display: none; } }

/* ---------- buttons ---------- */
.btn { font: 500 15px/1.2 var(--font-body); letter-spacing: -0.005em; padding: 13px 22px; gap: 10px; border-radius: var(--r-pill);
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.btn:hover { background: #000; border-color: #000; transform: translateY(-1px); box-shadow: 0 10px 20px -14px rgba(27, 25, 20, 0.7); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.ghost { border-color: var(--line-strong); background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--panel); border-color: var(--ink); box-shadow: none; }
.btn .arr { transition: transform .2s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- cards and surfaces ---------- */
.line { border-radius: var(--r-lg); padding: 26px; gap: 12px; transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
.line:hover { border-color: var(--line-strong); }
.line .tag { font-size: var(--fs-label); letter-spacing: 0.1em; }
.line p { line-height: 1.55; }
.calc, .board, .dash, .ptable, .mkt, .stack, .card-holder { border-radius: var(--r-xl); }
.calc, .board, .dash { box-shadow: var(--shadow-2); }
.card-holder { border-radius: var(--r-xl); }
.code { border-radius: var(--r-lg); box-shadow: var(--shadow-2); }

/* tables: quieter heads, row hover */
.mkt th, .ptable th, .board th { background: color-mix(in srgb, var(--soft) 55%, var(--panel)); font-size: 10.5px; letter-spacing: 0.1em; }
.mkt tbody tr, .ptable tbody tr { transition: background-color .15s var(--ease); }
.mkt tbody tr:hover, .ptable tbody tr:hover { background: color-mix(in srgb, var(--soft) 45%, transparent); }
.mkt td .a i, .tick i { border-radius: 8px; font-family: var(--font-mono); letter-spacing: .02em; }

/* FAQ and risk lists */
.faq summary, .risks summary { font-size: 17px; font-weight: 500; transition: color .2s var(--ease); }
.faq summary:hover { color: var(--accent); }
.faq summary::after, .risks summary::after { transition: transform .25s var(--ease); }
.faq details[open] summary::after { content: "+"; transform: rotate(45deg); }

/* closing band */
.closing { position: relative; overflow: hidden; border-radius: 28px; padding: clamp(32px, 6vw, 72px); align-items: center; }
.closing::after { content: ""; position: absolute; right: -150px; top: 50%; width: 460px; height: 460px; transform: translateY(-50%); pointer-events: none; opacity: .07;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'%3E%3Cpath d='M23.42 8.58A10.5 10.5 0 1 0 26.5 16' stroke='%23EDE8DD' stroke-width='2.4' stroke-linecap='round'/%3E%3Ccircle cx='16' cy='16' r='2.2' fill='%23EDE8DD'/%3E%3C/svg%3E") center/contain no-repeat; }
.closing > * { position: relative; z-index: 1; }
.closing .h2 { color: var(--code-ink); max-width: 16ch; }
.closing .h2 em { color: var(--code-str); }
.closing .btn:hover { background: #fff; border-color: #fff; color: var(--code-bg); }
@media (max-width: 720px) { .closing::after { width: 280px; height: 280px; right: -110px; top: auto; bottom: -120px; transform: none; } }

/* ---------- footer ---------- */
footer.site-foot { margin-top: calc(-1 * var(--section-gap) + 56px); display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; align-items: start; gap: 28px; padding-top: 36px; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--muted); }
.site-foot .top { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.site-foot .tagline { display: grid; gap: 10px; max-width: 34ch; }
.site-foot .tagline p { font: 400 22px/1.2 var(--font-display); color: var(--ink); }
.site-foot .tagline p em { color: var(--accent); }
.site-foot .cols { display: flex; gap: 56px; flex-wrap: wrap; }
.site-foot .cols div { display: grid; gap: 8px; align-content: start; }
.site-foot .cols b { font: 500 var(--fs-label)/1.6 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.site-foot .cols a { color: var(--ink); text-decoration: none; }
.site-foot .cols a:hover { color: var(--accent); }
.site-foot .legal { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 12.5px; padding-top: 18px; border-top: 1px solid var(--line); }
.site-foot .legal .mono { font-size: 12px; color: var(--muted); }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
  .reveal.in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}

/* ---------- home page ---------- */
.kicker { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 500 12.5px/1.3 var(--font-body); color: var(--ink-2); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 6px 14px 6px 10px; box-shadow: var(--shadow-1); }
.kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.kicker .sep { width: 1px; height: 12px; background: var(--line-strong); }
@media (max-width: 480px) { .kicker .sep, .kicker .k1 { display: none; } }
.hero { padding-top: clamp(40px, 7vw, 88px); gap: clamp(36px, 5vw, 72px); }
.hero .sub { font-size: 18.5px; line-height: 1.6; color: var(--muted); max-width: 44ch; margin-top: 26px; }
.ctas { margin-top: 34px; }
.stats { gap: 0; margin-top: 44px; border-top: 1px solid var(--line); padding-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 520px; }
.stats div { display: grid; gap: 6px; align-content: start; padding-right: 18px; }
.stats div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.stats dt { font: 500 28px/1 var(--font-body); color: var(--ink); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats dd { font-size: 13px; line-height: 1.4; color: var(--muted); }
@media (max-width: 420px) { .stats div + div { padding-left: 12px; } .stats div { padding-right: 10px; } .stats dt { font-size: 24px; } }

/* calculator card */
.calc { background: var(--panel); }
.calc-tabs { padding: 6px; gap: 4px; }
.calc-tabs button { border-radius: 12px; font-weight: 500; transition: color .2s var(--ease), background-color .2s var(--ease); }
.calc-tabs button[aria-selected="true"] { box-shadow: 0 1px 2px rgba(27, 25, 20, .08), 0 0 0 1px var(--line); }
.calc-head { padding: 20px 24px; }
.calc-head h2 { font-size: 27px; }
.calc-body { padding: 20px 24px 24px; gap: 13px; }
.pill-ok { font-size: 12px; }
.money-in { border-radius: var(--r-md); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.money-in:focus-within { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 8%, transparent); }
.money-in span, .money-in input { font-family: var(--font-display); font-weight: 400; }
.money-in input { font-size: 38px; }
.picks button, .mixseg button { font-family: var(--font-mono); transition: all .2s var(--ease); }
.picks button:hover { border-color: var(--ink); color: var(--ink); }
.calc-out .save dd { font: 400 30px/1 var(--font-display); }
.calc-note { padding: 14px 24px; line-height: 1.55; }

/* numbered section labels on the home page */
.home .wrap { counter-reset: sec; }
.home .wrap > section > .eyebrow, .home .wrap > section.split > div > .eyebrow, .home .wrap > section.rc > div > .eyebrow { counter-increment: sec; }
.home .wrap > section > .eyebrow::before, .home .wrap > section.split > div > .eyebrow::before, .home .wrap > section.rc > div > .eyebrow::before { content: counter(sec, decimal-leading-zero); width: auto; height: auto; background: none; color: var(--accent); margin-right: 4px; }

/* how-it-works steps and the stack */
.steps li { padding: 22px 0; }
.steps .n { font: 400 40px/0.9 var(--font-display); }
.steps b { font-weight: 600; letter-spacing: -0.005em; }
.stack > div { padding: 26px 22px; }
.stack .by { font-size: 11.5px; letter-spacing: .02em; }

/* board */
.board-head h2 { font-family: var(--font-mono); border-radius: var(--r-sm); }
.board-foot .big, .board-head .paid b { font-family: var(--font-display); font-weight: 400; font-size: 44px; }

/* $RAETO holder card */
.card-holder { padding: clamp(26px, 4vw, 48px); background: linear-gradient(180deg, var(--panel), color-mix(in srgb, var(--panel) 70%, var(--soft))); }
.holder-steps li::before { font-family: var(--font-mono); }
html { scroll-padding-top: 88px; }
.toc { top: 92px; }

/* rCREDIT */
.rc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
@media (max-width: 880px) { .rc { grid-template-columns: minmax(0, 1fr); } }
.rc .h2 { max-width: 15ch; }
.rc-facts { margin: 30px 0 0; display: grid; border-top: 1px solid var(--line); }
.rc-facts div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.rc-facts dt { font: 500 var(--fs-label)/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rc-facts dd { margin: 0; font-size: 15.5px; color: var(--ink); }
.rc .ctas { margin-top: 30px; }
.rc-card { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); padding: clamp(20px, 3vw, 32px); display: grid; gap: 22px; }
.rc-orbit { width: 100%; max-width: 420px; height: auto; justify-self: center; overflow: visible; }
.rc-orbit .lbl { font: 500 10.5px var(--font-mono); letter-spacing: .14em; fill: var(--muted); }
.rc-orbit circle[r="54"] { filter: drop-shadow(0 14px 22px rgba(46, 107, 71, .28)); }
.rc-flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; counter-reset: rc; }
.rc-flow li { counter-increment: rc; padding: 14px 16px; display: grid; gap: 4px; align-content: start; background: color-mix(in srgb, var(--soft) 40%, var(--panel)); }
.rc-flow li + li { border-left: 1px solid var(--line); }
.rc-flow b { font: 400 22px/1.1 var(--font-display); }
.rc-flow b::before { content: counter(rc, decimal-leading-zero) " "; font: 500 10.5px var(--font-mono); color: var(--accent); vertical-align: 5px; margin-right: 4px; }
.rc-flow span { font-size: 13px; line-height: 1.45; color: var(--muted); }
@media (max-width: 520px) { .rc-flow { grid-template-columns: minmax(0, 1fr); } .rc-flow li + li { border-left: 0; border-top: 1px solid var(--line); } .rc-facts div { grid-template-columns: 96px minmax(0, 1fr); } }

/* hero subhead */
.hero h1 { margin-top: 0; font-size: clamp(42px, 5.5vw, 76px); }
.hero .subhead { font: 500 clamp(20px, 2vw, 24px)/1.3 var(--font-body); letter-spacing: -0.015em; color: var(--ink); margin-top: 22px; }
.hero .subhead + .sub { margin-top: 14px; }
