/* perspicuity.app. The app's own look (Still Water): three tones of text, a serif for titles,
   and the articles' covers carrying the colour. No scripts, no outside requests; ui-serif is
   New York on Apple devices. */

:root {
  --bg: #eaf0ee;
  --deep: #dce6e3;
  --surface: #f6f9f8;
  --ink: #0b2226;
  --body: #38504f;
  --secondary: #64807d;
  --hairline: #c9d7d4;
  --accent: #2c7a70;
  --study: #1673c4;
  /* The cover is a picture: the same inks in light and dark. */
  --cover-ink: #14252b;

  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1619;
    --deep: #0f2126;
    --surface: #13272c;
    --ink: #f2f7f5;
    --body: #b4c5c1;
    --secondary: #869f9b;
    --hairline: #22393e;
    --accent: #8fe3cf;
    --study: #62bcff;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--deep);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(var(--bg), var(--deep));
  color: var(--body);
  font: 17px/1.55 var(--sans);
  padding: env(safe-area-inset-top, 0) 22px env(safe-area-inset-bottom, 0);
}

.top, main, footer {
  max-width: 640px;
  margin: 0 auto;
}

h1, h2, h3, p, blockquote, figure, ol { margin: 0; }
ol { padding: 0; list-style: none; }

a { color: var(--accent); text-underline-offset: 3px; }

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 0 8px;
}

.wordmark {
  font: 600 20px/1.2 var(--serif);
  color: var(--ink);
  text-decoration: none;
}

.pill {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--hairline);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 12px;
}

/* Hero: what the app is. */

.hero { padding: 40px 0 28px; }

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--study);
  margin-bottom: 12px;
}

.hero h1 {
  font: 600 clamp(36px, 10vw, 54px)/1.04 var(--serif);
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}

.text { margin-top: 14px; font-size: 18px; }

/* The articles, as the app shows them: one ground colour per field, the paper's real title. */

.covers { display: grid; gap: 14px; }

.cover {
  color: var(--cover-ink);
  border-radius: 22px;
  overflow: hidden;
}

.coral { background: #ff8162; }
.periwinkle { background: #86a6ff; }
.marigold { background: #ffc043; }

.cover-text { padding: 18px 20px; }
.cover:has(.motif) .cover-text { padding-bottom: 8px; }

.masthead {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1.5px solid rgb(20 37 43 / 0.4);
}

.field {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  opacity: 0.7;
}

.title {
  margin-top: 8px;
  font: 600 clamp(27px, 7.4vw, 34px)/1.08 var(--serif);
  letter-spacing: -0.01em;
}

.title.long { font-size: clamp(20px, 5.6vw, 25px); line-height: 1.15; }

.subtitle {
  margin-top: 6px;
  font: 500 17px/1.3 var(--serif);
}

.deck {
  margin-top: 10px;
  font: italic 500 17px/1.35 var(--serif);
}

.motif {
  display: block;
  width: 100%;
  height: auto;
}

/* The five pages of every article, in order. */

.parts { padding: 52px 0 8px; }

.parts h2 {
  font: 600 24px/1.2 var(--serif);
  color: var(--ink);
  margin-bottom: 20px;
}

.parts ol {
  display: grid;
  gap: 12px;
  counter-reset: part;
}

.parts li {
  counter-increment: part;
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 14px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 16px 18px;
}

.parts li::before {
  content: counter(part);
  grid-row: span 2;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--hue);
  background: color-mix(in srgb, var(--hue) 18%, transparent);
}

.parts h3 {
  font: 600 17px/1.3 var(--sans);
  color: var(--ink);
}

.parts li p { font-size: 16px; }

.parts li { --hue: var(--study); }

/* Three short notes. */

.notes {
  display: grid;
  gap: 22px;
  padding: 44px 0 8px;
}

.notes h3 {
  font: 600 19px/1.3 var(--serif);
  color: var(--ink);
}

.notes p { font-size: 16px; }

@media (min-width: 620px) {
  .notes { grid-template-columns: repeat(3, 1fr); }
}

/* The name, as a dictionary gives it. */

.name {
  margin-top: 44px;
  padding: 22px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}

.entry dfn {
  font: 600 22px/1.2 var(--serif);
  font-style: normal;
  color: var(--ink);
  margin-right: 8px;
}

.entry span {
  font-size: 14px;
  color: var(--secondary);
}

.meaning {
  margin-top: 4px;
  font: 400 18px/1.4 var(--serif);
  color: var(--ink);
}

/* Footer */

footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  padding: 26px 0 34px;
  font-size: 14px;
  color: var(--secondary);
}

footer nav {
  display: flex;
  gap: 18px;
}

footer a { color: var(--secondary); }
