/* SendJoy — notebook paper, crayons and kids' art. */
@font-face { font-family: 'Grandstander'; src: url('/fonts/grandstander.woff') format('woff'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/fonts/atkinson-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson Hyperlegible'; src: url('/fonts/atkinson-700.woff') format('woff'); font-weight: 700; font-display: swap; }
:root {
  --paper: #FFFFFF;
  --rule: #D9E8F6;
  --margin: #F4A6A6;
  --ink: #2E2A6B;
  --ink-soft: #5B5893;
  --red: #E8424F;
  --yellow: #FFC233;
  --sky: #3E9BE8;
  --green: #2BAE66;
  --pink: #FF79B0;
  --tint-yellow: #FFE9A8;
  --tint-red: #FFD0D3;
  --tint-sky: #D3E8FC;
  --tint-green: #CFF0DC;
  --tint-pink: #FFDAEA;
  --display: 'Grandstander', 'Comic Sans MS', 'Chalkboard SE', cursive;
  --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --line: 32px;
  --gutter: clamp(20px, 5vw, 64px);
  --margin-x: clamp(14px, 4vw, 56px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 2px), var(--rule) calc(var(--line) - 2px), var(--rule) var(--line));
  background-position: 0 14px;
  min-height: 100vh;
  overflow-x: hidden;
}
/* the red margin line of school paper */
body::before {
  content: '';
  position: fixed;
  top: 0; bottom: 0;
  left: var(--margin-x);
  width: 2px;
  background: var(--margin);
  pointer-events: none;
  z-index: 0;
}
main, header, footer { position: relative; z-index: 1; }

a { color: var(--sky); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; border-radius: 6px; }
img { max-width: 100%; }
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.12; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.5rem, 6.4vw, 4.6rem); }
h2 { font-size: clamp(2rem, 4.4vw, 3rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1em; max-width: 64ch; }
.lede { font-size: 1.2rem; color: var(--ink-soft); }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding-left: calc(var(--margin-x) + var(--gutter)); padding-right: var(--gutter); }

/* ---------- header ---------- */
.site-header { padding: 18px 0 8px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.9rem; letter-spacing: -0.02em; color: var(--ink); }
.logo-mark { width: 44px; height: 44px; }
.logo .l1 { color: var(--red); } .logo .l2 { color: #E8A100; } .logo .l3 { color: var(--green); } .logo .l4 { color: var(--sky); } .logo .l5 { color: var(--pink); }
.nav { display: flex; align-items: center; gap: 22px; font-weight: 700; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { color: var(--red); text-decoration: underline wavy var(--yellow); }
.nav-toggle { display: none; background: none; border: 3px solid var(--ink); border-radius: 12px; font: inherit; font-weight: 700; color: var(--ink); padding: 6px 12px; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; right: var(--gutter); top: 70px; flex-direction: column; align-items: stretch; gap: 0; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--yellow); padding: 8px; z-index: 20; min-width: 200px; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 12px; }
  .nav .btn { margin-top: 6px; }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font-family: var(--display); font-weight: 800; font-size: 1.15rem; line-height: 1;
  padding: .8em 1.3em; border-radius: 999px; border: 3px solid var(--ink);
  background: var(--red); color: #fff; text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.btn:hover { color: #fff; transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.secondary { background: #fff; color: var(--ink); }
.btn.secondary:hover { color: var(--ink); }
.btn.small { font-size: 1rem; padding: .6em 1em; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--ink); }

/* ---------- hero ---------- */
.hero { padding: clamp(24px, 5vw, 64px) 0 clamp(32px, 6vw, 80px); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(24px, 4vw, 56px); }
.hero h1 { margin-bottom: .35em; }
.hero h1 .scribble { position: relative; white-space: nowrap; }
.hero h1 .scribble svg { position: absolute; left: -2%; bottom: -.18em; width: 104%; height: .42em; overflow: visible; }
.hero .lede { font-size: clamp(1.15rem, 2vw, 1.35rem); margin-bottom: 1.4em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }
.hero-note { margin-top: 1.4em; font-size: .98rem; color: var(--ink-soft); display: flex; gap: 8px; align-items: center; }
.hero-note .icon { color: var(--pink); width: 1.3em; height: 1.3em; flex: none; }
.hero-art { position: relative; }
.hero-art svg { width: 100%; height: auto; display: block; overflow: visible; }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { max-width: 300px; justify-self: center; order: -1; margin-bottom: -10px; }
}

/* singing envelope: the one animated moment */
.note-float { opacity: 0; animation: float-note 3.6s ease-out infinite; transform-box: fill-box; }
.note-float.n2 { animation-delay: 1.2s; }
.note-float.n3 { animation-delay: 2.4s; }
@keyframes float-note {
  0% { opacity: 0; transform: translate(0, 18px) rotate(-8deg) scale(.7); }
  18% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(26px, -70px) rotate(12deg) scale(1.05); }
}
.env-mouth { animation: sing 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes sing { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.6); } }

/* ---------- sections ---------- */
section { padding: clamp(40px, 7vw, 88px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(24px, 4vw, 44px); }
.section-head p { color: var(--ink-soft); font-size: 1.12rem; }

/* products as taped pieces of construction paper */
.joys { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(28px, 4vw, 44px) clamp(22px, 3vw, 36px); }
.joy {
  position: relative; display: flex; flex-direction: column;
  padding: 34px 26px 24px; background: var(--tint); color: var(--ink);
  border-radius: 6px 10px 8px 12px / 10px 6px 12px 8px;
  transform: rotate(var(--tilt, -1deg));
  box-shadow: 0 2px 0 rgba(46,42,107,.06), 0 14px 24px -14px rgba(46,42,107,.35);
}
.joy::before { /* tape */
  content: ''; position: absolute; top: -13px; left: var(--tape-x, 38%); width: 92px; height: 28px;
  background: rgba(255, 246, 214, .78); border: 1px dashed rgba(46,42,107,.12);
  transform: rotate(var(--tape-r, -4deg)); box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.joy:nth-child(3n+1) { --tilt: -1.4deg; --tape-x: 14%; --tape-r: -6deg; }
.joy:nth-child(3n+2) { --tilt: 1.1deg; --tape-x: 54%; --tape-r: 5deg; }
.joy:nth-child(3n+3) { --tilt: -.5deg; --tape-x: 34%; --tape-r: -2deg; }
.joy[data-color=yellow] { --tint: var(--tint-yellow); --accent: #D99500; }
.joy[data-color=red] { --tint: var(--tint-red); --accent: var(--red); }
.joy[data-color=sky] { --tint: var(--tint-sky); --accent: var(--sky); }
.joy[data-color=green] { --tint: var(--tint-green); --accent: var(--green); }
.joy[data-color=pink] { --tint: var(--tint-pink); --accent: #E5508E; }
.joy .joy-icon { width: 58px; height: 58px; color: var(--accent); margin-bottom: 10px; }
.joy h3 { margin-bottom: .3em; }
.joy p { font-size: 1.02rem; flex: 1; }
.joy .price { font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; }
.joy .price small { font-size: .95rem; font-weight: 700; color: var(--ink-soft); }
.joy .joy-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.joy .badge { position: absolute; top: 14px; right: 16px; font-family: var(--display); font-weight: 800; font-size: .9rem; background: var(--ink); color: #fff; padding: 3px 11px; border-radius: 999px; transform: rotate(4deg); }
.joy .methods { font-size: .92rem; color: var(--ink-soft); margin: -4px 0 12px; }
.joy-extras { margin-top: clamp(28px, 4vw, 40px); padding: 18px 22px; border: 3px dashed var(--ink); border-radius: 16px; display: flex; gap: 16px; align-items: center; max-width: 760px; background: #fff; }
.joy-extras .icon { width: 44px; height: 44px; color: var(--yellow); flex: none; }
.joy-extras p { margin: 0; }

/* how it works — a real sequence, so it gets crayon numbers */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 4vw, 48px); counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 70px; }
.steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  font-family: var(--display); font-weight: 800; font-size: 3.6rem; line-height: 1; color: var(--c);
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill;
}
.steps li:nth-child(1) { --c: var(--yellow); }
.steps li:nth-child(2) { --c: var(--pink); }
.steps li:nth-child(3) { --c: var(--green); }
.steps h3 { font-size: 1.35rem; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* fridge gallery */
.fridge {
  background: #F4F7FA; border: 4px solid var(--ink); border-radius: 28px;
  padding: clamp(28px, 4vw, 48px) clamp(18px, 3vw, 40px); position: relative;
  box-shadow: inset 0 -10px 0 rgba(46,42,107,.06);
}
.fridge::after { /* handle */
  content: ''; position: absolute; right: 18px; top: 40px; width: 12px; height: 120px; border-radius: 8px; background: var(--ink); opacity: .85;
}
.fridge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 28px 22px; padding-right: 24px; }
.art { margin: 0; position: relative; background: #fff; padding: 10px 10px 12px; box-shadow: 0 10px 18px -12px rgba(46,42,107,.5); transform: rotate(var(--r, 1deg)); }
.art:nth-child(4n+1) { --r: -2deg; --mag: var(--red); }
.art:nth-child(4n+2) { --r: 1.6deg; --mag: var(--sky); }
.art:nth-child(4n+3) { --r: -.8deg; --mag: var(--green); }
.art:nth-child(4n+4) { --r: 2.2deg; --mag: var(--yellow); }
.art::before { content: ''; position: absolute; top: -10px; left: 50%; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%; background: var(--mag); border: 3px solid var(--ink); z-index: 2; }
.art img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #fafafa; }
.art figcaption { font-family: var(--display); font-weight: 700; font-size: .98rem; margin-top: 6px; text-align: center; }
.art.placeholder .ph { aspect-ratio: 4 / 3; display: grid; place-items: center; background: var(--tint, #fff7e0); }
.art.placeholder svg { width: 54%; height: 54%; color: var(--accent, var(--yellow)); }
.fridge-note { margin: 22px 0 0; color: var(--ink-soft); font-size: 1rem; }

/* Joy Club band */
.club { background: var(--tint-pink); border-top: 4px dashed var(--pink); border-bottom: 4px dashed var(--pink); }
.club .wrap { display: grid; grid-template-columns: 1fr auto; gap: 28px 40px; align-items: center; }
.club ul { list-style: none; padding: 0; margin: 0 0 1em; }
.club li { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.club li .icon { color: #E5508E; width: 1.1em; height: 1.1em; flex: none; position: relative; top: .15em; }
.club-price { font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; text-align: center; }
.club-price small { display: block; font-size: 1.05rem; color: var(--ink-soft); margin-top: 6px; }
@media (max-width: 760px) { .club .wrap { grid-template-columns: 1fr; } .club-price { text-align: left; } }

/* about */
.about .wrap { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
.polaroid { width: 230px; background: #fff; padding: 12px 12px 18px; box-shadow: 0 14px 24px -14px rgba(46,42,107,.5); transform: rotate(-3deg); border: 1px solid #eee; }
.polaroid .ph { aspect-ratio: 1; background: var(--tint-sky); display: grid; place-items: center; }
.polaroid svg { width: 70%; color: var(--yellow); }
.polaroid p { font-family: var(--display); font-weight: 700; text-align: center; margin: 10px 0 0; }
@media (max-width: 760px) { .about .wrap { grid-template-columns: 1fr; } .polaroid { width: 190px; } }

/* FAQ */
.faq { max-width: 820px; }
.faq details { border-bottom: 3px dashed var(--rule); padding: 14px 0; }
.faq summary { cursor: pointer; font-family: var(--display); font-weight: 800; font-size: 1.25rem; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 1.6rem; line-height: 1; color: var(--red); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 10px 0 0; }

/* closing CTA */
.closing { text-align: left; }
.closing .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.closing h2 { margin: 0; max-width: 18ch; }

/* footer */
.site-footer { padding: 40px 0 56px; border-top: 3px solid var(--ink); background: #fff; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 18px 40px; justify-content: space-between; align-items: flex-start; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 10px 24px; font-weight: 700; }
.site-footer nav a { color: var(--ink); }
.site-footer small { color: var(--ink-soft); display: block; max-width: 46ch; }

/* ---------- forms ---------- */
.page { padding: clamp(20px, 4vw, 48px) 0 clamp(48px, 7vw, 96px); }
.page-narrow { max-width: 860px; }
label { display: block; font-weight: 700; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: .95rem; }
input[type=text], input[type=search], input[type=number], input[type=email], input[type=tel], input[type=date], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 3px solid var(--ink); border-radius: 14px; padding: 12px 14px; min-height: 52px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(62,155,232,.25); }
.field { margin-bottom: 20px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; }
@media (max-width: 620px) { .row, .row-3 { grid-template-columns: 1fr; } }
.error-box { background: var(--tint-red); border: 3px solid var(--red); border-radius: 14px; padding: 12px 16px; font-weight: 700; margin: 0 0 18px; }
.ok-box { background: var(--tint-green); border: 3px solid var(--green); border-radius: 14px; padding: 12px 16px; font-weight: 700; margin: 0 0 18px; }
[hidden] { display: none !important; }

.paper-card { background: #fff; border: 3px solid var(--ink); border-radius: 22px; padding: clamp(20px, 3vw, 34px); box-shadow: 7px 7px 0 var(--yellow); }

/* choice tiles (radio / checkbox) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice .tile { display: flex; gap: 12px; align-items: flex-start; border: 3px solid var(--ink); border-radius: 16px; padding: 14px; background: #fff; height: 100%; transition: transform .1s; }
.choice .tile .icon { width: 36px; height: 36px; flex: none; color: var(--accent, var(--sky)); }
.choice .tile b { display: block; font-family: var(--display); font-size: 1.1rem; }
.choice .tile span { font-size: .93rem; color: var(--ink-soft); display: block; }
.choice .tile .tprice { font-family: var(--display); font-weight: 800; color: var(--ink); font-size: 1.05rem; margin-top: 4px; }
.choice input:checked + .tile { background: var(--tint, var(--tint-yellow)); box-shadow: 4px 4px 0 var(--ink); transform: translate(-2px, -2px); }
.choice input:focus-visible + .tile { outline: 3px dashed var(--red); outline-offset: 3px; }
.choice[data-color=yellow] { --tint: var(--tint-yellow); --accent: #D99500; }
.choice[data-color=red] { --tint: var(--tint-red); --accent: var(--red); }
.choice[data-color=sky] { --tint: var(--tint-sky); --accent: var(--sky); }
.choice[data-color=green] { --tint: var(--tint-green); --accent: var(--green); }
.choice[data-color=pink] { --tint: var(--tint-pink); --accent: #E5508E; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pills .choice .tile { padding: 9px 16px; border-radius: 999px; font-weight: 700; align-items: center; }

/* song request */
.song-box { border: 3px dashed var(--rule); border-radius: 18px; padding: 16px 18px 18px; margin: 0 0 22px; }
.song-box legend { font-weight: 700; padding: 0 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 700; cursor: pointer; }
.check input { width: 24px; height: 24px; flex: none; margin: 2px 0 0; accent-color: var(--green); }

/* order wizard */
.order-layout { display: grid; grid-template-columns: 1fr 320px; gap: clamp(20px, 3vw, 40px); align-items: start; }
@media (max-width: 900px) { .order-layout { grid-template-columns: 1fr; } }
.progress { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; flex-wrap: wrap; }
.progress li { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink-soft); font-size: .98rem; }
.progress li span { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--ink); display: grid; place-items: center; font-family: var(--display); background: #fff; color: var(--ink); }
.progress li.on { color: var(--ink); }
.progress li.on span { background: var(--yellow); }
.progress li.done span { background: var(--green); color: #fff; }
.progress li + li::before { content: ''; width: 18px; height: 3px; background: var(--rule); border-radius: 2px; }
.step-panel h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; flex-wrap: wrap; }
.summary { position: sticky; top: 18px; }
.summary h3 { margin-bottom: 10px; }
.summary dl { margin: 0; }
.summary .srow { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 2px dashed var(--rule); font-size: .98rem; }
.summary .srow dt { color: var(--ink-soft); }
.summary .srow dd { margin: 0; font-weight: 700; text-align: right; }
.summary .total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; font-family: var(--display); font-weight: 800; font-size: 1.6rem; }
.summary .secure { font-size: .88rem; color: var(--ink-soft); margin: 10px 0 0; }

/* tracking */
.track-steps { list-style: none; padding: 0; margin: 20px 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.track-steps li { text-align: center; font-weight: 700; font-size: .95rem; color: var(--ink-soft); position: relative; }
.track-steps li .dot { width: 46px; height: 46px; margin: 0 auto 8px; border-radius: 50%; border: 3px solid var(--ink); background: #fff; display: grid; place-items: center; }
.track-steps li .dot svg { width: 26px; height: 26px; color: var(--ink); opacity: .25; }
.track-steps li.done { color: var(--ink); }
.track-steps li.done .dot { background: var(--green); }
.track-steps li.done .dot svg { color: #fff; opacity: 1; }
.track-steps li.current .dot { background: var(--yellow); }
.track-steps li.current .dot svg { opacity: 1; }
@media (max-width: 520px) { .track-steps li { font-size: .82rem; } .track-steps li .dot { width: 40px; height: 40px; } }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 2px dashed var(--rule); }
.timeline time { color: var(--ink-soft); white-space: nowrap; font-size: .95rem; min-width: 110px; }

/* legal pages */
.prose h2 { font-size: 1.6rem; margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* 404 */
.lost { text-align: left; padding: 80px 0; }
