/* The website's look, shared by its pages: the app's palette, the top bar, buttons, the hero,
   sections, install, the closing band and the footer. */

/* The app's palette: its greys, and a colour per tool (blue: Review and draft, brown: Review
   and highlight). */
:root {
  color-scheme: light;
  --bg: #ebebef;
  --band: #dcdce1;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d6d6dc;
  --line: #c7c7cf;
  --blue: #2f6fde;
  --blue-soft: #e3ecfb;
  --brown: #b45309;
  --brown-soft: #f6e8db;
  --code-bg: #f3f3f6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 28px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161618;
    --band: #1f1f22;
    --card: #232326;
    --text: #f2f2f4;
    --muted: #a1a1a8;
    --border: #3a3a3f;
    --line: #4a4a50;
    --blue: #6b9bf2;
    --blue-soft: #1f2c44;
    --brown: #e08a3c;
    --brown-soft: #3a2a1c;
    --code-bg: #1b1b1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* Top bar, like the app's. */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--band) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 18px; text-decoration: none; letter-spacing: -0.01em; }
.brand svg { flex: none; }
.top nav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--text); }
.top nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
@media (max-width: 600px) { .top nav a:not(.keep) { display: none; } }

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--text); /* in the app's greys: near-black, or near-white in dark mode */
  color: var(--bg);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: background 0.15s;
}
.button:hover { background: color-mix(in srgb, var(--text) 82%, var(--bg)); }
.button.secondary { background: var(--card); color: var(--text); border-color: var(--border); }
/* Not out yet: shown, but not a link. */
.button.secondary:hover { background: var(--code-bg); }
.button:focus-visible, .copy:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Hero. */
.hero { padding: 72px 0 40px; text-align: center; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; margin: 0 0 18px; padding: 4px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--border); color: var(--muted); font-size: 13px; }
h1 { margin: 0 auto 16px; max-width: 16ch; font-size: clamp(36px, 6.4vw, 60px); line-height: 1.05; letter-spacing: -0.035em; }
h1 .blue { color: var(--blue); }
h1 .brown { color: var(--brown); }
.lede { margin: 0 auto 28px; max-width: 34em; font-size: clamp(17px, 2.2vw, 19px); color: var(--muted); }
/* The two tools, each with its own description: the hero swaps between them, and the window
   below with them (see setHeroTool). The pill showing fills up in its tool's colour, and once
   it's full the other takes over; the fill waits while the hero isn't in view. */
.hero-tools { display: inline-flex; gap: 6px; margin: 4px 0 16px; }
/* On a phone, one above the other: side by side, their names would wrap. */
@media (max-width: 600px) { .hero-tools { flex-direction: column; align-items: center; } .hero-tool { white-space: nowrap; } }
.hero-tool { --tool: var(--blue); --tool-soft: var(--blue-soft); position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border: 1px solid var(--border); border-radius: 99px; background: var(--card); color: var(--muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: color 0.3s, background 0.3s, border-color 0.3s; }
.hero-tool[data-tool="highlights"] { --tool: var(--brown); --tool-soft: var(--brown-soft); }
.hero-tool svg { color: var(--tool); }
.hero-tool::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--tool-soft); transform: scaleX(0); transform-origin: left; }
.hero-tool[aria-pressed="true"] { border-color: var(--tool); color: var(--tool); }
.hero-tool[aria-pressed="true"]::before { animation: hero-fill 7s linear forwards; }
.hero-tools.paused .hero-tool::before { animation-play-state: paused; }
@keyframes hero-fill { to { transform: scaleX(1); } }
.hero-tool:focus-visible { outline: 2px solid var(--tool); outline-offset: 2px; }
.ledes { display: grid; }
.ledes .lede { grid-area: 1 / 1; opacity: 0; transition: opacity 0.5s; }
.ledes .lede.shown { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .ledes .lede, .hero-tool { transition: none; }
  .hero-tool[aria-pressed="true"]::before { animation: none; transform: none; } /* no swapping by itself */
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hint { margin: 14px 0 0; font-size: 13px; color: var(--muted); }

/* Sections. */
/* Well apart, so each section reads on its own: more space on wider screens. */
section { padding: clamp(96px, 12vw, 160px) 0 0; scroll-margin-top: 56px; } /* linked to, clear of the sticky top bar */
.section-head { max-width: 640px; margin: 0 0 28px; }
.kicker { margin: 0 0 8px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
h2 { margin: 0 0 10px; font-size: clamp(26px, 3.6vw, 36px); line-height: 1.15; letter-spacing: -0.025em; }
.section-head p { margin: 0; color: var(--muted); font-size: 17px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { padding: 26px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); }
.card h3 { margin: 0 0 8px; font-size: 20px; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); }

/* Good to know: points with no cards, sliding past without end; still, and wrapped onto lines,
   for anyone who prefers less motion. */
.points { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.points-track { display: flex; width: max-content; margin: 0; padding: 0; list-style: none; animation: points-slide 60s linear infinite; }
.points-track li { width: 380px; padding: 0 40px; }
.points-track h3 { margin: 0 0 8px; font-size: 18px; letter-spacing: -0.01em; }
.points-track p { margin: 0; color: var(--muted); text-wrap: pretty; }
@keyframes points-slide { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .points { mask-image: none; max-width: 1080px; margin: 0 auto; }
  .points-track { width: auto; flex-wrap: wrap; row-gap: 28px; animation: none; }
  .points-track li[aria-hidden="true"] { display: none; }
}

/* Install. */
/* The install tabs, a segmented control like the app's All | To do, over one panel at a time. */
.tabs { display: inline-flex; gap: 2px; margin: 0 0 16px; padding: 3px; border-radius: 10px; background: var(--band); }
.tabs [role="tab"] { padding: 7px 16px; border: 0; border-radius: 7px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs [role="tab"]:hover { color: var(--text); }
.tabs [role="tab"][aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.tabs [role="tab"]:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.tab-panel { max-width: 720px; }
.tab-panel[hidden] { display: none; }
/* Free: the headline beside the MIT licence in plain words, its points stacked, each with an
   icon (no cards); one above the other on narrow screens. */
.free-layout { display: grid; gap: 40px 72px; }
@media (min-width: 860px) { .free-layout { grid-template-columns: 1fr 1fr; align-items: start; } }
.free-layout .section-head { margin: 0; }
.free .section-head p, .free-answer { text-wrap: pretty; }
.free-question { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.free-answer { margin: 0 0 24px; color: var(--muted); }
.free-points { display: grid; gap: 22px; margin: 0; padding: 0; list-style: none; }
.free-points li { display: flex; gap: 14px; align-items: flex-start; }
.free-icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--blue-soft); color: var(--blue); }
.free-points h3 { margin: 6px 0 4px; font-size: 17px; }
.free-points p { margin: 0; color: var(--muted); text-wrap: pretty; }

.install ol { margin: 14px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.command { position: relative; margin: 6px 0 0; }
.command pre {
  margin: 0;
  padding: 12px 84px 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--code-bg);
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  word-break: break-all;
}
.copy {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.small { margin: 14px 0 0; font-size: 14px; color: var(--muted); }
code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Closing band and footer. */
.closing { margin-top: clamp(96px, 12vw, 160px); padding: 56px 0; background: var(--band); text-align: center; }
.closing h2 { margin-bottom: 8px; }
.closing p { margin: 0 0 24px; color: var(--muted); }
footer { padding: 28px 0 40px; background: var(--band); border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
footer .brand { font-size: 15px; }
footer a:not(.brand) { color: var(--muted); }
footer .end { margin-left: auto; }
