/*
 * Ollita — ollita.nookpages.com. One stylesheet for every page: no scripts and no third-party files; one web font of
 * our own, Newsreader (fonts/, SIL Open Font License, fonts/OFL.txt), served from this site.
 * The look is the app's (apps/ollita/docs/art-direction.md): the kitchen-table receipt. Warm paper, ink, slips with
 * dotted leaders and dashed perforations, at most one torn edge (the home page's receipt), and one red, jamaica
 * #A3213D, for links, the pen line and the total. Money is never green or red. Colours are the app's tokens, light and
 * dark; text pairs meet WCAG AA in both (art-direction.md › Colour gives the ratios: ink on slip 16.7 / 14.1, secondary
 * 7.2 / 7.6, jamaica on paper 6.4, the dark tint #F08C9C on the dark slip 7.1).
 * Headings are Newsreader (the app's display face); body text is the system's own (SF Pro on Apple devices), as in the
 * app. The mark in each header and favicon.svg is drawn for the site; keep it close to the app icon (A8's).
 */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  /* Google Fonts' latin subset of the variable font (opsz 6–72, wght 200–800): Spanish included. */
  src: url("/fonts/newsreader-latin.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --paper: #f4eee3;
  --slip: #fffdf8;
  --muted: #eae2d3;
  --ink: #1f1c18;
  --ink-secondary: #5c554a;
  --ink-tertiary: #6f6658;
  --separator: #ded3c0;
  --border: #c9bba3;
  --border-strong: #887a63;
  --jamaica: #a3213d;
  --on-jamaica: #ffffff;
  --tint: #a3213d;
  --tint-hover: #7a1830;
  --jamaica-muted: #f8e1e4;
  --warning: #855600;
  --line: #2a2620;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --measure: 42rem;
  --wide: 64rem;
  --gutter: 1rem;
  --radius: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14110d;
    --slip: #211d18;
    --muted: #2e2922;
    --ink: #f2ebdd;
    --ink-secondary: #b8ae9c;
    --ink-tertiary: #9c9282;
    --separator: #38312a;
    --border: #4d453a;
    --border-strong: #7a705f;
    --jamaica: #c0344f;
    --tint: #f08c9c;
    --tint-hover: #fbd0d7;
    --jamaica-muted: #47202a;
    --warning: #e3b04b;
    --line: #e9e0cf;
  }
}

@media (min-width: 40rem) {
  :root {
    --gutter: 1.5rem;
  }
}

/* Base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }
}

main {
  flex: 1;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 1.7rem + 2.4vw, 3.2rem);
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-variation-settings: "opsz" 72;
}

h2 {
  font-size: clamp(1.5rem, 1.35rem + 0.8vw, 1.9rem);
  margin: 3rem 0 0.75rem;
  scroll-margin-top: 1.5rem;
  font-variation-settings: "opsz" 48;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
  scroll-margin-top: 1.5rem;
  font-variation-settings: "opsz" 20;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.35rem;
}

li::marker {
  color: var(--ink-tertiary);
}

a {
  color: var(--tint);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--tint-hover);
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--tint);
  outline-offset: 3px;
  border-radius: 4px;
}

strong {
  font-weight: 650;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--slip);
  color: var(--ink);
  border-radius: var(--radius);
  z-index: 10;
}

.skip:focus {
  left: 0.5rem;
}

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.page,
.narrow {
  max-width: calc(var(--measure) + 2 * var(--gutter));
}

.page {
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--separator);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  text-decoration: none;
}

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

.brand svg {
  width: 2.1rem;
  height: 2.1rem;
  flex: none;
}

.mark-ground {
  fill: var(--slip);
}

.mark-slip {
  fill: var(--slip);
  stroke: var(--line);
}

.mark-ink {
  stroke: var(--line);
}

.mark-ink-fill {
  fill: var(--line);
}

.mark-pot,
.mark-bar {
  fill: var(--jamaica);
}

.mark-pot {
  stroke: var(--line);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li + li {
  margin-top: 0;
}

.nav-list a {
  color: var(--ink);
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--tint);
  text-decoration: underline;
}

.lang {
  color: var(--ink-secondary);
}

.lang a {
  color: var(--tint);
}

.site-footer {
  border-top: 1px dashed var(--border);
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.site-footer p {
  margin: 0;
}

.site-footer .nav-list a {
  color: var(--ink-secondary);
}

/* Policy pages */

.doc-meta {
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.summary,
.toc,
.slip {
  background: var(--slip);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.5rem;
  margin: 1.75rem 0;
  border: 1px solid var(--separator);
}

.summary h2,
.toc h2 {
  margin-top: 0;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.toc ol {
  columns: 2 14rem;
  column-gap: 2rem;
}

.toc li {
  break-inside: avoid;
}

.facts dt {
  font-weight: 650;
  margin-top: 1rem;
}

.facts dd {
  margin: 0.15rem 0 0;
  color: var(--ink-secondary);
}

.note {
  border-left: 3px solid var(--jamaica);
  padding: 0.25rem 0 0.25rem 1rem;
  color: var(--ink-secondary);
}

.email {
  font-weight: 600;
}

/* Home page */

.hero {
  padding: 2.5rem 0 1rem;
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

@media (min-width: 52rem) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
  }
}

.eyebrow {
  font-size: 0.8rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-bottom: 0.75rem;
}

.lede {
  font-size: 1.2rem;
  color: var(--ink-secondary);
}

.hero-note {
  font-size: 0.95rem;
  color: var(--ink-secondary);
}

/* The receipt: a slip with caps labels, dotted leaders, a perforation and the one torn edge (bottom). */

.receipt {
  position: relative;
  max-width: 24rem;
  margin: 0 auto 1rem;
  background: var(--slip);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.4rem 1.4rem 1.6rem;
  font-variant-numeric: tabular-nums lining-nums;
}

.receipt::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
  background:
    linear-gradient(135deg, var(--slip) 50%, transparent 50%) 0 0 / 12px 8px repeat-x,
    linear-gradient(-135deg, var(--slip) 50%, transparent 50%) 0 0 / 12px 8px repeat-x;
}

.receipt-label {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.receipt-sub {
  margin: 0.2rem 0 0.9rem;
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

.receipt-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px dashed var(--border);
}

.receipt-lines li {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--separator);
  font-size: 0.98rem;
}

.receipt-day {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.15rem;
  width: 2.6rem;
  flex: none;
}

.receipt-dish {
  flex: 1;
}

.receipt-meta {
  color: var(--ink-secondary);
  font-size: 0.9rem;
  white-space: nowrap;
}

.receipt-total {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 1.1rem 0 0.25rem;
}

.receipt-total .receipt-label {
  flex: none;
}

.leader {
  flex: 1;
  border-bottom: 1px dotted var(--border);
  transform: translateY(-0.3rem);
}

.receipt-amount {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 2.3rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum", "lnum";
}

.ruler {
  position: relative;
  height: 1.6rem;
  margin: 1rem 0 0.25rem;
  border-bottom: 1px solid var(--ink);
}

.ruler-band {
  position: absolute;
  bottom: 0;
  left: 79.3%;
  width: 10%;
  height: 0.9rem;
  background: repeating-linear-gradient(-45deg, var(--tint) 0 2px, transparent 2px 5px);
}

.ruler-tick {
  position: absolute;
  bottom: 0;
  left: 90.9%;
  width: 2px;
  height: 1.6rem;
  background: var(--ink);
}

.receipt-foot {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

.receipt-caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-tertiary);
  margin-top: 1.4rem;
}

.section {
  padding: 2rem 0;
}

.section-title {
  margin-top: 0;
}

.section-intro {
  color: var(--ink-secondary);
  max-width: var(--measure);
}

.menu {
  list-style: none;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0 2.5rem;
  background: var(--slip);
  border-radius: var(--radius);
  padding: 0.5rem 1.4rem;
}

@media (min-width: 48rem) {
  .menu {
    grid-template-columns: 1fr 1fr;
  }
}

.menu li {
  margin: 0;
  padding: 1rem 0;
  border-bottom: 1px solid var(--separator);
}

.menu h3 {
  margin: 0 0 0.3rem;
}

.menu p {
  margin: 0;
  color: var(--ink-secondary);
}

.plans {
  display: grid;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

@media (min-width: 48rem) {
  .plans {
    grid-template-columns: 1fr 1fr;
  }
}

.plans .slip {
  margin: 0;
}

.plans h3 {
  margin-top: 0;
}

.fineprint {
  font-size: 0.92rem;
  color: var(--ink-secondary);
}

.disclaimer {
  margin-top: 2rem;
  font-size: 0.92rem;
  color: var(--ink-tertiary);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media print {
  .site-header nav,
  .skip {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}

/* The example receipts' rulers: from $0 to 110% of the larger of budget and top (art-direction.md › The ruler).
   English: $96–$108 against $110 (scale to $121). Spanish: $1,050–$1,180 against $1,250 (scale to $1,375). */
.ruler-mx .ruler-band {
  left: 76.4%;
  width: 9.4%;
}

/* No hairline under the menu's last row (two columns on wide screens). */
.menu li:last-child {
  border-bottom: none;
}

@media (min-width: 48rem) {
  .menu li:nth-last-child(2):nth-child(odd) {
    border-bottom: none;
  }
}
