/*
  dayjournal.app — one stylesheet for every page.

  The colours are the app's own (clients/ios/DayJournal/App/Theme.swift): the
  paper, the desk it lies on, the rules and the accent, plus the red header
  and the blue ink the icon is drawn in. No web fonts: the system's serif and
  sans are the faces the app itself is set in, and nothing is fetched from
  anyone else.
*/

:root {
  --paper: #ffffff;
  --desk: #eef0f3;
  --rule: #d3d7df;
  --rule-soft: #e4e7ec;
  --ink: #2b3a55;
  --ink-soft: #5b6475;
  --accent: #c4502b;
  --header-red: #d8261e;
  --pen-blue: #2f63d6;
  --highlight: rgba(255, 214, 0, 0.42);
  --shadow: 0 1px 2px rgba(20, 24, 33, 0.06), 0 12px 32px rgba(20, 24, 33, 0.10);

  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1b1d22;
    --desk: #0f1013;
    --rule: #363b45;
    --rule-soft: #2a2e36;
    --ink: #e8eaef;
    --ink-soft: #a3a9b6;
    --accent: #e27a57;
    --header-red: #e0453c;
    --pen-blue: #6f9bff;
    --highlight: rgba(255, 214, 0, 0.28);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--desk);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--pen-blue); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* ------------------------------------------------------------ top bar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.brand img { width: 32px; height: 32px; border-radius: 22.5%; }

.topbar nav { display: flex; gap: 20px; font-size: 15px; }
.topbar nav a { color: var(--ink-soft); text-decoration: none; }
.topbar nav a:hover, .topbar nav a[aria-current="page"] { color: var(--ink); }

/* ------------------------------------------------------------ hero */

.hero {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 56px;
  align-items: center;
  padding-block: 48px 72px;
}

.app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22.5%;
  box-shadow: var(--shadow);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }

.hero h1 { font-size: clamp(40px, 6vw, 64px); margin: 28px 0 16px; }
.hero .lede { font-size: 20px; color: var(--ink-soft); margin: 0 0 28px; max-width: 32em; }

.availability {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: 15px;
  font-weight: 500;
}
.availability .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.fineprint { font-size: 14px; color: var(--ink-soft); margin-top: 14px; }

/* The page in the hero: a fortnight of a month, with a date circled in the
   icon's blue ink and a highlighter across three days. */
.sheet {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.sheet svg { display: block; width: 100%; height: auto; }
.sheet .grid { stroke: var(--rule); stroke-width: 1; }
.sheet .weekday { fill: var(--ink-soft); font: 600 14px var(--sans); letter-spacing: 0.08em; }
.sheet .date { fill: var(--ink); font: 500 21px var(--sans); }
.sheet .date.muted { fill: var(--ink-soft); }
.sheet .today-badge { fill: var(--header-red); }
.sheet .today { fill: #fff; font: 700 19px var(--sans); }
.sheet .pen { fill: none; stroke: var(--pen-blue); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sheet .rust { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.sheet .marker { fill: none; stroke: var(--highlight); stroke-width: 22; stroke-linecap: round; }
.sheet .chip { fill: color-mix(in srgb, var(--pen-blue) 16%, transparent); }
.sheet .chip-bar { fill: var(--pen-blue); }
.sheet .chip-text { fill: var(--ink); font: 500 13px var(--sans); }

/* ------------------------------------------------------------ features */

.section { padding-block: 64px; border-top: 1px solid var(--rule-soft); }
.section > h2 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 12px; }
.section > .intro { color: var(--ink-soft); font-size: 19px; margin: 0 0 36px; max-width: 36em; }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  background: var(--paper);
  border-radius: 14px;
  padding: 24px 24px 22px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 21px; margin: 0 0 8px; }
.card p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.card .glyph { width: 28px; height: 28px; margin-bottom: 14px; color: var(--accent); }

.promise {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.promise li { border-left: 3px solid var(--accent); padding: 2px 0 2px 16px; }
.promise strong { display: block; font-family: var(--serif); font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.promise span { color: var(--ink-soft); font-size: 16px; }

/* ------------------------------------------------------------ documents */

.doc {
  background: var(--paper);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 56px);
  margin-block: 16px 64px;
  max-width: 760px;
  margin-inline: auto;
}
.doc h1 { font-size: clamp(32px, 5vw, 44px); margin: 0 0 6px; }
.doc .updated { color: var(--ink-soft); font-size: 15px; margin: 0 0 32px; }
.doc h2 { font-size: 24px; margin: 40px 0 10px; }
.doc h3 { font-size: 19px; margin: 24px 0 6px; font-family: var(--sans); }
.doc p, .doc li { font-size: 17px; }
.doc ul { padding-left: 1.25em; }
.doc li { margin-block: 6px; }

.summary {
  background: color-mix(in srgb, var(--accent) 7%, var(--paper));
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--paper));
  border-radius: 12px;
  padding: 18px 22px;
}
.summary ul { margin: 8px 0 0; }

.doc table { width: 100%; border-collapse: collapse; font-size: 16px; margin-block: 12px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--rule-soft); }
.doc th { font-weight: 600; white-space: nowrap; }

.faq details { border-bottom: 1px solid var(--rule-soft); padding-block: 14px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 18px; }
.faq details p { margin: 10px 0 0; color: var(--ink-soft); }

/* ------------------------------------------------------------ footer */

.footer {
  border-top: 1px solid var(--rule-soft);
  padding-block: 28px 40px;
  color: var(--ink-soft);
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}
.footer nav { display: flex; gap: 18px; }
.footer a { color: var(--ink-soft); }

/* ------------------------------------------------------------ narrow */

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-block: 24px 56px; }
  .features, .promise { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar nav { gap: 14px; }
  .app-icon { width: 80px; height: 80px; }
  .hero .lede { font-size: 18px; }
  .features, .promise { grid-template-columns: 1fr; }
  .section { padding-block: 48px; }
  .doc th { white-space: normal; }
}
