/* minibreaks.app
 *
 * The app's own colours, from `Assets.xcassets` in the Mini Breaks target:
 * `PageBackground`, `CardSurface`, `AccentColor` (oxblood) and `SecondAccent`
 * (ochre). Re-tinting the app means re-tinting this, or the page ends up a shade
 * off the screenshots sitting on it.
 *
 * And the app's own shape, from `Views/Components/Ledger.swift`: content set full
 * width and separated by hairlines rather than floated on cards, statements in a
 * serif, labels in small-caps sans, small radii, no shadows. This is not decoration.
 * Guideline 4.3 matches two apps from one developer on binary, metadata and concept,
 * and the two sites are the most public place that comparison gets made — so this
 * page and the sibling's must not be mistakable for each other at a glance.
 */

:root {
  --paper: #f5f6f7;
  --card: #ffffff;
  --ink: #16191c;
  --muted: #5b6469;
  --accent: #8e3b32;
  --ochre: #7a5a16;
  --rule: rgba(22, 25, 28, 0.14);

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

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14171a;
    --card: #1d2126;
    --ink: #e9ecee;
    --muted: #98a1a7;
    --accent: #e09084;
    --ochre: #d8b45e;
    --rule: rgba(233, 236, 238, 0.14);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 28px;
}

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

a:hover { text-decoration: none; }

/* Every rule on the page is 1px of `--rule`, dropped to half a pixel wherever the
 * display can draw one — `Rule` in the app is half a point at 14% of the ink, and a
 * whole CSS pixel is two device pixels on every phone this page is opened on, which
 * reads as a border rather than as ruling on paper. Each `border-top` below is
 * paired with a `min-resolution` override for that reason. */

/* The label: small caps in the sans, tracked out.
 *
 * Setting a label in the same face as the prose it labels makes both harder to
 * scan. The contrast between a serif statement and a sans label is doing the work
 * that a colour or a box would otherwise have to — the same reason `LedgerHeader`
 * exists in the app. */
.label {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 0 0 12px;
}

/* Hero */

header {
  padding: 84px 0 8px;
}

.mark {
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 48px;
}

a.mark:hover { color: var(--ink); }

/* The masthead: the drawing at one end of a ruled row and the name at the other.
 *
 * Which of the two files is the drawing comes from CSS rather than from a `<picture>`,
 * so that the artwork and the palette switch inside the same `@media` block. Split
 * across the two mechanisms they can disagree, and dark ink on dark paper is an
 * invisible logo. The dark file is not the light one dimmed — the greys are re-laid so
 * the loops still fade towards the paper — which is also why there is no `filter` trick
 * here doing it at render time.
 *
 * The row and its rule are the point: it is the same masthead the app puts above its
 * first screen, and it is nothing like the sibling site's centred logo stacked over a
 * centred wordmark. */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--rule);
}

@media (min-resolution: 2dppx) {
  .masthead { border-bottom-width: 0.5px; }
}

.masthead .mark { margin-bottom: 0; }

.mark-art {
  display: block;
  flex: none;
  width: 76px;
  aspect-ratio: 240 / 146;
  background: url("break-mark.png") left center / contain no-repeat;
}

@media (prefers-color-scheme: dark) {
  .mark-art { background-image: url("break-mark-dark.png"); }
}

h1 {
  font-size: clamp(2rem, 5.6vw, 3rem);
  line-height: 1.14;
  letter-spacing: -0.015em;
  font-weight: 600;
  margin: 0 0 22px;
  max-width: 21ch;
  text-wrap: balance;
}

.lede {
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 40px;
}

.badge img {
  display: block;
  height: 48px;
  width: auto;
}

/* The plan specimen */

.specimen { padding: 72px 0 0; }

.moments { margin: 0; }

.moment {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 24px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}

.moments .moment:last-child { border-bottom: 1px solid var(--rule); }

@media (min-resolution: 2dppx) {
  .moment { border-top-width: 0.5px; }
  .moments .moment:last-child { border-bottom-width: 0.5px; }
}

.moment dt {
  grid-column: 1;
  font-size: 1.125rem;
}

/* What you decided beforehand. Quieter than the situation, because the situation is
   what you scan for when you are standing in one. */
.moment dd {
  grid-column: 1;
  margin: 0;
  color: var(--muted);
}

/* Ochre for the moments that are named and waiting, oxblood for the one being
   worked on — the app's own rule for its two accents, which is that the second one
   is always the quieter of two things on a screen. */
/* Two classes, so it out-specifies the `.moment dd` above — it is a `dd` itself,
   because `dl > div` may hold only `dt` and `dd`, and "in scope" is another fact
   about the same situation. */
.moment .scope {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-family: var(--sans);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre);
  white-space: nowrap;
}

.moment .scope.in { color: var(--accent); }

.specimen .note {
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 58ch;
  margin: 20px 0 0;
}

/* Screens */

.screens {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding: 80px 0 0;
}

figure { margin: 0; }

/* Hairline and a small radius, and no shadow at all: a screenshot on this page is
   a specimen pasted onto the paper, not an object floating above it. */
figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--card);
}

figure .label { margin-bottom: 14px; }

/* Points */

.points { padding: 80px 0 0; }

.point {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0 8px;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}

.points .point:last-child { border-bottom: 1px solid var(--rule); }

@media (min-resolution: 2dppx) {
  .point { border-top-width: 0.5px; }
  .points .point:last-child { border-bottom-width: 0.5px; }
}

/* Scoped to `.point` rather than left bare: `.num` is a `<p>`, and `.point p` below
   would otherwise out-specify it and grey the number out. */
.point .num {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ochre);
  margin: 0;
  padding-top: 0.55rem;
}

.point h2 {
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 6px;
}

.point p { margin: 0; color: var(--muted); }

/* Asides */

.asides {
  padding: 56px 0 88px;
  color: var(--muted);
  font-size: 0.9375rem;
  max-width: 64ch;
}

.asides p { margin: 0 0 14px; }

.asides strong { color: var(--ink); font-weight: 600; }

/* Legal pages */

.doc { padding: 56px 0 0; }

.doc .mark { margin-bottom: 0; }

/* `.prose` already opens with 48px of its own, and the rule is the separation. */
.doc .masthead { margin-bottom: 0; }

.prose {
  max-width: 68ch;
  padding: 48px 0 80px;
}

.prose h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 8px;
  max-width: none;
}

.prose .updated {
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.8125rem;
  margin: 0 0 40px;
}

.prose h2 {
  font-family: var(--sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ochre);
  margin: 44px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

@media (min-resolution: 2dppx) {
  .prose h2 { border-top-width: 0.5px; }
}

.prose p, .prose li { color: var(--muted); }

.prose p { margin: 0 0 14px; }

.prose ul { margin: 0 0 14px; padding-left: 22px; }

.prose li { margin-bottom: 6px; }

.prose strong { color: var(--ink); font-weight: 600; }

/* Footer */

footer {
  border-top: 1px solid var(--rule);
  padding: 28px 0 64px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  justify-content: space-between;
}

@media (min-resolution: 2dppx) {
  footer { border-top-width: 0.5px; }
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}

@media (max-width: 760px) {
  header { padding-top: 56px; }
  .specimen, .screens, .points { padding-top: 56px; }
  .screens { grid-template-columns: 1fr; gap: 44px; max-width: 340px; }
  .moment { grid-template-columns: 1fr; }
  .moment .scope { grid-column: 1; grid-row: auto; align-self: start; margin-top: 6px; }
  .point { grid-template-columns: 1fr; }
  .point .num { padding-top: 0; margin-bottom: 8px; }
  footer { justify-content: flex-start; }
}
