/* VOICE   cozy and plain-spoken, for adults and seniors who love a puzzle with their coffee
   IDEA    the whole site behaves like a page of Betty's books: letters on white paper, words found and circled in red pencil
   PICTURE a live word search you can solve in the first screen; a Maple Street night scene with falling snow for the book
   COLOUR  paper #fff, ink navy #18264a, pencil red #c0322b, lamplight gold #f4c04e, night #101a36 (all from Betty's covers and emblem)
   TYPE    Caladea 700 (the covers' serif) for titles; Atkinson Hyperlegible Next (made for low-vision readers) for everything else
   LAYOUT  laptop: text left, puzzle page right, then full-width bands; phone: title, puzzle, buttons, one column */


/* Atkinson Hyperlegible Next draws 0 with a slash; numbers in prose read better with the reader's own plain sans digits */
@font-face { font-family: "Betty Digits"; src: local("Arial"), local("ArialMT"), local("Helvetica"), local("Roboto"), local("Roboto-Regular"), local("Liberation Sans"), local("LiberationSans"); font-weight: 200 600; unicode-range: U+0030-0039; }
@font-face { font-family: "Betty Digits"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Bold"), local("Helvetica-Bold"), local("Roboto Bold"), local("Roboto-Bold"), local("Liberation Sans Bold"), local("LiberationSans-Bold"); font-weight: 601 900; unicode-range: U+0030-0039; }

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #18264a;
  --ink-soft: #46527a;
  --pencil: #c0322b;
  --pencil-dark: #9b241e;
  --pencil-tint: #fbe8e6;
  --lamp: #f4c04e;
  --night: #101a36;
  --night-2: #1b2a57;
  --night-ink: #dfe5f4;
  --rule: #dde2ee;
  --tint: #f4f6fb;
  --cream: #fff4d6;
  --display: "Caladea", Cambria, Georgia, "Times New Roman", serif;
  --text: "Betty Digits", "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", Verdana, Tahoma, system-ui, sans-serif;
  --gut: max(5vw, 20px);
  --ease: cubic-bezier(.65, .05, .25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { min-width: 0; }
html { scroll-padding-top: 92px; -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 20px/1.6 var(--text); overflow-x: clip; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-underline-offset: 4px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 4px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(46px, 6vw, 80px); }
h2 { font-size: clamp(38px, 4.4vw, 60px); }
p { margin: 0; max-width: 34em; }
.wrap { max-width: 1240px; margin-inline: auto; padding-inline: var(--gut); }
/* things slide in from the side as you scroll; they must never make the page scroll sideways (clip keeps sticky working) */
main { overflow-x: clip; }
@supports not (overflow: clip) { main { overflow-x: hidden; } body { overflow-x: hidden; } }
.band { position: relative; padding-block: clamp(76px, 9vw, 140px); }
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: 16px; z-index: 100; padding: 12px 20px; background: var(--ink); color: #fff; border-radius: 10px; font-weight: 700; transform: translateY(-160%); }
.skip:focus { transform: none; }
.lead { margin-top: 24px; font-size: clamp(20px, 1.75vw, 23px); color: var(--ink-soft); }
.small { font-size: 17px; color: var(--ink-soft); }

/* reading progress: a red pencil line across the top */
.progress { position: fixed; inset: 0 0 auto 0; height: 5px; z-index: 70; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--pencil); transform: scaleX(0); transform-origin: 0 50%; }
html:not(.js) .progress, html.calm .progress { display: none; }

/* the hand-drawn pencil ring used on links and buttons */
.ring { position: absolute; left: -8px; top: -6px; width: calc(100% + 16px); height: calc(100% + 12px); overflow: visible; pointer-events: none; }
.ring path { fill: none; stroke: var(--pencil); stroke-width: 2.4; stroke-linecap: butt; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .5s var(--ease); }
.btn .ring path { stroke-width: 1.6; }

/* navigation */
.nav { position: sticky; top: 0; z-index: 60; background: #fff; border-bottom: 1px solid var(--rule); }
.nav .wrap { display: flex; align-items: center; gap: 20px; min-height: 80px; transition: min-height .3s var(--ease); }
.nav.small .wrap { min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 700 27px/1 var(--display); white-space: nowrap; }
.brand svg { width: 48px; height: 48px; flex: none; }
.links { display: flex; align-items: center; gap: 4px; margin: 0 0 0 auto; padding: 0; list-style: none; }
.links a { position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; text-decoration: none; font-weight: 700; font-size: 19px; }
.links a:hover .ring path, .links a:focus-visible .ring path, .links a[aria-current="true"] .ring path { stroke-dashoffset: 0; stroke-linecap: round; }
.calm-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px; border: 2px solid var(--rule); border-radius: 999px; background: #fff; font-weight: 700; font-size: 17px; cursor: pointer; white-space: nowrap; }
.calm-btn:hover { border-color: var(--ink); }
.calm-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.calm-btn svg { width: 22px; height: 22px; }
.menu-btn { display: none; margin-left: auto; min-height: 52px; padding: 0 18px; border: 2px solid var(--ink); border-radius: 999px; background: #fff; font-weight: 700; font-size: 19px; cursor: pointer; }
.sheet-menu { position: fixed; inset: 0; z-index: 80; background: var(--paper); display: none; flex-direction: column; padding: 22px var(--gut) 40px; overflow-y: auto; }
.sheet-menu.open { display: flex; }
.sheet-menu .top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sheet-menu ul { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 6px; }
.sheet-menu ul a { position: relative; display: inline-flex; min-height: 64px; align-items: center; padding: 0 12px; text-decoration: none; font: 700 clamp(30px, 8vw, 40px)/1.1 var(--display); }
.sheet-menu ul a:hover .ring path, .sheet-menu ul a:focus-visible .ring path { stroke-dashoffset: 0; stroke-linecap: round; }
.sheet-menu .calm-btn { align-self: flex-start; margin-top: 28px; }
@media (max-width: 980px) { .links, .nav .calm-btn { display: none; } .menu-btn { display: inline-flex; align-items: center; } }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 16px 22px; margin-top: 34px; }
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 62px; padding: 0 30px; border: 2px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font: 700 20px/1.1 var(--text); text-decoration: none; text-align: center; cursor: pointer; transition: background .2s, color .2s, border-color .2s, scale .15s; }
.btn:hover .ring path, .btn:focus-visible .ring path { stroke-dashoffset: 0; stroke-linecap: round; }
html:not(.alive) .btn:active { scale: .97; }
.btn .ring { left: -10px; top: -9px; width: calc(100% + 20px); height: calc(100% + 18px); }
.btn.primary { background: var(--pencil); border-color: var(--pencil); color: #fff; }
.btn.primary:hover { background: var(--pencil-dark); border-color: var(--pencil-dark); }
.btn.primary .ring path { stroke: var(--ink); }
.btn.light { background: #fff; border-color: #fff; color: var(--ink); }
.btn.light .ring path, .btn.ghost .ring path { stroke: var(--lamp); }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .85); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.linkbtn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; border: 0; background: none; color: var(--pencil); font: 700 18px/1 var(--text); text-decoration: underline; text-underline-offset: 5px; cursor: pointer; }
.linkbtn:hover { color: var(--pencil-dark); }

/* hero */
.hero { padding-block: clamp(36px, 5.5vw, 80px) clamp(70px, 8vw, 120px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(36px, 5vw, 80px); align-items: center; }
.hero h1 { font-size: clamp(46px, 4.9vw, 68px); }
@media (min-width: 1001px) and (max-height: 820px) { .hero { padding-top: 26px; } .hero .lead { margin-top: 16px; } .hero .actions { margin-top: 24px; } .try { margin-top: 24px; padding-top: 18px; } }
.try { display: flex; gap: 14px; align-items: flex-start; margin-top: 34px; padding-top: 24px; border-top: 2px dashed var(--rule); font-size: 18px; color: var(--ink-soft); max-width: 30em; }
.try svg { width: 34px; height: 34px; flex: none; margin-top: 2px; }
@media (max-width: 1000px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } .hero h1 { max-width: 13em; font-size: clamp(46px, 7.4vw, 66px); } .sheet { max-width: 640px; } }

/* the hero's entrance is plain CSS, so it plays from the very first paint, before any script has loaded.
   Script motion never touches these same elements (it moves .hero-text and .sheet-hold instead), so the two never fight. */
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .1em .05em .2em; margin: -.1em -.05em -.2em; }
.hero h1 .ch { display: inline-block; }
@keyframes b-rise { from { transform: translateY(118%) rotate(7deg); } }
@keyframes b-fade-up { from { opacity: 0; translate: 0 28px; } }
@keyframes b-drop { from { opacity: 0; translate: 0 70px; rotate: 7deg; } }
@keyframes b-pop { from { opacity: 0; scale: .3; } }
html.js:not(.calm) .hero h1 .ch { animation: b-rise .95s cubic-bezier(.165, .84, .44, 1) backwards; animation-delay: calc(.1s + var(--i) * 18ms); }
html.js:not(.calm) .hero-text .lead { animation: b-fade-up .7s cubic-bezier(.215, .61, .355, 1) .35s backwards; }
html.js:not(.calm) .hero-text .actions { animation: b-fade-up .75s cubic-bezier(.215, .61, .355, 1) .5s backwards; }
html.js:not(.calm) .hero-text .try { animation: b-fade-up .75s cubic-bezier(.215, .61, .355, 1) .65s backwards; }
html.js:not(.calm) #puzzle { animation: b-drop 1.1s cubic-bezier(.215, .61, .355, 1) .15s backwards; }
html.js:not(.calm) .hero .cell { animation: b-pop .55s cubic-bezier(.34, 1.56, .64, 1) backwards; animation-delay: calc(.35s + var(--d) * 24ms); }

/* the puzzle page */
.sheet { position: relative; background: #fff; border: 1px solid var(--rule); border-radius: 6px; padding: clamp(18px, 2.6vw, 34px); box-shadow: 0 1px 0 var(--rule), 16px 18px 0 -4px rgba(24, 38, 74, .07); rotate: 1deg; }
.sheet-title { font: 700 clamp(19px, 1.6vw, 22px)/1.3 var(--text); }
.sheet-memory { margin-top: 4px; font: italic 400 clamp(17px, 1.4vw, 19px)/1.45 var(--text); color: var(--ink-soft); }
.sheet-how { margin-top: 12px; font-size: 16px; line-height: 1.45; color: var(--ink-soft); }
/* the finished page, lifted off the pad (a copy laid over the new page while it flies away) */
.sheet.tearoff { position: absolute; inset: 0 0 auto 0; margin: 0; rotate: 0deg; z-index: 6; pointer-events: none; box-shadow: 0 26px 44px -20px rgba(24, 38, 74, .5); }
.hero .tearoff .cell { animation: none !important; }
.board { position: relative; margin-top: 18px; border: 3px solid var(--ink); aspect-ratio: 1; container-type: inline-size; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.board.drag { touch-action: none; }
@media (hover: hover) and (pointer: fine) { .board, .board .cell { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M3 29l2.5-7.5L22 5l5 5L10.5 26.5z' fill='%23f4c04e' stroke='%2318264a' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M3 29l2.5-7.5 5 5z' fill='%23fff4d6' stroke='%2318264a' stroke-width='1.8' stroke-linejoin='round'/%3E%3Cpath d='M3 29l1.2-3.6 2.4 2.4z' fill='%2318264a'/%3E%3Cpath d='M22 5l5 5' stroke='%23c0322b' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") 3 29, crosshair; } }
.cells { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-rows: repeat(10, minmax(0, 1fr)); height: 100%; }
.cell { display: grid; place-items: center; font: 700 clamp(19px, 2.55vw, 34px)/1 var(--text); font-size: clamp(19px, 7.6cqi, 42px); color: var(--ink); border-radius: 50%; cursor: pointer; transition: background .15s, color .15s, scale .15s; }
.cell:focus-visible { outline: 3px solid var(--pencil); outline-offset: -3px; border-radius: 10px; }
.cell.sel { color: var(--pencil); }
.cell.start { background: var(--pencil-tint); color: var(--pencil); box-shadow: inset 0 0 0 3px var(--pencil); }
.cell.hint { background: var(--lamp); }
.board.party .cell { transition: none; }
@media (hover: hover) { .cell:hover { background: var(--pencil-tint); scale: 1.16; } }
.marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.marks path { fill: none; stroke: var(--pencil); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }
.marks path.live { stroke: var(--ink); stroke-width: 6; opacity: .4; }
.wordlist { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 18px; margin: 18px 0 0; padding: 0; list-style: none; font: 700 clamp(17px, 1.5vw, 20px)/1.4 var(--text); }
.wordlist li { position: relative; justify-self: start; padding: 2px 4px; }
.wordlist li svg { position: absolute; left: -4px; top: 50%; width: calc(100% + 8px); height: 14px; translate: 0 -50%; overflow: visible; pointer-events: none; }
.wordlist li svg path { fill: none; stroke: var(--pencil); stroke-width: 3; stroke-linecap: butt; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .45s var(--ease); }
.wordlist li.found { color: var(--ink-soft); }
.wordlist li.found svg path { stroke-dashoffset: 0; stroke-linecap: round; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--rule); }
.count { font-weight: 700; font-size: 18px; }
.done { margin-top: 18px; padding: 20px 22px; border: 2px solid var(--pencil); border-radius: 14px; background: var(--pencil-tint); }
.done[hidden] { display: none; }
.done p { font-weight: 700; font-size: 20px; }
.done .actions { margin-top: 16px; }
.done .btn { min-height: 54px; padding: 0 22px; font-size: 18px; }
.spark { position: fixed; z-index: 95; width: 16px; height: 3px; margin-top: -1.5px; border-radius: 2px; transform-origin: 0 50%; pointer-events: none; }
.confetti { position: fixed; z-index: 90; pointer-events: none; font: 700 26px/1 var(--text); color: var(--pencil); }

/* letter strips: a row from a puzzle, with the section's word circled */
.strip { position: relative; display: grid; grid-template-columns: repeat(var(--n, 13), minmax(0, 1fr)); width: min(100%, 600px); margin-bottom: 28px; border: 2px solid var(--ink); border-radius: 4px; background: #fff; }
.strip span { display: grid; place-items: center; aspect-ratio: 1; font: 700 clamp(14px, 1.9vw, 23px)/1 var(--text); color: #7d86a3; border-right: 1px solid var(--rule); }
.strip span:last-of-type { border-right: 0; }
.strip span.w { color: var(--ink); }
.strip svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.strip svg path { fill: none; stroke: var(--pencil); stroke-width: 6; stroke-linecap: round; }
.on-night .strip { border-color: rgba(255, 255, 255, .85); background: rgba(255, 255, 255, .96); }
.strips { display: grid; gap: 10px; margin-bottom: 30px; }
.strips .strip { margin: 0; }

/* what you get */
.why .wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(36px, 6vw, 100px); align-items: start; }
.why .intro { position: sticky; top: 130px; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 20px; align-items: start; padding-block: 28px; border-bottom: 1px solid var(--rule); }
.checks li:first-child { padding-top: 6px; }
.checks svg { width: 60px; height: 60px; }
.checks .c, .checks .t { fill: none; stroke: var(--pencil); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.checks h3 { font: 700 clamp(23px, 2.1vw, 28px)/1.25 var(--text); letter-spacing: 0; }
.checks p { margin-top: 6px; color: var(--ink-soft); }
@media (max-width: 900px) { .why .wrap { grid-template-columns: minmax(0, 1fr); } .why .intro { position: static; } }

/* Maple Street at night */
.maple { position: relative; overflow: clip; background: var(--night); color: var(--night-ink); padding-block: clamp(110px, 11vw, 170px) 0; }
.drift { position: absolute; left: 0; top: -1px; width: 100%; height: clamp(40px, 6vw, 80px); z-index: 2; }
.snow { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.maple .wrap { position: relative; z-index: 3; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 100px); align-items: center; }
.maple h2 { color: #fff8ea; }
.maple .sub { margin-top: 12px; font: 700 clamp(20px, 1.8vw, 24px)/1.35 var(--text); color: var(--lamp); }
.maple p { color: var(--night-ink); }
.maple .lead { color: var(--night-ink); }
.facts { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.facts li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 14px; align-items: baseline; font-size: 19px; }
.facts li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--lamp); box-shadow: 0 0 0 4px rgba(244, 192, 78, .2); }
.gift { margin-top: 22px; font-weight: 700; color: #fff8ea; }
.review-note { margin-top: 16px; font-size: 17px; color: #c3cbe2; }
.cover3d { perspective: 1400px; }
.book { position: relative; display: block; border-radius: 3px 10px 10px 3px; transform-style: preserve-3d; box-shadow: -2px 0 0 #0b1229, -22px 30px 50px rgba(0, 0, 0, .5); }
.book img { border-radius: inherit; }
.book::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 14px; border-radius: 3px 0 0 3px; background: linear-gradient(90deg, rgba(0, 0, 0, .35), rgba(255, 255, 255, .12) 60%, transparent); }
.book::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: radial-gradient(circle at var(--gx, 30%) var(--gy, 20%), rgba(255, 255, 255, .38), transparent 55%); opacity: 0; transition: opacity .3s; pointer-events: none; }
.book:hover::after { opacity: 1; }
.scene { position: relative; z-index: 2; display: block; width: 100%; height: clamp(170px, 24vw, 340px); margin-top: clamp(60px, 7vw, 110px); }
@media (max-width: 900px) { .maple .wrap { grid-template-columns: minmax(0, 1fr); } .cover3d { max-width: 380px; } }

/* look inside */
.inside .head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; }
.rail-wrap { margin-top: 40px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.rail { display: flex; gap: 28px; width: max-content; padding: 6px var(--gut) 18px; }
.slide { flex: none; width: min(80vw, 940px); margin: 0; scroll-snap-align: center; }
.slide img { width: 100%; border: 1px solid var(--rule); border-radius: 10px; }
.slide figcaption { margin-top: 12px; font-size: 18px; color: var(--ink-soft); max-width: 46em; }
.rail-ctrl { display: flex; gap: 12px; }
.round { display: inline-grid; place-items: center; width: 58px; height: 58px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; cursor: pointer; }
.round:hover { background: var(--ink); color: #fff; }
.round svg { width: 26px; height: 26px; }
.pinned .rail-wrap { overflow: hidden; scroll-snap-type: none; padding-top: 10px; }
.pinned .slide { width: min(76vw, 1000px, calc((100svh - 196px) * 1.6)); }
.pinned .rail-ctrl { display: none; }
.rail-count { display: none; }
.pinned .rail-count { display: block; position: absolute; right: var(--gut); top: 14px; z-index: 2; padding: 6px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: 18px; }
.rail-wrap { position: relative; }

/* free puzzles */
.free { background-color: var(--tint); background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 44px 44px; background-position: -1px -1px; }
.free .wrap, .testers .wrap, .about .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 100px); align-items: center; }
.envelope { width: min(100%, 540px); justify-self: center; overflow: visible; }
@media (min-width: 901px) { .free .wrap { align-items: start; } .envelope { position: sticky; top: 150px; margin-top: 60px; } }
.form { display: grid; gap: 18px; max-width: 560px; margin-top: 30px; padding: clamp(22px, 3vw, 36px); border: 2px solid var(--ink); border-radius: 18px; background: #fff; }
.field label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 19px; }
.field .opt { font-weight: 400; color: var(--ink-soft); }
.field input { width: 100%; min-height: 60px; padding: 0 18px; border: 2px solid #8e98b6; border-radius: 12px; background: #fff; color: var(--ink); font: 400 20px/1 var(--text); }
.field input:focus { border-color: var(--ink); outline: 4px solid rgba(192, 50, 43, .3); outline-offset: 1px; }
.form .btn { justify-self: start; }
.form-msg { font-weight: 700; font-size: 19px; }
.form-msg:empty { display: none; }
.form-msg.ok { color: #1f6b3a; }
.form-msg.err { color: var(--pencil); }
.fine { font-size: 17px; color: var(--ink-soft); }

/* testers */
.stamp { width: min(100%, 360px); justify-self: center; overflow: visible; }
.testers .note { margin-top: 18px; font-size: 18px; color: var(--ink-soft); }

/* about */
.about { background: var(--cream); }
.about .wrap { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.emblem { width: min(100%, 420px); justify-self: center; }
/* Betty's portrait: a painting in a tilted photo frame, with her emblem stuck on the corner like a sticker */
.betty { position: relative; width: min(100%, 440px); justify-self: center; padding: 26px 0 0 26px; }
.polaroid { margin: 0; background: #fff; padding: 14px 14px 0; border-radius: 6px; rotate: -3deg; box-shadow: 0 2px 4px rgba(24, 38, 74, .08), 0 28px 54px -22px rgba(24, 38, 74, .5); transition: rotate .55s cubic-bezier(.34, 1.56, .64, 1), scale .55s cubic-bezier(.34, 1.56, .64, 1); }
.polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1; border-radius: 3px; }
.polaroid figcaption { padding: 12px 8px 16px; text-align: center; font: italic 400 19px/1.3 var(--text); color: var(--ink-soft); }
html.alive .polaroid:hover { rotate: 0deg; scale: 1.03; }
html.alive.fine .polaroid { transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.betty .emblem { position: absolute; left: -2%; top: -2%; width: 34%; max-width: none; z-index: 2; filter: drop-shadow(0 10px 14px rgba(24, 38, 74, .3)); }
@media (max-width: 560px) { .betty { width: min(100%, 340px); padding: 20px 0 0 20px; } }
.bio { margin-top: 24px; font-size: clamp(21px, 1.9vw, 25px); line-height: 1.6; }
.sig { margin-top: 18px; font: 700 34px/1 var(--display); color: var(--pencil); }

/* contact */
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 26px; }
.mail a { display: inline-flex; align-items: center; min-height: 48px; font-weight: 700; font-size: clamp(20px, 2.4vw, 28px); overflow-wrap: anywhere; }

/* footer */
.foot { background: var(--night); color: var(--night-ink); padding-block: 60px 44px; font-size: 18px; }
.foot .wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 32px 40px; }
.foot .brand { color: #fff; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.foot a { color: #fff; display: inline-flex; min-height: 44px; align-items: center; }
.foot .calm-btn { color: var(--ink); }
.foot .strip { width: min(100%, 520px); margin: 0 0 18px; }
.foot .strip span { transition: translate .2s var(--ease), color .2s; }
@media (hover: hover) { .foot .strip span:hover { translate: 0 -7px; color: var(--pencil); } }
.foot .legal { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .18); font-size: 16px; color: #b9c2dc; }

@media (max-width: 900px) {
  .free .wrap, .testers .wrap, .about .wrap { grid-template-columns: minmax(0, 1fr); }
  .envelope, .stamp, .emblem { max-width: 360px; }
  .book-text .strips { display: none; }
}
@media (max-width: 560px) { .stamp { max-width: 250px; } .envelope { max-width: 330px; } .emblem { max-width: 300px; } }
/* phones: less empty scrolling between sections */
@media (max-width: 560px) { .band { padding-block: 56px; } .hero { padding-bottom: 52px; } .maple { padding-top: 86px; } }
@media (max-width: 560px) {
  body { font-size: 19px; }
  .btn { width: 100%; }
  .wordlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet { rotate: 0deg; padding: 16px 14px; }
  .actions { gap: 14px; }
  .done .btn { width: 100%; }
}

/* calm mode and reduced motion: everything still, nothing hidden */
html.calm .ring path, html.calm .wordlist li svg path { transition: none; }
html.calm .snow { display: none; }
@media (prefers-reduced-motion: reduce) {
  .ring path, .wordlist li svg path, .nav .wrap, .btn { transition: none !important; }
}
@media print {
  .nav, .progress, .snow, .scene, .drift, .menu-btn, .rail-ctrl, .form, .calm-btn, #ambient, #trail, #cursor, #ink, .marquee { display: none !important; }
  .maple, .foot { background: #fff; color: #000; }
  * { transform: none !important; opacity: 1 !important; }
}
/* ---------- the living page (alive.js). None of this shows in calm mode, with "reduce motion", or without the script.
   The background drifts and changes colour with each part of the page, letters float behind everything,
   Betty's pencil draws its way down the side, and every button, link and click answers back. ---------- */
#ambient, #trail, #cursor, #ink { display: none; }
html.alive #ambient { display: block; position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #fff; }
#ambient .blob { position: absolute; width: 72vmax; height: 72vmax; border-radius: 50%; will-change: transform; }
#ambient .b1 { left: -24vmax; top: -30vmax; background: radial-gradient(closest-side, rgba(244, 192, 78, .32), rgba(244, 192, 78, 0)); animation: b-drift-1 24s ease-in-out infinite alternate; }
#ambient .b2 { right: -30vmax; top: 6vh; background: radial-gradient(closest-side, rgba(224, 72, 63, .14), rgba(224, 72, 63, 0)); animation: b-drift-2 31s ease-in-out infinite alternate; }
#ambient .b3 { left: 4vw; bottom: -40vmax; background: radial-gradient(closest-side, rgba(110, 150, 255, .17), rgba(110, 150, 255, 0)); animation: b-drift-3 37s ease-in-out infinite alternate; }
#ambient .b4 { right: 0; bottom: -18vmax; width: 52vmax; height: 52vmax; background: radial-gradient(closest-side, rgba(255, 226, 150, .45), rgba(255, 226, 150, 0)); animation: b-drift-1 21s ease-in-out infinite alternate-reverse; }
@keyframes b-drift-1 { to { transform: translate(22vw, 16vh) scale(1.18); } }
@keyframes b-drift-2 { to { transform: translate(-20vw, 30vh) scale(.86); } }
@keyframes b-drift-3 { to { transform: translate(26vw, -24vh) scale(1.12); } }
#letters { position: absolute; inset: 0; width: 100%; height: 100%; }
html.alive-lite #letters { display: none; }
html.alive-lite #ambient .blob { animation-play-state: paused; }
html.alive-lighter #trail, html.alive-lighter #ambient .blob { display: none; }
html.alive .about { background: transparent; }
html.alive .free { background-color: rgba(244, 246, 251, .35); }
@media (min-width: 900px) { html.alive .nav { background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: saturate(1.5) blur(14px); backdrop-filter: saturate(1.5) blur(14px); } }
@media (max-width: 700px) { #ambient .blob { width: 64vmax; height: 64vmax; } #ambient .b4 { display: none; } }

/* Betty's pencil and its red line (alive.js draws them) */
html.alive #trail { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; }

/* the cursor ring, its label, and the ink trail */
html.alive.fine #cursor { display: block; position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 96; pointer-events: none; }
#cursor::before { content: ""; position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border: 2px solid var(--pencil); border-radius: 50%; opacity: 0; transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .3s, background-color .3s, border-color .3s; }
#cursor.on::before { opacity: .85; }
#cursor.link::before { transform: scale(1.8); background: rgba(192, 50, 43, .08); }
#cursor.board::before { transform: scale(.45); border-color: var(--ink); }
#cursor.text::before { transform: scale(.6, 1.25); border-radius: 10px; }
#cursor.down::before { transform: scale(.7); }
#cursor.link.down::before { transform: scale(1.45); }
#cursor span { position: absolute; left: 0; top: 0; translate: -50% -50%; padding: 8px 15px; border-radius: 999px; background: var(--pencil); color: #fff; font: 700 16px/1 var(--text); white-space: nowrap; scale: 0; transition: scale .35s cubic-bezier(.2, .8, .2, 1); }
#cursor.labelled span { scale: 1; }
#cursor.labelled::before { opacity: 0; }
html.alive.fine #ink { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 94; pointer-events: none; }

/* buttons: colour pours in from where the pointer enters, the label rolls over, a light sweeps across, presses squash */
.btn-fill { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }
.btn-fill::before { content: ""; position: absolute; left: var(--fx, 50%); top: var(--fy, 50%); width: 260%; aspect-ratio: 1; border-radius: 50%; background: var(--fill, var(--ink)); transform: translate(-50%, -50%) scale(0); transition: transform .6s cubic-bezier(.65, .05, .25, 1); }
html.alive .btn:hover .btn-fill::before, html.alive .btn:focus-visible .btn-fill::before { transform: translate(-50%, -50%) scale(1); }
.btn > :not(.btn-fill):not(.ring) { position: relative; z-index: 1; }
.btn > .ring { z-index: 2; }
html.alive .btn:not(.primary):hover { color: #fff; }
.on-night .btn { --fill: var(--lamp); }
html.alive .on-night .btn:hover { color: var(--ink); border-color: var(--lamp); }
.btn-ripple { position: absolute; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; background: rgba(255, 255, 255, .55); pointer-events: none; }
.btn.primary .btn-fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .36) 50%, transparent 62%); transform: translateX(-130%); }
html.alive .btn.primary .btn-fill::after { animation: b-shine 5s ease-in-out 1.8s infinite; }
@keyframes b-shine { 0%, 72% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
.roll { display: inline-grid; overflow: hidden; vertical-align: top; padding-block: .1em; margin-block: -.1em; }
.roll > span { grid-area: 1 / 1; transition: transform .5s cubic-bezier(.65, .05, .25, 1); }
.roll-b { transform: translateY(110%); }
html.alive :is(.btn, .links a, .sheet-menu ul a):is(:hover, :focus-visible) .roll-a { transform: translateY(-110%); }
html.alive :is(.btn, .links a, .sheet-menu ul a):is(:hover, :focus-visible) .roll-b { transform: translateY(0); }

/* a soft lamp light follows the pointer across cards and forms */
.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: -10px; z-index: -1; border-radius: 22px; background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(244, 192, 78, .28), rgba(244, 192, 78, 0) 70%); opacity: 0; transition: opacity .35s; pointer-events: none; }
html.alive .spot:hover::before { opacity: 1; }

/* clicks and taps */
.tap-ring { position: fixed; z-index: 93; width: 150px; height: 150px; margin: -75px 0 0 -75px; border: 2px solid var(--pencil); border-radius: 50%; pointer-events: none; }
.tap-letter { font-size: 21px; }

/* the letter strips that run across the page */
.marquee { overflow: hidden; padding-block: clamp(18px, 3vw, 40px); border-block: 1px solid var(--rule); }
.mq-row { overflow: hidden; }
.mq-track { display: flex; align-items: center; width: max-content; font-size: clamp(36px, 5.6vw, 86px); will-change: transform; }
.mq-track span { font: 700 1em/1.15 var(--display); letter-spacing: -.02em; white-space: nowrap; padding-inline: .32em; color: var(--ink); }
.mq-alt .mq-track span { color: transparent; -webkit-text-stroke: 1.6px var(--ink); }
@supports not (-webkit-text-stroke: 1px #000) { .mq-alt .mq-track span { color: var(--ink-soft); } }
.mq-dot { flex: none; width: .62em; height: .42em; border: .07em solid var(--pencil); border-radius: 50%; rotate: -10deg; }

/* letter tiles in the strips swell and turn red under the pointer; inside pages lean toward it */
html.alive .strip span { transition: scale .3s cubic-bezier(.34, 1.56, .64, 1), translate .2s var(--ease), color .2s; }
html.alive .strip span:hover { scale: 1.32; color: var(--pencil); }
html.alive.fine .slide img { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
html.alive .stamp.clicky { cursor: pointer; }
::selection { background: var(--lamp); color: var(--ink); }

/* small things that keep moving */
html.alive .emblem { animation: b-float 6s ease-in-out infinite; }
@keyframes b-float { 50% { translate: 0 -12px; rotate: -1.2deg; } }
html.alive .try svg { animation: b-wiggle 3.4s ease-in-out infinite; transform-origin: 20% 80%; }
@keyframes b-wiggle { 0%, 70%, 100% { rotate: 0deg; } 78% { rotate: -14deg; } 86% { rotate: 10deg; } 93% { rotate: -5deg; } }
html.alive .checks li svg { transition: rotate .45s cubic-bezier(.34, 1.56, .64, 1), scale .45s cubic-bezier(.34, 1.56, .64, 1); }
html.alive .checks li:hover svg { rotate: -10deg; scale: 1.12; }

/* "Print it": just the puzzle, big and clean, ready for a pencil */
@media print {
  @page { margin: .5in; }
  html.print-puzzle body > :not(main), html.print-puzzle main > :not(.hero), html.print-puzzle .hero-text,
  html.print-puzzle .sheet-foot, html.print-puzzle .done, html.print-puzzle .marks, html.print-puzzle .tearoff,
  html.print-puzzle .wordlist li svg, html.print-puzzle .sr { display: none !important; }
  html.print-puzzle .hero { padding: 0; }
  html.print-puzzle .hero .wrap { display: block; max-width: none; padding: 0; }
  html.print-puzzle .sheet { border: 0; box-shadow: none; rotate: 0deg; padding: 0; max-width: none; animation: none; }
  html.print-puzzle .sheet-title { font-size: 24pt; }
  html.print-puzzle .sheet-memory { font-size: 14pt; color: #333; }
  html.print-puzzle .board { width: 6.6in; margin: 18pt auto 0; border: 2pt solid #000; }
  html.print-puzzle .cell { font-size: 30pt; color: #000 !important; background: none !important; box-shadow: none !important; animation: none !important; }
  html.print-puzzle .wordlist { font-size: 20pt; margin-top: 20pt; }
  html.print-puzzle .wordlist li { color: #000; }
  html.print-puzzle .sheet-how { font-size: 12pt; color: #333; }
  html.print-puzzle #puzzle::after { content: attr(data-site); display: block; margin-top: 16pt; font-size: 11pt; color: #444; }
}
