/* ===========================================================================
   NYC Summer Bucket List — hazy summer editorial.
   Sun-warmed sky gradient, bookish serif display type, frosted cards,
   hairline rules, a quiet gold shimmer for first place. System fonts only.
   =========================================================================== */

:root {
  --ink: #22334c;
  --ink-soft: #4c5f78;
  --muted: #7e8ca0;
  --faint: #a3b0c2;

  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --surface-2: #eef4fb;

  --line: rgba(56, 88, 132, 0.14);
  --hairline: rgba(56, 88, 132, 0.22);

  --accent: #3d74ba;
  --accent-deep: #2c5e9e;
  --accent-soft: rgba(120, 162, 214, 0.16);

  --gold: #c99a2e;
  --gold-soft: rgba(222, 178, 74, 0.18);
  --silver: #8d9aab;
  --bronze: #b57e4b;
  --good: #34865d;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow:
    0 1px 2px rgba(38, 60, 92, 0.05),
    0 10px 30px -12px rgba(38, 60, 92, 0.18);
  --shadow-soft:
    0 1px 2px rgba(38, 60, 92, 0.04),
    0 6px 18px -10px rgba(38, 60, 92, 0.14);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: #e9f1fa;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Fixed sky backdrop (pseudo-element so iOS keeps it steady on scroll) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(120vmax 70vmax at 88% -18%, rgba(255, 235, 195, 0.85), rgba(255, 235, 195, 0) 55%),
    radial-gradient(90vmax 60vmax at -20% 30%, rgba(176, 206, 240, 0.75), rgba(176, 206, 240, 0) 60%),
    radial-gradient(80vmax 55vmax at 110% 85%, rgba(214, 231, 247, 0.9), rgba(214, 231, 247, 0) 65%),
    linear-gradient(172deg, #dfecfa 0%, #eaf2fb 48%, #f4f1e8 100%);
}

/* Whisper of film grain over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.05;
  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%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 30px) 18px 56px;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: 0.005em;
  margin: 0;
}
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

::selection { background: rgba(222, 178, 74, 0.35); }

/* --- States ---------------------------------------------------------------- */
.state {
  min-height: 72vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 24px;
}
.state h2 { font-size: 1.5rem; }
.state-emoji { font-size: 2.6rem; margin: 0; }
.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(61, 116, 186, 0.18);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Sample banner ---------------------------------------------------------- */
.banner {
  background: linear-gradient(120deg, rgba(255, 248, 224, 0.92), rgba(255, 242, 205, 0.92));
  border: 1px solid rgba(196, 158, 60, 0.35);
  color: #6f5a1c;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 0.86rem;
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft);
}

/* --- Entrance choreography --------------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
#content > * { animation: rise 0.65s cubic-bezier(0.22, 0.9, 0.3, 1) backwards; }
#content > *:nth-child(2) { animation-delay: 0.05s; }
#content > *:nth-child(3) { animation-delay: 0.14s; }
#content > *:nth-child(4) { animation-delay: 0.23s; }
#content > *:nth-child(5) { animation-delay: 0.32s; }
#content > *:nth-child(6) { animation-delay: 0.41s; }
#content > *:nth-child(7) { animation-delay: 0.5s; }

/* --- Hero -------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: clamp(26px, 7vw, 48px) 8px 30px;
}
.hero-kicker {
  margin: 0 0 14px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  text-indent: 0.34em; /* re-centers letterspaced caps */
  color: var(--ink-soft);
}
.hero h1 {
  font-size: clamp(2.35rem, 9.5vw, 3.7rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  margin: 0 auto;
  max-width: 14ch;
  color: var(--ink);
  text-wrap: balance;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 18px auto 16px;
  max-width: 300px;
}
.orn-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--hairline));
}
.orn-line:last-child {
  background: linear-gradient(90deg, var(--hairline), transparent);
}
.orn-sun {
  color: var(--gold);
  font-size: 0.85rem;
  line-height: 1;
  animation: sunspin 24s linear infinite;
}
@keyframes sunspin { to { transform: rotate(360deg); } }

.ethos {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 14px;
  font-size: clamp(1rem, 3.4vw, 1.12rem);
  letter-spacing: 0.01em;
}
.ethos .dot { margin: 0 10px; color: var(--faint); font-style: normal; }
.ethos-item { display: inline; overflow-wrap: break-word; }

.rule {
  display: block;
  width: fit-content;
  margin: 0 auto 26px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent-deep);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.85), rgba(224, 237, 250, 0.85));
  border: 1px solid rgba(61, 116, 186, 0.28);
  padding: 6px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.pool {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  outline: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 40px 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pool::before {
  /* faint sunbeam across the card */
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 55%;
  height: 220%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 231, 176, 0.35), transparent);
  pointer-events: none;
}
.pool-label {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--gold);
}
.pool-amount {
  font-family: var(--serif);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.12;
  font-variant-numeric: lining-nums;
}
.pool-note { font-size: 0.78rem; color: var(--muted); }

/* --- Sections ------------------------------------------------------------------ */
.section { margin-top: clamp(30px, 6vw, 44px); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hairline);
}
.section-title { min-width: 0; }
.kicker {
  display: block;
  font-size: 0.64rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--gold);
  margin-bottom: 2px;
}
.section-head h2 {
  font-size: clamp(1.4rem, 4.5vw, 1.6rem);
  line-height: 1.15;
}
.hint { margin: -4px 0 12px; }

.search, .sort {
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
  min-width: 0;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}
.sort {
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%234c5f78' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.search { max-width: 180px; }
.search::placeholder { color: var(--faint); }
.search:focus, .sort:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(61, 116, 186, 0.16), var(--shadow-soft);
}

/* --- Stats strip ------------------------------------------------------------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  outline: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.stat {
  padding: 16px 6px 13px;
  text-align: center;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: none; }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 4.5vw, 1.7rem);
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: lining-nums;
}
.stat-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 2px;
}

/* --- Leaderboard -------------------------------------------------------------- */
.leaderboard {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  outline: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.lb-row {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px 18px 13px 10px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}
.lb-row:last-child { border-bottom: none; }
.lb-row:hover { background: rgba(255, 255, 255, 0.55); }

.lb-rank {
  font-family: var(--serif);
  font-size: 1.05rem;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: lining-nums;
}
.top-1 .lb-rank, .top-2 .lb-rank, .top-3 .lb-rank {
  font-size: 1.45rem;
  filter: drop-shadow(0 2px 3px rgba(38, 60, 92, 0.18));
}

/* Podium washes */
.top-1 {
  position: relative;
  background:
    radial-gradient(140% 200% at 0% 50%, rgba(240, 205, 110, 0.32), transparent 55%),
    linear-gradient(90deg, rgba(255, 246, 219, 0.9), rgba(255, 246, 219, 0) 70%);
  box-shadow: inset 3px 0 0 var(--gold);
  overflow: hidden;
}
.top-1::after {
  /* slow celebratory shimmer sweeping across first place */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 236, 180, 0.5) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shimmer {
  0%, 55% { transform: translateX(-100%); }
  85%, 100% { transform: translateX(100%); }
}
.top-1 .lb-score { color: var(--gold); }
.top-2 {
  background: linear-gradient(90deg, rgba(236, 241, 246, 0.95), rgba(236, 241, 246, 0) 65%);
  box-shadow: inset 3px 0 0 var(--silver);
}
.top-3 {
  background: linear-gradient(90deg, rgba(250, 236, 222, 0.9), rgba(250, 236, 222, 0) 65%);
  box-shadow: inset 3px 0 0 var(--bronze);
}

.lb-names { display: flex; flex-wrap: wrap; gap: 5px 12px; min-width: 0; }
.lb-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.005em;
}
.name-text { min-width: 0; overflow-wrap: anywhere; }
.qual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(30, 80, 55, 0.3);
  flex-shrink: 0;
}
.lb-score {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 2ch;
  text-align: right;
  font-variant-numeric: lining-nums;
  color: var(--ink);
}
.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-style: italic; font-family: var(--serif); }

/* --- Records --------------------------------------------------------------------- */
.records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.record {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  outline: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px 13px;
  box-shadow: var(--shadow-soft);
}
.record-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  font-weight: 600;
}
.record-value {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 3px 0 1px;
  line-height: 1.2;
}
.record-holder { font-size: 0.87rem; color: var(--ink-soft); }

/* --- Challenges --------------------------------------------------------------------- */
.challenges { display: flex; flex-direction: column; gap: 9px; }
.ch {
  background: var(--surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  outline: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  box-shadow: var(--shadow-soft);
  transition: outline-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.ch:hover { outline-color: rgba(61, 116, 186, 0.35); }
.ch.open {
  outline-color: rgba(61, 116, 186, 0.4);
  box-shadow: var(--shadow);
}
.ch-unscored { outline-style: dashed; background: rgba(255, 255, 255, 0.5); }
.ch-unscored .ch-desc { color: var(--ink-soft); }

.ch-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.ch-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}
.ch-emoji {
  flex-shrink: 0;
  font-size: 1.3rem;
  line-height: 1;
  width: 1.9rem;
  text-align: center;
}
.ch-unscored .ch-emoji { filter: grayscale(0.4); opacity: 0.75; }
.ch-desc { font-weight: 600; font-size: 0.93rem; flex: 1; min-width: 0; }
.ch-count {
  flex-shrink: 0;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 11px;
  font-size: 0.85rem;
  font-variant-numeric: lining-nums;
}
.ch-unscored .ch-count {
  color: var(--muted);
  background: rgba(126, 140, 160, 0.12);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
}
/* Expand caret */
.ch-head::after {
  content: "";
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--faint);
  border-bottom: 1.6px solid var(--faint);
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.25s ease, border-color 0.15s ease;
}
.ch.open .ch-head::after {
  transform: rotate(225deg) translate(-2px, -2px);
  border-color: var(--accent);
}

.ch-bar {
  height: 4px;
  background: rgba(56, 88, 132, 0.1);
  border-radius: 999px;
  margin-top: 11px;
  overflow: hidden;
}
.ch-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8ab2e2, var(--accent) 60%, var(--accent-deep));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.ch-unscored .ch-bar { background: rgba(56, 88, 132, 0.06); }

.ch-doers {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px dashed var(--hairline);
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink-soft);
  animation: rise 0.3s ease backwards;
}

/* --- Footer ------------------------------------------------------------------------- */
.footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--hairline);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

/* --- Responsive ----------------------------------------------------------------------- */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(odd) { border-left: none; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .lb-row { grid-template-columns: 42px 1fr auto; padding: 12px 14px 12px 6px; }
  .section-head { flex-wrap: wrap; align-items: center; }
  .search { max-width: none; flex: 1 1 100%; }
  .pool { padding: 14px 30px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .top-1::after { display: none; }
}

/* ===========================================================================
   Multi-page chrome: nav, page heroes, buckets, announcements.
   =========================================================================== */

:root {
  /* Reusable cute pail as a data-URI (for CSS accents / watermarks). */
  --bkt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 34'%3E%3Cpath d='M10 13 Q18 4 26 13' fill='none' stroke='%234a9cb8' stroke-width='2.4' stroke-linecap='round'/%3E%3Crect x='6' y='11.5' width='24' height='5' rx='2.5' fill='%2384d4e4'/%3E%3Cpath d='M7.5 16.5 H28.5 L25.4 29.5 Q24.9 32.4 21.7 32.4 H14.3 Q11.1 32.4 10.6 29.5 Z' fill='%2357b7d0'/%3E%3Cpath d='M7.9 16.5 H28.1 L27.4 19.4 H8.6 Z' fill='%23469fb8'/%3E%3C/svg%3E");
}

.bucket-svg { display: inline-block; vertical-align: middle; }
.bucket-logo { filter: drop-shadow(0 2px 3px rgba(38, 60, 92, 0.18)); }

/* --- Top nav ---------------------------------------------------------------- */
#nav-root { position: sticky; top: 0; z-index: 30; }
.nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px clamp(14px, 4vw, 22px);
  background: rgba(233, 241, 250, 0.72);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--ink); font-family: var(--serif); font-weight: 600; font-size: 1.02rem;
  white-space: nowrap;
}
.nav-brand:hover .bucket-logo { transform: translateY(-1px) rotate(-4deg); transition: transform 0.2s; }
.nav-links { display: flex; gap: 3px; }
.nav-link {
  text-decoration: none; color: var(--ink-soft);
  font-size: 0.9rem; font-weight: 600; letter-spacing: 0.01em;
  padding: 6px 13px; border-radius: 999px; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover { background: var(--accent-soft); color: var(--accent-deep); }
.nav-link.active {
  color: var(--accent-deep);
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(224, 237, 250, 0.9));
  box-shadow: var(--shadow-soft);
}

/* --- Sub-page hero ---------------------------------------------------------- */
.page-hero { text-align: center; padding: clamp(24px, 6vw, 44px) 8px 6px; }
.page-hero::before {
  content: ""; display: block; width: 54px; height: 51px; margin: 0 auto 12px;
  background: var(--bkt) center / contain no-repeat;
  filter: drop-shadow(0 3px 4px rgba(38, 60, 92, 0.16));
  animation: bob 3.2s ease-in-out infinite;
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-4px) rotate(2deg); } }
.page-hero h1 {
  font-family: var(--serif); font-weight: 600; color: var(--ink);
  font-size: clamp(2.1rem, 7.5vw, 3rem); line-height: 1.05; letter-spacing: -0.01em; margin: 0;
}
.page-lede { max-width: 44ch; margin: 10px auto 0; font-size: 0.98rem; }

/* --- "See challenges" CTA on the leaderboard -------------------------------- */
.cta { text-align: center; margin-top: 28px; }
.cta a { color: var(--accent-deep); font-weight: 700; text-decoration: none; }
.cta a:hover { text-decoration: underline; }

/* --- Announcements / updates ------------------------------------------------ */
.announcements { display: flex; flex-direction: column; gap: 16px; max-width: 640px; margin: 0 auto; }
.post {
  position: relative; overflow: hidden;
  background: var(--surface); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.85); outline: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(16px, 4vw, 24px); box-shadow: var(--shadow);
}
.post::after {
  content: ""; position: absolute; right: -14px; bottom: -18px; width: 104px; height: 98px;
  background: var(--bkt) center / contain no-repeat; opacity: 0.07; pointer-events: none;
  transform: rotate(-8deg);
}
.post-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.post-date { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); }
.post-tag {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; color: var(--accent-deep);
  background: var(--accent-soft); padding: 3px 11px; border-radius: 999px;
}
.post-title { font-family: var(--serif); font-size: clamp(1.25rem, 4.5vw, 1.5rem); color: var(--ink); margin: 0 0 8px; }
.post-body p { margin: 0 0 9px; color: var(--ink-soft); }
.post-body p:last-child { margin-bottom: 0; }
.post-highlights { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.post-highlights li { position: relative; padding-left: 26px; color: var(--ink-soft); font-size: 0.92rem; }
.post-highlights li::before {
  content: ""; position: absolute; left: 0; top: 1px; width: 17px; height: 16px;
  background: var(--bkt) center / contain no-repeat;
}

/* --- Cute empty state ------------------------------------------------------- */
.empty-bucket { text-align: center; padding: 44px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* --- Footer bucket motif ---------------------------------------------------- */
.footer::before {
  content: ""; display: block; width: 32px; height: 30px; margin: 0 auto 10px;
  background: var(--bkt) center / contain no-repeat; opacity: 0.85;
}

/* --- Narrow-screen nav ------------------------------------------------------ */
@media (max-width: 460px) {
  .nav-brand span { display: none; }         /* keep the bucket, drop the wordmark */
  .nav-link { padding: 6px 10px; font-size: 0.86rem; }
}

/* ===========================================================================
   Help page + Timeline + wider (4-tab) nav.
   =========================================================================== */

/* --- Help / contacts -------------------------------------------------------- */
.help-list { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin: 0 auto; }
.help-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.85); outline: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 18px; box-shadow: var(--shadow-soft);
}
.help-bucket { flex: none; filter: drop-shadow(0 2px 3px rgba(38, 60, 92, 0.16)); }
.help-body { min-width: 0; }
.help-who { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--ink); }
.help-initial {
  color: var(--accent-deep);
  font-weight: 700;
  font-size: 1.5em;
  line-height: 0;
}
.help-for { color: var(--ink-soft); font-size: 0.92rem; }
.help-for strong { color: var(--ink); font-weight: 600; }
.help-where { color: var(--accent-deep); }

/* --- Timeline / schedule ---------------------------------------------------- */
.timeline { position: relative; max-width: 560px; margin: 0 auto; padding-left: 26px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent-soft));
  border-radius: 2px;
}
.tl-item { position: relative; padding: 4px 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface-solid);
  box-shadow: 0 0 0 1px var(--accent-soft);
}
.tl-label { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--ink); line-height: 1.2; }
.tl-date { font-size: 0.85rem; color: var(--accent-deep); font-weight: 600; letter-spacing: 0.02em; margin-top: 1px; }
.tl-past .tl-dot { background: var(--faint); box-shadow: none; }
.tl-past .tl-label { color: var(--muted); }
.tl-past .tl-date { color: var(--muted); font-weight: 500; }

/* --- Nav: fit 4 tabs on small screens -------------------------------------- */
.nav-links { max-width: 100%; }
@media (max-width: 520px) {
  .nav-brand span { display: none; }             /* keep the bucket, drop the wordmark */
  .nav-links { gap: 2px; }
  .nav-link { padding: 6px 9px; font-size: 0.82rem; }
}
@media (max-width: 360px) {
  .nav-link { padding: 5px 7px; font-size: 0.78rem; letter-spacing: -0.01em; }
}

/* ===========================================================================
   Cute bucket animations. All reduced-motion-safe (the global
   prefers-reduced-motion block above disables them via !important).
   =========================================================================== */

/* Loading: the plain spinner becomes a bouncing, squashing bucket. */
.spinner {
  border: none;
  border-radius: 0;
  width: 48px; height: 45px;
  background: var(--bkt) center / contain no-repeat;
  transform-origin: 50% 100%;
  filter: drop-shadow(0 4px 3px rgba(38, 60, 92, 0.16));
  animation: bkt-bounce 1s cubic-bezier(0.5, 0.05, 0.5, 0.95) infinite;
}
@keyframes bkt-bounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30%      { transform: translateY(-16px) scale(0.94, 1.08) rotate(-6deg); }
  50%      { transform: translateY(0) scale(1.1, 0.9); }        /* squash on landing */
  62%      { transform: translateY(0) scale(0.98, 1.02) rotate(4deg); }
  100%     { transform: translateY(0) scale(1, 1); }
}

/* Nav bucket: sits still, then does a quick happy wiggle every ~6s. */
.bucket-logo { transform-origin: 50% 90%; animation: bkt-peek 6s ease-in-out infinite; }
@keyframes bkt-peek {
  0%, 78%, 100% { transform: rotate(0); }
  83% { transform: rotate(-11deg); }
  88% { transform: rotate(9deg); }
  93% { transform: rotate(-5deg); }
  97% { transform: rotate(2deg); }
}
/* On hover it jiggles on demand (overrides the idle wiggle). */
.nav-brand:hover .bucket-logo { animation: bkt-jiggle 0.5s ease; }
@keyframes bkt-jiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg) translateY(-2px); }
  60% { transform: rotate(12deg); }
  80% { transform: rotate(-6deg); }
}

/* Help cards: the bucket hops when you hover the card. */
.help-card { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.help-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.help-card:hover .help-bucket { animation: bkt-hop 0.55s ease; }
@keyframes bkt-hop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  35% { transform: translateY(-9px) rotate(-8deg); }
  60% { transform: translateY(0) scale(1.08, 0.9); }
  80% { transform: translateY(0) scale(1, 1); }
}

/* Footer bucket: slow, sleepy sway. */
.footer::before { transform-origin: 50% 90%; animation: bkt-sway 5s ease-in-out infinite; }
@keyframes bkt-sway { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }

/* Empty-state face bucket: a happy little hop. */
.empty-bucket .bucket-svg { animation: bkt-bounce 1.6s ease-in-out infinite; transform-origin: 50% 100%; }

/* ===========================================================================
   Leaderboard bucket characters — crowned champion, sleepy zeroes, hop-in.
   =========================================================================== */

/* Rank cell holds the bucket character + its rank number. */
.lb-row { grid-template-columns: 56px 1fr auto; }
.lb-rank {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; overflow: visible; font-size: 1rem;
}
.bkt-char { display: block; overflow: visible; }
.lb-rank-badge {
  font-family: var(--serif); font-weight: 700; font-size: 0.82rem;
  color: var(--ink-soft); line-height: 1;
}

/* Champion: gentle celebratory bounce + twinkling sparkles. */
.bkt-champ { transform-origin: 50% 100%; animation: bkt-celebrate 1.5s ease-in-out infinite; }
@keyframes bkt-celebrate {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-2px) rotate(-4deg); }
  50% { transform: translateY(-3px) rotate(0); }
  75% { transform: translateY(-2px) rotate(4deg); }
}
.bkt-spark { transform-origin: center; animation: bkt-twinkle 1.5s ease-in-out infinite; }
.bkt-spark2 { animation-delay: 0.75s; }
@keyframes bkt-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Happy scorers: a slow, content little sway. */
.bkt-happy { transform-origin: 50% 100%; animation: bkt-nod 3.2s ease-in-out infinite; }
@keyframes bkt-nod { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }

/* Sleepy zeroes: a floating "z" drifting up. */
.bkt-zzz { animation: bkt-float 2.6s ease-in-out infinite; opacity: 0; }
@keyframes bkt-float {
  0% { opacity: 0; transform: translateY(3px); }
  40% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-7px); }
}

/* Rows hop into place on load (initial render only; not on search). */
.lb-row.lb-in { animation: lb-hop 0.5s cubic-bezier(0.22, 0.9, 0.3, 1) backwards; }
@keyframes lb-hop {
  0% { opacity: 0; transform: translateY(11px) scale(0.98); }
  60% { transform: translateY(-3px); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .lb-row { grid-template-columns: 48px 1fr auto; }
}

/* ===========================================================================
   Split hero: copy on the left, flat summer still-life on the right.
   Stacks (copy on top, centered) below 761px.
   =========================================================================== */

.hero-scene { display: block; width: 100%; height: auto; }

/* Stacked (mobile-first) */
.hero-split { padding-bottom: 18px; }
.hero-art { max-width: 400px; margin: 10px auto 0; }

@media (min-width: 761px) {
  .hero-split {
    display: grid;
    grid-template-columns: 46fr 54fr;
    align-items: center;
    gap: clamp(24px, 4.5vw, 56px);
    text-align: left;
    /* Let the hero breathe wider than the 760px column, never past the viewport */
    margin-inline: calc((100% - min(1000px, 100vw - clamp(36px, 8vw, 96px))) / 2);
    padding: clamp(18px, 3.5vw, 38px) 0 14px;
  }
  .hero-art { max-width: none; margin: 0; }
  .hero-split .hero-kicker { text-indent: 0; }
  .hero-split h1 {
    margin: 0;
    font-size: clamp(2.15rem, 3.9vw, 3.05rem);
    max-width: 13ch;
  }
  .hero-split .ornament { margin: 16px 0 14px; max-width: 230px; }
  .hero-split .rule { margin: 0 0 24px; }
}

/* The one looping animation: the flag planted in the pail ripples like cloth.
   The flag outline and its two fold lines morph through six snapshots of a
   sine wave traveling from the pole to the free edge (CSS `d` path morph;
   browsers without `d` support simply show the static wavy flag).
   (No !important, so the global reduced-motion block above disables it.) */
.hero-flag,
.hero-flag-fold-a,
.hero-flag-fold-b {
  animation: flag-wave 2.8s linear infinite;
}
.hero-flag-fold-a { animation-name: flag-fold-a; }
.hero-flag-fold-b { animation-name: flag-fold-b; }

@keyframes flag-wave {
  0%, 100% { d: path("M0 0 C1.92 0.13 7.67 0.88 11.5 0.75 C15.33 0.62 19.17 -0.31 23 -0.78 C26.83 -1.25 30.67 -2.72 34.5 -2.08 C38.33 -1.43 44.08 2.22 46 3.07 C48.14 11.32 48.14 19.82 46 28.07 C44.08 27.22 38.33 23.57 34.5 22.92 C30.67 22.28 26.83 23.75 23 24.22 C19.17 24.69 15.33 25.62 11.5 25.75 C7.67 25.88 1.92 25.13 0 25 Z"); }
  16.67% { d: path("M0 0 C1.92 0.09 7.67 0.38 11.5 0.53 C15.33 0.69 19.17 1.45 23 0.93 C26.83 0.42 30.67 -2.35 34.5 -2.57 C38.33 -2.79 44.08 -0.76 46 -0.4 C48.01 7.85 48.01 16.35 46 24.6 C44.08 24.24 38.33 22.21 34.5 22.43 C30.67 22.65 26.83 25.42 23 25.93 C19.17 26.45 15.33 25.69 11.5 25.53 C7.67 25.38 1.92 25.09 0 25 Z"); }
  33.33% { d: path("M0 0 C1.92 -0.04 7.67 -0.5 11.5 -0.22 C15.33 0.07 19.17 1.76 23 1.71 C26.83 1.66 30.67 0.37 34.5 -0.5 C38.33 -1.36 44.08 -2.98 46 -3.47 C45.88 4.78 45.88 13.28 46 21.53 C44.08 22.02 38.33 23.64 34.5 24.5 C30.67 25.37 26.83 26.66 23 26.71 C19.17 26.76 15.33 25.07 11.5 24.78 C7.67 24.5 1.92 24.96 0 25 Z"); }
  50% { d: path("M0 0 C1.92 -0.13 7.67 -0.88 11.5 -0.75 C15.33 -0.62 19.17 0.31 23 0.78 C26.83 1.25 30.67 2.72 34.5 2.08 C38.33 1.43 44.08 -2.22 46 -3.07 C43.86 5.18 43.86 13.68 46 21.93 C44.08 22.78 38.33 26.43 34.5 27.08 C30.67 27.72 26.83 26.25 23 25.78 C19.17 25.31 15.33 24.38 11.5 24.25 C7.67 24.12 1.92 24.87 0 25 Z"); }
  66.67% { d: path("M0 0 C1.92 -0.09 7.67 -0.38 11.5 -0.53 C15.33 -0.69 19.17 -1.45 23 -0.93 C26.83 -0.42 30.67 2.35 34.5 2.57 C38.33 2.79 44.08 0.76 46 0.4 C43.99 8.65 43.99 17.15 46 25.4 C44.08 25.76 38.33 27.79 34.5 27.57 C30.67 27.35 26.83 24.58 23 24.07 C19.17 23.55 15.33 24.31 11.5 24.47 C7.67 24.62 1.92 24.91 0 25 Z"); }
  83.33% { d: path("M0 0 C1.92 0.04 7.67 0.5 11.5 0.22 C15.33 -0.07 19.17 -1.76 23 -1.71 C26.83 -1.66 30.67 -0.37 34.5 0.5 C38.33 1.36 44.08 2.98 46 3.47 C46.12 11.72 46.12 20.22 46 28.47 C44.08 27.98 38.33 26.36 34.5 25.5 C30.67 24.63 26.83 23.34 23 23.29 C19.17 23.24 15.33 24.93 11.5 25.22 C7.67 25.5 1.92 25.04 0 25 Z"); }
}
@keyframes flag-fold-a {
  0%, 100% { d: path("M6 8.47 C8.17 8.45 14.67 8.79 19 8.39 C23.33 7.99 27.83 5.77 32 6.06 C36.17 6.34 42 9.43 44 10.11"); }
  16.67% { d: path("M6 8.17 C8.17 8.36 14.67 9.63 19 9.35 C23.33 9.08 27.83 6.94 32 6.53 C36.17 6.11 42 6.82 44 6.88"); }
  33.33% { d: path("M6 7.9 C8.17 8.11 14.67 9.03 19 9.16 C23.33 9.29 27.83 9.37 32 8.67 C36.17 7.97 42 5.58 44 4.97"); }
  50% { d: path("M6 7.93 C8.17 7.95 14.67 7.61 19 8.01 C23.33 8.41 27.83 10.63 32 10.34 C36.17 10.06 42 6.97 44 6.29"); }
  66.67% { d: path("M6 8.23 C8.17 8.04 14.67 6.77 19 7.05 C23.33 7.32 27.83 9.46 32 9.87 C36.17 10.29 42 9.58 44 9.52"); }
  83.33% { d: path("M6 8.5 C8.17 8.29 14.67 7.37 19 7.24 C23.33 7.11 27.83 7.03 32 7.73 C36.17 8.43 42 10.82 44 11.43"); }
}
@keyframes flag-fold-b {
  0%, 100% { d: path("M6 17.07 C8.17 17.05 14.67 17.39 19 16.99 C23.33 16.59 27.83 14.37 32 14.66 C36.17 14.94 42 18.03 44 18.71"); }
  16.67% { d: path("M6 16.77 C8.17 16.96 14.67 18.23 19 17.95 C23.33 17.68 27.83 15.54 32 15.13 C36.17 14.71 42 15.42 44 15.48"); }
  33.33% { d: path("M6 16.5 C8.17 16.71 14.67 17.63 19 17.76 C23.33 17.89 27.83 17.97 32 17.27 C36.17 16.57 42 14.18 44 13.57"); }
  50% { d: path("M6 16.53 C8.17 16.55 14.67 16.21 19 16.61 C23.33 17.01 27.83 19.23 32 18.94 C36.17 18.66 42 15.57 44 14.89"); }
  66.67% { d: path("M6 16.83 C8.17 16.64 14.67 15.37 19 15.65 C23.33 15.92 27.83 18.06 32 18.47 C36.17 18.89 42 18.18 44 18.12"); }
  83.33% { d: path("M6 17.1 C8.17 16.89 14.67 15.97 19 15.84 C23.33 15.71 27.83 15.63 32 16.33 C36.17 17.03 42 19.42 44 20.03"); }
}

/* --- Ambient hero motion: sun breathes, gulls glide, boat bobs ------------- */
.hero-sun-pulse {
  transform-box: fill-box; transform-origin: center;
  animation: sun-pulse 4.5s ease-out infinite;
}
@keyframes sun-pulse {
  0% { transform: scale(0.85); opacity: 0.5; }
  70% { opacity: 0; }
  100% { transform: scale(1.95); opacity: 0; }
}
.hero-sun-glow {
  transform-box: fill-box; transform-origin: center;
  animation: sun-glow 4.5s ease-in-out infinite;
}
@keyframes sun-glow {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.12); opacity: 1; }
}
.hero-gull-1 { animation: gull-glide-1 6s ease-in-out infinite; }
.hero-gull-2 { animation: gull-glide-2 7.5s ease-in-out infinite; }
@keyframes gull-glide-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, -7px); }
}
@keyframes gull-glide-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-10px, -5px); }
}
.hero-boat {
  transform-box: fill-box; transform-origin: 50% 92%;
  animation: boat-bob 4s ease-in-out infinite;
}
@keyframes boat-bob {
  0%, 100% { transform: translateY(0) rotate(-2.5deg); }
  50% { transform: translateY(-2px) rotate(2.5deg); }
}

/* --- Skyline window glints (subtle, staggered) ----------------------------- */
.hero-glint { opacity: 0; animation: glint 4s ease-in-out infinite; }
.hero-glint-2 { animation-delay: 1.3s; }
.hero-glint-3 { animation-delay: 2.6s; }
@keyframes glint {
  0%, 45%, 72%, 100% { opacity: 0; }
  56% { opacity: 0.85; }
}

/* --- Sunglasses lens twinkle ----------------------------------------------- */
.hero-shades-twinkle {
  transform-box: fill-box; transform-origin: center;
  animation: shades-twinkle 3s ease-in-out infinite;
}
@keyframes shades-twinkle {
  0%, 100% { opacity: 0; transform: scale(0.3) rotate(0deg); }
  12% { opacity: 0.95; transform: scale(1) rotate(15deg); }
  32% { opacity: 0; transform: scale(0.4) rotate(30deg); }
}

/* --- Water sparkles: fade out and reappear in shifted spots ---------------- */
.hero-wave { opacity: 0.55; animation: water-shimmer 7s ease-in-out infinite; }
.hero-wave-2 { animation-duration: 8.5s; animation-delay: 1.6s; }
.hero-wave-3 { animation-duration: 6.4s; animation-delay: 3.2s; }
@keyframes water-shimmer {
  0%   { opacity: 0;    transform: translate(0, 0); }
  13%  { opacity: 0.55; }
  30%  { opacity: 0;    transform: translate(0, 0); }
  31%  { transform: translate(17px, 4px); }
  46%  { opacity: 0.5; }
  62%  { opacity: 0;    transform: translate(17px, 4px); }
  63%  { transform: translate(-13px, -3px); }
  79%  { opacity: 0.55; }
  96%, 100% { opacity: 0; transform: translate(-13px, -3px); }
}
