:root {
  color-scheme: light dark;
  --bg: light-dark(#ece9dd, #1b1d19);
  --paper: light-dark(#f8f5eb, #24271f);
  --ink: light-dark(#292d25, #eaece2);
  --muted: light-dark(#626957, #adb5a2);
  --line: light-dark(#c9ccbb, #48503e);
  --accent: light-dark(#405c3b, #c0d3ad);
  --accent-ink: light-dark(#f8f6ec, #212b1a);
  --soft: light-dark(#e0e6d5, #303a27);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.55 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.35;
}
button:hover,
.button:hover {
  background: var(--soft);
}
.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.primary:hover {
  filter: brightness(1.08);
  background: var(--accent);
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px;
}
textarea {
  min-height: 130px;
  resize: vertical;
}
label {
  display: block;
  margin: 18px 0 7px;
  font-weight: 550;
}
form > button {
  margin-top: 22px;
}
input[type='checkbox'] {
  width: 19px;
  min-height: 19px;
  accent-color: var(--accent);
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
}
.help,
.quiet {
  color: var(--muted);
  font-size: 14px;
}
.help {
  margin: 8px 0 18px;
}
.tiny,
.eyebrow {
  font:
    11px/1.5 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
  letter-spacing: 0.13em;
  color: var(--muted);
}
.eyebrow {
  margin: 0 0 20px;
}
.topbar {
  max-width: 1260px;
  margin: auto;
  padding: 28px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 20px;
}
.brand {
  font-size: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 650;
  letter-spacing: -0.05em;
  text-decoration: none;
}
.brand-note {
  font-size: 12px;
  letter-spacing: 0;
  font-weight: 400;
  color: var(--muted);
  padding-left: 8px;
}
.fold-mark {
  width: 24px;
  height: 30px;
  display: inline-block;
  background: var(--accent);
  clip-path: polygon(0 0, 65% 0, 65% 28%, 100% 28%, 100% 100%, 0 100%);
}
nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}
nav a {
  padding: 8px 0;
  text-decoration: none;
  min-height: 44px;
}
main {
  max-width: 1160px;
  margin: auto;
  padding: 62px 32px 80px;
  min-height: 75vh;
}
.view[hidden],
[hidden] {
  display: none !important;
}
.narrow {
  max-width: 620px;
  margin: auto;
}
.manuscript {
  max-width: 860px;
  margin: auto;
}
h1 {
  font:
    normal clamp(36px, 4.8vw, 64px)/1.07 Georgia,
    serif;
  letter-spacing: -0.045em;
  margin: 0 0 26px;
}
h2 {
  font:
    normal 29px/1.2 Georgia,
    serif;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
p {
  margin: 0 0 20px;
}
.lede {
  font-size: 19px;
  max-width: 450px;
  color: var(--muted);
}
.hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 65px;
  align-items: center;
  margin: 14px 0 75px;
}
.hero h1 {
  font-size: clamp(42px, 5.1vw, 68px);
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.paper-sample {
  padding: 30px 32px 0;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 9px 11px 0 var(--soft);
  transform: rotate(3deg);
  min-height: 350px;
  position: relative;
}
.paper-sample p {
  font:
    20px/1.65 ui-monospace,
    SFMono-Regular,
    monospace;
  margin-top: 30px;
}
.sample-fold {
  margin: 18px -32px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  height: 7px;
}
.paper-bottom {
  margin: 35px -32px 0;
  padding: 15px 28px;
  border-top: 1px solid var(--line);
  text-align: right;
  color: var(--accent);
}
.cursor {
  display: inline-block;
  width: 10px;
  height: 22px;
  background: var(--accent);
}
.how {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  color: var(--muted);
}
.how b {
  display: block;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: 6px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin: 35px 0 18px;
}
.section-heading h1 {
  font-size: 48px;
}
.card-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 32px;
}
.story-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
}
.story-card strong {
  font-weight: 550;
  font-size: 19px;
  display: block;
}
.story-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.badge {
  font:
    12px/1.3 ui-monospace,
    monospace;
  white-space: nowrap;
  color: var(--accent);
  background: var(--soft);
  padding: 7px 10px;
  border-radius: 30px;
}
.notice {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
  margin: 20px 0;
}
.notice button {
  margin-top: 10px;
}
.divider {
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 24px;
  margin: 28px 0;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 20px;
}
details {
  margin: 24px 0;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  align-content: center;
}
details[open] summary {
  margin-bottom: 14px;
}
.prompt-panel {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
#fold-prompt-ideas {
  display: grid;
  gap: 10px;
}
#fold-prompt-ideas button {
  display: block;
  text-align: left;
  background: var(--paper);
}
#fold-prompt-ideas p {
  margin: 0 0 8px;
}
#fold-prompt-ideas span {
  font-size: 13px;
  color: var(--accent);
}
#fold-starting-prompt,
.prose,
.writing-field {
  font:
    17px/1.8 ui-monospace,
    SFMono-Regular,
    Menlo,
    monospace;
}
.rule-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 25px;
}
.opening {
  border-left: 2px solid var(--accent);
  padding: 8px 20px;
  margin: 24px 0;
}
.turn-order {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  margin: 0 0 24px;
  background: var(--paper);
}
.turn-order-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.turn-order-heading h2 {
  font-size: 18px;
  margin: 0;
}
.turn-order-heading > span {
  font-size: 12px;
}
.turn-order-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(145px, 100%), 1fr));
  gap: 8px;
  padding: 0;
  margin: 0;
}
.turn-seat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px;
}
.turn-seat strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}
.turn-seat > .quiet {
  font-size: 11px;
}
.turn-seat-label {
  color: var(--muted);
  font-size: 11px;
}
.turn-seat.is-current {
  background: var(--soft);
}
.turn-seat.is-next {
  border-color: var(--accent);
}
.turn-seat.is-you strong {
  color: var(--accent);
}
.turn-order-note {
  font-size: 13px;
  margin: 12px 0 0;
}
.opening p {
  margin: 6px 0 0;
}
.paper {
  padding: 34px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px double var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.paper .prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sealed-lines {
  height: 68px;
  opacity: 0.55;
  filter: blur(3px);
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 9px,
    var(--muted) 10px,
    var(--muted) 13px,
    transparent 14px
  );
  margin: 15px 0 26px;
  mask-image: linear-gradient(to right, #000 65%, transparent);
}
.fragment {
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}
.writing-field {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 12px 0;
  min-height: 220px;
  outline-offset: 5px;
  resize: vertical;
  overflow-wrap: anywhere;
}
.write-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 17px;
  margin-top: 15px;
}
.write-footer p {
  margin: 0;
}
.curtain {
  padding: 78px 28px;
  text-align: center;
  background: repeating-linear-gradient(90deg, var(--soft) 0, var(--paper) 14px, var(--soft) 29px);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.curtain h2 {
  margin-bottom: 12px;
}
.curtain p {
  margin-bottom: 0;
}
.curtain .curtain-label {
  display: inline-block;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.revealed-paragraph {
  border-bottom: 1px solid var(--line);
  padding: 24px 0;
}
.revealed-paragraph .prose {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.revealed-paragraph:first-child {
  padding-top: 0;
}
.byline {
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
}
.footer {
  max-width: 1180px;
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 25px 32px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: var(--muted);
}
#message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  width: max-content;
  background: var(--ink);
  color: var(--bg);
  padding: 14px 20px;
  border-radius: 6px;
  z-index: 20;
  box-shadow: 0 5px 25px #0002;
}
.skip {
  position: fixed;
  top: -80px;
  left: 15px;
  background: var(--paper);
  padding: 12px;
  z-index: 30;
}
.skip:focus {
  top: 10px;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font:
    14px/1.7 ui-monospace,
    monospace;
}
.danger {
  color: light-dark(#8b3028, #f2a399);
}
.empty {
  padding: 28px 0;
  color: var(--muted);
}
@media (max-width: 800px) {
  .brand-note {
    display: none;
  }
  .hero {
    gap: 30px;
  }
  .paper-sample {
    padding: 20px 22px 0;
  }
  .paper-sample p {
    font-size: 17px;
  }
  .sample-fold,
  .paper-bottom {
    margin-left: -22px;
    margin-right: -22px;
  }
  .topbar {
    padding: 18px 24px;
  }
  .topbar nav {
    gap: 14px;
  }
  .hero h1 {
    font-size: 48px;
  }
}
@media (max-width: 600px) {
  main {
    padding: 35px 20px 60px;
  }
  .topbar {
    padding: 13px 20px;
    align-items: flex-start;
  }
  .brand {
    font-size: 28px;
  }
  nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px 14px;
    max-width: 245px;
    font-size: 13px;
  }
  #connection {
    width: 100%;
    text-align: right;
    font-size: 11px;
  }
  .hero {
    grid-template-columns: 1fr;
    gap: 42px;
    margin: 10px 0 50px;
  }
  .hero h1 {
    font-size: 47px;
  }
  .lede {
    font-size: 17px;
  }
  .paper-sample {
    max-width: 320px;
    width: 88%;
    margin: auto;
    min-height: 270px;
  }
  .paper-sample p {
    font-size: 18px;
    margin-top: 20px;
  }
  .paper-bottom {
    margin-top: 20px;
  }
  .how {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .section-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
  }
  .section-heading h1 {
    font-size: 38px;
    margin-bottom: 10px;
  }
  .story-card {
    padding: 17px;
    gap: 12px;
  }
  .story-card strong {
    font-size: 17px;
  }
  .badge {
    font-size: 10px;
  }
  .paper {
    padding: 22px;
  }
  .writing-field {
    font-size: 16px;
    min-height: 240px;
  }
  .curtain {
    padding: 55px 16px;
  }
  .write-footer {
    flex-wrap: wrap;
  }
  .write-footer .actions {
    width: 100%;
  }
  .footer {
    flex-direction: column;
    gap: 7px;
    padding: 20px;
  }
  .narrow h1 {
    font-size: 42px;
  }
  #fold-starting-prompt {
    min-height: 170px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
