/* One Clear Reader: base styles. Section styles are inline in the page. */
html, body { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: #F4F1EA; color: #141414; font-family: "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
* { box-sizing: border-box; }
a { color: #141414; text-decoration: none; }
a:hover { color: #1F6FEB; }
img { max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 2px solid #1F6FEB; outline-offset: 3px; }
input[type="range"] { accent-color: #FF5A36; width: 100%; margin: 0; height: 22px; }
[id] { scroll-margin-top: 90px; }

@keyframes mdr-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes mdr-spin { 100% { transform: rotate(360deg); } }
@keyframes mdr-drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, -8px); } }
@keyframes mdr-drift2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-22px, 6px); } }
@keyframes mdr-wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(1.5deg); } }
@keyframes mdr-up { 0% { transform: translateY(0); } 100% { transform: translateY(-50%); } }
@keyframes mdr-marq { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
@keyframes mdrMenuIn { 0% { opacity: 0; transform: translateY(-8px) scale(.98); } 100% { opacity: 1; transform: none; } }
@keyframes ocr-fade { from { opacity: .35; } to { opacity: 1; } }

/* Navigation: one version for wide screens, one for phones. */
.nav-mobile { display: none; }
@media (max-width: 819px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
}
@media (max-width: 429px) {
  .nav-mobile nav > div > a[href$="#download"] { display: none; }
}
#mdr-menu { animation: mdrMenuIn .22s ease-out; }
.menu-open { overflow: hidden; }

/* Phone layouts for a few desktop-first blocks. */
@media (max-width: 760px) {
  .hero-peak { display: none; }
}
@media (max-width: 600px) {
  .hero-doc { grid-template-columns: minmax(0, 1fr) !important; }
  .hero-doc > :first-child { display: none !important; }
  .culprit-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* Swapped sections fade in gently. */
.ocr-swapped { animation: ocr-fade .35s ease-out; }

/* FAQ */
.faq-list { display: flex; flex-direction: column; }
.faq-group { margin: 0 0 6px; padding-bottom: 12px; border-bottom: 1.5px solid #141414; display: flex; align-items: center; gap: 10px; font-family: "JetBrains Mono", monospace; font-size: 12.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: #141414; }
.faq-group-later { margin-top: 44px; }
.faq-dot { width: 10px; height: 10px; border-radius: 3px; background: #4A9FE8; }
.faq-g2 .faq-dot { background: #E9CF5E; }
.faq-g3 .faq-dot { background: #4C9A4C; }
.faq-item { margin: 4px -20px 0; padding: 0 20px; border-bottom: 1px solid rgba(0,0,0,.12); border-radius: 0; transition: background .35s, box-shadow .35s; }
.faq-item summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 20px; cursor: pointer; padding: 22px 0; font-size: clamp(18px, 1.6vw, 22px); font-weight: 500; line-height: 1.25; color: #141414; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-plus { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: #F4F1EA; color: #141414; display: grid; place-items: center; transition: transform .3s, background .3s; }
.faq-plus::before { content: "+"; font-size: 22px; line-height: 1; }
.faq-item[open] { border-radius: 22px; border-bottom-color: transparent; box-shadow: 0 18px 40px rgba(20,40,80,.08); background: #DCE9FB; }
.faq-item.faq-g2[open] { background: #FBF0B8; }
.faq-item.faq-g3[open] { background: #D9EDD9; }
.faq-item[open] .faq-plus { transform: rotate(45deg); background: #1B4C82; color: #fff; }
.faq-item.faq-g2[open] .faq-plus { background: #6B5C14; }
.faq-item.faq-g3[open] .faq-plus { background: #1E5A1E; }
.faq-a { margin: 0 0 20px; padding: 22px 26px; background: rgba(255,255,255,.58); border-radius: 16px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); font-size: 16px; line-height: 1.6; color: #2B2B2B; display: flex; flex-direction: column; gap: 9px; }
.faq-a p { margin: 0; text-wrap: pretty; }

.noise { background-image: url("data:image/svg+xml;utf8,<svg xmlns=%22http://www.w3.org/2000/svg%22 width=%22160%22 height=%22160%22><filter id=%22n%22><feTurbulence type=%22fractalNoise%22 baseFrequency=%22.9%22 numOctaves=%222%22/><feColorMatrix values=%220 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .08 0%22/></filter><rect width=%22160%22 height=%22160%22 filter=%22url(%23n)%22/></svg>"); }

/* Reading profile demo. Values mirror the app's presets, scaled for a small preview. */
.rp-card { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); background: #fff; border-radius: 28px; box-shadow: 0 30px 70px rgba(20, 40, 80, .22); overflow: hidden; text-align: left; }
.rp-controls { padding: 30px 28px; display: flex; flex-direction: column; gap: 12px; border-right: 1px solid rgba(0,0,0,.08); }
.rp-eyebrow { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .14em; color: #555; }
.rp-title { font-family: "Instrument Serif", serif; font-size: 34px; line-height: 1; color: #141414; }
.rp-title-small { font-size: 24px; margin-top: 8px; }
.rp-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rp-chips-looks { grid-template-columns: repeat(3, 1fr); }
.rp-chip { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 10px; border-radius: 14px; border: 1.5px solid rgba(0,0,0,.12); background: #F4F1EA; color: #141414; font-size: 14.5px; font-weight: 600; text-align: center; line-height: 1.2; transition: background .2s, border-color .2s, color .2s; }
.rp-chip:hover { border-color: #141414; }
.rp-chip:focus-visible { outline: 2px solid #1F6FEB; outline-offset: 3px; }
.rp-chip[aria-pressed="true"] { background: #141414; border-color: #141414; color: #fff; }
.rp-pro { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: #FF5A36; color: #fff; }
.rp-desc { margin: 2px 0 0; font-size: 14.5px; line-height: 1.55; color: #3A4566; min-height: 4.7em; }
.rp-foot { margin: 0; font-size: 13px; line-height: 1.5; color: #555; }
.rp-preview-wrap { background: #F4F1EA; padding: 22px 26px 30px; min-width: 0; }
.rp-preview-label { font-family: "JetBrains Mono", monospace; font-size: 12px; letter-spacing: .14em; color: #555; margin-bottom: 14px; }
.rp-page {
  --rp-bg: #ffffff; --rp-ink: #2b2b2b; --rp-head: #141414; --rp-h1: var(--rp-head); --rp-h2: var(--rp-head); --rp-h3: var(--rp-head);
  --rp-strong: var(--rp-head); --rp-link: #1F5FBF; --rp-marker: #FF5A36; --rp-rule: #FF5A36;
  --rp-font: "DM Sans", system-ui, sans-serif; --rp-head-font: "Instrument Serif", Georgia, serif;
  --rp-size: 17px; --rp-lh: 1.72; --rp-ls: 0em; --rp-ws: 0em; --rp-gap: 1; --rp-measure: 600px;
  background: var(--rp-bg); color: var(--rp-ink); font-family: var(--rp-font); font-size: var(--rp-size); line-height: var(--rp-lh);
  letter-spacing: var(--rp-ls); word-spacing: var(--rp-ws); border-radius: 18px; padding: 30px clamp(20px, 4vw, 44px) 26px;
  box-shadow: 0 10px 30px rgba(20, 40, 80, .1); transition: background .3s, color .3s; min-height: 430px;
}
.rp-page > * { max-width: var(--rp-measure); margin: 0 0 calc(.8em * var(--rp-gap)); transition: opacity .3s; }
.rp-page p { margin-bottom: calc(1em * var(--rp-gap)); }
.rp-page ul { padding-left: 1.2em; }
.rp-page li { margin: .2em 0; }
.rp-page li::marker { color: var(--rp-marker); }
.rp-page strong { color: var(--rp-strong); }
.rp-page a { color: var(--rp-link); text-decoration: underline; text-underline-offset: 3px; }
.rp-h1 { font-family: var(--rp-head-font); font-size: 2em; line-height: 1.05; color: var(--rp-h1); letter-spacing: -.01em; padding-bottom: .3em; }
.rp-h1::after { content: ""; display: block; width: 44px; height: 3px; border-radius: 2px; background: var(--rp-rule); margin-top: .35em; }
.rp-h2 { font-family: var(--rp-head-font); font-size: 1.45em; line-height: 1.1; color: var(--rp-h2); margin-top: .9em !important; }
.rp-h3 { font-family: var(--rp-font); font-weight: 700; font-size: 1.1em; color: var(--rp-h3); margin-top: .9em !important; }

.rp-card[data-profile="large"] .rp-page { --rp-size: 20px; --rp-lh: 1.78; --rp-ls: .005em; }
.rp-card[data-profile="compact"] .rp-page { --rp-size: 14.5px; --rp-lh: 1.55; --rp-gap: .75; --rp-measure: 100%; }
.rp-card[data-profile="neuro"] .rp-page { --rp-font: "Atkinson Hyperlegible", Verdana, sans-serif; --rp-head-font: "Atkinson Hyperlegible", Verdana, sans-serif; --rp-size: 18px; --rp-lh: 1.85; --rp-ls: .02em; --rp-ws: .06em; --rp-gap: 1.2; --rp-measure: 500px; }
.rp-card[data-profile="neuro"][data-look="paper"] .rp-page { --rp-bg: #f7f3e8; --rp-ink: #202938; --rp-head: #202938; }
.rp-card[data-profile="custom"] .rp-page { --rp-font: Literata, Georgia, serif; --rp-head-font: Literata, Georgia, serif; --rp-size: 17px; --rp-lh: 1.8; --rp-measure: 540px; }
.rp-card[data-profile="paragraph"] .rp-block { opacity: .22; cursor: pointer; }
.rp-card[data-profile="paragraph"] .rp-block.is-focus { opacity: 1; }

.rp-page { --rp-h3: #b83a1c; --rp-link: #b83a1c; --rp-marker: #e2502d; --rp-rule: #ff5a36; }
.rp-card[data-look="mist"] .rp-page { --rp-bg: #f3f6fa; --rp-ink: #26303d; --rp-head: #111a26; --rp-h3: #2459b3; --rp-link: #2459b3; --rp-marker: #2f6fd6; --rp-rule: #2f6fd6; }
.rp-card[data-look="night"] .rp-page { --rp-bg: #141821; --rp-ink: #d5dbea; --rp-head: #ffffff; --rp-h3: #ffa28a; --rp-link: #ffa28a; --rp-marker: #ff7a5c; --rp-rule: #ff7a5c; }
.rp-card[data-look="linen"] .rp-page { --rp-bg: #fbf8f1; --rp-ink: #3a3630; --rp-head: #1c1a17; --rp-h3: #a8391b; --rp-link: #a8391b; --rp-marker: #d0461f; --rp-rule: #d8431f; }
.rp-card[data-look="spring"] .rp-page { --rp-bg: #f5fcf8; --rp-ink: #1f3a33; --rp-head: #0f2a23; --rp-h1: #0b6e4f; --rp-h2: #1864ab; --rp-h3: #862e9c; --rp-strong: #0b6e4f; --rp-link: #1864ab; --rp-marker: #0f9f71; --rp-rule: #0b6e4f; }
.rp-card[data-look="neon"] .rp-page { --rp-bg: #1b1033; --rp-ink: #e6e0ff; --rp-head: #ffffff; --rp-h1: #ff6ac1; --rp-h2: #36f9f6; --rp-h3: #fede5d; --rp-strong: #ff9e5e; --rp-link: #36f9f6; --rp-marker: #ff6ac1; --rp-rule: #ff6ac1; }
.rp-card[data-accent="coral"] .rp-page { --rp-link: #c2401f; --rp-marker: #e0431f; --rp-rule: #e0431f; }
.rp-card[data-accent="blue"] .rp-page { --rp-link: #1f5fbf; --rp-marker: #1f5fbf; --rp-rule: #1f5fbf; }
.rp-card[data-accent="violet"] .rp-page { --rp-link: #6741d9; --rp-marker: #6741d9; --rp-rule: #6741d9; }
.rp-card[data-accent="green"] .rp-page { --rp-link: #2b8a3e; --rp-marker: #2b8a3e; --rp-rule: #2b8a3e; }
.rp-card[data-accent="coral"][data-look="night"] .rp-page, .rp-card[data-accent="coral"][data-look="neon"] .rp-page { --rp-link: #ff7a5c; --rp-marker: #ff7a5c; --rp-rule: #ff7a5c; }
.rp-card[data-accent="blue"][data-look="night"] .rp-page, .rp-card[data-accent="blue"][data-look="neon"] .rp-page { --rp-link: #8ccbf1; --rp-marker: #8ccbf1; --rp-rule: #8ccbf1; }
.rp-card[data-accent="violet"][data-look="night"] .rp-page, .rp-card[data-accent="violet"][data-look="neon"] .rp-page { --rp-link: #b197fc; --rp-marker: #b197fc; --rp-rule: #b197fc; }
.rp-card[data-accent="green"][data-look="night"] .rp-page, .rp-card[data-accent="green"][data-look="neon"] .rp-page { --rp-link: #69db7c; --rp-marker: #69db7c; --rp-rule: #69db7c; }
.rp-accent-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rp-accent-label { font-size: 14px; color: #3A4566; margin-right: 4px; }
.rp-accent { all: unset; box-sizing: border-box; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14); }
.rp-accent[data-accent=""] { background: conic-gradient(#ff5a36, #fcc419, #69db7c, #8ccbf1, #b197fc, #f783ac, #ff5a36); }
.rp-accent[data-accent="coral"] { background: #e0431f; }
.rp-accent[data-accent="blue"] { background: #1f5fbf; }
.rp-accent[data-accent="violet"] { background: #6741d9; }
.rp-accent[data-accent="green"] { background: #2b8a3e; }
.rp-accent[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #141414; }
.rp-accent:focus-visible { outline: 2px solid #1F6FEB; outline-offset: 3px; }

@media (max-width: 760px) {
  .rp-card { grid-template-columns: minmax(0, 1fr); }
  .rp-controls { border-right: 0; border-bottom: 1px solid rgba(0,0,0,.08); padding: 24px 20px; }
  .rp-preview-wrap { padding: 18px 14px 22px; }
  .rp-page { min-height: 0; }
  .rp-desc { min-height: 0; }
}

/* Try-it preview */
#mdr-try-out svg { max-width: 100%; height: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
