/* Card Doctor: a document being checked. Sheets on a slate desk; the wavy underline is the product. */

@font-face { font-family: "Sheet"; src: url("/assets/fonts/LiberationSerif-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Sheet"; src: url("/assets/fonts/LiberationSerif-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Sheet"; src: url("/assets/fonts/LiberationSerif-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --desk: #2f3440;
  --desk-deep: #23272f;
  --on-desk: #eceef3;
  --on-desk-quiet: #bcc3d1;
  --sheet: #ffffff;
  --ink: #17191e;
  --ink-quiet: #4b5263;
  --rule: #d8dce4;
  --wash: #f2f4f8;
  --red: #c4122f;
  --red-wash: #fde9ec;
  --red-on-dark: #ff7a8a;
  --amber: #b25c00;
  --amber-text: #8f4a00;
  --amber-wash: #fdf0dc;
  --green: #17713f;
  --blue: #1b56c4;
  --blue-deep: #143f92;
  --focus-on-dark: #a9c8ff;
  --sheet-face: "Sheet", "Liberation Serif", "Times New Roman", Times, serif;
  --app-face: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sheet: 0 2px 5px rgba(8, 10, 14, .4), 0 22px 44px rgba(8, 10, 14, .28);
  --shadow-note: 0 1px 2px rgba(23, 25, 30, .22), 0 10px 26px rgba(23, 25, 30, .18);
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-color: #687083 var(--desk); scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--on-desk); font: 1rem/1.5 var(--app-face); }
::selection { background: #c9dcff; color: var(--ink); }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { color: var(--blue-deep); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: .75rem; top: -4rem; z-index: 20; background: var(--sheet); color: var(--ink); padding: .5rem .8rem; border-radius: 6px; }
.skip:focus { top: .5rem; }

/* The app's own chrome: menu bar, ruler, status bar. */
.appbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1.5rem; min-height: 3.25rem; padding: .4rem clamp(.75rem, 3vw, 1.5rem); background: var(--desk-deep); }
.appbar :focus-visible, .statusbar :focus-visible { outline-color: var(--focus-on-dark); }
.doc-title { display: inline-flex; align-items: center; gap: .6rem; color: var(--on-desk); font-weight: 650; text-decoration: none; white-space: nowrap; }
.doc-title:hover { color: #fff; }
.menus { display: flex; gap: .25rem; margin-right: auto; }
.menus a { color: var(--on-desk-quiet); text-decoration: none; padding: .35rem .7rem; border-radius: 6px; font-size: .95rem; }
.menus a:hover { color: #fff; background: rgba(255, 255, 255, .09); }
.ruler { height: 1rem; background-color: #394050;
  background-image: linear-gradient(90deg, rgba(236, 238, 243, .55) 0 1px, transparent 1px), linear-gradient(90deg, rgba(236, 238, 243, .32) 0 1px, transparent 1px);
  background-size: 5rem .65rem, .5rem .32rem; background-position: 0 100%, 0 100%; background-repeat: repeat-x; }

.button { display: inline-block; font: 600 1rem/1.2 var(--app-face); padding: .78rem 1.2rem; border: 0; border-radius: 8px; background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; transition: background-color .15s ease-out; }
.button:hover { background: #2c3038; color: #fff; }
.button.primary { background: var(--blue); }
.button.primary:hover { background: var(--blue-deep); }
.button.on-dark { margin-left: auto; background: #fff; color: var(--ink); font-size: .92rem; padding: .5rem .95rem; white-space: nowrap; }
.button.on-dark:hover { background: #dfe6f5; color: var(--ink); }
.menus + .button.on-dark { margin-left: 0; }
.quiet { font: 500 1rem var(--app-face); }

/* Sheets. */
.desk { padding: clamp(1rem, 3vw, 2rem) clamp(.5rem, 3vw, 2rem) 3rem; }
.sheet { position: relative; max-width: 47rem; margin: 0 auto clamp(1rem, 3vw, 2rem); padding: clamp(2rem, 7vw, 4.75rem) clamp(1.25rem, 8vw, 5.25rem) 1.5rem; background: var(--sheet); color: var(--ink); border-radius: 2px; box-shadow: var(--shadow-sheet); font: 1.1875rem/1.55 var(--sheet-face); }
.sheet p, .sheet ol, .sheet ul, .sheet dl { max-width: 35em; }
.sheet p { margin: 0 0 1rem; }
h1, h2 { font-family: var(--sheet-face); font-weight: 700; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.7rem, 10.5vw, 5.4rem); line-height: 1; letter-spacing: -.022em; margin-bottom: 1.4rem; }
h2 { font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.1; letter-spacing: -.012em; margin-bottom: .9rem; }
.lede { font-size: clamp(1.2rem, 3.4vw, 1.4rem); line-height: 1.45; }
.small { font: .92rem/1.5 var(--app-face); color: var(--ink-quiet); }
.pagefoot { display: flex; justify-content: space-between; margin-top: clamp(2rem, 6vw, 3.5rem); padding-top: .7rem; border-top: 1px solid var(--rule); font: .8rem var(--app-face); color: var(--ink-quiet); font-variant-numeric: tabular-nums; }

/* A card set as two lines of the document, and the marks on it. */
.specimen { position: relative; margin: 2rem 0; font-size: clamp(1.3rem, 4.2vw, 1.7rem); line-height: 1.4; }
.specimen .q, .specimen .a, .revision .q, .revision .a { display: grid; grid-template-columns: 1.7rem 1fr; align-items: baseline; margin: 0; max-width: none; }
.specimen .a, .revision .a { margin-top: .2rem; }
.side { font: 700 .8rem var(--app-face); color: var(--ink-quiet); }
.mark { display: inline; font: inherit; color: inherit; text-align: left; padding: 0 .06em; margin: 0 -.06em; border: 0; border-radius: 3px; background: transparent; cursor: pointer;
  text-decoration: underline wavy var(--red); text-decoration-thickness: max(2px, .075em); text-underline-offset: .2em; text-decoration-skip-ink: none; transition: background-color .15s ease-out; }
.mark.weak { text-decoration-color: var(--amber); }
.mark.still { cursor: text; }
button.mark:hover, button.mark[aria-expanded="true"] { background: var(--red-wash); }
button.mark.weak:hover, button.mark.weak[aria-expanded="true"] { background: var(--amber-wash); }

.note { margin: .7rem 0 0 1.7rem; max-width: 29rem; padding: .85rem 1rem .9rem; background: var(--sheet); border-radius: 9px; box-shadow: var(--shadow-note); font: .96rem/1.45 var(--app-face); color: var(--ink); }
.note p { margin: 0 0 .35rem; max-width: none; }
.note .note-title { font-weight: 700; }
.note .note-fix { margin: .6rem 0 0; padding-top: .6rem; border-top: 1px solid var(--rule); }
.level { font-weight: 700; margin-right: .35em; }
.level.broken { color: var(--red); }
.level.weak { color: var(--amber-text); }
.level::after { content: ":"; }
.level.clean { color: var(--green); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin: 2.2rem 0 0; }

.document { list-style: none; margin: 1.5rem 0 1.25rem; padding: 0; max-width: none; }
.document .specimen { margin: 0; padding: 1.05rem 0 1.15rem; border-top: 1px solid var(--rule); font-size: clamp(1.2rem, 3.8vw, 1.45rem); }
.document .specimen:last-child { border-bottom: 1px solid var(--rule); }
.pair .second { margin-top: .75rem; }
.flag { margin: .5rem 0 0 1.7rem; max-width: none; font: .92rem/1.4 var(--app-face); color: var(--ink); }
.document .note { margin-top: .5rem; }

/* Try it. */
.tryit { display: grid; grid-template-columns: 1.7rem 1fr; gap: .9rem 0; align-items: baseline; margin: 1.5rem 0 0; }
.tryit textarea { width: 100%; min-height: 2.2em; padding: .1rem 0 .3rem; border: 0; border-bottom: 1px solid #8b93a5; border-radius: 0; background: transparent; color: var(--ink); caret-color: var(--blue); font: clamp(1.25rem, 4vw, 1.5rem)/1.4 var(--sheet-face); resize: vertical; }
.tryit textarea::placeholder { color: #5d6475; opacity: 1; }
.tryit textarea:focus-visible { outline: none; border-bottom-color: var(--blue); box-shadow: 0 2px 0 var(--blue); }
.verdict { margin-top: 1.4rem; min-height: 9.5rem; }
.verdict .specimen { margin: 0 0 .2rem; }
.verdict .note { margin-bottom: .9rem; }
.verdict .waiting, .verdict .clean-line { font: .96rem/1.45 var(--app-face); color: var(--ink-quiet); }
.verdict .clean-line { color: var(--ink); display: flex; gap: .55rem; align-items: baseline; }
.verdict .clean-line svg { flex: none; translate: 0 .15em; color: var(--green); }

/* Install. */
.steps { margin: 1.2rem 0 1.4rem; padding-left: 1.4em; }
.steps li { margin: 0 0 .6rem; padding-left: .2em; }
.steps li::marker { font-weight: 700; }
.code { font: .92em ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--wash); padding: .12em .42em; border-radius: 4px; font-variant-numeric: tabular-nums; }
.code[data-pending] { font: inherit; font-style: italic; background: none; padding: 0; }

/* Pro: a rewrite shown as a tracked change, with the change bar in the margin. */
.revision { position: relative; margin: 1.6rem 0 2rem; font-size: clamp(1.2rem, 3.8vw, 1.5rem); line-height: 1.45; }
.revision::before { content: ""; position: absolute; left: clamp(-1.6rem, -3vw, -.7rem); top: .2em; bottom: .2em; width: 2px; background: var(--ink-quiet); }
del { color: var(--red); text-decoration: line-through; text-decoration-thickness: .06em; }
ins { color: var(--green); text-decoration: underline; text-decoration-thickness: .06em; text-underline-offset: .18em; }
.plans { margin: 0 0 1.4rem; }
.plans > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: .2rem 1.25rem; padding: .95rem 0; border-top: 1px solid var(--rule); }
.plans > div:last-child { border-bottom: 1px solid var(--rule); }
.plans dt { font: 700 1rem/1.5 var(--app-face); }
.plans dd { margin: 0; }
.price { display: block; font-weight: 500; color: var(--ink-quiet); }

/* Agents. */
.paste { display: flex; gap: 1rem; align-items: flex-start; margin: 1.1rem 0 1.4rem; padding: 1rem 1.1rem; background: var(--wash); border-radius: 9px; }
.paste p { margin: 0; flex: 1; font: .98rem/1.5 var(--app-face); overflow-wrap: anywhere; }
.paste .button { flex: none; font-size: .92rem; padding: .55rem .95rem; min-width: 5.2rem; }
.links { list-style: none; padding: 0; margin: 0; font: .98rem/1.5 var(--app-face); }
.links li { margin: 0 0 .5rem; overflow-wrap: anywhere; }
.links code { font: .93em ui-monospace, "SF Mono", Menlo, Consolas, monospace; }

.statusbar { position: sticky; bottom: 0; z-index: 9; display: flex; flex-wrap: wrap; gap: .15rem 1.4rem; padding: .4rem clamp(.75rem, 3vw, 1.5rem); background: var(--desk-deep); color: var(--on-desk-quiet); font: .8rem/1.5 var(--app-face); font-variant-numeric: tabular-nums; }
.statusbar .grow { flex: 1; }
.statusbar a { color: var(--on-desk); }
.statusbar a:hover { color: #fff; }

@media (max-width: 40rem) {
  .menus { display: none; }
  .menus + .button.on-dark { margin-left: auto; }
  .flag { margin-left: 0; }
  .statusbar { position: static; }
  .statusbar .grow { display: none; }
  .note { margin-left: 0; }
  .plans > div { grid-template-columns: 1fr; }
  .paste { flex-direction: column; }
  .revision::before { left: -.7rem; }
}

/* One authored moment: the first underline is drawn, then its note opens. */
@media (prefers-reduced-motion: no-preference) {
  #sheet-1 .mark { animation: underline-in .5s .35s cubic-bezier(.16, 1, .3, 1) both; }
  #sheet-1 .note.open { animation: note-in .55s .8s cubic-bezier(.16, 1, .3, 1) both; transform-origin: 1.5rem 0; }
  @keyframes underline-in { from { text-decoration-color: transparent; background-color: var(--red-wash); } }
  @keyframes note-in { from { opacity: 0; transform: translateY(-.4rem) scale(.97); clip-path: inset(0 0 100% 0 round 9px); } to { clip-path: inset(-2rem round 9px); } }
}
