@font-face {
  font-family: "Courier Prime";
  src: url("./fonts/CourierPrime-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  /* Avoid swapping typefaces beneath a person already writing. */
  font-display: optional;
}
:root {
  color-scheme: dark;
  --background: #201729;
  --cream: #e8d9c9;
  --muted: #a59b95;
  --writing-font: "Courier Prime", "Courier New", Courier, monospace;
  font-family: var(--writing-font);
  background: var(--background);
  color: var(--cream);
  -webkit-text-size-adjust: 100%;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.page {
  width: min(100%, 1120px);
  min-height: 100vh;
  min-height: 100svh;
  margin: auto;
  padding: max(32px, env(safe-area-inset-top)) max(26px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}
h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
}
h1 span {
  color: #c3a58a;
}
.app-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
/* Remove this span and rule when the beta ends. */
.beta-label {
  color: var(--muted);
  font-size: 10px;
}
main {
  flex: 1;
  padding-top: clamp(62px, 11svh, 112px);
}
.intro {
  line-height: 1.5;
  letter-spacing: -0.35px;
  margin: 0 0 52px;
  font-weight: 400;
}
.writing {
  position: relative;
}
.writing-surface {
  position: relative;
  min-height: 180px;
  overflow-anchor: none;
}
textarea,
.passage,
.caret-mirror {
  font: 400 19px/1.2 var(--writing-font);
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  tab-size: 4;
  padding: 0;
  margin: 0;
  border: 0;
}
textarea {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 180px;
  resize: none;
  overflow: hidden;
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  caret-color: #d2b79e;
  outline: none;
  scroll-margin-block: 24px;
}
textarea::placeholder {
  color: #938b87;
  opacity: 1;
}
textarea:focus-visible {
  box-shadow: -2px 0 0 -1px #7f7065;
}
::selection {
  color: var(--cream);
  background: #241c30;
}
#released-passages {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
/* Bottom alignment keeps the last lines of long passages visible in the bounded
   lane. Clipping prevents either intro or editor overlap, including on resize. */
.passage {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  color: var(--cream);
  pointer-events: none;
}
.passage span {
  animation: dissolve 6s ease-in forwards;
  animation-delay: var(--delay, 0ms);
}
.passage.whole {
  animation:
    dissolve 7s ease-in forwards,
    drift 7s linear forwards;
}
@keyframes dissolve {
  0% {
    opacity: 1;
    filter: blur(0);
  }
  28% {
    opacity: 0.72;
    filter: blur(0);
  }
  100% {
    opacity: 0;
    filter: blur(1.5px);
  }
}
/* Translate the layer, keeping inline character wrapping identical to the editor. */
.passage {
  animation: drift 7s linear forwards;
}
@keyframes drift {
  to {
    transform: translateY(-10px);
  }
}
.writing-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 20px;
}
#writing-hint {
  font-size: 11px;
  line-height: 1.9;
  color: var(--muted);
  margin: 0;
}
.newline-hint {
  color: #918882;
  font-size: 10px;
}
button,
summary,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
}
#release {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  min-height: 44px;
  padding: 0 0 12px 0;
}
#release:hover {
  color: var(--cream);
}
button:focus-visible,
summary:focus-visible,
input:focus-visible {
  outline: 1px solid #d2b79e;
  outline-offset: 5px;
}
.gentle-message {
  height: 3.6em;
  overflow: hidden;
  margin: 25px 0 30px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  opacity: 0;
  transition: opacity 1.5s ease;
  pointer-events: none;
}
.gentle-message.is-visible {
  opacity: 1;
}
footer {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 54px;
  font-size: 11px;
  color: var(--muted);
}
.about-copy {
  overflow-wrap: break-word;
}
.about-opening strong {
  font-weight: 600;
}
.about-copy .about-closing {
  font-size: 10px;
  color: var(--muted);
}
details {
  max-width: 560px;
}
summary {
  cursor: pointer;
  list-style: none;
  min-height: 44px;
  padding-top: 12px;
}
summary::-webkit-details-marker {
  display: none;
}
summary span {
  margin-left: 10px;
}
details[open] summary span {
  display: none;
}
.about {
  padding: 6px 0 20px;
  font-size: 11px;
  line-height: 1.9;
}
.about p {
  margin: 0 0 16px;
}
.message-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}
input {
  accent-color: #d2b79e;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.setting-note {
  font-size: 10px;
}
.footer-note {
  white-space: nowrap;
  font-size: 10px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
noscript {
  display: block;
  padding: 24px;
  line-height: 1.8;
}
@media (min-width: 600px) {
  .page {
    padding: 48px 56px 30px;
  }
  main {
    padding-left: clamp(24px, 4vw, 52px);
    padding-right: clamp(60px, 12vw, 160px);
  }
  .small-break {
    display: none;
  }
  .intro {
    margin-bottom: 58px;
  }
  .writing-surface,
  textarea {
    min-height: 220px;
  }
  textarea,
  .passage,
  .caret-mirror {
    font-size: 20px;
  }
  #writing-hint,
  #release {
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gentle-message {
    transition: none;
  }
  .passage {
    display: none;
    animation: none;
  }
  .passage span {
    animation: none;
  }
}
