/* Turning — shared tokens and components.
   Layout concept: full-bleed white sheets; giant serif set flush-left; specimen labels in mono at the margins;
   the leaf lies on top of everything as a physical object. Deliberately single-theme: white paper. */
:root {
  --paper: #ffffff;
  --ink: #11120e;
  --ink-2: #4f5149;
  --ink-3: #686a62;
  --rule: #e4e5df;
  --stem: #b0351c;
  --chloro: #3d6b21;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  --step--1: clamp(13px, 0.78rem + 0.1vw, 14px);
  --step-0: clamp(16px, 0.95rem + 0.25vw, 19px);
  --step-1: clamp(20px, 1.1rem + 0.8vw, 28px);
  --step-2: clamp(26px, 1.2rem + 1.8vw, 44px);
  --step-3: clamp(40px, 1.4rem + 4.6vw, 88px);
  --step-4: clamp(64px, 1rem + 11.5vw, 220px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--paper); color: var(--ink); }
body {
  margin: 0;
  font-family: var(--display);
  font-optical-sizing: auto;
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--stem); }
:focus-visible { outline: 2px solid var(--stem); outline-offset: 3px; border-radius: 2px; }

.label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.mono { font-family: var(--mono); font-size: 12.5px; line-height: 1.55; letter-spacing: 0.01em; color: var(--ink-2); }
.cite { font-family: var(--mono); font-size: 11px; line-height: 1.5; letter-spacing: 0.02em; color: var(--ink-3); }
.cite a { color: var(--ink-3); }
.cite a:hover { color: var(--stem); }

.display {
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  letter-spacing: -0.04em;
  line-height: 0.82;
  margin: 0;
  text-wrap: balance;
}
.display i, .display em {
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  letter-spacing: -0.02em;
}

.btn {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 0.75em 1.15em;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn.ghost { border-color: var(--rule); }

/* the WebGL layer that the leaf and its shadow live on */
.gl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; display: block; }
.fallback-leaf { position: absolute; pointer-events: none; z-index: 5; filter: drop-shadow(14px 18px 14px rgba(10, 16, 30, 0.22)); }
.is-holding { -webkit-user-select: none; user-select: none; }

.topbar {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) var(--gutter) 0;
  position: relative; z-index: 6;
}
.topbar a { text-decoration: none; }
.back { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--stem); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
