/* earlylight.app: one page in the app's Paper theme (doc 08). Self-hosted fonts, no scripts.
   Design: a page from a book. Serif reading text, a small masthead, screenshots as captioned figures. */

@font-face {
  font-family: "Early Light Serif";
  src: url("fonts/early-light-serif.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Early Light Serif";
  src: url("fonts/early-light-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Early Light Sans";
  src: url("fonts/early-light-sans.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #FBF6EC;
  --grain: url("img/grain.png");
  --text: #3B3632;
  --muted: #6E655C;
  --accent: #763624;
  --sun: #D9963A;
  --rule: #E7DCCB;
  --shot-edge: #E3D7C3;
  --serif: "Early Light Serif", Georgia, "Times New Roman", serif;
  --sans: "Early Light Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1A19;
    --grain: url("img/grain_dark.png");
    --text: #E9E2D6;
    --muted: #B3A898;
    --accent: #C9A882;
    --sun: #E8B04A;
    --rule: #34302B;
    --shot-edge: #3A352F;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  /* Paper grain over the paper color (remove var(--grain) for a flat page). */
  background: var(--grain) repeat, var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 19px;
  line-height: 1.6;
}

.page {
  max-width: 38rem;
  margin: 0 auto;
  padding: 28px 22px 40px;
}

/* Masthead: small icon and the name, like the running head of a book. */
.masthead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}

.masthead img {
  width: 36px;
  height: 36px;
  border-radius: 22%;
}

.masthead .name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

main {
  padding-top: 9vh;
}

/* Even line lengths in headings and captions; no lone last words in body text. */
h1,
h2,
figcaption {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.005em;
  max-width: 30rem;
}

.status {
  margin: 14px 0 36px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
}

main > p {
  margin: 0 0 18px;
}

/* A short scripture line set like a book epigraph, with a small sun ornament above. */
.epigraph {
  margin: 8px auto 52px;
  max-width: 26rem;
  text-align: center;
}

.epigraph::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: -18px 0 0 -1px var(--rule), 18px 0 0 -1px var(--rule);
}

.epigraph p {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.45;
  text-wrap: balance;
}

.epigraph footer {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* A pair of screenshots side by side. */
.figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 40px 0 44px;
}

figure {
  margin: 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--shot-edge);
}

figcaption {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

/* Section label in the app's style ("THIS WEEK"). */
h2 {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.points {
  list-style: none;
  margin: 0;
  padding: 0;
}

.points li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 14px;
}

.points strong {
  font-weight: 600;
}

/* Small sun-colored dot as the marker. */
.points li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.66em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sun);
}

.plans {
  margin: 0;
}

.points + h2 {
  margin-top: 36px;
}

/* The maker's note, set like a quotation in a book: indented and italic. */
.note {
  position: relative;
  margin: 44px 2rem 36px;
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.6;
}


.note p {
  margin: 0 0 12px;
}

.note footer {
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: right;
}


.contact {
  margin: 28px 0 0;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Masthead link back home (privacy page). */
.masthead .home {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

/* Text pages (privacy): section headings in serif, a little tighter top space. */
.doc main {
  padding-top: 6vh;
}

.doc h2 {
  margin: 36px 0 10px;
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}

.doc main > p {
  margin-bottom: 14px;
}

.footer a {
  color: inherit;
}

/* 404 page */
.not-found main {
  padding-top: 12vh;
}

.not-found p {
  color: var(--muted);
}

@media (max-width: 420px) {
  body {
    font-size: 18px;
  }

  h1 {
    font-size: 1.7rem;
  }

  .figures {
    gap: 14px;
  }
}
