/* Sally. Halloween Town at night: bone, moonlight, a little pumpkin. */

:root {
  --ink: #0b0a12;
  --ink-2: #121020;
  --panel: #16132a;
  --panel-2: #1c1832;
  --line: #2d2748;
  --bone: #ece7dc;
  --bone-dim: #a49db0;
  --bone-faint: #6f6883;
  --pumpkin: #e07b39;
  --thread: #b4536b;
  --moon: #f2ead0;
  --radius: 14px;
  --measure: 40rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--bone);
  font: 400 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}

a { color: var(--pumpkin); }
a:hover { color: #f0975d; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- the night ---------- */

.sky {
  position: fixed;
  inset: 0 0 auto 0;
  height: min(46vh, 420px);
  background: url("/img/sky.svg") center bottom / cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

.sky::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(11, 10, 18, 0), var(--ink));
}

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(2.5rem, 9vh, 5rem) 1.25rem 1.5rem;
}

.wordmark {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(3.4rem, 12vw, 6rem);
  line-height: 1;
  letter-spacing: .02em;
  color: var(--moon);
  transform: rotate(-1.2deg);
  text-shadow: 0 0 42px rgba(242, 234, 208, .18);
}

.tagline {
  margin: .85rem auto 0;
  max-width: 28rem;
  color: var(--bone-dim);
  font-size: 1rem;
}

/* ---------- layout ---------- */

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  flex: 1;
}

/* ---------- the chat panel, stitched at the edge ---------- */

.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px -30px rgba(0, 0, 0, .9);
  overflow: hidden;
  position: relative;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(180, 83, 107, .32);
  border-radius: 9px;
  pointer-events: none;
}

.log {
  padding: 1.5rem 1.25rem .5rem;
  max-height: min(56vh, 560px);
  min-height: 11rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.msg { margin: 0 0 1.35rem; }

.who {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: .95rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bone-faint);
  margin-bottom: .35rem;
}

.msg.sally .who { color: var(--thread); }

.bubble p { margin: 0 0 .7rem; }
.bubble p:last-child { margin-bottom: 0; }

.msg.you .bubble {
  color: var(--bone-dim);
}

.msg.sally .bubble {
  color: var(--bone);
}

/* the cursor while she is speaking */
.typing::after {
  content: "";
  display: inline-block;
  width: .5rem;
  height: 1.05em;
  margin-left: .12rem;
  vertical-align: -.18em;
  background: var(--thread);
  animation: blink 1.05s steps(2, start) infinite;
}

@keyframes blink { to { visibility: hidden; } }

.msg.error .who { color: var(--pumpkin); }
.msg.error .bubble { color: #f0b088; }

/* ---------- starters ---------- */

.starters {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .25rem 1.25rem 1rem;
}

.starter {
  font: inherit;
  font-size: .875rem;
  color: var(--bone-dim);
  background: rgba(255, 255, 255, .035);
  border: 1px dashed var(--line);
  border-radius: 999px;
  padding: .4rem .85rem;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}

.starter:hover {
  color: var(--bone);
  border-color: var(--thread);
  background: rgba(180, 83, 107, .1);
}

.starters.gone { display: none; }

/* ---------- composer ---------- */

.composer {
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  padding: .9rem 1.1rem 1.1rem;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, .18);
}

.composer textarea {
  flex: 1;
  font: inherit;
  color: var(--bone);
  background: transparent;
  border: 0;
  resize: none;
  max-height: 8rem;
  padding: .5rem 0;
  line-height: 1.5;
}

.composer textarea::placeholder { color: var(--bone-faint); }
.composer textarea:focus { outline: none; }

.composer:focus-within { box-shadow: inset 0 1px 0 var(--thread); }

#send {
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--pumpkin);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .12s, background .15s, opacity .15s;
}

#send:hover { background: #f0975d; }
#send:active { transform: scale(.94); }

#send[disabled] {
  opacity: .35;
  cursor: default;
}

.status {
  margin: 0;
  padding: 0 1.25rem;
  min-height: 0;
  font-size: .85rem;
  color: var(--bone-faint);
}

.status:not(:empty) { padding-bottom: .9rem; }

/* ---------- about ---------- */

.about {
  margin-top: 2.5rem;
  color: var(--bone-dim);
  font-size: .95rem;
}

.about h2 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--bone);
  margin: 0 0 .6rem;
}

.about p { margin: 0 0 .8rem; }

/* ---------- foot ---------- */

.foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 1.5rem 1.25rem 2.5rem;
  text-align: center;
  color: var(--bone-faint);
  font-size: .8rem;
}

.foot p {
  margin: 0 auto .5rem;
  max-width: var(--measure);
}

.foot .by { margin-bottom: 0; }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .typing::after { animation: none; opacity: .6; }
}

@media (max-width: 30rem) {
  .wrap { padding-left: .85rem; padding-right: .85rem; }
  .log { padding-left: 1rem; padding-right: 1rem; }
  .starters, .status { padding-left: 1rem; padding-right: 1rem; }
  .composer { padding-left: .9rem; padding-right: .9rem; }
}

/* ---------- the meter ---------- */

.meter {
  margin: 0;
  padding: 0 1.25rem 1rem;
  font-size: .8rem;
  color: var(--bone-faint);
  letter-spacing: .01em;
}

.note {
  margin: .25rem 0 1.35rem;
  padding: .6rem .8rem;
  border-left: 2px solid var(--thread);
  background: rgba(180, 83, 107, .08);
  color: var(--bone-dim);
  font-size: .9rem;
}

/* ---------- the paywall ---------- */

.paywall {
  margin-top: 1.25rem;
  padding: 1.5rem 1.35rem;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
}

.paywall::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px dashed rgba(224, 123, 57, .3);
  border-radius: 9px;
  pointer-events: none;
}

.paywall > * { position: relative; }

.paywall h2 {
  margin: 0 0 .5rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.65rem;
  color: var(--bone);
}

.paywall-line {
  margin: 0 0 1.1rem;
  color: var(--bone-dim);
  font-size: .95rem;
}

.offer {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.1rem;
}

.plan {
  font: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .8rem 1.1rem;
  color: var(--bone);
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.plan:hover { border-color: var(--pumpkin); }

.plan.chosen {
  border-color: var(--pumpkin);
  background: rgba(224, 123, 57, .12);
}

.plan-price {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.7rem;
  line-height: 1;
  color: var(--moon);
}

.plan-what {
  font-size: .82rem;
  color: var(--bone-dim);
}

/* ---------- card form ---------- */

.card-form { margin-top: .25rem; }

.card-form .row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
}

.field { margin-bottom: .75rem; }

.field label {
  display: block;
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bone-faint);
  margin-bottom: .3rem;
}

.field input {
  width: 100%;
  font: inherit;
  color: var(--bone);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .7rem;
}

.field input:focus {
  outline: none;
  border-color: var(--pumpkin);
}

.field input::placeholder { color: #4b4560; }

.buy {
  font: inherit;
  font-weight: 500;
  width: 100%;
  padding: .7rem 1rem;
  color: #1a0d03;
  background: var(--pumpkin);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}

.buy:hover { background: #f0975d; }
.buy[disabled] { opacity: .5; cursor: default; }

.fineprint {
  margin: .6rem 0 0;
  font-size: .75rem;
  color: var(--bone-faint);
  text-align: center;
}

.pay-error {
  margin: .75rem 0 0;
  font-size: .85rem;
  color: #f0a07a;
  display: none;
}

.pay-error.shown { display: block; }

/* ---------- comp code ---------- */

.code-box {
  margin-top: 1.1rem;
  border-top: 1px solid var(--line);
  padding-top: .9rem;
}

.code-box summary {
  cursor: pointer;
  font-size: .85rem;
  color: var(--bone-faint);
  list-style: none;
}

.code-box summary::-webkit-details-marker { display: none; }
.code-box summary:hover { color: var(--bone-dim); }

.code-form {
  display: flex;
  gap: .5rem;
  margin-top: .7rem;
}

.code-form input {
  flex: 1;
  font: inherit;
  color: var(--bone);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .5rem .7rem;
}

.code-form input:focus { outline: none; border-color: var(--thread); }

.code-form button {
  font: inherit;
  color: var(--bone);
  background: transparent;
  border: 1px solid var(--thread);
  border-radius: 8px;
  padding: .5rem 1rem;
  cursor: pointer;
}

.code-form button:hover { background: rgba(180, 83, 107, .15); }

@media (max-width: 30rem) {
  .card-form .row { grid-template-columns: 1fr 1fr; }
  .paywall { padding: 1.25rem 1rem; }
}

/* the hidden attribute needs its own rule, any author display beats it */
[hidden] { display: none !important; }


/* ================= homepage ================= */

.hero {
  /* The art gets its own band rather than sitting behind the words. Laid over
     each other, the moon washed out the tagline and the two figures grew a
     headline through their chests. */
  display: block;
  padding: 0 0 clamp(1.5rem, 5vh, 2.75rem);
}

.hero-art {
  height: clamp(210px, 40vh, 400px);
  background: url("/img/hero.svg") center bottom / cover no-repeat;
}

.hero-words {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 .4rem;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--bone-faint);
}

.hero .wordmark { margin: 0; }

.hero .tagline {
  margin: 1rem auto 0;
  max-width: 34rem;
  color: var(--bone-dim);
}

.freebadge {
  display: inline-block;
  margin: 1.1rem 0 0;
  padding: .32rem .85rem;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--moon);
  border: 1px dashed rgba(180, 83, 107, .55);
  border-radius: 999px;
}

.jump {
  display: block;
  width: max-content;
  margin: 1.4rem auto 0;
  padding: .7rem 1.6rem;
  font-weight: 500;
  color: #1a0d03;
  background: var(--pumpkin);
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s;
}

.jump:hover { background: #f0975d; color: #1a0d03; }

/* ---- sections ---- */

.section { padding: clamp(2.5rem, 7vh, 4.5rem) 1.25rem; }

.wrap.section {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
}

.section-title {
  margin: 0 0 .5rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  color: var(--bone);
}

.section-lede {
  margin: 0 0 1.6rem;
  color: var(--bone-dim);
  max-width: 36rem;
}

/* ---- can / cannot ---- */

.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.75rem;
}

.col-head {
  margin: 0 0 .8rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.35rem;
}

.col-head.can { color: #8fc7a8; }
.col-head.cannot { color: var(--pumpkin); }

.caps { list-style: none; margin: 0; padding: 0; }

.caps li {
  margin: 0 0 1rem;
  padding-left: .9rem;
  border-left: 1px dashed var(--line);
}

.caps strong {
  display: block;
  font-weight: 500;
  color: var(--bone);
  margin-bottom: .15rem;
}

.caps span {
  color: var(--bone-dim);
  font-size: .92rem;
}

.caps-fallback { color: var(--pumpkin); font-size: .9rem; }

/* ---- tiles ---- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}

.tile {
  position: relative;
  padding: 1.2rem 1.15rem 1.3rem;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tile h3 {
  margin: 0 0 .45rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.3rem;
  color: var(--bone);
}

.tile p {
  margin: 0 0 1rem;
  color: var(--bone-dim);
  font-size: .92rem;
}

.tile.soon { opacity: .62; }
.tile.soon p:last-of-type { margin-bottom: 0; }

.badge {
  display: inline-block;
  padding: .2rem .6rem;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--bone-faint);
  border: 1px dashed var(--line);
  border-radius: 999px;
}

.tile-go {
  display: inline-block;
  font: inherit;
  font-size: .9rem;
  padding: .45rem 1rem;
  color: var(--bone);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--thread);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}

.tile-go:hover { background: rgba(180, 83, 107, .16); color: var(--bone); }

.premonition {
  margin: 1rem 0 0;
  padding-top: .9rem;
  border-top: 1px dashed var(--line);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--moon);
  min-height: 3.2rem;
  opacity: 0;
  transition: opacity .5s ease;
}

.premonition.shown { opacity: 1; }

/* ---- about ---- */

.about h3 {
  margin: 1.6rem 0 .5rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--bone);
}

@media (max-width: 30rem) {
  .hero { min-height: min(74vh, 560px); }
  .section { padding-left: .95rem; padding-right: .95rem; }
}

main { flex: 1; }

/* A failure still comes from Sally and still looks like her. Dimmer and set in
   italic so it reads as an aside rather than as something she said. */
.msg.quiet .bubble {
  color: var(--bone-dim);
  font-style: italic;
}

/* draw.html */
.hidden-field { position: absolute; left: -9999px; }

.field.check label {
  display: flex;
  gap: .55rem;
  align-items: flex-start;
  font-size: .9rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bone-dim);
  cursor: pointer;
}

.field.check input { width: auto; margin-top: .2rem; }

.field input[type="file"] {
  padding: .5rem;
  font-size: .9rem;
}

.field textarea {
  width: 100%;
  font: inherit;
  color: var(--bone);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .7rem;
  resize: vertical;
}

.field textarea:focus { outline: none; border-color: var(--pumpkin); }
