/* PassiveVoiceChecker — site.css
   Palette: blue-black ink, white paper, blue pencil, amber highlighter. */
@font-face { font-family: 'Lora'; src: url('/static/fonts/Lora-Variable.woff2') format('woff2'); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Lora'; src: url('/static/fonts/Lora-Italic-Variable.woff2') format('woff2'); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --paper: #ffffff;
  --field: #f3f5f7;
  --rule: #d6dbe2;
  --rule-soft: #e8ecf0;
  --ink: #1b2330;
  --ink-soft: #4b5563;
  --ink-mute: #7b8494;
  --pencil: #2251d1;
  --pencil-soft: #e6ecfb;
  --hi: #ffd54a;
  --hi-soft: #fff3bf;
  --adj: #c9ced6;
  --ok: #1d7f4f;
  --serif: 'Lora', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --measure: 68ch;
  --radius: 6px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141821; --field: #1c2230; --rule: #333b4b; --rule-soft: #262d3b;
    --ink: #e9ecf2; --ink-soft: #b6bdca; --ink-mute: #8a93a3;
    --pencil: #7b9cff; --pencil-soft: #1f2a48;
    --hi: #d9b324; --hi-soft: #4a3f12; --adj: #4a5262; --ok: #4cc38a;
  }
}
html[data-theme="dark"] {
  --paper: #141821; --field: #1c2230; --rule: #333b4b; --rule-soft: #262d3b;
  --ink: #e9ecf2; --ink-soft: #b6bdca; --ink-mute: #8a93a3;
  --pencil: #7b9cff; --pencil-soft: #1f2a48;
  --hi: #d9b324; --hi-soft: #4a3f12; --adj: #4a5262; --ok: #4cc38a;
}
html[data-theme="light"] {
  --paper: #ffffff; --field: #f3f5f7; --rule: #d6dbe2; --rule-soft: #e8ecf0;
  --ink: #1b2330; --ink-soft: #4b5563; --ink-mute: #7b8494;
  --pencil: #2251d1; --pencil-soft: #e6ecfb;
  --hi: #ffd54a; --hi-soft: #fff3bf; --adj: #c9ced6; --ok: #1d7f4f;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.0625rem; line-height: 1.6;
  font-variation-settings: 'wght' 400;
}
a { color: var(--pencil); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--pencil); outline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 600; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); font-weight: 600; margin-top: 2.6rem; margin-bottom: .6rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.8rem; margin-bottom: .4rem; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.3rem; margin: 0 0 1rem; }
li { margin-bottom: .35rem; }
blockquote { margin: 1rem 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--hi); color: var(--ink-soft); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--field); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--field); padding: 1rem; overflow: auto; border-radius: var(--radius); }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0 1.5rem; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
th { font-weight: 600; border-bottom: 2px solid var(--rule); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
img { max-width: 100%; height: auto; }
button, .btn { font-family: var(--sans); font-size: .95rem; }
.btn { display: inline-block; padding: .6rem 1rem; border-radius: var(--radius); border: 1px solid var(--pencil); color: var(--pencil); background: transparent; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--pencil-soft); }
.btn.primary { background: var(--pencil); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); background: var(--pencil); }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.sans { font-family: var(--sans); }
.mute { color: var(--ink-mute); }
.small { font-size: .9rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.wrap { width: min(100% - 2.5rem, 1180px); margin-inline: auto; }
.wrap.narrow { width: min(100% - 2.5rem, 760px); }
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; padding-block: .5rem; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.wordmark span { color: var(--pencil); }
.nav { display: flex; gap: 1.2rem; font-family: var(--sans); font-size: .93rem; }
.nav a { color: var(--ink-soft); text-decoration: none; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--hi); }
.theme-toggle { background: none; border: 1px solid var(--rule); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; color: var(--ink-soft); display: grid; place-items: center; }
main { padding: 2.2rem 0 4rem; }
.site-footer { border-top: 1px solid var(--rule); padding: 2rem 0 3rem; font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
.site-footer h4 { font-family: var(--sans); font-size: .9rem; margin-bottom: .5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--ink-soft); }
@media (max-width: 760px) {
  .site-footer .wrap { grid-template-columns: 1fr; }
  .site-header .wrap { min-height: 0; }
  .wordmark { font-size: 1.05rem; }
  .nav { gap: .7rem; font-size: .85rem; }
  .nav a.hide-sm { display: none; }
}

/* Article */
.article { max-width: var(--measure); }
.article .lead { font-size: 1.22rem; line-height: 1.5; color: var(--ink); margin: 1rem 0 1.6rem; }
.article h1 { margin-bottom: .4rem; }
.byline { font-family: var(--sans); font-size: .85rem; color: var(--ink-mute); margin-bottom: 1.8rem; }
.article .faq dt { font-weight: 600; margin-top: 1rem; }
.article .faq dd { margin: .25rem 0 0; }
.toc { font-family: var(--sans); font-size: .9rem; border-left: 3px solid var(--hi); padding: .3rem 0 .3rem 1rem; margin: 1.4rem 0 2rem; }
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin: .2rem 0; }
.toc a { color: var(--ink-soft); text-decoration: none; }
.toc a:hover { color: var(--pencil); text-decoration: underline; }
.example-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0 1.4rem; }
.example-pair > div { padding: .8rem 1rem; border-radius: var(--radius); background: var(--field); }
.example-pair .label { font-family: var(--sans); font-size: .78rem; color: var(--ink-mute); margin-bottom: .3rem; }
.example-pair .passive-ex mark { background: var(--hi); color: var(--ink); padding: 0 .1em; }
@media (max-width: 640px) { .example-pair { grid-template-columns: 1fr; } }
mark.p { background: var(--hi); color: #1b2330; padding: 0 .12em; border-radius: 2px; }
mark.q { background: var(--hi-soft); color: inherit; padding: 0 .12em; border-radius: 2px; }
mark.a { background: none; color: inherit; text-decoration: underline dotted var(--adj); text-decoration-thickness: 2px; text-underline-offset: 3px; }
mark.g { background: var(--pencil-soft); color: inherit; padding: 0 .12em; border-radius: 2px; }

/* Checker tool */
.tool-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tool-head p { font-size: 1.05rem; color: var(--ink-soft); max-width: 60ch; margin: .4rem 0 0; }
.checker { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .95fr); gap: 1.6rem; align-items: start; }
.checker.compact { grid-template-columns: 1fr; gap: .9rem; margin-top: 1.5rem; }
.editor { position: relative; }
.editor textarea {
  width: 100%; min-height: 320px; resize: vertical; font-family: var(--serif); font-size: 1.05rem; line-height: 1.6;
  color: var(--ink); background: var(--field); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem;
}
.editor textarea:focus { outline: 2px solid var(--pencil); outline-offset: 0; border-color: transparent; }
.editor .bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .7rem; font-family: var(--sans); font-size: .88rem; color: var(--ink-mute); }
.editor .bar .spacer { flex: 1; }
.marked { font-size: 1.05rem; line-height: 1.75; padding: 1rem 1.1rem; background: var(--field); border-radius: var(--radius); border: 1px solid var(--rule); min-height: 320px; white-space: pre-wrap; }
.marked.hidden, .editor.hidden { display: none; }
.checker.compact .editor textarea, .checker.compact .marked { min-height: 160px; }

.results { font-family: var(--sans); }
.score { display: grid; grid-template-columns: auto 1fr; gap: 0 1.2rem; align-items: end; padding-bottom: 1rem; border-bottom: 1px solid var(--rule); }
.score .big { font-family: var(--serif); font-size: 3.2rem; font-weight: 600; line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.score .big small { font-size: 1.1rem; font-weight: 400; color: var(--ink-mute); margin-left: .15rem; }
.score .meta { font-size: .9rem; color: var(--ink-soft); line-height: 1.45; }
.score .meta b { color: var(--ink); font-weight: 600; }
.bench { margin: 1rem 0; font-size: .85rem; color: var(--ink-soft); }
.bench .track { position: relative; height: 10px; background: var(--rule-soft); border-radius: 999px; margin: .5rem 0 .35rem; }
.bench .you { position: absolute; top: -4px; width: 3px; height: 18px; background: var(--pencil); border-radius: 2px; }
.bench .tick { position: absolute; top: 0; width: 2px; height: 10px; background: var(--ink-mute); opacity: .55; }
.bench .ticklist { font-size: .78rem; color: var(--ink-mute); line-height: 1.6; }
.bench .ticklist b { color: var(--ink-soft); font-weight: 600; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--ink-soft); margin: .6rem 0 1rem; }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: .35rem; }
.notes { list-style: none; padding: 0; margin: 0; max-height: 70vh; overflow: auto; }
.note { padding: .85rem 0; border-bottom: 1px solid var(--rule-soft); }
.note .sent { font-family: var(--serif); font-size: .98rem; line-height: 1.5; color: var(--ink); }
.note .why { font-size: .84rem; color: var(--ink-soft); margin: .35rem 0 0; }
.note .fix { margin-top: .5rem; padding: .55rem .7rem; background: var(--pencil-soft); border-left: 3px solid var(--pencil); border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--serif); font-size: .96rem; color: var(--ink); }
.note .fix .lab { font-family: var(--sans); font-size: .72rem; color: var(--pencil); display: block; margin-bottom: .15rem; }
.note .verdict { font-size: .8rem; color: var(--ink-mute); margin-top: .4rem; }
.note .zombie { font-size: .8rem; color: var(--ink-mute); margin-top: .3rem; font-style: italic; }
.note.adj { opacity: .78; }
.note.adj .sent { color: var(--ink-soft); }
.note .tag { font-size: .72rem; padding: .1rem .45rem; border-radius: 999px; background: var(--hi); color: #1b2330; margin-right: .4rem; vertical-align: 1px; }
.note.prob .tag { background: var(--hi-soft); color: var(--ink); }
.note.adj .tag { background: var(--rule-soft); color: var(--ink-soft); }
.empty { color: var(--ink-mute); font-size: .92rem; padding: 1rem 0; }
.good { color: var(--ok); }
@media (max-width: 900px) { .checker { grid-template-columns: 1fr; } .notes { max-height: none; } }

/* Marginalia-style sweep when results appear */
@keyframes sweep { from { background-size: 0% 100%; } to { background-size: 100% 100%; } }
.marked mark.p, .marked mark.q { background-repeat: no-repeat; background-size: 100% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .marked.fresh mark.p { background-image: linear-gradient(var(--hi), var(--hi)); background-color: transparent; animation: sweep .5s ease-out forwards; }
  .marked.fresh mark.q { background-image: linear-gradient(var(--hi-soft), var(--hi-soft)); background-color: transparent; animation: sweep .5s ease-out forwards; }
}

/* Slots */
.ad-slot { margin: 2rem 0; min-height: 90px; }
.ad-slot.inline { margin: 2.2rem 0; }
.cta-card { margin: 2rem 0; padding: 1.1rem 1.3rem; border: 1px solid var(--rule); border-left: 4px solid var(--hi); border-radius: var(--radius); font-family: var(--sans); }
.cta-card h3 { font-family: var(--serif); margin: 0 0 .3rem; font-size: 1.1rem; }
.cta-card p { margin: 0 0 .7rem; font-size: .93rem; color: var(--ink-soft); }
.cta-card .links { display: flex; gap: .6rem; flex-wrap: wrap; }
.signup { margin: 2.2rem 0; padding: 1.2rem 1.3rem; background: var(--field); border-radius: var(--radius); font-family: var(--sans); }
.signup h3 { font-family: var(--serif); margin: 0 0 .3rem; }
.signup p { font-size: .93rem; color: var(--ink-soft); margin-bottom: .8rem; }
.signup form { display: flex; gap: .5rem; flex-wrap: wrap; }
.signup input[type=email] { flex: 1; min-width: 200px; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: var(--radius); font-family: var(--sans); font-size: .95rem; background: var(--paper); color: var(--ink); }
.disclosure { font-family: var(--sans); font-size: .8rem; color: var(--ink-mute); }

/* Index page */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 1.4rem 0 2rem; }
.kpi { padding: .9rem 1rem; border-top: 3px solid var(--hi); background: var(--field); border-radius: 0 0 var(--radius) var(--radius); }
.kpi .v { font-family: var(--serif); font-size: 2rem; font-weight: 600; line-height: 1.1; }
.kpi .l { font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); margin-top: .25rem; }
.chart { margin: 1.4rem 0 2rem; }
.chart svg { width: 100%; height: auto; display: block; }
.chart figcaption { font-family: var(--sans); font-size: .85rem; color: var(--ink-mute); margin-top: .5rem; }
.index-table { font-family: var(--sans); font-size: .9rem; }
.index-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.index-table th[data-sorted="asc"]::after { content: " ▲"; font-size: .7em; }
.index-table th[data-sorted="desc"]::after { content: " ▼"; font-size: .7em; }
.index-table td.ex { font-family: var(--serif); color: var(--ink-soft); font-size: .88rem; max-width: 36ch; }
.index-table .bar { display: inline-block; height: 8px; background: var(--hi); border-radius: 2px; vertical-align: middle; margin-right: .4rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; font-family: var(--sans); margin: 1rem 0; }
.filters button { padding: .35rem .7rem; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink-soft); cursor: pointer; font-size: .85rem; }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Quiz */
.quiz-q { padding: 1rem 0; border-bottom: 1px solid var(--rule-soft); }
.quiz-q .stem { font-size: 1.05rem; margin-bottom: .5rem; }
.quiz-q .opts { display: flex; gap: .5rem; flex-wrap: wrap; font-family: var(--sans); }
.quiz-q .opts button { padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--ink); cursor: pointer; }
.quiz-q .opts button[data-state="right"] { background: var(--ok); color: #fff; border-color: var(--ok); }
.quiz-q .opts button[data-state="wrong"] { background: var(--hi-soft); border-color: var(--hi); }
.quiz-q .expl { font-family: var(--sans); font-size: .88rem; color: var(--ink-soft); margin-top: .5rem; display: none; }
.quiz-q.answered .expl { display: block; }
.quiz-score { font-family: var(--sans); font-weight: 600; margin: 1rem 0; }

/* Worksheet print */
@media print {
  .site-header, .site-footer, .ad-slot, .cta-card, .signup, .checker, .no-print { display: none !important; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .article { max-width: none; }
}

/* Converter two-pane */
.converter .fix { font-size: 1rem; }
.rewrites { list-style: none; padding: 0; margin: 0; }
.rewrites li { padding: .8rem 0; border-bottom: 1px solid var(--rule-soft); }
.rewrites .orig { color: var(--ink-soft); font-size: .95rem; }
.rewrites .orig mark { background: var(--hi); color: #1b2330; }
.rewrites .new { font-size: 1.02rem; margin-top: .3rem; }
.rewrites .new .lab { font-family: var(--sans); font-size: .72rem; color: var(--pencil); display: block; }
