/* Santa Wishes v4: the Christmas sweater. */
:root {
  --red: #c4122f;
  --red-deep: #8f0b21;
  --green: #1d6b45;
  --green-deep: #134a30;
  --wool: #fbf7ef;
  --wool-2: #f1e9da;
  --ink: #2b0a12;
  --ink-2: #5a3840;
  --wood: #cf9257;
  --wood-deep: #8a5527;
  --wood-ink: #2a1306;
  --stitch: rgba(196, 18, 47, .5);
  --radius: 18px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scrollbar-color: var(--green) var(--red-deep); }
body {
  margin: 0;
  background: var(--red);
  color: var(--ink);
  font: 400 1.0625rem/1.6 Nunito, system-ui, sans-serif;
  caret-color: var(--red);
  -webkit-font-smoothing: antialiased;
  background-repeat: round repeat;
}
::selection { background: var(--green); color: #fff; }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--red-deep); }
::-webkit-scrollbar-thumb { background: var(--green); border-radius: 6px; border: 3px solid var(--red-deep); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 6px; }
.collar :focus-visible, .hem :focus-visible { outline-color: var(--wool); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1220px, 100% - 48px); margin-inline: auto; }

/* type: every heading is knitted lettering (Nunito ExtraBold read into stitch charts); everything else is one rounded wool sans */
h1, h2 { font-family: Nunito, system-ui, sans-serif; font-weight: 800; color: var(--red); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.6rem, 4.6vw, 4rem); line-height: 1; }
h2 { font-size: clamp(1.9rem, 3vw, 2.5rem); line-height: 1.06; }
h3 { font: 800 1.35rem/1.2 Nunito, system-ui, sans-serif; color: var(--ink); margin: 0; text-wrap: balance; }
[data-knit-text] { position: relative; display: block; }
[data-knit-text] > canvas { display: block; }
[data-knit-text].halo { width: fit-content; max-width: 100%; }
.kt-in > canvas { position: absolute; left: 0; top: 0; max-width: none; }
p { margin: 0; text-wrap: pretty; }

/* ---- knit surfaces (the renderer fills these in; the colors are the fallback) ---- */
.knit-ground { background-color: var(--red); }
.band { display: block; background-color: var(--green); background-repeat: repeat-x; background-position: center top; }
.band[data-band="stars"] { background-color: var(--red); }

/* ---- collar: ribbed neckband carrying the name and nav ---- */
.collar { background-color: var(--green); background-repeat: repeat; position: relative; z-index: 2; }
.collar-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 76px; }
.mark { font: 800 1.5rem/1 Nunito, system-ui, sans-serif; color: #fff; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.collar nav { display: flex; align-items: center; gap: 4px; }
.collar nav a:not(.toggle) { color: #fff; font-weight: 700; text-decoration: none; padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 999px; }
.collar nav a:not(.toggle):hover { background: rgba(255, 255, 255, .12); }

/* ---- knitted tab buttons: real stitches behind a real label ---- */
.toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 30px;
  border: 3px solid #3a9b6b; border-radius: 12px;
  font: 900 1.06rem/1 Nunito, system-ui, sans-serif; letter-spacing: .01em;
  color: #fff; text-decoration: none; cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 20, 8, .7), 0 0 8px rgba(0, 20, 8, .45);
  background-color: var(--green);
  transition: transform .18s cubic-bezier(.2, .8, .2, 1), border-color .18s;
}
.knit .toggle { background-image: var(--btn-img); background-size: var(--btn-size); }
.toggle:hover { transform: translateY(-2px); border-color: #63c493; }
.toggle:active { transform: translateY(1px); }
.toggle:disabled { opacity: .65; cursor: progress; transform: none; }
.collar .toggle { background-color: var(--red); border-color: #e2445c; }
.knit .collar .toggle { background-image: var(--btnr-img); background-size: var(--btnr-size); }
.collar .toggle:hover { border-color: #ff8095; }
.toggle.sm { min-height: 44px; padding: 0 20px; font-size: .95rem; margin-left: 8px; }
/* the duffle toggle: a painted wooden barrel in its yarn loop at the head of every big button */
.knit .toggle:not(.sm):not(.codebox .toggle) {
  background-image: var(--barrel-img), var(--btn-img); background-size: 40px 16px, var(--btn-size);
  background-position: 16px 50%, 0 0; background-repeat: no-repeat, repeat; padding-left: 66px;
}

/* ---- wool patches: a carved lighter-red halo row, a soft wool rim, a flat field to read on ---- */
.patch {
  --pt: clamp(28px, 3.4vw, 48px); --px: clamp(28px, 3.4vw, 48px);
  position: relative; isolation: isolate;
  border: 14px solid #e2445c;
  border-radius: 24px;
  background: var(--wool);
  padding: var(--pt) var(--px);
}
/* sewn on: the frame tile is halo knit under a blanket stitch in pine yarn, so the border is thread, not a CSS line */
.knit .patch {
  border-color: transparent; border-radius: 14px;
  border-image: var(--frame-img) 14 round;
  background: var(--wool-img) 0 0 / var(--wool-size) padding-box;
}
.patch::before {
  content: ""; position: absolute; inset: 10px; z-index: -1;
  background: var(--wool); border-radius: 6px;
}
/* a band knitted into the top of a patch, flush with the stitched edge */
.patch > .cuff { display: block; margin: calc(-1 * var(--pt)) calc(-1 * var(--px)) 24px; }
.halo { border: 8px solid #e2445c; border-radius: 16px; }
.knit .halo { border-color: transparent; background: var(--halo-img) 0 0 / var(--halo-size) border-box; }
.halo canvas { border-radius: 8px; }

/* ---- hero ---- */
.hero { padding: clamp(36px, 5vw, 64px) 0 clamp(40px, 5vw, 64px); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.hero-patch .lead { margin-top: 24px; font-size: 1.16rem; color: var(--ink-2); max-width: 34em; }
.ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 30px; }
.ctas .link { font-weight: 700; color: var(--ink); min-height: 44px; display: inline-flex; align-items: center; }
.fine { margin-top: 22px; color: var(--ink-2); font-size: .98rem; }
.fine b { color: var(--ink); font-size: 1.1rem; }
.fine a { font-weight: 700; color: var(--ink); }
.schoolnote { margin-top: 12px; font-weight: 700; color: var(--green); }

.motif { margin: 0; display: grid; gap: 18px; justify-items: center; }
.knitbox { position: relative; display: block; width: 100%; line-height: 0; }
.knitbox canvas { display: block; width: 100%; height: auto; }

.scene { overflow: hidden; }
.sleeps { width: min(100%, 520px); overflow: hidden; }

/* knitting row by row: the fg canvas is revealed from the bottom, one row per step */
@keyframes knit { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: no-preference) {
  .knitbox.knitting canvas.fg { animation: knit calc(var(--rows, 20) * 70ms) steps(var(--rows, 20)) both; }
}

/* ---- the call ---- */
.call { padding: clamp(48px, 6vw, 80px) 0; }
.call-in { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(24px, 3vw, 40px); align-items: start; }
.call-side { position: sticky; top: 24px; }
.told-patch .told-h { font-size: 1.9rem; line-height: 1.1; }
.told-patch dl { margin: 14px 0 0; display: grid; gap: 10px; }
.told-patch dl div { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; }
.told-patch dt { font-weight: 800; color: var(--ink); }
.told-patch dd { margin: 0; color: var(--ink-2); }
.told-patch .partial { color: var(--red); font-weight: 700; }
.told-patch .wishknit { margin: 24px 0 0; padding-top: 20px; border-top: 2px solid var(--wool-2); }
.transcript .intro { margin-top: 14px; color: var(--ink-2); max-width: 40em; }
.foot-strip:empty { display: none; }

.transcript .sample-tag, .notes .sample-tag { display: inline-flex; align-items: center; min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--red); color: #fff; font-weight: 800; font-size: .88rem; }
.transcript .when { margin-top: 14px; font-style: italic; color: var(--ink-2); }
.lines { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.ln { display: grid; grid-template-columns: 4.2em 1fr; gap: 12px; padding: 8px 12px; border-radius: 12px; transition: background-color .4s cubic-bezier(.2, .8, .2, 1), opacity .4s; }
.ln .who { font-weight: 800; font-size: .88rem; padding-top: 3px; color: var(--green); }
.ln.santa .who { color: var(--red); }
.ln p { color: var(--ink); }
.ln.child p { font-weight: 600; }
.ln mark { background: none; color: var(--red); font-weight: 800; box-shadow: inset 0 -.38em 0 rgba(196, 18, 47, .14); }
.ln.wait { visibility: hidden; }
.ln.now { background: var(--wool-2); }
.transcript .go-row { margin-top: 22px; display: flex; align-items: center; gap: 14px 18px; flex-wrap: wrap; }

.notes { margin-top: clamp(24px, 3vw, 40px); max-width: 52em; margin-inline: auto; }
.notes ul, .notes .lede { max-width: 46em; }
.notes .lede { margin-top: 14px; color: var(--ink-2); }
.notes .lede .sample-tag { margin-right: 8px; vertical-align: 1px; }
.notes ul { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 14px; }
.notes li { display: grid; grid-template-columns: 9em 1fr; gap: 12px; padding-bottom: 20px; background: var(--run-img) left bottom / 12px 6px repeat-x; }
.notes li:last-child { background: none; padding-bottom: 0; }
.notes li b { color: var(--ink); }
.notes li span { color: var(--ink-2); }
.notes li q { color: var(--ink); font-weight: 700; quotes: "\201C" "\201D"; }
.wishknit { display: grid; gap: 12px; margin: 0; }
.wishknit figcaption { text-align: center; color: var(--ink-2); font-size: .92rem; }
.wishknit .knitbox { width: fit-content; justify-self: center; }

/* ---- how it works ---- */
/* the steps sit straight on a band of cream knit, a break from the run of patches */
.how { padding: clamp(52px, 6vw, 88px) 0; }
.creamknit { background-color: #efe5d3; }
.how h2 { max-width: 30em; }
.steps { list-style: none; margin: 34px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps li { padding: 0 clamp(18px, 2.4vw, 34px); background: var(--runv-img) left top / 6px 12px repeat-y; }
.steps .icon { display: block; width: fit-content; margin-bottom: 16px; }
.steps .icon canvas { border-radius: 6px; }
.knitbox.icon canvas, .knitbox.tag canvas { width: auto; max-width: 100%; }
.knitbox.tag { width: fit-content; max-width: 100%; }
.steps li:first-child { padding-left: 0; background: none; }
.steps li:last-child { padding-right: 0; }
.steps h3 { display: flex; align-items: baseline; gap: 12px; }
.steps .num { font: 800 2.2rem/.8 Nunito, system-ui, sans-serif; color: var(--red); display: inline-block; }
.steps h3 { align-items: center; }
.steps p { margin-top: 12px; color: var(--ink-2); }

/* ---- promises ---- */
.promises { padding: 0 0 clamp(48px, 6vw, 80px); }
.vows { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 40px; }
.vows li { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; }
.vows .icon { width: fit-content; }
.vows b { display: block; font-size: 1.1rem; }
.vows span { color: var(--ink-2); }
.signoff { margin-top: 28px; }

/* ---- booking + gift forms ---- */
.book { padding: clamp(48px, 6vw, 80px) 0; }
.formpatch { max-width: 900px; margin-inline: auto; }
.formpatch .price { margin-top: 12px; color: var(--ink-2); font-size: 1.05rem; }
.formpatch .price b { color: var(--ink); font-size: 1.2rem; }
fieldset { border: 0; margin: 28px 0 0; padding: 0; min-width: 0; }
legend { font: 900 1.25rem/1.2 Nunito, system-ui, sans-serif; color: var(--ink); padding: 0; margin-bottom: 14px; }
.choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* option swatches: wool patches whipstitched in tan yarn, re-sewn in pine when chosen */
.choice label { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; padding: 10px 12px; min-height: 56px; background: var(--wool); border: 10px solid #e2d7c5; cursor: pointer; transition: transform .15s; }
.knit .choice label { border-color: transparent; border-image: var(--opt-img) 10 round; background: var(--wool-img) 0 0 / var(--wool-size) padding-box; }
.choice label:hover { transform: translateY(-1px); }
.choice label:has(input:checked) { border-color: var(--green); background: #eef6f1; }
.knit .choice label:has(input:checked) { border-image: var(--opt-on-img) 10 round; background: var(--woolg-img) 0 0 / var(--woolg-size) padding-box; }
.choice input { accent-color: var(--green); width: 26px; height: 26px; margin: 0; }
/* wooden buttons: four holes, and a cross of pine yarn once the option is sewn on */
.knit .choice input, .knit .consent input {
  appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--b-off-img) center / 26px 26px no-repeat; transition: transform .15s;
}
.knit .choice input:checked, .knit .consent input:checked { background-image: var(--b-on-img); }
.knit .choice label:hover input, .knit .consent:hover input { transform: scale(1.06); }
.wbtn { flex: none; width: 32px; height: 32px; background: var(--b-plus-img) center / 32px 32px no-repeat; }
details[open] > summary .wbtn { background-image: var(--b-minus-img); }
.choice b { display: block; }
.choice span span { display: block; color: var(--ink-2); font-size: .94rem; margin-top: 2px; }
.dear { margin-top: 30px; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin-top: 16px; }
.field { display: grid; gap: 6px; align-content: start; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 800; font-size: .96rem; }
.field label small { font-weight: 600; color: var(--ink-2); }
.field .hint { color: var(--ink-2); font-size: .88rem; }
/* fields: a flat wool-2 reading surface inside a running stitch of tan yarn, pine thread on focus */
input:not([type="radio"]):not([type="checkbox"]), select {
  width: 100%; min-height: 50px; padding: 0 10px;
  font: 700 1rem/1.2 Nunito, system-ui, sans-serif; color: var(--ink);
  background: #fbf6ec padding-box; border: 6px solid #e2d7c5; border-radius: 0;
}
.knit input:not([type="radio"]):not([type="checkbox"]), .knit select { border-color: transparent; border-image: var(--field-img) 6 round; }
input::placeholder { color: #7b6268; font-weight: 400; font-style: italic; }
input:focus, select:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px rgba(29, 107, 69, .25); }
.knit input:not([type="radio"]):not([type="checkbox"]):focus, .knit select:focus { border-image-source: var(--field-on-img); }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 6l5 5 5-5' fill='none' stroke='%232b0a12' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right 10px center / 14px 14px no-repeat padding-box, #fbf6ec padding-box; }
input[type="date"]::-webkit-calendar-picker-indicator { width: 22px; height: 22px; opacity: 1; cursor: pointer; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Crect x='2.5' y='4.5' width='17' height='15' rx='2' fill='none' stroke='%232b0a12' stroke-width='2'/%3E%3Cpath d='M2.5 9.5h17M7 2.5v4M15 2.5v4' stroke='%232b0a12' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='14' r='1.6' fill='%23c4122f'/%3E%3C/svg%3E") center / 20px 20px no-repeat; }
.pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; margin-top: 14px; }
.pick[hidden], .choice label[hidden] { display: none; }
.consent { display: grid; grid-template-columns: 26px 1fr; gap: 12px; margin-top: 26px; align-items: start; cursor: pointer; font-weight: 600; }
.consent input { width: 26px; height: 26px; margin: 0; accent-color: var(--green); }
.havecode { margin-top: 18px; }
.havecode summary { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 800; color: var(--green); cursor: pointer; list-style: none; }
.havecode summary::-webkit-details-marker { display: none; }
.havecode summary .wbtn { width: 28px; height: 28px; background-size: 28px 28px; }
.codebox { display: grid; gap: 8px; margin-top: 6px; max-width: 520px; }
.codebox label { font-weight: 800; font-size: .95rem; }
.codebox > div { display: flex; gap: 10px; }
.codebox .toggle { min-height: 50px; padding: 0 22px; }
.hint.ok, .msg.ok { color: var(--green); font-weight: 700; }
.hint.err, .msg.err { color: var(--red); font-weight: 700; }
.go { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 28px; }
.go .toggle { min-height: 60px; padding: 0 38px; font-size: 1.12rem; }
.msg { font-weight: 600; }
.terms { margin-top: 18px; color: var(--ink-2); font-size: .92rem; }
.tick { margin-top: 16px; padding-top: 20px; background: var(--run-img) left top / 12px 6px repeat-x; color: var(--ink-2); }
.tick b { color: var(--red); }

.gift { padding: 0 0 clamp(48px, 6vw, 80px); }

/* ---- FAQ ---- */
.faq { padding: clamp(48px, 6vw, 80px) 0; }
.faq .patch { max-width: 900px; margin-inline: auto; }
.faq details { padding-bottom: 6px; background: var(--run-img) left bottom / 12px 6px repeat-x; }
.faq details:last-child { background: none; padding-bottom: 0; }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 10px 0; font-weight: 800; font-size: 1.08rem; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }

.faq details p { padding: 0 0 18px; color: var(--ink-2); max-width: 62ch; }
.faq details a { color: var(--green); font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }
.pm { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.pm .v { transition: opacity .2s; }
details[open] > summary .pm .v { opacity: 0; }

/* ---- hem: ribbed waistband ---- */
.hem { background-color: var(--green); color: #fff; }
.hem-in { display: grid; gap: 22px; padding: 30px 0 32px; }
.hem-top { display: flex; align-items: center; justify-content: space-between; gap: 20px 32px; flex-wrap: wrap; }
/* the woven care label, sewn to the hem with a running stitch */
.carelabel {
  display: grid; gap: 2px; max-width: 440px; padding: 10px 14px; color: var(--ink); font-size: .92rem; line-height: 1.45;
  background: var(--wool); border: 10px solid transparent;
}
.knit .carelabel { border-image: var(--label-img) 8 round; border-width: 8px; }
.hem .carelabel .brand { color: var(--ink); }
.carelabel b { font-size: 1rem; }
.hem .carelabel a { color: var(--ink); min-height: 0; display: inline; font-weight: 700; }
.hem .carelabel span { color: var(--ink-2); display: block; }
.hem-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 28px; }
.hem .hem-links span { gap: 0; }
.hem a { color: #fff; font-weight: 700; display: inline-flex; align-items: center; min-height: 44px; }
.hem span { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 6px; }

/* ---- responsive ---- */
@media (max-width: 960px) {
  .hero-in, .call-in, .notes { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 24px; }
  .steps li { padding: 24px 0 0; background: var(--run-img) left top / 12px 6px repeat-x; }
  .steps li:first-child { padding-top: 0; background: none; }
  .vows { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 28px); }
  .collar nav a:not(.toggle) { display: none; }
  .mark { font-size: 1.55rem; }
  .patch { --pt: 26px; --px: 22px; }
  .knit .patch { border-width: 12px; }
  .patch::before { inset: 8px; }
  .knit .toggle:not(.sm):not(.codebox .toggle) { padding-left: 60px; background-position: 14px 50%, 0 0; }
  .foot-strip { position: relative; z-index: 2; margin: 18px -22px -26px; padding: 12px 14px 14px; background: var(--wool); border-top: 2px solid var(--wool-2); border-radius: 0 0 12px 12px; }
  .foot-strip .wishknit { gap: 8px; }
  .transcript.playing .foot-strip { position: sticky; bottom: 0; }
  .call-side { position: static; }
  .patch > .cuff { margin-bottom: 20px; }
  .hem-top { flex-direction: column; align-items: flex-start; }
  .choice, .choice.two, .fields, .pick { grid-template-columns: 1fr; }
  .told-patch dl div, .notes li, .ln { grid-template-columns: 1fr; gap: 2px; }
  .go .toggle, .ctas .toggle { width: 100%; max-width: 360px; }
  .codebox > div { flex-direction: column; }
  .hem-links { flex-direction: column; }
  .hem-links span { display: block; }
  .hem-links a { display: inline-flex; }
}
.motif .vh { color: #fff; }


/* ============ the fun layer: battery lights, the reindeer's nose, the jingle bell, the ugliness dial ============ */
.collar-in { gap: 12px; }
.collar nav { gap: 2px; }
.brand { display: flex; align-items: center; gap: 2px; min-width: 0; }
.mark[data-knit-text] { width: auto; }
/* the bell, on its yarn loop, hung from the last letter of the wordmark */
.bell { flex: none; width: 44px; height: 44px; margin: 6px 0 0 -2px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 10px; }
.bell svg { display: block; width: 28px; height: 38px; margin: 0 auto; overflow: visible; }
.bell .swing { transform-origin: 14px 8px; }
.bell:hover .swing { transform: rotate(6deg); }
@keyframes swing { 0% { transform: rotate(0); } 15% { transform: rotate(-20deg); } 35% { transform: rotate(16deg); } 55% { transform: rotate(-9deg); } 75% { transform: rotate(4deg); } 100% { transform: rotate(0); } }
.bell.ring .swing { animation: swing 1s cubic-bezier(.3, .7, .3, 1) both; }
/* the lights switch: a painted wooden button sliding in a dark slot */
.lightsw { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: #fff; font: 800 .95rem/1 Nunito, system-ui, sans-serif; cursor: pointer; border-radius: 999px; }
.lightsw:hover { background: rgba(255, 255, 255, .12); }
.lightsw .sw { position: relative; width: 42px; height: 22px; border-radius: 11px; background: #14301f; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6); }
.lightsw .sw::before { content: ""; position: absolute; top: 2px; left: 22px; width: 18px; height: 18px; border-radius: 50%; background: var(--b-on-img) center / 18px 18px no-repeat; transition: left .2s cubic-bezier(.2, .8, .2, 1); }
.lightsw[aria-pressed="false"] .sw::before { left: 2px; background-image: var(--b-off-img); }
/* the string of lights: a wire with drawn bulbs, blinking in three phases */
.lights { position: absolute; pointer-events: none; overflow: visible; }
.collarband { position: relative; }
.collarband .lights { left: 0; top: 0; width: 100%; height: 100%; }
.hero-patch { position: relative; }
.lights-patch { inset: -16px; width: calc(100% + 32px); height: calc(100% + 32px); z-index: 3; }
.lights .wire { fill: none; stroke: #16221a; stroke-width: 3.2; stroke-linecap: round; }
.lights .wire2 { fill: none; stroke: #3f8a5f; stroke-width: 1.2; stroke-dasharray: 7 9; stroke-linecap: round; }
.lights .tack { fill: none; stroke: #e2d7c5; stroke-width: 2.2; stroke-linecap: round; }
.lights .glow { opacity: .3; cy: 11; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes glowblink { 0%, 100% { opacity: .32; } 50% { opacity: .06; } }
.bulb .lamp { animation: blink 2.1s ease-in-out infinite; }
.bulb .glow { animation: glowblink 2.1s ease-in-out infinite; }
.bulb.b1 * { animation-delay: .7s; }
.bulb.b2 * { animation-delay: 1.4s; }
.lights-off .bulb .lamp, .lights-off .bulb .glow { animation: none; opacity: .4; }
.lights-off .bulb .glow { opacity: 0; }
/* the reindeer's nose: a red LED stitch, on the same blink as the string */
.nose { position: absolute; left: 43.75%; top: 58%; width: 2.6%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ff9a8a, #e5342b 55%, #9e0f1a); animation: blink 2.1s ease-in-out .7s infinite; }
.nose::after { content: ""; position: absolute; inset: -140%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 90, 60, .55), rgba(255, 70, 50, .18) 40%, rgba(255, 70, 50, 0) 70%); pointer-events: none; }
.lights-off .nose { animation: none; opacity: .75; }
.lights-off .nose::after { display: none; }
/* the dial */
.dial { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 6px 0 0; padding: 0; border: 0; min-width: 0; }
.dial legend { float: left; margin: 0 8px 0 0; padding: 0; color: #fff; font: 900 .95rem/1 Nunito, system-ui, sans-serif; text-shadow: 0 1px 2px rgba(60, 0, 10, .6); }
.dial label { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 10px; border-radius: 999px; color: #fff; font: 800 .95rem/1 Nunito, system-ui, sans-serif; cursor: pointer; background: var(--red-deep); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18); text-shadow: 0 1px 2px rgba(60, 0, 10, .6); }
.knit .dial label { background: var(--btnd-img) 0 0 / var(--btnd-size); }
.dial input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; border: 0; border-radius: 50%; background: var(--b-off-img) center / 26px 26px no-repeat; cursor: pointer; }
.dial input:checked { background-image: var(--b-on-img); }
.dial label:has(input:checked) { background-color: var(--green); }
.knit .dial label:has(input:checked) { background: var(--btn-img) 0 0 / var(--btn-size); box-shadow: inset 0 0 0 2px #3a9b6b; }
.dial input:focus-visible { outline: 3px solid var(--wool); outline-offset: 3px; }
/* cozy: the lights go away and the motif bands quiet down (the renderer swaps them) */
html[data-ugly="cozy"] .lights, html[data-ugly="cozy"] .nose, html[data-ugly="cozy"] .lightsw { display: none; }
html[data-ugly="cozy"] .bell { display: none; }
/* office party: tinsel along every band, pompoms on the patch corners, HO HO HO blinking in the sleeps band */
.hoho { display: none; }
.motif { position: relative; }
html[data-ugly="office"] .band:not(.cuff) { position: relative; z-index: 1; }
html[data-ugly="office"] .band:not(.cuff)::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 32px; background: var(--tinsel-img) 0 0 / 64px 32px repeat-x; pointer-events: none; z-index: 2; }
html[data-ugly="office"] .hero-patch::after, html[data-ugly="office"] .formpatch::after, html[data-ugly="office"] .faq .patch::after {
  content: ""; position: absolute; inset: -19px; pointer-events: none; z-index: 4;
  background: var(--pom-img) left top / 38px 38px no-repeat, var(--pom-img) right top / 38px 38px no-repeat, var(--pom-img) left bottom / 38px 38px no-repeat, var(--pom-img) right bottom / 38px 38px no-repeat;
}
@keyframes hoho-a { 0%, 48% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes hoho-b { 0%, 48% { opacity: 0; } 50%, 100% { opacity: 1; } }
html[data-ugly="office"] .hoho { display: block; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); animation: hoho-b 3s steps(1, end) infinite; }
html[data-ugly="office"] .sleeps:not(.hoho) { animation: hoho-a 3s steps(1, end) infinite; }
@media (prefers-reduced-motion: reduce) {
  .bulb .lamp, .bulb .glow, .nose, .bell.ring .swing { animation: none !important; }
  html[data-ugly="office"] .hoho { position: static; transform: none; animation: none; }
  html[data-ugly="office"] .sleeps:not(.hoho) { animation: none; }
}
/* ---- booked: the page turns into the celebration ---- */
.is-booked main > :not(#booked) { display: none; }
.booked { position: relative; min-height: calc(100svh - 120px); padding: clamp(36px, 5vw, 64px) 0 clamp(48px, 6vw, 80px); }
.booked-in { position: relative; z-index: 1; display: grid; gap: clamp(28px, 4vw, 48px); }
.booked-top { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.booked #booked-h:focus { outline: none; }
#booked-h { font-size: clamp(2.6rem, 4.6vw, 4rem); line-height: 1; } /* an H2 that keeps the H1 look: the page has one H1 */
.booked-patch .lead { margin-top: 22px; font-size: 1.16rem; color: var(--ink-2); }
.ticket { margin: 22px 0 0; padding: 18px 0; display: grid; gap: 10px; border-block: 2px solid var(--wool-2); }
.ticket div { display: grid; grid-template-columns: 8.5em 1fr; gap: 12px; }
.ticket dt { font-weight: 800; color: var(--ink); }
.ticket dd { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.ticket #booked-when { color: var(--red); font-weight: 800; }
.booked .fine b { font-size: inherit; overflow-wrap: anywhere; }
.again-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 48px); margin-top: 26px; }
.again-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: start; }
.again-card .icon { grid-row: span 2; }
.again-card p { color: var(--ink-2); }
.again-card .toggle { grid-column: 2; justify-self: start; margin-top: 12px; }
.snowfall { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.snowfall img { position: absolute; top: -40px; left: var(--x); animation: fall var(--t) linear var(--d) infinite; will-change: transform; }
.burst { position: fixed; left: 0; top: 0; z-index: 6; pointer-events: none; will-change: transform, opacity; }
@keyframes fall { 0% { transform: translate(0, 0) rotate(0) scale(var(--s)); } 50% { transform: translate(var(--sway), 55vh) rotate(90deg) scale(var(--s)); } 100% { transform: translate(0, 110vh) rotate(180deg) scale(var(--s)); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.97); } }
@media (prefers-reduced-motion: no-preference) {
  .is-booked .booked-patch { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
  .is-booked .booked-top .motif { animation: rise .6s .15s cubic-bezier(.2, .8, .2, 1) both; }
  .is-booked .again { animation: rise .6s .45s cubic-bezier(.2, .8, .2, 1) both; }
}
@media (max-width: 960px) {
  .booked-top, .again-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .ticket div { grid-template-columns: 1fr; gap: 0; }
  .again-card .toggle { grid-column: 1 / -1; width: 100%; }
  .booked .ctas .toggle { max-width: none; }
  #booked-h canvas { max-width: 100%; height: auto !important; } /* a long name in one word can outrun the knitted label */
}
@media (max-width: 720px) {
  .mark { font-size: 1.25rem; white-space: nowrap; }
  .collar-in { gap: 6px; }
  .collar nav { gap: 0; }
  .collar .toggle.sm { padding: 0 12px; margin-left: 0; white-space: nowrap; font-size: .9rem; }
  .bell { width: 36px; margin-left: 0; }
  .lightsw { padding: 0 4px; }
  .lightsw .sw { width: 36px; }
  .lightsw .sw::before { left: 16px; }
  .lightsw .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lights-patch { inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); }
  .dial { gap: 8px; }
  .dial legend { float: none; width: 100%; margin: 0 0 2px; }
  .dial label { flex: 1 1 0; justify-content: center; padding: 0 10px 0 8px; font-size: .9rem; white-space: nowrap; }
  .go .toggle { padding: 0 20px; font-size: 1.02rem; white-space: nowrap; }
  .knit .toggle.go-main { padding-left: 54px; }
  html[data-ugly="office"] .hero-patch::after, html[data-ugly="office"] .formpatch::after, html[data-ugly="office"] .faq .patch::after { inset: -16px; background-size: 30px 30px, 30px 30px, 30px 30px, 30px 30px; }
}
