/* Giggle Bells. One face (Atkinson Hyperlegible Next, shared with the main park and built for easy reading,
   so a six-year-old can read the card out loud), one radius, two inks. The play lives in the cards, never in
   the letterforms. Red is for the punchline and the objects it sits on, never a band of chrome. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  src: url('/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --pine: #153a27;
  --pine-deep: #0f2c1d;
  --ground: #e8ede8;
  --paper: #ffffff;
  --ink: #12241a;
  --ink-soft: #46574d;
  --berry: #b51d2c;
  --on-pine: #f3f6f2;
  --on-pine-soft: #b9cbbf;
  --rule: #c9d3cb;
  --radius: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --wrap: 1180px;
  --face: 'Atkinson Hyperlegible Next', system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 1.125rem/1.55 var(--face);
  font-variant-numeric: lining-nums;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--berry); }
:focus-visible { outline: 3px solid var(--berry); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; z-index: 10; background: var(--paper); padding: 8px 14px; }

/* Masthead */
.top { background: var(--pine); color: var(--on-pine); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.mark { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; text-decoration: none; color: var(--on-pine); white-space: nowrap; }
.mark:hover { color: var(--on-pine); }
.nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; padding: 8px 0; }
.nav a { color: var(--on-pine-soft); text-decoration: none; font-size: 1rem; padding: 6px 0; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--on-pine); text-decoration: underline; }
@media (max-width: 760px) {
  .top .wrap { gap: 0; }
  .nav { margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) 10px; width: calc(100% + var(--gutter) * 2); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

/* Type */
h1, h2, h3 { font-weight: 800; letter-spacing: -0.02em; line-height: 1.08; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.4rem, 6.2vw, 4.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
p { margin: 0; }
.lede { font-size: clamp(1.15rem, 1.9vw, 1.35rem); max-width: 40em; text-wrap: pretty; }

/* Page head */
.head { padding: clamp(36px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.head .lede { margin-top: 18px; }
.head .tools { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; }

/* Controls: one solid button per screen, the rest outline */
.btn {
  font: 700 1rem/1 var(--face); border-radius: 999px; padding: 13px 20px; min-height: 46px;
  border: 2px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
  transition: background-color .18s, color .18s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(.97); }
.btn.solid { background: var(--berry); border-color: var(--berry); color: #fff; }
.btn.solid:hover { background: #95131f; border-color: #95131f; }
.on-pine .btn { border-color: var(--on-pine); color: var(--on-pine); }
.on-pine .btn:hover { background: var(--on-pine); color: var(--pine); }
.on-pine .btn.solid { background: var(--berry); border-color: var(--berry); color: #fff; }

/* The joke card: the product */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin: 20px 0 8px; padding: 0; list-style: none; }
.card {
  background: var(--paper); border-radius: var(--radius); padding: 22px 22px 16px;
  display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 24px;
}
.card .q { font-weight: 700; font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.01em; text-wrap: pretty; }
.card .a { color: var(--berry); font-weight: 700; font-size: 1.3rem; line-height: 1.3; text-wrap: pretty; }
.card .lines { font-weight: 700; font-size: 1.2rem; line-height: 1.4; }
.card .lines span { display: block; }
.card .lines span:nth-child(even) { color: var(--ink-soft); padding-left: 1.2em; }
.card .acts { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.card .acts button {
  font: 700 .95rem/1 var(--face); background: none; border: 0; padding: 10px 2px; min-height: 44px;
  color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.card .acts button + button { margin-left: auto; color: var(--ink-soft); }
.card .acts button:hover { color: var(--berry); }
.card:target { outline: 3px solid var(--berry); outline-offset: 2px; }
.js .card:not(.open) .a { display: none; }
.no-js .reveal { display: none; }

.group { margin-top: clamp(32px, 5vw, 56px); }
.group > h2 { margin-bottom: 4px; }
.group > p { color: var(--ink-soft); max-width: 40em; }

/* Home hero: a table of cards on pine */
.hero { background: var(--pine); color: var(--on-pine); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(48px, 8vw, 104px); }
.hero h1 { color: var(--on-pine); }
.hero .lede { color: var(--on-pine-soft); margin-top: 18px; }
.hero .lede strong { color: var(--on-pine); font-weight: 700; }
.table { position: relative; display: grid; place-items: center; padding: 28px 0; }
.deck { position: absolute; width: min(100%, 440px); height: 78%; border-radius: var(--radius); background: var(--paper); opacity: .14; }
.deck.d1 { transform: rotate(-8deg) translate(-16px, 6px); }
.deck.d2 { background: var(--berry); opacity: 1; transform: rotate(5deg) translate(22px, -4px); }
.today {
  position: relative; z-index: 1; margin: 0 auto; width: min(100%, 440px); background: var(--paper); color: var(--ink);
  border-radius: var(--radius); padding: 28px 28px 20px; transform: rotate(-1.5deg);
  display: flex; flex-direction: column; gap: 14px; min-height: 270px;
}
.today .tag { font-size: .95rem; color: var(--ink-soft); font-weight: 700; }
.today .q { font-size: clamp(1.45rem, 2.6vw, 1.8rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.today .a { font-size: clamp(1.3rem, 2.4vw, 1.6rem); font-weight: 800; color: var(--berry); line-height: 1.25; }
.js .today:not(.open) .a { display: none; }
.today .acts { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; }
.today .btn { border-color: var(--ink); color: var(--ink); }
.today .btn:hover { background: var(--ink); color: #fff; }
.today .btn.solid { color: #fff; border-color: var(--berry); }
.today .from { font-size: .95rem; color: var(--ink-soft); }
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .table { padding: 8px 0 0; }
  .deck { display: none; }
  .today { transform: none; min-height: 0; padding: 22px 20px 16px; }
  .today .btn { padding: 12px 16px; }
}
@media (prefers-reduced-motion: no-preference) {
  .today.flip { animation: flip .32s ease-out; }
  @keyframes flip { from { transform: rotate(-1.5deg) rotateX(70deg); } to { transform: rotate(-1.5deg) rotateX(0); } }
}

/* Piles: each section of the site as a stack of cards */
.piles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 28px 24px; margin: 28px 0 0; padding: 0; list-style: none; }
.pile a {
  display: flex; flex-direction: column; gap: 10px; min-height: 176px; text-decoration: none; color: var(--ink);
  background: var(--paper); border-radius: var(--radius); padding: 20px; position: relative; z-index: 1;
  margin: 0 12px 12px 0;
}
.pile { position: relative; }
.pile::before, .pile::after { content: ''; position: absolute; inset: 0 12px 12px 0; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--rule); }
.pile::before { transform: translate(12px, 12px); }
.pile::after { transform: translate(6px, 6px); }
.pile a:hover .pile-name { color: var(--berry); }
.pile-name { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.pile-count { color: var(--ink-soft); font-size: 1rem; }
.pile-sample { margin-top: auto; font-weight: 700; line-height: 1.3; }

/* How families use them */
.uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 20px 32px; margin-top: 22px; }
.uses p { max-width: 26em; }

/* Sections */
.band { padding: clamp(40px, 7vw, 80px) 0; }
.band + .band { padding-top: 0; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 64px); align-items: start; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }

/* The door to the main park */
.lane { background: var(--pine-deep); color: var(--on-pine); padding: clamp(44px, 7vw, 84px) 0; }
.lane h2 { color: var(--on-pine); max-width: 18em; }
.lane p { color: var(--on-pine-soft); max-width: 36em; margin-top: 14px; }
.lane .acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* Advent doors */
.doors { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; margin-top: 24px; padding: 0; list-style: none; }
.door { background: var(--paper); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 190px; scroll-margin-top: 24px; }
.door .day { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.door .q { font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.door .a { color: var(--berry); font-weight: 700; font-size: 1.12rem; line-height: 1.3; }
.door .acts button { font: 700 .95rem/1 var(--face); background: none; border: 0; padding: 10px 0; min-height: 44px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; cursor: pointer; color: var(--ink); margin-top: auto; }
.js .door:not(.open) .a { display: none; }
.js .door.locked .q, .js .door.locked .acts { display: none; }
.door .wait { display: none; color: var(--ink-soft); }
.js .door.locked .wait { display: block; margin-top: auto; }
.js .door.locked { background: var(--pine); color: var(--on-pine); }
.js .door.locked .wait { color: var(--on-pine-soft); }
.door.is-today { outline: 3px solid var(--berry); }
.door.christmas { grid-column: 1 / -1; background: var(--pine); color: var(--on-pine); min-height: 0; }
.door.christmas blockquote { margin: 0; font-size: clamp(1.2rem, 2.2vw, 1.5rem); line-height: 1.45; max-width: 38em; }
.door.christmas cite { font-style: normal; color: var(--on-pine-soft); font-weight: 700; }
.js .door.christmas.locked blockquote, .js .door.christmas.locked cite { display: none; }

/* Would you rather */
.wyr { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.wyr li { background: var(--paper); border-radius: var(--radius); padding: 20px 22px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px 20px; align-items: start; }
.wyr .n { grid-column: 1 / -1; color: var(--ink-soft); font-weight: 700; font-size: .95rem; }
.wyr .opt { font-weight: 700; font-size: 1.2rem; line-height: 1.3; }
.wyr .opt small { display: block; font-weight: 400; font-size: 1rem; color: var(--ink-soft); margin-top: 6px; }
.wyr .or { font-weight: 800; color: var(--berry); padding-top: 2px; }
@media (max-width: 640px) { .wyr li { grid-template-columns: 1fr; } }

.stage[open] { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; border: 0; padding: 0; background: var(--pine); color: var(--on-pine); }
.stage::backdrop { background: var(--pine); }
.stage .inner { height: 100%; display: grid; grid-template-rows: auto 1fr auto; padding: clamp(16px, 3vw, 40px); gap: 16px; }
.stage .bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; }
.stage .halves { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 3vw, 32px); align-items: stretch; }
.stage .half { border-radius: var(--radius); padding: clamp(20px, 4vw, 48px); display: flex; flex-direction: column; justify-content: center; gap: 18px; background: var(--paper); color: var(--ink); }
.stage .half.b { background: var(--berry); color: #fff; }
.stage .half .big { font-size: clamp(1.6rem, 4vw, 3.4rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.stage .half .move { font-size: clamp(1.1rem, 2.2vw, 1.7rem); font-weight: 700; }
.stage .ask { font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 800; text-align: center; }
.stage .half .move { opacity: .85; }
.stage .nav2 { display: flex; justify-content: center; gap: 12px; }
@media (max-width: 640px) { .stage .halves { grid-template-columns: 1fr; } }

/* Songs */
.song { background: var(--paper); border-radius: var(--radius); padding: clamp(22px, 4vw, 40px); margin-top: 24px; scroll-margin-top: 24px; }
.song .tune { color: var(--ink-soft); margin-top: 6px; }
.song .parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 24px 40px; margin-top: 22px; }
.song h3 { color: var(--berry); font-size: 1.05rem; margin-bottom: 6px; }
.song .verse p { font-size: 1.15rem; line-height: 1.5; }

/* Prose (about, notes) */
.prose { max-width: 40em; }
.prose p + p, .prose h2 + p, .prose p + h2 { margin-top: 16px; }
.prose h2 { margin-top: 36px; }
.note { color: var(--ink-soft); margin-top: 18px; max-width: 42em; }
.more { margin-top: clamp(40px, 6vw, 64px); }
.more ul { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.more a { font-weight: 700; }

/* Footer */
.foot { padding: 36px 0 48px; color: var(--ink-soft); font-size: 1rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.toast.show { opacity: 1; }

/* Print: every answer shown, no chrome, cards cut-ready */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; font-size: 12pt; }
  .top, .foot, .lane, .tools, .acts, .more, .skip, .table, .toast, .stage { display: none !important; }
  .head { padding: 0 0 8mm; }
  h1 { font-size: 24pt; }
  .lede { font-size: 12pt; }
  .card .a, .door .a, .door .q, .today .a { display: block !important; }
  .door.locked .wait { display: none !important; }
  .cards, .doors { grid-template-columns: 1fr 1fr; gap: 0; }
  .card, .door, .wyr li, .song { border: 1px dashed #999; border-radius: 0; break-inside: avoid; }
  .door.christmas { background: #fff; color: #000; }
  .door.christmas cite { color: #000; }
  .group { break-inside: auto; }
}
