/* labs.slashy.com/prose: the short version on two columns, a label and its text, under one painting, then
   the full story in one column beside the list of its sections. The top shares its layout with the
   join and sign-in screens (voice-model frontend/src/AccessPanel.tsx, styles.css .access). Page shell,
   nav and colours from labs.css; the switch and the buttons are the playground's. Designed in Paper,
   "Slashy Labs - Echo playground", page "Prose waitlist and sign in". */
:root {
  --app-secondary: #625f6b;
  --app-soft: #f1f1f4;
  --quiet: #e9e9ee; /* a secondary button on the grey page, where --app-soft does not show */
}

.sheet { width: 100%; max-width: var(--wide); padding-top: 24px; }

.hero { position: relative; }
.hero-painting {
  display: block; width: 100%; height: 400px;
  border-radius: 18px; object-fit: cover; object-position: 50% 78%;
  background: #93a5dc; /* the lake, until it loads */
}

/* The card starts on the right column's edge, in the painting's lower corner. Both texts share one grid
   cell, so it is always as tall as the longer one and nothing moves when they swap. */
.rewrite {
  position: absolute; right: 24px; bottom: 24px;
  display: flex; flex-direction: column; gap: 10px;
  width: 452px; padding: 14px 20px 16px;
  border-radius: 12px; background: #fff;
}
.modes { position: relative; display: inline-flex; flex-wrap: wrap; max-width: 100%; align-self: flex-start; gap: 2px; padding: 2px; border-radius: 8px; background: var(--app-soft); }
.mode {
  position: relative; border: 0; border-radius: 6px; padding: 3px 10px; background: transparent; cursor: pointer;
  font: 500 13px/20px var(--sans); color: var(--app-secondary);
  transition: color 160ms ease-out;
}
.mode[aria-pressed="true"] { color: var(--ink); }
/* The white key under the chosen label. The script slides one between the two; without it, it stands under Prose. */
.modes:not(.has-key) .mode[aria-pressed="true"], .mode-key {
  background: #fff; box-shadow: 0 0 0 1px rgba(15, 16, 20, 0.04), 0 1px 2px rgba(15, 16, 20, 0.08);
}
.mode-key { position: absolute; top: 0; left: 0; border-radius: 6px; transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), width 200ms cubic-bezier(0.22, 1, 0.36, 1); }
.mode:hover:not([aria-pressed="true"]) { color: var(--ink); }
.mode:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.rewrite-texts { display: grid; }
.rewrite-text {
  grid-area: 1 / 1; display: flex; flex-direction: column;
  visibility: hidden; opacity: 0;
  transition: opacity 120ms ease-out, visibility 0s linear 120ms;
}
.rewrite-text.is-shown { visibility: visible; opacity: 1; transition: opacity 180ms ease-out 60ms, visibility 0s; }
.rewrite-text p { font: 15px/23px var(--sans); overflow-wrap: anywhere; }
/* A reply keeps its own paragraphs. */
.rewrite-text p + p { padding-top: 9px; }
.rewrite-text p.from { padding-top: 9px; color: var(--muted); }
.rewrite-text--draft p.from { padding-top: 6px; }
.rewrite-text--draft p { font-size: 13px; line-height: 18px; color: var(--app-secondary); }
.rewrite-text--draft p + p { padding-top: 4px; }
.rewrite-text--draft strong { font-weight: 500; color: var(--ink); }
/* A stock phrase: underlined the way an editor would, not boxed. */
.rewrite-text mark, .message mark {
  background: none; color: inherit;
  text-decoration: underline wavy #d9534a; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-skip-ink: none;
}

.row { display: grid; grid-template-columns: 400px 420px; justify-content: space-between; padding-top: 56px; }
.row--intro { padding-top: 44px; }
.row p { font: 17px/28px var(--sans); text-wrap: pretty; }
.row h2 { font: 500 17px/28px var(--sans); }
.row a:not(.button) {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color 150ms ease;
}
.row a:not(.button):hover { color: #2b3796; }

/* The logo and the waitlist field (join.css), beside the words. */
.lead { display: flex; flex-direction: column; gap: 26px; min-width: 0; }
.lead .join { max-width: 380px; }

/* The same lockup as .mark, a little smaller and on the left edge. */
.prose-mark { display: flex; align-items: flex-end; align-self: start; gap: 10px; }
.prose-mark img { width: 134px; height: 45px; }
.prose-mark span { font: 500 40px/40px var(--sans); letter-spacing: -0.04em; color: var(--muted); padding-bottom: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 20px; }
.button {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 8px;
  font: 500 14px/20px var(--sans); text-decoration: none; white-space: nowrap;
  transition: background-color 150ms ease;
}
.button-secondary { background: var(--quiet); color: var(--ink); }
.button-secondary:hover { background: #dfdfe6; }

/* Benchmark: one bar per model, Prose in the accent. Every bar carries its number (--n, out of 30), so
   there is no axis. A zero still gets a sliver, to show it was measured. */
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding-top: 40px; }
.chart { margin: 0; min-width: 0; }
.chart h3 { font: 500 17px/28px var(--sans); }
.chart figcaption { padding-top: 14px; font: 14px/21px var(--sans); color: var(--muted); text-wrap: pretty; }
.bars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 0; padding: 20px 0 0; list-style: none; }
.bar { --h: max(3px, calc(174px * var(--n) / 30)); display: grid; grid-template-rows: 200px 42px; justify-items: center; }
.bar-fill { grid-row: 1; grid-column: 1; align-self: end; width: 100%; max-width: 52px; height: var(--h); border-radius: 1px; background: #9896a3; }
.bar-value { grid-row: 1; grid-column: 1; align-self: end; margin-bottom: calc(var(--h) + 4px); font: 15px/20px var(--sans); font-variant-numeric: tabular-nums; }
.bar-name { grid-row: 2; padding-top: 8px; font: 13px/17px var(--sans); color: var(--muted); text-align: center; text-wrap: balance; }
.bar--us .bar-fill { border-radius: 4px 4px 0 0; background: var(--accent); }
.bar--us .bar-name, .bar--us .bar-value { font-weight: 500; color: var(--ink); }

.story { display: grid; grid-template-columns: 200px 640px; justify-content: space-between; align-items: start; padding-top: 128px; }
.story-side { position: sticky; top: 32px; }
.story-side h2 { font: 500 17px/28px var(--sans); }
.toc { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 12px; }
.toc a { font: 14px/20px var(--sans); color: var(--muted); text-decoration: none; transition: color 150ms ease; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--ink); }
.toc a[aria-current="true"] { font-weight: 500; }
.story-text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.story-text > p { font: 17px/28px var(--sans); text-wrap: pretty; }
.story-text > h3 { padding-top: 32px; font: 500 22px/28px var(--sans); letter-spacing: -0.01em; scroll-margin-top: 0; }
.story-text > h3:first-child { padding-top: 0; scroll-margin-top: 32px; }
.story-text > p a, .story-text .plain-list a {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: color 150ms ease;
}
.story-text > p a:hover, .story-text .plain-list a:hover { color: #2b3796; }

/* An example: which one, what was asked, and what each model wrote. */
.example { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.example[hidden] { display: none; }
/* Which example: the same switch, larger, on the grey page. One row; a phone scrolls it sideways. */
.tabs { width: 100%; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; border-radius: 10px; padding: 3px; background: #e9e9ee; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; border-radius: 8px; padding: 6px 13px; font-size: 14px; white-space: nowrap; }
.tabs .mode-key { border-radius: 8px; }
.tab:focus-visible { outline-offset: -2px; }
.example-about { display: flex; flex-direction: column; gap: 14px; font: 17px/28px var(--sans); text-wrap: pretty; }
.comparison { display: flex; flex-direction: column; gap: 12px; }
.example-about + .comparison { padding-top: 6px; }
/* The tab bar, the prompt and the replies are one width, and their text starts 16px in. */
.asked { padding: 14px 16px 16px; border-radius: 12px; background: #ededf1; font: 14px/22px var(--sans); overflow-wrap: anywhere; }
.asked p { padding-top: 6px; }
.asked ul { margin: 0; padding: 2px 0 0 18px; }
/* The replies, side by side. Cards in a row are as tall as the longest, so their edges line up. */
.replies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.reply { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 20px; border-radius: 12px; background: #fff; }
.reply:only-child { grid-column: 1 / -1; }
.reply-by { margin: 0; font: 500 13px/20px var(--sans); color: var(--muted); }
.reply-by--us { color: var(--accent); }
.message { display: flex; flex-direction: column; gap: 10px; font: 14px/22px var(--sans); overflow-wrap: anywhere; }
.message strong, .message h5 { font-weight: 500; }
.message h5 { margin: 0; font-size: 15px; }
.message ul { margin: 0; padding-left: 18px; }
.message .subject { font-weight: 500; }
.message .subject span { padding-right: 6px; font-weight: 400; color: var(--muted); }
.message mark, .rewrite-text mark { cursor: help; }
.message mark:focus-visible, .rewrite-text mark:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.example-note { padding-top: 2px; font: 14px/21px var(--sans); color: var(--muted); text-wrap: pretty; }
.tip {
  position: absolute; z-index: 5; max-width: 260px; padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: #fff; font: 13px/18px var(--sans); pointer-events: none;
}
.tip[hidden] { display: none; }

.foot {
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  width: 100%; max-width: calc(var(--wide) + 32px); margin: 0 auto; padding: 112px 16px 40px;
  font: 14px/20px var(--sans); color: var(--muted);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.foot a { color: var(--muted); text-decoration: none; transition: color 150ms ease; }
.foot a:hover { color: var(--accent); }

/* Too narrow for two columns: the label goes above its text, and the card under the painting, so the
   desk is not covered. */
@media (max-width: 900px) {
  .hero-painting { height: auto; max-height: 400px; aspect-ratio: 358 / 220; border-radius: 14px; object-position: 50% 72%; }
  .rewrite { position: static; width: auto; margin-top: 24px; padding: 14px 16px 18px; }
  .row { grid-template-columns: 1fr; gap: 6px; padding-top: 40px; }
  /* One column: the logo and the waitlist field come straight after the painting, so they are on a phone's
     first screen, then the card and the words. The boxes around them step aside for that. */
  .sheet { display: flex; flex-direction: column; }
  .sheet > * { order: 5; }
  .hero, .row--intro { display: contents; }
  .hero > picture { order: 1; }
  .lead { order: 2; gap: 18px; padding-top: 28px; }
  .lead .join { max-width: 420px; }
  .rewrite { order: 3; }
  .intro { order: 4; padding-top: 32px; }
  .charts { padding-top: 28px; }
  .story { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 88px; }
  .story-side { position: static; }
  .story-side h2 { font-size: 26px; line-height: 32px; letter-spacing: -0.02em; }
  .toc { display: none; }
  .story-text > h3, .story-text > h3:first-child { scroll-margin-top: 0; }
  .foot { padding-top: 72px; }
}
@media (max-width: 640px) {
  .charts { grid-template-columns: minmax(0, 1fr); gap: 44px; }
  .bars { gap: 8px; }
  .bar-name { font-size: 12px; line-height: 16px; }
  .replies { grid-template-columns: minmax(0, 1fr); }
  .message { font-size: 15px; line-height: 23px; }
  .sheet { padding-top: 8px; }
  .prose-mark img { width: 120px; height: 40px; }
  .prose-mark span { font-size: 36px; line-height: 36px; padding-bottom: 1.5px; }
}
/* A phone on its side: the painting leaves room for the words. */
@media (max-height: 480px) and (max-width: 900px) { .hero-painting { height: 220px; aspect-ratio: auto; } }
/* Fingers: bigger things to press. */
@media (pointer: coarse) {
  .mode { padding-top: 8px; padding-bottom: 8px; }
  .foot a { padding: 6px 0; }
  .foot, .foot nav { row-gap: 4px; }
}
@media (prefers-reduced-motion: reduce) { .mode, .mode-key, .rewrite-text, .rewrite-text.is-shown, .button, .toc a, .story-text a, .row a, .foot a { transition: none; } }

/* A short list inside the post: the limitations. */
.story-text .plain-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.story-text .plain-list li { font: 17px/28px var(--sans); text-wrap: pretty; }
