/* Inkpot site. Colours are the app's own (Theme/Ink.xcassets), light and dark.
   New York and SF come from the visitor's system; nothing is downloaded. */
:root {
  color-scheme: light dark;

  --paper: #faf8f3;
  --surface: #ffffff;
  --text: #1b1a17;
  --secondary: #6b675e;
  --accent: #2340c4;
  --on-accent: #ffffff;
  --hairline: #e4dfd4;
  --rule: #d3cbbe;

  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  /* Spacing scale */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;
  --s9: 96px;
  --s10: 144px;

  /* Type scale */
  --t-small: 15px;
  --t-body: 18px;
  --t-lede: 21px;
  --t-h3: 21px;
  --t-h2: clamp(32px, 4.2vw, 46px);
  --t-h1: clamp(42px, 6.4vw, 72px);
  --t-doc-h1: clamp(38px, 5vw, 56px);
  --t-doc-h2: 27px;

  --radius: 12px; /* Ink.radius */
  --measure: 62ch;
  --maxw: 1120px;
  --gutter: clamp(16px, 5vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121417;
    --surface: #1a1c20;
    --text: #ece9e2;
    --secondary: #9a968d;
    --accent: #9db0ff;
    --on-accent: #0e1430;
    --hairline: #2a2d31;
    --rule: #40444a;
  }
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 var(--t-body) / 1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  accent-color: var(--accent);
}

::selection { background: color-mix(in srgb, var(--accent) 22%, transparent); }

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); line-height: 1.04; }
h2 { font-size: var(--t-h2); line-height: 1.1; }
h3 { font-size: var(--t-h3); line-height: 1.3; letter-spacing: 0; }

p { margin: 0; text-wrap: pretty; }

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

.skip {
  position: absolute;
  left: var(--s4);
  top: -100px;
}
.skip:focus { top: var(--s4); }

/* Header */
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 72px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s3);
  color: var(--text);
  text-decoration: none;
  font: 700 21px / 1 var(--serif);
  min-height: 44px;
}
.brand img { width: 32px; height: 32px; border-radius: 7px; }
.site-nav { display: flex; gap: var(--s5); }
.site-nav a {
  color: var(--secondary);
  text-decoration: none;
  font-size: var(--t-small);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

/* Home */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--s8);
  align-items: center;
  padding-top: var(--s8);
  padding-bottom: var(--s9);
}
.hero .lede { margin-top: var(--s5); max-width: 30ch; }
.lede { font-size: var(--t-lede); line-height: 1.45; color: var(--secondary); }
.badge { display: inline-block; margin-top: var(--s6); border-radius: 8px; }
.badge img { width: 156px; height: auto; }
.phone { width: 100%; max-width: 340px; justify-self: center; }

.section { padding: var(--s9) 0; border-top: 1px solid var(--hairline); }
.section h2 + .lede { margin-top: var(--s3); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s8);
  align-items: center;
}
.split .phone { max-width: 300px; }
.split.phone-first .phone { order: -1; }

.facts { margin: var(--s6) 0 0; padding: 0; list-style: none; max-width: 46ch; }
.facts li { padding: var(--s3) 0; border-top: 1px solid var(--hairline); }
.facts li:last-child { border-bottom: 1px solid var(--hairline); }

/* The cleanup, typeset: what was said, and what Inkpot typed. */
.transcript {
  margin: var(--s7) 0 0;
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  column-gap: var(--s5);
  row-gap: var(--s5);
  max-width: 900px;
}
.transcript dt { color: var(--secondary); font-size: var(--t-small); padding-top: 0.5em; }
.transcript dd { margin: 0; font: 400 clamp(24px, 3vw, 32px) / 1.35 var(--serif); }
.transcript .said { color: var(--secondary); }
.transcript del {
  text-decoration: line-through;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  color: var(--accent);
}

/* Styles: one sentence, four ways. */
.styles { margin: var(--s7) 0 0; padding: 0; list-style: none; max-width: 900px; }
.styles li {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  column-gap: var(--s5);
  padding: var(--s5) 0;
  border-top: 1px solid var(--hairline);
}
.styles li:last-child { border-bottom: 1px solid var(--hairline); }
.styles .name { font: 700 var(--t-h3) / 1.3 var(--serif); }
.styles .sample { font: 400 var(--t-h3) / 1.45 var(--serif); }

.body-copy { margin-top: var(--s5); max-width: 46ch; }

.closing {
  padding: var(--s9) 0 var(--s10);
  border-top: 1px solid var(--hairline);
}
.closing .icon { width: 96px; height: 96px; border-radius: 21px; box-shadow: 0 0 0 1px var(--hairline); }
.closing h2 { margin-top: var(--s5); }

/* Footer */
.site-footer { border-top: 1px solid var(--hairline); padding: var(--s6) 0 var(--s7); }
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s4) var(--s6);
  color: var(--secondary);
  font-size: var(--t-small);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.site-footer a { color: var(--secondary); }
.site-footer a:hover { color: var(--text); }

/* Text pages: privacy and support */
.doc { padding-top: var(--s8); padding-bottom: var(--s9); }
.doc > * { max-width: var(--measure); }
.doc h1 { font-size: var(--t-doc-h1); }
.doc .meta { margin-top: var(--s3); color: var(--secondary); font-size: var(--t-small); }
.doc .lede { margin-top: var(--s5); }
.doc h2 { font-size: var(--t-doc-h2); line-height: 1.25; margin-top: var(--s8); letter-spacing: -0.01em; }
.doc h3 { margin-top: var(--s6); }
.doc h2 + p, .doc h3 + p, .doc h2 + ul, .doc h3 + ul { margin-top: var(--s3); }
.doc p + p, .doc ul + p, .doc p + ul { margin-top: var(--s4); }
.doc ul { padding-left: 1.2em; margin-bottom: 0; }
.doc li + li { margin-top: var(--s2); }
.doc .toc { list-style: none; padding: 0; margin-top: var(--s6); border-top: 1px solid var(--hairline); }
.doc .toc li { margin: 0; border-bottom: 1px solid var(--hairline); }
.doc .toc a { display: block; padding: var(--s3) 0; text-decoration: none; }
.doc .toc a:hover { text-decoration: underline; }
.contact {
  margin-top: var(--s6);
  padding: var(--s5);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.contact a { font-weight: 600; overflow-wrap: anywhere; }
.contact p + p { margin-top: var(--s2); color: var(--secondary); font-size: var(--t-small); }
.figure-inline { margin: var(--s5) 0 0; max-width: 260px; }

/* Phone widths */
@media (max-width: 820px) {
  .hero, .split { grid-template-columns: minmax(0, 1fr); gap: var(--s7); }
  .hero { padding-top: var(--s6); padding-bottom: var(--s8); }
  .split.phone-first .phone { order: 0; }
  .phone, .split .phone { max-width: 280px; }
  .section { padding: var(--s8) 0; }
  .transcript { grid-template-columns: minmax(0, 1fr); row-gap: var(--s2); }
  .transcript dd + dt { margin-top: var(--s4); }
  .transcript dt { padding-top: 0; }
  .styles li { grid-template-columns: minmax(0, 1fr); row-gap: var(--s1); }
  .closing { padding: var(--s8) 0 var(--s9); }
}
