:root {
  font-family: "Times New Roman", Times, serif;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html { background: #eee4ca; min-height: 100%; }
* { box-sizing: border-box; }
.ink-filter { position: absolute; width: 0; height: 0; overflow: hidden; }
body {
  margin: 0;
  min-width: 280px;
  background: #eee4ca;
  color: #29261f;
  isolation: isolate;
}
.paper {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 0;
  background: linear-gradient(125deg, #b9b1a0 0%, #ead4ad 45%, #ffe8b6 75%, #ead3a8 100%);
  box-shadow: 5px 0 12px #51432e45;
}
.paper::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("assets/paper-grain.svg") repeat;
  mix-blend-mode: multiply;
  opacity: .65;
}
.paper-shader { width: 100%; height: 100%; display: block; opacity: 0; }
.paper-shader.is-ready { opacity: 1; }
.hero {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 23.333333svh clamp(28px, 12vw, 192px) 96px;
  text-align: left;
}
.text-canvas {
  font-size: clamp(10px, 2.9vw, 23px);
  line-height: 1.5;
  white-space: pre;
  max-width: 100%;
  outline: none;
  cursor: text;
}
.title {
  font-size: clamp(49px, 8vw, 88px);
  line-height: 1;
  font-weight: 500;
}
/* Fixed edge texture, with a small increase for the title. */
[data-write] { filter: url(#printed-ink); }
.title { filter: url(#printed-ink-title); }
.download { cursor: pointer; }
[data-download-underlined] .download {
  text-decoration: underline;
  text-underline-offset: .12em;
  text-decoration-thickness: 1px;
}
.text-canvas ::selection { background-color: rgba(221, 255, 0, .78); }
@media (hover: hover) { .download:hover { background-color: rgba(221, 255, 0, .78); } }
.download,.submit,.waitlist-submit { touch-action: manipulation; }
.highlight { background-color: rgba(221, 255, 0, .78); }
@media (max-width: 540px) {
  /* Safari composites scrolling paper behind its translucent bottom toolbar.
     Overscan prevents its revealed scroll pocket from exposing the root. */
  body { position: relative; min-height: calc(100lvh + 1px); background: transparent; }
  .paper { position: absolute; inset: -64px 0 -64px; }
  .hero { padding: 23.333333svh 9vw 64px; }
  .text-canvas { font-size: 20px; line-height: 1.5; white-space: pre-wrap; }
}

.explanation { white-space: pre-wrap; }
.bullet-line { display: inline-block; width: 100%; padding-left: 1em; text-indent: -1em; white-space: pre-wrap; }

.has-playback-caret:not([data-phase="editing"]) { caret-color: transparent; }
.playback-caret {
  position: fixed;
  top: 0;
  left: 0;
  width: 1.5px;
  background: currentColor;
  pointer-events: none;
  z-index: 2;
}
.playback-caret.is-idle { animation: caret-blink 1.1s step-end infinite; }
@keyframes caret-blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .playback-caret { animation: none; }
}

.timing-panel {
  position: fixed;
  z-index: 10;
  top: 12px;
  right: 12px;
  width: min(310px, calc(100vw - 24px));
  max-height: calc(100svh - 24px);
  overflow-y: auto;
  --tp-base-font-family: system-ui, sans-serif;
}
.timing-panel-note { margin: 8px 4px; font: 11px/1.4 system-ui, sans-serif; }

/* The DOM remains the semantic editor; only its paint moves into the material. */
.paper-rendered .text-canvas { opacity: 0; -webkit-text-fill-color: transparent; caret-color: transparent; }
.paper-rendered .text-canvas * { -webkit-text-fill-color: transparent; }
.paper-rendered .text-canvas ::selection { background: transparent; }
.paper-rendered .text-canvas::selection { background: transparent; }
.paper-rendered .playback-caret { opacity: 0; animation: none; }
.paper-rendered .download:hover { background: transparent; }
.paper-rendered .highlight { background: transparent; }
.paper-rendered .paper::after { display: none; }

.paper-rendered [data-write], .paper-rendered .title { filter: none; }
.paper-rendered .text-canvas, .paper-rendered .text-canvas * {
  color: transparent !important;
  text-decoration-color: transparent !important;
}
.paper-rendered .text-canvas::selection,
.paper-rendered .text-canvas *::selection {
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  text-decoration-color: transparent !important;
  background: transparent !important;
  text-shadow: none !important;
}

/* The typed underscores remain the rule: activating the input adds no paint. */
.waitlist-form { position: absolute; margin: 0; z-index: 3; }
.waitlist-email-hit-area { position: absolute; display: block; cursor: text; touch-action: manipulation; }
.waitlist-email {
  position: relative;
  display: block; width: 100%; height: 100%; padding: 0; margin: 0;
  border: 0; border-radius: 0; outline: none; background: transparent;
  color: #30291f; font: inherit; box-shadow: none; appearance: none;
}
.paper-rendered .waitlist-email { opacity: 0; }

.waitlist-submit { position: absolute; padding: 0; border: 0; background: transparent; cursor: pointer; }
.waitlist-submit:focus-visible { outline: 1px solid #30291f; outline-offset: 3px; }

/* Conceal the unprojected DOM and flat paper until the first GPU frame.
   CSS fails open if scripts fail to load; no-JavaScript remains readable. */
html.paper-starting .paper, html.paper-starting .hero {
  visibility: hidden;
  animation: paper-startup-fallback 0s 5s forwards;
}
@keyframes paper-startup-fallback { to { visibility: visible; } }
