:root {
  --ink: #0a0a0f; --ink2: #14141c; --line: #2a2a36; --paper: #f3efe6; --dim: #9a968c;
  --hot: #ff4b2b; --sun: #ffb400; --sea: #19d3c5; --pink: #ff3ea5; --vio: #7c5cff; --lime: #b6f23c;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--ink); color: var(--paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.55; min-height: 100vh; }
a { color: var(--paper); text-underline-offset: 3px; text-decoration-color: var(--hot); }
a:hover { color: var(--sun); }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { width: min(100% - 2rem, 620px); margin: 0 auto; padding: 1.25rem 0 3rem; text-align: center; position: relative; z-index: 1; }
#fly { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

.mark { position: relative; width: min(78vw, 360px); aspect-ratio: 1; margin: 0 auto -2.25rem; }
.mark canvas { width: 100%; height: 100%; display: block; }
.mark .cursor { position: absolute; left: 50%; top: 50%; width: 1.5%; height: 5.6%; margin-top: 1.1%; transform: translate(-50%, -50%); background: var(--paper); animation: blink 1.15s steps(1) infinite; }
.mark .cursor::before { content: ""; position: absolute; left: -20%; bottom: 122%; width: 140%; aspect-ratio: 1; border-radius: 50%; background: var(--paper); }
@keyframes blink { 50% { opacity: 0; } }

h1 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(2.1rem, 8vw, 3.2rem); letter-spacing: -0.01em; margin: 0 0 1.5rem; text-wrap: balance; }
h2 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 2rem; margin: 0 0 .5rem; }

textarea { width: 100%; min-height: 11rem; resize: vertical; background: var(--ink2); color: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 1.1rem 1.15rem; font-family: var(--serif); font-size: 1.2rem; line-height: 1.5; caret-color: var(--hot); }
textarea::placeholder { color: #6f6b63; font-style: italic; }
textarea:focus { outline: none; border-color: var(--paper); box-shadow: 0 0 0 3px rgba(255, 75, 43, .25); }
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin: .75rem 0 1.25rem; text-align: left; font-size: .9rem; color: var(--dim); }
.share { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; }
.share input { width: 1.1rem; height: 1.1rem; margin: .15rem 0 0; accent-color: var(--hot); flex: none; }
#count { font-variant-numeric: tabular-nums; flex: none; }

button { font: inherit; cursor: pointer; }
#go, #again { background: var(--paper); color: var(--ink); border: 0; border-radius: 999px; padding: .85rem 2.4rem; font-family: var(--serif); font-style: italic; font-size: 1.25rem; transition: transform .15s, background .15s; }
#go:hover:not(:disabled), #again:hover { background: var(--sun); transform: translateY(-1px); }
#go:disabled { opacity: .35; cursor: default; }
#err { color: var(--sun); margin: 1rem 0 0; }

#done { padding: 2.5rem 0 1rem; }
.soft { color: var(--dim); margin: 0 0 1.5rem; }
.heavy { text-align: left; border: 1px solid var(--sun); border-radius: 4px; padding: 1rem 1.15rem; margin: 0 0 1.5rem; }
.heavy p { margin: 0 0 .5rem; } .heavy p:last-child { margin: 0; }

.truths { list-style: none; padding: 0; margin: 3rem 0 1.25rem; color: var(--dim); font-size: .92rem; }
.truths li { padding: .3rem 0; }
.help { font-size: .92rem; color: var(--paper); margin: 0 0 2.5rem; }
footer { display: flex; gap: .7rem; justify-content: center; font-size: .85rem; color: var(--dim); }
footer a { color: var(--dim); }

/* reading pages */
.page .wrap { text-align: left; padding-top: 3rem; }
.page h1 { font-size: clamp(2rem, 7vw, 2.8rem); margin-bottom: .25rem; }
.page .back { font-size: .85rem; color: var(--dim); display: inline-block; margin-bottom: 2rem; }
.page h2 { font-size: 1.35rem; margin: 2.2rem 0 .4rem; color: var(--sun); }
.page p, .page li { color: #d9d5cb; max-width: 62ch; }
.page .lead { font-family: var(--serif); font-size: 1.3rem; font-style: italic; color: var(--paper); }
.page .date { color: var(--dim); font-size: .85rem; margin-top: 3rem; }
.page .big { font-family: var(--serif); font-size: 1.6rem; color: var(--paper); margin: .2rem 0; }
.page footer { justify-content: flex-start; margin-top: 2.5rem; }

@media (prefers-reduced-motion: reduce) { .mark .cursor { animation: none; } * { transition: none !important; } }

/* ---- home: always fits the screen, never scrolls ---- */
html:has(body.home), body.home { height: 100%; overflow: hidden; }
.home .wrap { height: 100vh; height: 100dvh; padding: clamp(.4rem, 1.5dvh, 1.25rem) 0 clamp(.5rem, 1.6dvh, 1.25rem); display: flex; flex-direction: column; justify-content: center; }
.home .wrap > * { flex: 0 0 auto; }
.home .mark { width: min(30dvh, 72vw, 340px); margin: 0 auto calc(min(30dvh, 72vw, 340px) * -0.1); }
.home h1 { font-size: clamp(1.5rem, min(8vw, 6dvh), 3.2rem); margin: 0 0 clamp(.4rem, 1.8dvh, 1.4rem); line-height: 1.15; }
.home #f { flex: 1 1 auto; min-height: 0; max-height: 25rem; display: flex; flex-direction: column; }
.home #f > * { flex: 0 0 auto; }
.home #f textarea { flex: 1 1 auto; min-height: 3.2rem; resize: none; padding: clamp(.6rem, 1.6dvh, 1.1rem) 1rem; font-size: clamp(1.02rem, 2.4dvh, 1.2rem); }
.home .row { margin: clamp(.35rem, 1dvh, .75rem) 0 clamp(.45rem, 1.4dvh, 1.1rem); font-size: clamp(.76rem, 1.7dvh, .9rem); line-height: 1.35; }
.home #go, .home #again { align-self: center; padding: clamp(.5rem, 1.3dvh, .85rem) 2.2rem; font-size: clamp(1.05rem, 2.4dvh, 1.25rem); }
.home #err { margin: .4rem 0 0; font-size: .85rem; }
.home #done { padding: clamp(.4rem, 2dvh, 2rem) 0 0; min-height: 0; }
.home #done h2 { font-size: clamp(1.4rem, 4.5dvh, 2rem); margin: 0 0 .2rem; }
.home .soft { margin: 0 0 clamp(.5rem, 1.8dvh, 1.4rem); }
.home .heavy { padding: .6rem .8rem; margin: 0 0 clamp(.5rem, 1.6dvh, 1.2rem); font-size: clamp(.8rem, 1.9dvh, .95rem); line-height: 1.4; }
.home .truths { margin: clamp(.5rem, 2.2dvh, 2.2rem) 0 clamp(.25rem, 1dvh, .9rem); font-size: clamp(.7rem, 1.65dvh, .9rem); line-height: 1.4; }
.home .truths li { padding: clamp(0rem, .35dvh, .25rem) 0; }
.home .help { margin: 0 0 clamp(.3rem, 1.4dvh, 1.4rem); font-size: clamp(.74rem, 1.7dvh, .9rem); line-height: 1.4; }
.home footer { font-size: clamp(.72rem, 1.6dvh, .85rem); }
.home.sent .truths { display: none; }

/* short screens: the four lines run together as one small paragraph */
@media (max-height: 640px) {
  .home .truths li { display: inline; padding: 0; }
  .home .mark { width: min(24dvh, 60vw); margin-bottom: calc(min(24dvh, 60vw) * -0.1); }
  .home.sent .mark { width: min(16dvh, 40vw); }
}
/* short and wide (a phone on its side): mark and small print left, the box right */
@media (max-height: 520px) and (min-aspect-ratio: 5/4) {
  .home .wrap { width: min(100% - 2rem, 900px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); grid-template-rows: repeat(6, auto); column-gap: 1.5rem; align-content: center; }
  .home .wrap > * { grid-column: 1; }
  .home #f, .home #done { grid-column: 2; grid-row: 1 / 7; align-self: stretch; max-height: none; justify-content: center; }
  .home #done { display: flex; flex-direction: column; justify-content: center; }
  .home .mark, .home.sent .mark { width: min(28dvh, 26vw); margin-bottom: calc(min(28dvh, 26vw) * -0.1); }
  .home .truths { margin-top: .3rem; }
  .home h1 { font-size: clamp(1.3rem, 8dvh, 2.2rem); }
}

/* ---- the burst that never ends, behind everything ---- */
#sky { position: fixed; z-index: 0; pointer-events: none; opacity: .7; transform-origin: 50% 50%; will-change: transform; }
.home .truths { color: #cfcbc1; }
.home .truths, .home .help, .home footer, .home .row, .home h1, .home #done { text-shadow: 0 0 4px var(--ink), 0 0 10px var(--ink), 0 0 18px var(--ink); }
.home footer, .home footer a { color: #bdb9af; }
.home .row { color: #cfcbc1; }
.home textarea { background: rgba(16, 16, 23, .93); }

/* bot check: the floating badge is hidden; the required line sits in the small print instead */
.grecaptcha-badge { visibility: hidden; }
.rc { margin: clamp(.2rem, .8dvh, .6rem) 0 0; font-size: clamp(.62rem, 1.35dvh, .72rem); color: #8f8b82; text-shadow: 0 0 4px var(--ink), 0 0 10px var(--ink); }
.rc a { color: #a9a59b; }
/* the very shortest sideways phones */
@media (max-height: 360px) and (min-aspect-ratio: 5/4) {
  .home .mark, .home.sent .mark { width: min(22dvh, 22vw); margin-bottom: calc(min(22dvh, 22vw) * -0.1); }
  .home h1 { font-size: 1.25rem; margin-bottom: .2rem; }
  .home .truths { font-size: .66rem; line-height: 1.3; margin: .2rem 0 .15rem; }
  .home .help { font-size: .7rem; line-height: 1.3; margin-bottom: .15rem; }
  .home footer { font-size: .68rem; }
  .home .rc { font-size: .58rem; margin-top: .1rem; }
}
