/*
 * Rail Box: components
 * Built only from tokens.css. Load tokens.css first.
 * Page shape: <body class="rb"><div class="rb-shell"> rail + main </div></body>.
 * The rail is a column on the left on wide screens and a tab bar along the
 * bottom on phones. Everything else sits centered in the main area.
 */

/* Base */
*, *::before, *::after { box-sizing: border-box; }
.rb { margin: 0; background: var(--rb-black); color: var(--rb-text); font-family: var(--rb-mono); font-size: var(--rb-text-body); font-weight: var(--rb-weight); line-height: var(--rb-leading); -webkit-font-smoothing: antialiased; overflow-x: clip; }
:where(.rb) a { color: inherit; text-decoration: none; }
:where(.rb) p, :where(.rb) h1, :where(.rb) h2, :where(.rb) h3, :where(.rb) ul, :where(.rb) ol, :where(.rb) figure, :where(.rb) blockquote, :where(.rb) dl, :where(.rb) dd { margin: 0; }
:where(.rb) ul, :where(.rb) ol { padding: 0; list-style: none; }
:where(.rb) svg { display: block; flex: none; }
:where(.rb) button { font: inherit; color: inherit; }
.rb ::selection { background: var(--rb-white); color: var(--rb-on-white); }
.rb :focus-visible { outline: none; box-shadow: var(--rb-focus); }
@media (max-width: 720px) { :root { --rb-pad: 16px; --rb-section: 72px; } }

/* Shell */
.rb-shell { display: grid; grid-template-columns: var(--rb-rail-w) minmax(0, 1fr); min-height: 100vh; }
.rb-main { min-width: 0; padding: 0 var(--rb-pad) 48px; }

/* Rail: the only navigation */
.rb-rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; background: var(--rb-rail); border-right: var(--rb-border); }
.rb-rail__logo { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; color: var(--rb-white); }
.rb-rail__item { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 56px; padding: 8px 0 6px; border-radius: var(--rb-radius-rail); color: var(--rb-mute); font-size: var(--rb-text-micro); line-height: 1.2; transition: background var(--rb-fast), color var(--rb-fast); }
.rb-rail__item:hover { background: var(--rb-chip); color: var(--rb-white); }
.rb-rail__item--on, .rb-rail__item[aria-current="page"] { background: var(--rb-chip-hi); color: var(--rb-white); }
.rb-rail__item svg { width: 20px; height: 20px; }
.rb-rail__badge { position: relative; }
.rb-rail__badge::after { content: ""; position: absolute; top: -1px; right: -4px; width: 6px; height: 6px; border-radius: var(--rb-radius-round); background: var(--rb-mint); }
.rb-rail__spacer { flex: 1; }
@media (max-width: 720px) {
  .rb-shell { grid-template-columns: minmax(0, 1fr); padding-bottom: var(--rb-bar-h); }
  .rb-rail { position: fixed; inset: auto 0 0 0; z-index: 20; height: var(--rb-bar-h); flex-direction: row; justify-content: space-around; gap: 0; padding: 6px 4px; border-right: 0; border-top: var(--rb-border); }
  .rb-rail__logo, .rb-rail__spacer, .rb-rail__more { display: none; }
  .rb-rail__item { width: auto; min-width: 56px; padding: 6px 8px 4px; }
}

/* Top row: one centered pill and one corner button */
.rb-top { position: relative; display: flex; justify-content: center; align-items: center; min-height: 64px; }
.rb-top__end { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; gap: var(--rb-gap); }
.rb-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 6px; border-radius: var(--rb-radius-round); color: var(--rb-text); font-size: var(--rb-text-small); font-weight: var(--rb-weight-medium); white-space: nowrap; transition: background var(--rb-fast); }
.rb-pill:hover { background: var(--rb-chip); }
.rb-pill__plus { display: grid; place-items: center; width: 18px; height: 18px; border-radius: var(--rb-radius-round); background: var(--rb-chip-hi); color: var(--rb-white); font-size: 13px; line-height: 1; }
.rb-iconbtn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--rb-radius-chip); background: var(--rb-chip); color: var(--rb-white); cursor: pointer; transition: background var(--rb-fast); }
.rb-iconbtn:hover { background: var(--rb-chip-hi); }
.rb-iconbtn svg { width: 18px; height: 18px; }
@media (max-width: 720px) { .rb-top { justify-content: flex-start; } }

/* The stage: mascot over one box */
.rb-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: min(calc(100vh - 128px), 780px); padding: 32px 0; text-align: center; }
.rb-mascot { width: 120px; height: 120px; margin-bottom: 18px; color: var(--rb-white); }
.rb-mascot svg { width: 100%; height: 100%; }
.rb-mascot--sm { width: 72px; height: 72px; margin-bottom: 12px; }
.rb-mascot .rb-blush { fill: var(--rb-rose); opacity: 0.55; }
.rb-stage__note { margin-top: auto; padding-top: 48px; color: var(--rb-dim); font-size: var(--rb-text-micro); }
.rb-stage__note a { color: var(--rb-mute); text-decoration: underline; text-underline-offset: 3px; }

.rb-tool { width: 100%; max-width: var(--rb-box); text-align: left; }
.rb-box { display: flex; align-items: center; gap: 10px; height: var(--rb-input-h); padding: 0 14px; border: var(--rb-border); border-radius: var(--rb-radius-box); background: var(--rb-black); transition: border-color var(--rb-fast), background var(--rb-fast); }
.rb-box:hover { background: var(--rb-rail); }
.rb-box:focus-within { border-color: var(--rb-mute); }
.rb-box svg { width: 18px; height: 18px; color: var(--rb-mute); }
.rb-box__input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--rb-white); font: var(--rb-weight-medium) var(--rb-text-body)/1 var(--rb-mono); outline: none; }
.rb-box__input::placeholder { color: var(--rb-mute); }
.rb-box__go { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--rb-white); color: var(--rb-on-white); cursor: pointer; }
.rb-box__go svg { color: var(--rb-on-white); width: 16px; height: 16px; }
.rb-tool__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--rb-gap); margin-top: 10px; }

/* Chips: every control */
.rb-chips { display: flex; flex-wrap: wrap; gap: var(--rb-gap); }
.rb-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: calc(var(--rb-radius-chip) + 3px); background: var(--rb-chip); }
.rb-chip { display: inline-flex; align-items: center; gap: 7px; height: var(--rb-chip-h); padding: 0 12px; border: 0; border-radius: var(--rb-radius-chip); background: var(--rb-chip); color: var(--rb-text); font: var(--rb-weight-medium) var(--rb-text-small)/1 var(--rb-mono); white-space: nowrap; cursor: pointer; transition: background var(--rb-fast), color var(--rb-fast); }
.rb-seg .rb-chip { height: calc(var(--rb-chip-h) - 6px); background: transparent; }
.rb-chip:hover { background: var(--rb-chip-hi); color: var(--rb-white); }
.rb-chip--on, .rb-chip[aria-pressed="true"] { background: var(--rb-white) !important; color: var(--rb-on-white) !important; }
.rb-chip svg { width: 15px; height: 15px; }
.rb-tag { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: var(--rb-border); border-radius: var(--rb-radius-round); color: var(--rb-mute); font-size: var(--rb-text-micro); white-space: nowrap; }
.rb-tag--mint { border-color: transparent; background: var(--rb-chip); color: var(--rb-mint); }
.rb-dot { display: inline-block; width: 6px; height: 6px; border-radius: var(--rb-radius-round); background: var(--rb-mint); flex: none; }

/* Buttons */
.rb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--rb-radius-chip); background: var(--rb-white); color: var(--rb-on-white); font: var(--rb-weight-bold) var(--rb-text-small)/1 var(--rb-mono); white-space: nowrap; cursor: pointer; transition: opacity var(--rb-fast); }
.rb-btn:hover { opacity: 0.86; }
.rb-btn--ghost { background: var(--rb-chip); color: var(--rb-white); }
.rb-btn--ghost:hover { background: var(--rb-chip-hi); opacity: 1; }
.rb-btn--block { width: 100%; height: var(--rb-input-h); }
.rb-btn svg { width: 16px; height: 16px; }
.rb-link { color: var(--rb-white); text-decoration: underline; text-decoration-color: var(--rb-dim); text-underline-offset: 3px; }
.rb-link:hover { text-decoration-color: var(--rb-white); }

/* Type */
.rb-hero { color: var(--rb-white); font-size: var(--rb-text-hero); font-weight: var(--rb-weight-bold); line-height: var(--rb-leading-tight); letter-spacing: var(--rb-tracking-hero); text-wrap: balance; }
.rb-h2 { color: var(--rb-white); font-size: var(--rb-text-h2); font-weight: var(--rb-weight-bold); line-height: 1.2; letter-spacing: var(--rb-tracking-h2); text-wrap: balance; }
.rb-h3 { color: var(--rb-white); font-size: var(--rb-text-h3); font-weight: var(--rb-weight-bold); line-height: 1.4; }
.rb-lead { max-width: 52ch; color: var(--rb-text); font-size: var(--rb-text-lead); }
.rb-label { color: var(--rb-mute); font-size: var(--rb-text-small); font-weight: var(--rb-weight-medium); }
.rb-fine { color: var(--rb-dim); font-size: var(--rb-text-micro); }
.rb-mute { color: var(--rb-mute); }
.rb-kbd { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: 6px; background: var(--rb-chip-hi); color: var(--rb-white); font-size: var(--rb-text-micro); line-height: 20px; text-align: center; }

/* Sections */
.rb-section { margin: var(--rb-section) auto 0; max-width: var(--rb-wide); }
.rb-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 36px; text-align: center; }
.rb-head .rb-lead { margin-inline: auto; }
.rb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.rb-tile { display: flex; flex-direction: column; gap: 10px; padding: 22px; border: var(--rb-border); border-radius: var(--rb-radius-box); background: var(--rb-rail); }
.rb-tile__ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--rb-radius-chip); background: var(--rb-chip-hi); color: var(--rb-white); }
.rb-tile__ico svg { width: 18px; height: 18px; }
.rb-tile__num { color: var(--rb-dim); font-size: var(--rb-text-micro); font-weight: var(--rb-weight-medium); }
.rb-cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--rb-gap); max-width: 760px; margin: 0 auto; }

/* Before and after */
.rb-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.rb-card { padding: 22px; border: var(--rb-border); border-radius: var(--rb-radius-box); background: var(--rb-rail); }
.rb-card--clean { background: var(--rb-black); border-color: var(--rb-mute); }
.rb-card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.rb-noise { display: flex; flex-direction: column; gap: 8px; }
.rb-noise span { display: block; height: 9px; border-radius: 4px; background: var(--rb-chip-hi); }
.rb-noise span:nth-child(3n) { width: 72%; }
.rb-noise span:nth-child(4n) { width: 88%; }
.rb-noise__ad { display: grid; place-items: center; height: 64px; border: 1px dashed var(--rb-line); border-radius: var(--rb-radius-chip); color: var(--rb-dim); font-size: var(--rb-text-micro); }
.rb-check { display: flex; flex-direction: column; }
.rb-check li { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: var(--rb-border); }
.rb-check li:last-child { border-bottom: 0; }
.rb-check b { min-width: 64px; color: var(--rb-white); font-weight: var(--rb-weight-medium); }
.rb-steps { counter-reset: st; display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.rb-steps li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; }
.rb-steps li::before { counter-increment: st; content: counter(st); display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--rb-radius-round); background: var(--rb-chip-hi); color: var(--rb-white); font-size: var(--rb-text-micro); line-height: 1; margin-top: 1px; }

/* Toast: the one status line */
.rb-toast { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: var(--rb-radius-chip); background: var(--rb-chip); color: var(--rb-white); font-size: var(--rb-text-small); }

/* FAQ */
.rb-faq { max-width: var(--rb-box); margin: 0 auto; }
.rb-faq details { border-bottom: var(--rb-border); }
.rb-faq summary { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; color: var(--rb-white); font-weight: var(--rb-weight-medium); cursor: pointer; list-style: none; }
.rb-faq summary::-webkit-details-marker { display: none; }
.rb-faq summary::after { content: "+"; color: var(--rb-mute); }
.rb-faq details[open] summary::after { content: "-"; }
.rb-faq p { padding: 0 0 18px; color: var(--rb-text); }

/* Pricing */
.rb-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; max-width: var(--rb-wide); margin: 0 auto; }
.rb-plan { display: flex; flex-direction: column; gap: 16px; padding: 24px; border: var(--rb-border); border-radius: var(--rb-radius-box); background: var(--rb-rail); }
.rb-plan--on { border-color: var(--rb-white); background: var(--rb-black); }
.rb-plan__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rb-price { display: flex; align-items: baseline; gap: 6px; color: var(--rb-white); font-size: 40px; font-weight: var(--rb-weight-bold); line-height: 1; letter-spacing: -0.04em; }
.rb-price small { color: var(--rb-mute); font-size: var(--rb-text-small); font-weight: var(--rb-weight); letter-spacing: 0; }
.rb-feats { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.rb-feats li { display: flex; gap: 10px; }
.rb-feats li::before { content: "+"; color: var(--rb-mint); font-weight: var(--rb-weight-bold); }
.rb-feats li.rb-no { color: var(--rb-dim); }
.rb-feats li.rb-no::before { content: "-"; color: var(--rb-dim); }
.rb-table-wrap { max-width: var(--rb-wide); margin: 0 auto; overflow-x: auto; border: var(--rb-border); border-radius: var(--rb-radius-box); }
.rb-table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: var(--rb-text-small); }
.rb-table th, .rb-table td { padding: 12px 16px; border-bottom: var(--rb-border); text-align: left; }
.rb-table thead th { background: var(--rb-rail); color: var(--rb-mute); font-weight: var(--rb-weight-medium); }
.rb-table tbody tr:last-child td { border-bottom: 0; }
.rb-table td:first-child { color: var(--rb-white); }
.rb-yes { color: var(--rb-mint); }

/* Article */
.rb-article { max-width: var(--rb-box); margin: 0 auto; padding-top: 32px; }
.rb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--rb-gap); margin-bottom: 20px; }
.rb-byline { display: flex; align-items: center; gap: 12px; margin: 24px 0 36px; padding-bottom: 24px; border-bottom: var(--rb-border); }
.rb-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--rb-radius-round); background: var(--rb-chip-hi); color: var(--rb-white); font-size: var(--rb-text-small); font-weight: var(--rb-weight-bold); }
.rb-prose { display: flex; flex-direction: column; gap: 18px; color: var(--rb-text); font-size: 15px; line-height: 1.8; }
.rb-prose h2 { margin-top: 22px; color: var(--rb-white); font-size: 20px; font-weight: var(--rb-weight-bold); line-height: 1.35; letter-spacing: -0.02em; }
.rb-prose a { color: var(--rb-white); text-decoration: underline; text-decoration-color: var(--rb-dim); text-underline-offset: 3px; }
.rb-prose ul { display: flex; flex-direction: column; gap: 6px; }
.rb-prose ul li { display: flex; gap: 10px; }
.rb-prose ul li::before { content: "-"; color: var(--rb-mute); }
.rb-prose blockquote { padding: 18px 20px; border-radius: var(--rb-radius-box); background: var(--rb-rail); border: var(--rb-border); color: var(--rb-white); }
.rb-prose blockquote cite { display: block; margin-top: 8px; color: var(--rb-mute); font-size: var(--rb-text-small); font-style: normal; }
.rb-prose code { padding: 1px 6px; border-radius: 6px; background: var(--rb-chip); color: var(--rb-white); font-size: 0.92em; }
.rb-figure { padding: 20px; border: var(--rb-border); border-radius: var(--rb-radius-box); }
.rb-figure figcaption { margin-top: 12px; color: var(--rb-mute); font-size: var(--rb-text-small); }

/* Forms */
.rb-form { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 400px; text-align: left; }
.rb-field { display: flex; flex-direction: column; gap: 6px; }
.rb-input { width: 100%; height: 44px; padding: 0 14px; border: var(--rb-border); border-radius: var(--rb-radius-chip); background: var(--rb-black); color: var(--rb-white); font: var(--rb-weight-medium) var(--rb-text-body)/1 var(--rb-mono); outline: none; transition: border-color var(--rb-fast), background var(--rb-fast); }
.rb-input::placeholder { color: var(--rb-dim); }
.rb-input:hover { background: var(--rb-rail); }
.rb-input:focus { border-color: var(--rb-mute); }
.rb-input--bad { border-color: var(--rb-rose); }
.rb-help { color: var(--rb-mute); font-size: var(--rb-text-micro); }
.rb-error { color: var(--rb-rose); font-size: var(--rb-text-micro); }
.rb-tick { display: flex; align-items: flex-start; gap: 10px; color: var(--rb-text); font-size: var(--rb-text-small); cursor: pointer; }
.rb-tick input { appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; border: var(--rb-border); border-radius: 5px; background: var(--rb-black); cursor: pointer; }
.rb-tick input:checked { border-color: var(--rb-white); background: var(--rb-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23050506' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; }
.rb-divider { display: flex; align-items: center; gap: 12px; color: var(--rb-dim); font-size: var(--rb-text-micro); }
.rb-divider::before, .rb-divider::after { content: ""; flex: 1; height: 1px; background: var(--rb-line); }

/* Footer */
.rb-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; max-width: var(--rb-wide); margin: var(--rb-section) auto 0; padding-top: 24px; border-top: var(--rb-border); color: var(--rb-dim); font-size: var(--rb-text-micro); }
.rb-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.rb-foot a { color: var(--rb-mute); }
.rb-foot a:hover { color: var(--rb-white); }

@media (prefers-reduced-motion: reduce) { .rb * { transition: none !important; } }
