/* sthavar.com base: tokens, fonts, reset. Shared by every page. */

@font-face {
  font-family: "Young Serif";
  src: url("/assets/fonts/young-serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-roman.woff2") format("woff2");
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("/assets/fonts/newsreader-italic.woff2") format("woff2");
  font-weight: 400 500;
  font-style: italic;
  font-display: swap;
}
/* Georgia, adjusted to each face's metrics, so the swap doesn't move the layout. */
@font-face {
  font-family: "Young Serif Fallback";
  src: local("Georgia");
  size-adjust: 112.8%;
  ascent-override: 93%;
  descent-override: 32.8%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 95%;
  ascent-override: 77.9%;
  descent-override: 28.4%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia Italic"), local("Georgia-Italic");
  font-style: italic;
  size-adjust: 87.8%;
  ascent-override: 84.3%;
  descent-override: 30.8%;
  line-gap-override: 0%;
}

:root {
  /* The listening room */
  --room: #14100D;
  --room-raised: #1D1712;
  --room-line: #2E2620;
  --vinyl: #0B0A09;
  --groove: #1A1816;
  --chalk: #EDE3D2;
  --chalk-2: #B3A592;
  --chalk-3: #8A7D6D;
  --paper: #EEE4D1;
  --paper-2: #E2D5BC;
  --ink: #1B1612;
  --ink-2: #5E5246;
  --lamp: #FFB86B;
  --amber: #F0A45B;
  --pencil: #C4402A;

  /* Dave, from Dave/Design/Theme.swift */
  --night: #1C1424;
  --night-raised: #2A2034;
  --night-line: #3A2E46;
  --napkin: #FFF4E2;
  --napkin-deep: #F3E4CB;
  --dave-ink: #22172A;
  --dave-ink-soft: #6B5C72;
  --olive: #93B63C;
  --olive-deep: #3F5A12;
  --pimento: #EE4430;
  --lemon: #FFD23F;
  --plum: #7A45E6;
  --sky: #7FD3F0;
  --cobalt: #3D5AFE;
  --guava: #FF5E8E;
  --peel: #FF8A2A;
  --mint: #2FC99A;

  --display: "Young Serif", "Young Serif Fallback", Georgia, serif;
  --text: "Newsreader", "Newsreader Fallback", Georgia, serif;
  --dave-display: ui-serif, "New York", "Young Serif", "Young Serif Fallback", Georgia, serif;
  --dave-ui: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-arm: cubic-bezier(.33, .08, .2, 1);
  --ease-in-out: cubic-bezier(.45, 0, .25, 1);
  --tap: 120ms;
  --swap: 380ms;
  --arm: 900ms;

  --focus: var(--amber);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  min-height: 100svh;
  font-family: var(--text);
  font-optical-sizing: auto;
  line-height: 1.55;
}

h1, h2, h3, h4, p, ol, ul, dl, dd, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1, h2, h3, h4 { font-weight: 400; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
img, svg, canvas, picture, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; margin: 0; }
a { color: inherit; }
em, i { font-style: italic; }
strong, b { font-weight: 500; }

.nums, time { font-variant-numeric: lining-nums tabular-nums; }
.nb { white-space: nowrap; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 100;
  padding: 6px 10px;
  transform: translateY(-200%);
  font-style: italic;
  font-size: 17px;
  background: var(--chalk);
  color: var(--ink);
  text-decoration: none;
}
.skip:focus-visible { transform: none; }

svg.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 24px; height: 24px; flex: none; }
.icon--32 { width: 32px; height: 32px; }

/* Facts and lines still waiting for Sthavar. Visible on purpose, so they can't ship by accident. */
.mk {
  font: italic 500 13px/1.3 var(--text);
  color: #F0A45B;
  background: rgb(240 164 91 / .12);
  padding: 1px 4px;
  white-space: nowrap;
  vertical-align: .12em;
}
.on-paper .mk, .mk--paper { color: #8C2D1C; background: rgb(196 64 42 / .12); }
