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

/* Base */
.rp { margin: 0; background: var(--rp-paper); color: var(--rp-ink); font-family: var(--rp-sans); font-size: var(--rp-text-body); line-height: 1.6; -webkit-font-smoothing: antialiased; }
.rp *, .rp *::before, .rp *::after { box-sizing: border-box; }
.rp img, .rp svg { max-width: 100%; display: block; }
:where(.rp) a { color: inherit; }
.rp-container { width: min(100% - 48px, var(--rp-container)); margin-inline: auto; }
.rp-wide { width: min(100% - 32px, var(--rp-wide)); margin-inline: auto; }
.rp-narrow { width: min(100% - 48px, var(--rp-narrow)); margin-inline: auto; }
.rp-section { padding-block: var(--rp-section); }
.rp-section--mist { background: var(--rp-mist); }
.rp-center { text-align: center; }

/* Nav: logo left, plain text links right */
.rp-nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 18px; }
.rp-logo { display: inline-flex; align-items: center; gap: 12px; font-family: var(--rp-display); font-weight: 800; font-size: 20px; text-decoration: none; color: var(--rp-ink); }
.rp-logo__mark { width: 34px; height: 34px; border-radius: 50%; background: var(--rp-red); display: grid; place-items: center; color: var(--rp-paper); flex: none; }
.rp-nav__links { display: flex; gap: 36px; list-style: none; margin: 0; padding: 0; }
.rp-nav__links a { text-decoration: none; color: var(--rp-ink); font-size: 16px; }
.rp-nav__links a:hover { color: var(--rp-red); }
@media (max-width: 860px) { .rp-nav__links { display: none; } }

/* Headlines */
.rp-hero-title { font-family: var(--rp-display); font-weight: 800; font-size: var(--rp-text-hero); line-height: 1.08; letter-spacing: var(--rp-tracking-hero); margin: 0; }
.rp-h2 { font-family: var(--rp-display); font-weight: 800; font-size: var(--rp-text-h2); line-height: 1.12; letter-spacing: -.01em; margin: 0; }
.rp-h3 { font-family: var(--rp-display); font-weight: 700; font-size: var(--rp-text-h3); line-height: 1.25; margin: 0; }
.rp-lead { font-size: var(--rp-text-lead); color: var(--rp-ink); line-height: 1.45; margin: 0; }
.rp-sub { color: var(--rp-soft); margin: 0; }
.rp-eyebrow { display: inline-block; font-family: var(--rp-display); font-weight: 700; font-size: var(--rp-text-small); letter-spacing: .06em; text-transform: uppercase; color: var(--rp-red); }

/* The signature: a hand-drawn teal underline under one word */
.rp-mark { position: relative; white-space: nowrap; display: inline-block; }
.rp-mark::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -.04em; height: .16em;
  background: var(--rp-teal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 3, 90 4, 130 6 S 185 9, 198 4' fill='none' stroke='black' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 3, 90 4, 130 6 S 185 9, 198 4' fill='none' stroke='black' stroke-width='6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

/* Sketch ticks: three little teal strokes that "sparkle" above an active item */
.rp-ticks { position: relative; }
.rp-ticks::before {
  content: ""; position: absolute; left: 50%; top: -22px; width: 46px; height: 16px; transform: translateX(-50%);
  background: var(--rp-teal);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 16'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 8 L10 14'/%3E%3Cpath d='M23 2 L23 11'/%3E%3Cpath d='M40 8 L36 14'/%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 46 16'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 8 L10 14'/%3E%3Cpath d='M23 2 L23 11'/%3E%3Cpath d='M40 8 L36 14'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* Buttons: rounded rectangles, never pills. Outlined ink is the default */
.rp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap; font-family: var(--rp-display); font-weight: 700; font-size: 17px; line-height: 1; padding: 15px 24px; border-radius: var(--rp-radius); border: var(--rp-border-ink); background: var(--rp-paper); color: var(--rp-ink); text-decoration: none; cursor: pointer; transition: background .2s var(--rp-ease), color .2s var(--rp-ease), border-color .2s var(--rp-ease); }
.rp-btn:hover { background: var(--rp-ink); color: var(--rp-paper); }
.rp-btn--primary { background: var(--rp-red); border-color: var(--rp-red); color: var(--rp-paper); }
.rp-btn--primary:hover { background: var(--rp-red-dark); border-color: var(--rp-red-dark); }
.rp-btn--ghost { border-color: transparent; background: transparent; color: var(--rp-red); padding-inline: 8px; }
.rp-btn--ghost:hover { background: var(--rp-red-soft); color: var(--rp-red-dark); }
.rp-btn--sm { font-size: 15px; padding: 10px 16px; }
.rp-btn--block { width: 100%; }

/* Badge-style button: two lines, like a store badge */
.rp-badge-btn { display: inline-flex; align-items: center; gap: 14px; padding: 10px 22px 10px 18px; border: var(--rp-border-ink); border-radius: var(--rp-radius); text-decoration: none; color: var(--rp-ink); background: var(--rp-paper); white-space: nowrap; }
.rp-badge-btn small { display: block; font-size: 12px; line-height: 1.2; }
.rp-badge-btn strong { display: block; font-family: var(--rp-display); font-weight: 700; font-size: 22px; line-height: 1.1; }
.rp-badge-btn:hover { background: var(--rp-mist); }

/* Device tabs: plain words with a thin icon, the active one gets ticks and a teal underline */
.rp-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; list-style: none; margin: 0; padding: 0; }
.rp-tab { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; color: var(--rp-faint); background: none; border: 0; padding: 4px 2px 8px; cursor: pointer; font-family: var(--rp-sans); }
.rp-tab[aria-selected="true"] { color: var(--rp-ink); box-shadow: inset 0 -2px 0 var(--rp-teal); }
.rp-tab sup { color: var(--rp-red); font-weight: 700; font-size: 10px; letter-spacing: .04em; }

/* Tags and chips */
.rp-tag { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--rp-radius-sm); background: var(--rp-mist-2); color: var(--rp-ink); font-size: 14px; white-space: nowrap; }
.rp-tag::before { content: "#"; color: var(--rp-soft); font-weight: 700; }
.rp-new { display: inline-block; color: var(--rp-red); font-family: var(--rp-display); font-weight: 800; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.rp-pill { display: inline-block; padding: 4px 12px; border-radius: var(--rp-radius-pill); background: var(--rp-red-soft); color: var(--rp-red-dark); font-size: 13px; font-weight: 700; }

/* App window: the product shot. Dark sidebar, a list, a roomy editor */
.rp-window { display: grid; grid-template-columns: 200px 270px 1fr; border-radius: var(--rp-radius-lg); overflow: hidden; background: var(--rp-paper); box-shadow: var(--rp-shadow-lg); border: var(--rp-border); text-align: left; font-size: 14px; }
.rp-window__side { background: var(--rp-night); color: #d9dbde; padding: 14px 10px; }
.rp-window__lights { display: flex; gap: 7px; padding: 2px 6px 16px; }
.rp-window__lights i { width: 11px; height: 11px; border-radius: 50%; background: var(--rp-red); }
.rp-window__lights i:nth-child(2) { background: var(--rp-amber); }
.rp-window__lights i:nth-child(3) { background: #5cbf6a; }
.rp-window__nav { list-style: none; margin: 0; padding: 0; }
.rp-window__nav li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--rp-radius-sm); color: #b9bcc2; }
.rp-window__nav li.is-on { background: var(--rp-night-2); color: #fff; }
.rp-window__nav svg { width: 15px; height: 15px; flex: none; }
.rp-window__list { border-right: var(--rp-border); }
.rp-window__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-weight: 700; border-bottom: var(--rp-border); }
.rp-note { padding: 12px 14px; border-bottom: var(--rp-border); }
.rp-note strong { display: block; font-size: 14px; }
.rp-note p { margin: 2px 0 0; color: var(--rp-soft); font-size: 13px; line-height: 1.45; }
.rp-note time { display: block; margin-top: 6px; color: var(--rp-faint); font-size: 11px; }
.rp-note.is-on { background: var(--rp-mist); box-shadow: inset 3px 0 0 var(--rp-red); }
.rp-window__editor { padding: 34px 44px; }
.rp-window__editor h4 { font-family: var(--rp-display); font-weight: 800; font-size: 26px; margin: 0 0 10px; }
.rp-window__editor p { margin: 0 0 14px; line-height: 1.6; }
.rp-window__editor h5 { font-family: var(--rp-display); font-weight: 800; font-size: 18px; margin: 20px 0 8px; }
.rp-check { display: flex; align-items: center; gap: 10px; color: var(--rp-soft); margin: 6px 0; }
.rp-check::before { content: ""; width: 14px; height: 14px; border: 1.5px solid var(--rp-line-strong); border-radius: 4px; flex: none; }
.rp-check.is-done { text-decoration: line-through; }
.rp-check.is-done::before { background: var(--rp-teal); border-color: var(--rp-teal); }
@media (max-width: 900px) { .rp-window { grid-template-columns: 1fr; } .rp-window__side, .rp-window__list { display: none; } .rp-window__editor { padding: 24px 22px; } }

/* Callout inside notes and articles */
.rp-callout { border: var(--rp-border); border-left: 3px solid var(--rp-amber); background: var(--rp-amber-soft); border-radius: var(--rp-radius-sm); padding: 12px 16px; }
.rp-callout strong { display: block; font-family: var(--rp-display); }

/* Feature cards */
.rp-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.rp-card { background: var(--rp-paper); border: var(--rp-border); border-radius: var(--rp-radius-lg); padding: 28px; }
.rp-card--mist { background: var(--rp-mist); border-color: transparent; }
.rp-card__icon { width: 44px; height: 44px; border-radius: 12px; background: var(--rp-red-soft); color: var(--rp-red); display: grid; place-items: center; margin-bottom: 18px; }
.rp-card__icon svg { width: 22px; height: 22px; }
.rp-card p { color: var(--rp-soft); margin: 8px 0 0; }

/* Quote */
.rp-quote { font-family: var(--rp-display); font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.35; margin: 0; }
.rp-quote-by { display: flex; align-items: center; gap: 12px; margin-top: 20px; color: var(--rp-soft); font-size: 15px; }
.rp-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--rp-teal-soft); color: var(--rp-ink); display: grid; place-items: center; font-family: var(--rp-display); font-weight: 800; flex: none; }

/* Pricing */
.rp-toggle { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--rp-radius); background: var(--rp-mist); }
.rp-toggle button { border: 0; background: transparent; padding: 9px 18px; border-radius: var(--rp-radius-sm); font: 700 15px var(--rp-display); color: var(--rp-soft); cursor: pointer; white-space: nowrap; }
.rp-toggle button[aria-pressed="true"] { background: var(--rp-paper); color: var(--rp-ink); box-shadow: var(--rp-shadow); }
.rp-plans { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
.rp-plan { border: var(--rp-border); border-radius: var(--rp-radius-lg); padding: 32px; background: var(--rp-paper); }
.rp-plan--featured { border: 1.5px solid var(--rp-ink); box-shadow: var(--rp-shadow); }
.rp-plan__price { font-family: var(--rp-display); font-weight: 800; font-size: 52px; line-height: 1; margin: 18px 0 6px; }
.rp-plan__price small { font-size: 17px; font-weight: 600; color: var(--rp-soft); }
.rp-plan ul { list-style: none; padding: 0; margin: 24px 0 28px; display: grid; gap: 10px; }
.rp-plan li { display: flex; gap: 10px; align-items: baseline; }
.rp-plan li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rp-teal); flex: none; transform: translateY(-1px); }

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

/* Article */
.rp-article { font-size: 19px; line-height: 1.75; }
.rp-article h2 { font-family: var(--rp-display); font-weight: 800; font-size: 30px; line-height: 1.2; margin: 48px 0 12px; }
.rp-article p { margin: 0 0 22px; }
.rp-article a { color: var(--rp-ink); text-decoration-color: var(--rp-teal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.rp-article a:hover { color: var(--rp-red); }
.rp-article blockquote { margin: 32px 0; padding-left: 22px; border-left: 3px solid var(--rp-teal); font-family: var(--rp-display); font-weight: 700; font-size: 24px; line-height: 1.4; }
.rp-article code { font-family: var(--rp-mono); font-size: .85em; background: var(--rp-mist); padding: 2px 6px; border-radius: 4px; }
.rp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; color: var(--rp-soft); font-size: 15px; }

/* Forms */
.rp-field { display: grid; gap: 6px; margin-bottom: 18px; }
.rp-label { font-family: var(--rp-display); font-weight: 700; font-size: 15px; }
.rp-input { width: 100%; font: 400 17px var(--rp-sans); color: var(--rp-ink); background: var(--rp-paper); border: 1.5px solid var(--rp-line-strong); border-radius: var(--rp-radius); padding: 13px 14px; outline: none; transition: border-color .2s var(--rp-ease), box-shadow .2s var(--rp-ease); }
.rp-input:focus { border-color: var(--rp-ink); box-shadow: 0 0 0 4px var(--rp-teal-soft); }
.rp-hint { color: var(--rp-soft); font-size: 14px; }
.rp-checkline { display: flex; gap: 10px; align-items: flex-start; color: var(--rp-soft); font-size: 15px; }
.rp-checkline input { accent-color: var(--rp-red); margin-top: 4px; }
.rp-divider { display: flex; align-items: center; gap: 14px; color: var(--rp-faint); font-size: 14px; margin: 22px 0; }
.rp-divider::before, .rp-divider::after { content: ""; flex: 1; height: 1px; background: var(--rp-line); }
.rp-panel { background: var(--rp-paper); border: var(--rp-border); border-radius: var(--rp-radius-lg); padding: clamp(24px, 4vw, 40px); box-shadow: var(--rp-shadow); }

/* Footer */
.rp-footer { border-top: var(--rp-border); padding-block: 56px 40px; color: var(--rp-soft); font-size: 15px; }
.rp-footer__cols { display: grid; gap: 32px; grid-template-columns: 2fr repeat(3, 1fr); }
.rp-footer h4 { font-family: var(--rp-display); color: var(--rp-ink); font-size: 15px; margin: 0 0 12px; }
.rp-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rp-footer a { text-decoration: none; }
.rp-footer a:hover { color: var(--rp-red); }
.rp-footer__base { margin-top: 40px; padding-top: 20px; border-top: var(--rp-border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; }
@media (max-width: 720px) { .rp-footer__cols { grid-template-columns: 1fr 1fr; } .rp-footer__cols > :first-child { grid-column: 1 / -1; } }

/* Motion: small, slow fades */
@media (prefers-reduced-motion: no-preference) {
  .rp-fade { animation: rp-fade .9s var(--rp-ease) both; }
  @keyframes rp-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}
