/* Logolith site: tokens, type, nav and shared parts. Light editorial: parchment, a huge light serif, coral from the mark. */
:root {
  --paper: #f4f1ea;
  --paper-2: #ece8de;
  --paper-3: #e2ddd1;
  --card: #fbfaf6;
  --ink: #17171c;
  --ink-2: #4b4a50;
  --ink-3: #85827a;
  --line: rgba(23, 23, 28, .1);
  --line-strong: rgba(23, 23, 28, .18);
  --coral: #ff7a59;
  --coral-ink: #c2452a; /* coral dark enough for text on paper */
  --night: #17171c;
  --night-2: #202027;
  --night-ink: #f5f5f7;
  --night-muted: #a1a1a6;
  --focus: #c2452a;

  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.45, .64, 1);
  --r-sm: 8px; --r-md: 14px; --r-lg: 24px; --r-xl: 32px;
  --section: clamp(88px, 12vw, 168px);
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--sans); letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
/* Paper grain: a faint dot field, like a drafting sheet. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image: radial-gradient(rgba(23, 23, 28, .07) 1px, transparent 1.2px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, .35)); mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, .35));
}
img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pill, .nav-brand, .link, .foot-row a, summary { touch-action: manipulation; -webkit-touch-callout: none; }
.pill, .nav-brand, summary { user-select: none; -webkit-user-select: none; }
a { color: inherit; }
code { font: 500 .88em var(--mono); background: var(--paper-2); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--coral); color: #fff; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 max(var(--gutter), env(safe-area-inset-right, 0px)) 0 max(var(--gutter), env(safe-area-inset-left, 0px)); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; }
.skip:focus { left: 12px; }

/* Type. Hierarchy comes from the jump between a very large light serif and small, tight sans. */
.display {
  font: 400 clamp(44px, 6.4vw, 96px)/1.06 var(--serif); letter-spacing: -0.02em; text-wrap: balance;
}
.display em, .hero-title em { font-style: italic; font-weight: 500; color: var(--coral-ink); }
.lead { font-size: clamp(18px, 1.6vw, 21px); line-height: 1.5; color: var(--ink-2); max-width: 34em; }
.side-note { font-size: 15px; line-height: 1.55; color: var(--ink-2); max-width: 30em; }
.fine { font-size: 13px; line-height: 1.5; color: var(--ink-3); }
.mono, .mono-num { font-family: var(--mono); font-weight: 500; letter-spacing: -0.02em; }
.strike { position: relative; }
.strike::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 55%; height: .06em; background: var(--ink);
  transform: scaleX(0); transform-origin: left; transition: transform .9s var(--ease) .6s;
}
.in .strike::after, .in.strike::after, .display.in .strike::after { transform: scaleX(1); }

/* Actions: one filled pill, ink on paper. Links are underlined text. */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; font: 500 16px var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform .12s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
}
.pill:active { transform: scale(.97); }
.pill-ink { background: var(--ink); color: var(--paper); box-shadow: 0 10px 30px -14px rgba(23, 23, 28, .6); }
@media (hover: hover) and (pointer: fine) { .pill-ink:hover { background: #000; box-shadow: 0 14px 34px -14px rgba(23, 23, 28, .75); } }
.pill-light { background: var(--night-ink); color: var(--night); }
.link {
  font-weight: 500; text-decoration: underline; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 5px;
  transition: text-underline-offset .3s var(--ease);
}
@media (hover: hover) and (pointer: fine) { .link:hover { text-underline-offset: 8px; } }

/* Segmented choices used across demos */
.seg, .try-fonts, .starts, .board-tabs, .ed-tools, .lib-filters, .kit-pick, .persona { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: 999px; font: 500 14px var(--sans); border: 1px solid var(--line-strong); background: transparent;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .12s var(--ease);
}
.try-fonts button, .starts button, .lib-filters button, .kit-pick button, .persona button, .type-styles button, .ed-tools button, .ed-actions button {
  min-height: 40px; padding: 0 16px; border-radius: 999px; font: 500 14px var(--sans); border: 1px solid var(--line-strong);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .12s var(--ease);
}
@media (hover: hover) and (pointer: fine) { :is(.try-fonts, .starts, .lib-filters, .kit-pick, .persona, .type-styles, .ed-tools) button:hover { border-color: var(--ink); } }
:is(.try-fonts, .starts, .lib-filters, .kit-pick, .persona, .type-styles, .ed-tools) button[aria-checked="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
:is(.try-fonts, .starts, .lib-filters, .kit-pick, .persona, .type-styles, .ed-tools, .ed-actions) button:active { transform: scale(.96); }

/* Nav: a full bar at the top that tightens into a floating island once you scroll. */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: env(safe-area-inset-top) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); transition: padding .5s var(--ease); }
.nav-inner {
  display: flex; align-items: center; gap: 24px; max-width: 1200px; margin: 0 auto; height: 64px; padding: 0 var(--gutter);
  border-radius: 999px; transition: max-width .6s var(--ease), background .4s var(--ease), box-shadow .4s var(--ease), height .4s var(--ease), padding .4s var(--ease);
}
.nav.scrolled { padding-top: calc(env(safe-area-inset-top) + 10px); }
.nav.scrolled .nav-inner {
  max-width: 760px; height: 56px; padding: 0 8px 0 18px; background: rgba(251, 250, 246, .78);
  -webkit-backdrop-filter: saturate(1.4) blur(18px); backdrop-filter: saturate(1.4) blur(18px);
  box-shadow: 0 0 0 1px var(--line), 0 18px 40px -24px rgba(23, 23, 28, .35);
}
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 500 22px var(--serif); letter-spacing: -0.01em; }
.nav-brand img { border-radius: 8px; }
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a { font-size: 14px; text-decoration: none; color: var(--ink-2); padding: 10px 12px; border-radius: 999px; transition: color .2s, background .2s; }
@media (hover: hover) and (pointer: fine) { .nav-links a:hover { color: var(--ink); background: rgba(23, 23, 28, .05); } }
.nav-buy { min-height: 40px; padding: 0 18px; font-size: 14px; }
.nav-price { font-family: var(--mono); opacity: .7; }

/* Reveal: rise in once, staggered by --d. */
.reveal { opacity: 0; transform: translateY(28px); filter: blur(12px); transition: opacity 1s var(--ease), transform 1s var(--ease), filter 1.1s var(--ease); transition-delay: calc(var(--d, 0) * 90ms); }
.reveal.in { opacity: 1; transform: none; filter: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60;
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 24px; font-size: 14px; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .5);
  width: max-content; max-width: min(520px, calc(100vw - 32px)); text-align: center; /* left:50% alone squeezes it to half the screen */
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; }
  .nav.scrolled .nav-inner { max-width: calc(100% - 24px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* The hidden attribute always wins over component display rules (e.g. .pill is inline-flex). */
[hidden] { display: none !important; }
/* Header link for people who already paid: opens Dodo's purchases page to download again. */
.nav-owned { font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; padding: 10px 4px; }
.nav-owned span { color: var(--ink); text-decoration: underline; text-decoration-color: var(--coral); text-underline-offset: 4px; }
@media (hover: hover) and (pointer: fine) { .nav-owned:hover span { text-underline-offset: 6px; } }
@media (max-width: 860px) { .nav-owned { margin-left: auto; } }
@media (max-width: 420px) { .nav-owned { font-size: 12px; } .nav-owned span { display: none; } }

/* Nav: a pill slides behind the link for the section you are in; a coral line shows how far down the page you are. */
.nav-links { position: relative; isolation: isolate; }
.nav-pill { position: absolute; left: 0; top: 50%; height: 34px; margin-top: -17px; border-radius: 999px; background: rgba(23, 23, 28, .07); z-index: -1; opacity: 0; transition: transform .55s var(--spring), width .55s var(--spring), opacity .3s var(--ease); }
.nav-pill.on { opacity: 1; }
.nav-links a[aria-current] { color: var(--ink); }
.nav-links a { transition: color .3s var(--ease); }
.nav-inner { position: relative; }
.nav-progress { position: absolute; left: 24px; right: 24px; bottom: 0; height: 2px; border-radius: 2px; background: var(--coral); transform: scaleX(0); transform-origin: left; opacity: 0; transition: opacity .4s var(--ease); pointer-events: none; }
.nav.scrolled .nav-progress { opacity: .9; }
.nav-buy.lit { box-shadow: 0 0 0 4px rgba(255, 122, 89, .25), 0 14px 34px -12px rgba(255, 122, 89, .7); }
.nav-buy { transition: box-shadow .4s var(--ease), background .3s var(--ease), transform .12s var(--ease); }
