/* Ihop: tokens. Paper, ink and wine: the app's own palette, light and dark. */
/* Atelier: Gambetta for headlines, General Sans for text (and the app), Patrick Hand where people write by hand.
   Gambetta and General Sans: Indian Type Foundry via Fontshare (ITF Free Font License). Patrick Hand: OFL. Self-hosted. */
@font-face { font-family: "Gambetta"; src: url("/assets/fonts/gambetta-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Gambetta"; src: url("/assets/fonts/gambetta-400i.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gambetta"; src: url("/assets/fonts/gambetta-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Gambetta"; src: url("/assets/fonts/gambetta-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("/assets/fonts/general-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("/assets/fonts/general-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("/assets/fonts/general-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "General Sans"; src: url("/assets/fonts/general-sans-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("/assets/fonts/patrick-hand-400-latin.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Patrick Hand"; src: url("/assets/fonts/patrick-hand-400-latin-ext.woff2") format("woff2"); font-weight: 400; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light dark;
  /* Colour: the app's palette, unchanged */
  --ground: #F3EBDF;    /* paper */
  --sheet: #FBF7F1;     /* a sheet on the paper */
  --ink: #2A211C;
  --ink2: #6B5D53;      /* muted text on paper (5.6:1) */
  --rule: #E2D6C6;
  --accent: #7B2D3B;    /* wine */
  --accent-soft: #EFDFDC;
  --on-accent: #FFFFFF;
  --sand: #DBB48D;      /* the warm tan from the current icon, used sparingly */
  --ok: #3F6B4B;        /* settled, ticked */
  --shadow-1: 0 1px 0 rgba(42,33,28,.05), 0 10px 28px -16px rgba(42,33,28,.35);
  --shadow-2: 0 2px 0 rgba(42,33,28,.04), 0 30px 60px -30px rgba(42,33,28,.45);

  /* Type */
  --serif: "Gambetta", ui-serif, "Iowan Old Style", Georgia, serif;
  --sans: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --hand: "Patrick Hand", "Bradley Hand", "Segoe Print", cursive;
  --t-mega: clamp(44px, 7.2vw, 104px);
  --t-h1: clamp(36px, 5vw, 68px);
  --t-h2: clamp(28px, 3.4vw, 46px);
  --t-h3: clamp(20px, 1.7vw, 24px);
  --t-lead: clamp(18px, 1.4vw, 21px);
  --t-body: 17px;
  --t-small: 15px;
  --t-label: 13px;

  /* Space: 4-based */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 136px;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1200px;
  --read: 680px;

  /* Shape: everything you hold is soft, like a well-used notebook */
  --r-1: 8px; --r-2: 14px; --r-3: 22px; --r-phone: 40px; --r-pill: 999px;

  /* Motion: three verbs. Settle (things land), slide (sheets move), tick (a small yes). */
  --ease-settle: cubic-bezier(.2, .8, .2, 1);
  --ease-slide: cubic-bezier(.65, 0, .35, 1);
  --ease-tick: cubic-bezier(.34, 1.4, .64, 1);
  --d-tick: 160ms; --d-ui: 240ms; --d-settle: 620ms; --d-scene: 900ms;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #1D1714; --sheet: #27201C; --ink: #F3EBDF; --ink2: #B7A899; --rule: #3A302A;
    --accent: #C9737F; --accent-soft: #3A2529; --on-accent: #1D1714; --sand: #B98E66; --ok: #8DBB97;
    --shadow-1: 0 1px 0 rgba(0,0,0,.2), 0 10px 28px -16px rgba(0,0,0,.7);
    --shadow-2: 0 2px 0 rgba(0,0,0,.2), 0 30px 60px -30px rgba(0,0,0,.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --d-tick: 1ms; --d-ui: 1ms; --d-settle: 1ms; --d-scene: 1ms; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font: 400 var(--t-body)/1.55 var(--sans); color: var(--ink); background: var(--ground); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.012em; text-wrap: balance; }
p, li { text-wrap: pretty; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ink); color: var(--ground); border-radius: var(--r-1); }
.skip:focus { top: 12px; }

/* Section themes */
.t-sheet { background: var(--sheet); }
.t-ink { --ground: #2A211C; --sheet: #352A24; --ink: #F3EBDF; --ink2: #C9BBAD; --rule: #4A3D35; --accent: #E3A0A9; --on-accent: #2A211C; background: var(--ground); color: var(--ink); }
.t-wine { --ink: #FBF7F1; --ink2: #EBD3D5; --rule: rgba(251,247,241,.22); --accent: #FBF7F1; --on-accent: #7B2D3B; background: #7B2D3B; color: var(--ink); }
@media (prefers-color-scheme: dark) {
  .t-ink { --ground: #120E0C; --sheet: #1D1714; }
  .t-wine { background: #5A222C; --on-accent: #5A222C; }
}
