/*
 * Red Thread: components
 * Needs tokens.css first. Every class starts with "rt-" so it can sit next to any other CSS.
 */

/* Base */
.rt { margin: 0; background: var(--rt-paper); color: var(--rt-ink); font-family: var(--rt-sans); font-size: var(--rt-text-body); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: clip; }
.rt *, .rt *::before, .rt *::after { box-sizing: border-box; }
.rt img, .rt svg { max-width: 100%; }
.rt a { color: inherit; }
.rt-container { width: min(100% - 40px, var(--rt-container)); margin-inline: auto; }
.rt-narrow { width: min(100% - 40px, var(--rt-narrow)); margin-inline: auto; }
.rt-center { text-align: center; }
.rt-center .rt-lead { margin-inline: auto; }

/* Sections */
.rt-section { position: relative; padding-block: var(--rt-section); }
.rt-section--cream { background: var(--rt-cream); }
.rt-section--tight { padding-block: 56px; }

/* Type: one rounded sans at heavy weight for headlines, regular for everything else */
.rt-hero-title, .rt-h2, .rt-h3 { margin: 0; font-weight: 700; color: var(--rt-ink); }
.rt-hero-title { font-size: var(--rt-text-hero); letter-spacing: var(--rt-tracking-hero); line-height: 1.08; }
.rt-h2 { font-size: var(--rt-text-h2); letter-spacing: var(--rt-tracking-h2); line-height: 1.12; }
.rt-h3 { font-size: var(--rt-text-h3); letter-spacing: -.01em; line-height: 1.25; }
.rt-h3--teal { color: var(--rt-teal); }
.rt-h3--plum { color: var(--rt-blob-plum); }
.rt-h3--sage { color: #6f8f78; }
.rt-lead { max-width: 600px; margin: 14px 0 0; color: var(--rt-soft); font-size: var(--rt-text-lead); line-height: 1.5; }
.rt-eyebrow { display: inline-block; margin-bottom: 12px; color: var(--rt-red); font-size: var(--rt-text-small); font-weight: 700; letter-spacing: .02em; }
.rt-mono { font-family: var(--rt-mono); font-size: var(--rt-text-micro); }
.rt-red { color: var(--rt-red); }
.rt-muted { margin: 0; color: var(--rt-soft); }

/* The scribble: a hand-drawn teal underline under ONE word per page. Put the inline SVG inside. */
.rt-scribble { position: relative; display: inline-block; white-space: nowrap; }
.rt-scribble svg { position: absolute; left: -2%; bottom: -.16em; width: 104%; height: .32em; overflow: visible; }
.rt-scribble path { fill: none; stroke: var(--rt-teal); stroke-width: 5; stroke-linecap: round; }

/* Sparkles: small four-point stars, scattered around a hero or quote. Size them with width. */
.rt-sparkle { position: absolute; width: 18px; aspect-ratio: 1; background: var(--rt-line-strong); clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); pointer-events: none; }
.rt-sparkle--teal { background: var(--rt-teal); }
.rt-sparkle--red { background: var(--rt-red); }

/* Nav: logo left, quiet links on the right */
.rt-nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 18px; }
.rt-logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; text-decoration: none; color: var(--rt-ink); }
.rt-logo__mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50% 50% 50% 12%; background: var(--rt-red); color: var(--rt-paper); }
.rt-nav__links { display: flex; gap: 30px; font-size: 15px; font-weight: 500; }
.rt-nav__links a { color: var(--rt-ink); text-decoration: none; }
.rt-nav__links a:hover { color: var(--rt-red); }

/* Buttons: rounded rectangles, not pills. Red for the one main action, outlined for the rest */
.rt-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border: 2px solid transparent; border-radius: var(--rt-radius); font-family: var(--rt-sans); font-size: 16px; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background .2s var(--rt-ease), transform .2s var(--rt-ease), border-color .2s var(--rt-ease); }
.rt-btn:active { transform: translateY(1px); }
.rt-btn--primary { background: var(--rt-red); color: var(--rt-paper); }
.rt-btn--primary:hover { background: var(--rt-red-dark); }
.rt-btn--outline { border-color: var(--rt-ink); background: var(--rt-paper); color: var(--rt-ink); }
.rt-btn--outline:hover { background: var(--rt-cream); }
.rt-btn--quiet { padding-inline: 8px; color: var(--rt-soft); }
.rt-btn--quiet:hover { color: var(--rt-ink); }
.rt-btn--block { width: 100%; }
.rt-btn--sm { padding: 8px 16px; font-size: 15px; }
.rt-btn__stack { display: flex; flex-direction: column; text-align: left; line-height: 1.1; }
.rt-btn__stack small { font-size: 10px; font-weight: 500; }
.rt-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.rt-center .rt-actions { justify-content: center; }

/* Platform tabs: the active one is red with three tiny tick marks above it */
.rt-tabs { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px 30px; margin-top: 22px; color: var(--rt-faint); font-size: 18px; }
.rt-tabs button { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: inherit; font: inherit; cursor: pointer; }
.rt-tabs button[aria-pressed="true"] { border-bottom-color: var(--rt-red); color: var(--rt-ink); }
.rt-tabs button[aria-pressed="true"]::before { content: ""; position: absolute; left: 50%; top: -14px; width: 28px; height: 12px; transform: translateX(-50%); background: var(--rt-teal); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 12'%3E%3Cg stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M14 1v8M4 4l4 6M24 4l-4 6'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 12'%3E%3Cg stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M14 1v8M4 4l4 6M24 4l-4 6'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.rt-tabs__new { color: var(--rt-red); font-size: 9px; font-weight: 800; vertical-align: super; }

/* App window: dark sidebar, a note list, the open note. The product is always the hero picture */
.rt-app { display: grid; grid-template-columns: 200px 250px 1fr; overflow: hidden; min-height: 440px; border: var(--rt-border); border-radius: var(--rt-radius-lg); background: var(--rt-paper); box-shadow: var(--rt-shadow-lg); text-align: left; font-size: 13px; }
.rt-app__side { padding: 14px 10px; background: var(--rt-sidebar); color: var(--rt-sidebar-text); }
.rt-app__lights { display: flex; gap: 6px; margin: 0 0 16px 4px; }
.rt-app__lights i { width: 10px; height: 10px; border-radius: 50%; background: #e86a5b; }
.rt-app__lights i:nth-child(2) { background: #e9b949; }
.rt-app__lights i:nth-child(3) { background: #63bd65; }
.rt-app__item { display: flex; justify-content: space-between; gap: 8px; padding: 5px 10px; border-radius: var(--rt-radius-sm); }
.rt-app__item--on { background: var(--rt-sidebar-2); color: var(--rt-paper); }
.rt-app__item--sub { padding-left: 26px; }
.rt-app__list { border-right: var(--rt-border); background: var(--rt-paper); }
.rt-app__list-head { display: flex; justify-content: space-between; padding: 14px 14px 10px; font-weight: 700; }
.rt-app__note { padding: 12px 14px; border-top: var(--rt-border); border-left: 3px solid transparent; color: var(--rt-soft); line-height: 1.45; }
.rt-app__note b { display: block; margin-bottom: 3px; color: var(--rt-ink); }
.rt-app__note--on { border-left-color: var(--rt-red); background: var(--rt-cream); }
.rt-app__time { display: block; margin-top: 6px; color: var(--rt-faint); font-size: 11px; }
.rt-app__doc { padding: 34px 40px; }
.rt-app__doc h4 { margin: 0 0 10px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.rt-app__doc h5 { margin: 22px 0 8px; font-size: 16px; font-weight: 700; }
.rt-app__doc p { margin: 0; color: var(--rt-soft); }
.rt-cursor { display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: -.2em; background: var(--rt-red); animation: rt-blink 1.1s steps(1) infinite; }
@keyframes rt-blink { 50% { opacity: 0; } }

/* Note pieces: tags, highlights, callouts, checklists. Use them inside notes and articles */
.rt-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--rt-radius-pill); background: #eeebe8; color: var(--rt-soft); font-size: .88em; white-space: nowrap; }
.rt-mark { padding: 0 3px; border-radius: 3px; background: var(--rt-mark); }
.rt-callout { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--rt-amber); border-radius: 0 var(--rt-radius-sm) var(--rt-radius-sm) 0; background: #fdf6ea; color: var(--rt-ink); }
.rt-callout b { display: block; margin-bottom: 2px; }
.rt-check { display: flex; align-items: center; gap: 10px; padding: 3px 0; color: var(--rt-ink); }
.rt-check::before { content: ""; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--rt-line-strong); border-radius: 4px; }
.rt-check--done { color: var(--rt-faint); text-decoration: line-through; }
.rt-check--done::before { border-color: var(--rt-teal); background: var(--rt-teal); }

/* Awards: a small laurel of two curved brackets around a name and year */
.rt-awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px 56px; }
.rt-award { position: relative; padding: 6px 30px; color: var(--rt-soft); font-size: var(--rt-text-small); font-weight: 600; text-align: center; line-height: 1.35; }
.rt-award small { display: block; font-weight: 400; color: var(--rt-faint); }
.rt-award::before, .rt-award::after { content: ""; position: absolute; top: 0; bottom: 0; width: 18px; border: 2px dotted var(--rt-line-strong); border-radius: 50%; }
.rt-award::before { left: 0; border-right: 0; }
.rt-award::after { right: 0; border-left: 0; }

/* Feature row: text on one side, a card floating on a soft blob on the other */
.rt-feature { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 64px; }
.rt-feature--flip .rt-feature__media { order: -1; }
.rt-feature__media { position: relative; display: grid; place-items: center; min-height: 360px; }
.rt-blob { position: absolute; inset: 0 -12%; border-radius: 58% 42% 46% 54% / 52% 44% 56% 48%; background: var(--rt-blob-teal); z-index: 0; }
.rt-blob--plum { background: var(--rt-blob-plum); border-radius: 44% 56% 60% 40% / 50% 58% 42% 50%; }
.rt-blob--sage { background: var(--rt-blob-sage); border-radius: 50% 50% 40% 60% / 60% 46% 54% 40%; }
.rt-list { margin: 18px 0 0; padding: 0; list-style: none; }
.rt-list li { position: relative; padding: 0 0 12px 22px; color: var(--rt-soft); }
.rt-list li::before { content: ""; position: absolute; left: 4px; top: .65em; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .6; }

/* Card: white, thin border, soft shadow. Used alone or floating on a blob */
.rt-card { position: relative; z-index: 1; padding: 26px; border: var(--rt-border); border-radius: var(--rt-radius-lg); background: var(--rt-paper); box-shadow: var(--rt-shadow); }
.rt-card--float { width: min(100%, 360px); box-shadow: var(--rt-shadow-lg); }
.rt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.rt-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 16px; border-radius: 12px; background: var(--rt-red-soft); color: var(--rt-red); }

/* Quote */
.rt-quote { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
.rt-quote--sm { font-size: 20px; }
.rt-quote cite { display: block; margin-top: 16px; color: var(--rt-soft); font-size: var(--rt-text-small); font-style: normal; font-weight: 500; }

/* Pricing */
.rt-billing { display: inline-flex; gap: 2px; padding: 4px; border: var(--rt-border); border-radius: var(--rt-radius); background: var(--rt-cream); }
.rt-billing button { padding: 7px 16px; border: 0; border-radius: var(--rt-radius-sm); background: transparent; color: var(--rt-soft); font: 600 14px var(--rt-sans); cursor: pointer; }
.rt-billing button[aria-pressed="true"] { background: var(--rt-paper); color: var(--rt-ink); box-shadow: var(--rt-shadow); }
.rt-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; align-items: start; }
.rt-plan { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 30px; border: var(--rt-border); border-radius: var(--rt-radius-lg); background: var(--rt-paper); }
.rt-plan--featured { border: 2px solid var(--rt-red); box-shadow: var(--rt-shadow-lg); }
.rt-plan__badge { position: absolute; top: -13px; left: 28px; padding: 3px 12px; border-radius: var(--rt-radius-pill); background: var(--rt-red); color: var(--rt-paper); font-size: var(--rt-text-micro); font-weight: 700; }
.rt-plan__name { font-size: 18px; font-weight: 700; }
.rt-plan__price { font-size: 46px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.rt-plan__price small { color: var(--rt-soft); font-size: 15px; font-weight: 500; letter-spacing: 0; }
.rt-plan ul { margin: 0; padding: 0; list-style: none; }
.rt-plan li { display: flex; gap: 10px; padding: 6px 0; color: var(--rt-soft); }
.rt-plan li::before { content: ""; flex: none; width: 14px; height: 8px; margin-top: 7px; border-left: 2px solid var(--rt-teal); border-bottom: 2px solid var(--rt-teal); transform: rotate(-45deg); }

/* FAQ */
.rt-faq { border-top: var(--rt-border); }
.rt-faq details { border-bottom: var(--rt-border); padding: 18px 0; }
.rt-faq summary { display: flex; justify-content: space-between; gap: 16px; font-weight: 700; cursor: pointer; list-style: none; }
.rt-faq summary::-webkit-details-marker { display: none; }
.rt-faq summary::after { content: "+"; color: var(--rt-red); font-size: 22px; line-height: 1; }
.rt-faq details[open] summary::after { content: "\2212"; }
.rt-faq p { margin: 10px 0 0; color: var(--rt-soft); }

/* Article: reads like an open note */
.rt-article { font-size: 18px; line-height: 1.75; }
.rt-article h2 { margin: 44px 0 12px; font-size: 28px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.rt-article p { margin: 0 0 20px; }
.rt-article a { color: var(--rt-red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rt-article ul { margin: 0 0 20px; padding-left: 22px; }
.rt-article blockquote { margin: 32px 0; padding-left: 22px; border-left: 3px solid var(--rt-red); font-size: 22px; font-weight: 600; line-height: 1.45; }
.rt-article pre { overflow-x: auto; margin: 0 0 24px; padding: 18px 20px; border-radius: var(--rt-radius); background: var(--rt-cream); border: var(--rt-border); font: 14px/1.6 var(--rt-mono); }
.rt-byline { display: flex; align-items: center; gap: 12px; color: var(--rt-soft); font-size: var(--rt-text-small); }
.rt-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--rt-red-soft); color: var(--rt-red); font-weight: 800; }
.rt-figure { margin: 32px 0; }
.rt-figure figcaption { margin-top: 10px; color: var(--rt-faint); font-size: var(--rt-text-small); text-align: center; }

/* Forms */
.rt-form { display: grid; gap: 16px; }
.rt-field { display: grid; gap: 6px; }
.rt-label { font-size: var(--rt-text-small); font-weight: 700; }
.rt-input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--rt-line-strong); border-radius: var(--rt-radius); background: var(--rt-paper); color: var(--rt-ink); font: 16px var(--rt-sans); }
.rt-input:focus { outline: none; border-color: var(--rt-red); box-shadow: 0 0 0 4px var(--rt-red-soft); }
.rt-hint { color: var(--rt-faint); font-size: var(--rt-text-micro); }
.rt-checkline { display: flex; gap: 10px; align-items: flex-start; color: var(--rt-soft); font-size: var(--rt-text-small); }
.rt-checkline input { margin-top: 3px; accent-color: var(--rt-red); }
.rt-or { display: flex; align-items: center; gap: 12px; color: var(--rt-faint); font-size: var(--rt-text-small); }
.rt-or::before, .rt-or::after { content: ""; flex: 1; height: 1px; background: var(--rt-line); }

/* Footer */
.rt-footer { padding-block: 56px 40px; border-top: var(--rt-border); background: var(--rt-cream); color: var(--rt-soft); font-size: var(--rt-text-small); }
.rt-footer__cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.rt-footer h6 { margin: 0 0 12px; color: var(--rt-ink); font-size: var(--rt-text-small); font-weight: 700; }
.rt-footer a { display: block; padding: 3px 0; color: var(--rt-soft); text-decoration: none; }
.rt-footer a:hover { color: var(--rt-red); }
.rt-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: var(--rt-border); }

.rt-footer__base:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.rt-footer--slim { padding-block: 28px; }

/* Phone */
@media (max-width: 900px) {
  .rt-app { grid-template-columns: 1fr; min-height: 0; }
  .rt-app__side, .rt-app__list { display: none; }
  .rt-app__doc { padding: 26px 22px; }
  .rt-feature, .rt-grid, .rt-plans, .rt-footer__cols { grid-template-columns: 1fr; }
  .rt-feature { gap: 36px; }
  .rt-feature--flip .rt-feature__media { order: 0; }
  .rt-feature__media { min-height: 300px; }
  .rt-blob { inset: 0 -4%; }
  .rt-nav__links { display: none; }
}
@media (min-width: 640px) and (max-width: 900px) {
  .rt-app { grid-template-columns: 220px 1fr; }
  .rt-app__list { display: block; }
}
