/* ============================================================
   THE 22nd — placeholder corner (just the countdown)
   ============================================================ */

:root {
  --paper:      #f3e9d6;
  --ink:        #3c322a;
  --ink-soft:   #6b5d4f;
  --rose:       #cf8585;
  --rose-deep:  #a85a5a;
  --blush:      #efc9c1;
  --blush-pale: #f6ddd6;
  --green:      #5d6e4e;
  --green-deep: #3f4e34;
  --sage:       #9aa882;
  --ochre:      #cd9a4f;
  --n-sage:     #cdd9b6;
  --shadow-soft: 0 10px 26px rgba(60,50,42,0.18);
  --shadow-lift: 0 18px 40px rgba(60,50,42,0.26);
  --f-marker: "Permanent Marker", "Comic Sans MS", cursive;
  --f-hand:   "Caveat", "Segoe Script", cursive;
  --f-tall:   "Amatic SC", "Caveat", cursive;
  --f-serif:  "Playfair Display", Georgia, serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-serif);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(207,133,133,0.12), transparent 42%),
    radial-gradient(circle at 82% 18%, rgba(93,110,78,0.12), transparent 40%),
    radial-gradient(circle at 60% 88%, rgba(205,154,79,0.10), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.7;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.32'/%3E%3C/svg%3E");
}

:focus-visible { outline: 3px dashed var(--green); outline-offset: 3px; }

/* ---------- BACK TAB ---------- */
.back-tab {
  position: fixed;
  top: 16px; left: 16px;
  z-index: 10;
  font-family: var(--f-hand);
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  background: var(--n-sage);
  padding: 0.5rem 1rem 0.5rem 1.4rem;
  border-radius: 3px;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease;
}
.back-tab:hover, .back-tab:focus-visible { transform: rotate(0) scale(1.04); outline: none; }
.back-tab-pin {
  position: absolute;
  top: -7px; left: 12px;
  width: 14px; height: 14px;
  background: radial-gradient(circle at 35% 30%, #e98, var(--rose-deep));
  border-radius: 50%;
  box-shadow: 0 2px 3px rgba(0,0,0,0.3);
}

/* ---------- PAGE ---------- */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 90px 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.kicker {
  font-family: var(--f-hand);
  font-size: 1.4rem;
  color: var(--ink-soft);
  transform: rotate(-2deg);
}
.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.92;
  margin: 8px 0 6px;
}
.title-script {
  font-family: var(--f-hand);
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--rose-deep);
  transform: rotate(-3deg);
}
.title-marker {
  font-family: var(--f-marker);
  font-size: clamp(3.4rem, 13vw, 6rem);
  color: var(--green-deep);
}
.lede {
  font-family: var(--f-hand);
  font-size: 1.4rem;
  color: var(--ink-soft);
  margin-bottom: 2.4rem;
  transform: rotate(0.6deg);
}

/* ---------- CHALKBOARD COUNTDOWN ---------- */
.chalkboard {
  position: relative;
  width: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,255,255,0.05), transparent 50%),
    linear-gradient(160deg, #38463a, #2c3830);
  border-radius: 10px;
  padding: 3rem 1.6rem 3.4rem;
  box-shadow: var(--shadow-lift);
  transform: rotate(-1deg);
  color: var(--paper);
  overflow: hidden;
}
.chalk-frame {
  position: absolute;
  inset: 12px;
  border: 3px solid rgba(243, 233, 214, 0.4);
  border-radius: 6px;
  pointer-events: none;
}
.chalkboard::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 78% 88%, rgba(255,255,255,0.10), transparent 40%),
    radial-gradient(ellipse at 14% 16%, rgba(255,255,255,0.07), transparent 35%);
  pointer-events: none;
}

.cake-doodle { position: absolute; top: 18px; right: 26px; width: 88px; height: 78px; }
.cake-doodle svg { width: 100%; height: 100%; }
.cake-doodle path {
  fill: none;
  stroke: var(--blush-pale);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cake-body { fill: rgba(239,201,193,0.18); }
.flame {
  position: absolute;
  width: 7px; height: 11px;
  background: radial-gradient(circle at 50% 70%, #ffe39a, #ef8a3a);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  filter: blur(0.3px);
  transform-origin: bottom center;
  animation: flicker 0.45s ease-in-out infinite alternate;
}
.flame-1 { top: 16px; right: 56px; }
.flame-2 { top: 12px; right: 39px; animation-delay: 0.12s; }
.flame-3 { top: 16px; right: 22px; animation-delay: 0.24s; }
@keyframes flicker {
  from { transform: scaleY(0.85) rotate(-5deg); opacity: 0.85; }
  to   { transform: scaleY(1.12) rotate(5deg); opacity: 1; }
}

.countdown-card { position: relative; z-index: 2; }
.cc-eyebrow {
  font-family: var(--f-hand);
  font-size: 1.5rem;
  color: var(--blush);
  margin-bottom: 0.4rem;
}
.cc-eyebrow em { font-style: normal; color: var(--ochre); }
.cc-headline {
  font-family: var(--f-tall);
  font-weight: 700;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  letter-spacing: 1px;
  margin-bottom: 1.6rem;
}
.countdown {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.countdown-cell {
  background: rgba(243, 233, 214, 0.07);
  border: 2px solid rgba(243,233,214,0.28);
  border-radius: 8px 6px 9px 7px;
  padding: 0.9rem 0.6rem 0.6rem;
  min-width: 76px;
  transform: rotate(var(--tile-r, 0deg));
}
.countdown-cell:nth-child(1) { --tile-r: -2deg; }
.countdown-cell:nth-child(2) { --tile-r: 1.5deg; }
.countdown-cell:nth-child(3) { --tile-r: -1deg; }
.countdown-cell:nth-child(4) { --tile-r: 2deg; }
.countdown-num {
  display: block;
  font-family: var(--f-marker);
  font-size: clamp(2rem, 7vw, 3rem);
  color: var(--blush-pale);
  text-shadow: 0 0 6px rgba(255,255,255,0.18);
  line-height: 1;
}
.countdown-label {
  display: block;
  font-family: var(--f-hand);
  font-size: 1.05rem;
  color: var(--sage);
  margin-top: 0.3rem;
}
.cc-day {
  font-family: var(--f-marker);
  font-size: clamp(2.4rem, 8vw, 3.6rem);
  color: var(--blush-pale);
  text-shadow: 0 0 12px rgba(255,255,255,0.2);
  line-height: 1.2;
}
.chalk-note {
  position: relative;
  z-index: 2;
  font-family: var(--f-hand);
  font-size: 1.25rem;
  color: var(--sage);
  margin-top: 1.8rem;
}
.chalk-note em { font-style: normal; color: var(--blush); }

.footnote {
  font-family: var(--f-hand);
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin-top: 2.4rem;
  max-width: 42ch;
  transform: rotate(-0.5deg);
}

.site-credit {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--f-marker);
  font-size: 1.1rem;
  color: var(--green-deep);
  padding: 14px 0 10px;
}

@media (max-width: 560px) {
  .cake-doodle { width: 60px; height: 52px; top: 12px; right: 14px; }
  .flame-1 { right: 39px; top: 12px; } .flame-2 { right: 27px; top: 9px; } .flame-3 { right: 15px; top: 12px; }
}

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