/* Public pages: share previews (/p /a /e), the landing page, and error pages. Self-contained,
   same cozy flat language as the app: warm paper, rounded type, flat fills, offset shadows. */

:root {
  color-scheme: light;
  --bg: #fcfaf1;
  --surface: #ffffff;
  --surface-2: #f4f5fb;
  --line: #e0e2ee;
  --line-2: #cacdde;
  --edge: #d5d8e8;
  --text: #202343;
  --muted: #575b77;
  --primary: #d44214;
  --primary-edge: #a8260a;
  --on-primary: #ffffff;
  --accent: #008466;
  --honey: #fec92f;
  --honey-edge: #dd9314;
  --display: 'Fredoka', 'Noto Color Emoji', system-ui, sans-serif;
  --body: 'Nunito', 'Noto Color Emoji', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) { color-scheme: dark; --bg: #101223; --surface: #1d1f36; --surface-2: #262942; --line: #30334c; --line-2: #444863;
    --edge: #050613; --text: #f6f3eb; --muted: #b9bcd1; --primary: #fa7959; --primary-edge: #c04732; --on-primary: #121428; --accent: #5dd0a9; }
}
:root[data-theme='dark'] { color-scheme: dark; --bg: #101223; --surface: #1d1f36; --surface-2: #262942; --line: #30334c; --line-2: #444863;
  --edge: #050613; --text: #f6f3eb; --muted: #b9bcd1; --primary: #fa7959; --primary-edge: #c04732; --on-primary: #121428; --accent: #5dd0a9; }

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); font: 17px/1.55 var(--body); overflow-x: hidden; background: var(--bg); }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.12; margin: 0 0 0.4em; }
.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.center { text-align: center; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; max-width: 1140px; margin: 0 auto; }
.pub-brand { display: inline-flex; align-items: center; gap: 10px; font: 600 1.15rem var(--display); letter-spacing: 0.06em; text-decoration: none; }
.pub-brand::before { content: ''; width: 34px; height: 34px; background: url('/favicon.svg') center / contain no-repeat; }
.pub-brand b { color: var(--primary); font-weight: 600; }
.pub-nav { display: flex; align-items: center; gap: 16px; }
.pub-link { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.pub-link:hover { color: var(--text); }
@media (max-width: 560px) { .pub-nav .pub-link:nth-child(2) { display: none; } }
.pub-main { max-width: 1040px; margin: 0 auto; padding: 16px 20px 60px; }
.pub-foot { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 30px 20px 40px; }
.pub-kicker { font: 600 0.8rem var(--display); letter-spacing: 0.12em; color: var(--primary); margin: 0 0 8px; }
.pub-cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border-radius: 16px; cursor: pointer;
  font: 600 1.05rem var(--display); color: var(--on-primary); text-decoration: none; background: var(--primary);
  border: 2px solid var(--primary-edge); box-shadow: 0 5px 0 var(--primary-edge); transition: transform 0.1s, box-shadow 0.1s;
}
.pub-cta:hover { background: color-mix(in srgb, var(--primary) 90%, #fff); }
.pub-cta:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--primary-edge); }
.pub-cta.small { min-height: 40px; padding: 0 16px; font-size: 0.95rem; border-radius: 12px; box-shadow: 0 3px 0 var(--primary-edge); }
.pub-ghost { display: inline-flex; align-items: center; min-height: 52px; padding: 0 20px; border-radius: 16px; border: 2px solid var(--line-2); text-decoration: none; font: 600 1rem var(--display); color: var(--text); background: var(--surface); box-shadow: 0 5px 0 var(--edge); }
.pub-ghost:hover { border-color: var(--primary); }

/* Pass / event preview */
.pub-hero {
  display: grid; gap: 26px; align-items: center; padding: 26px; border-radius: 30px; color: var(--t); background: var(--b);
  border: 2px solid color-mix(in srgb, var(--t) 14%, var(--b)); box-shadow: 0 6px 0 color-mix(in srgb, var(--t) 18%, var(--b));
}
@media (min-width: 760px) { .pub-hero { grid-template-columns: 260px 1fr; } }
.pub-hero a { color: inherit; }
.pub-hero .pub-kicker { color: var(--p); }
.pub-hero .pub-cta { background: var(--p); border-color: color-mix(in oklch, var(--p) 70%, #000); box-shadow: 0 5px 0 color-mix(in oklch, var(--p) 70%, #000);
  color: var(--on-p, #ffffff); }
.pub-cover { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 26px; overflow: hidden; max-width: 260px; width: 100%; margin: 0 auto;
  border: 3px solid color-mix(in srgb, var(--t) 16%, var(--b)); isolation: isolate; }
.pub-scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.pub-medallion { display: grid; place-items: center; width: 46%; aspect-ratio: 1; border-radius: 50%; font-size: 3.6rem; background: var(--s); border: 5px solid var(--p);
  box-shadow: 0 6px 0 color-mix(in oklch, var(--p) 65%, #000); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.pub-hero-text h1 { font-size: clamp(2.1rem, 6vw, 3.3rem); }
.pub-tagline { font-size: 1.15rem; opacity: 0.9; margin: 0 0 10px; }
.pub-meta { opacity: 0.8; margin: 8px 0 16px; font-size: 0.96rem; font-weight: 600; }
.pub-progress { height: 16px; border-radius: 999px; background: color-mix(in srgb, var(--t) 12%, var(--b)); overflow: hidden; margin: 12px 0 6px; }
.pub-progress span { display: block; height: 100%; background: var(--p); border-radius: inherit; }
.pub-grid { display: grid; gap: 22px; margin: 30px 0; }
@media (min-width: 760px) { .pub-grid { grid-template-columns: 1fr 1fr; } }
.pub-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.pub-list li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--edge); }
.pub-list li.done { border-color: var(--honey-edge); }
.pub-list li span:last-child { display: flex; flex-direction: column; }
.pub-list small { color: var(--muted); }
.pub-emoji { font-size: 1.6rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); flex: none; }
.pub-reward.r-rare .pub-emoji { box-shadow: inset 0 0 0 3px #0392c4; }
.pub-reward.r-epic .pub-emoji { box-shadow: inset 0 0 0 3px #9615b5; }
.pub-reward.r-legendary .pub-emoji { box-shadow: inset 0 0 0 3px #e79703; }
.pub-art { width: 46px; height: 46px; padding: 6px; box-sizing: border-box; border-radius: 50%; background: var(--surface-2); object-fit: contain; flex: none; }
.pub-reward.r-rare .pub-art { box-shadow: inset 0 0 0 3px #0392c4; }
.pub-reward.r-epic .pub-art { box-shadow: inset 0 0 0 3px #9615b5; }
.pub-reward.r-legendary .pub-art { box-shadow: inset 0 0 0 3px #e79703; }
.pub-art-inline { width: 1.15em; height: 1.15em; vertical-align: -0.18em; }
.pub-desc { color: var(--muted); max-width: 720px; }
.pub-achievement { display: grid; gap: 26px; align-items: center; }
@media (min-width: 820px) { .pub-achievement { grid-template-columns: 1fr 1fr; } }
.pub-achievement img { width: 100%; height: auto; border-radius: 24px; }
.pub-error { text-align: center; padding-top: 80px; }
.pub-error h1 { font-size: 4rem; }

/* Landing -------------------------------------------------------------------------- */
.welcome main { max-width: 1140px; margin: 0 auto; padding: 0 20px 40px; }
.w-hero { display: grid; gap: 34px; align-items: center; padding: 26px 0 40px; }
@media (min-width: 920px) { .w-hero { grid-template-columns: 1.05fr 1fr; padding: 46px 0; } }
.w-hero h1 { font-size: clamp(2.6rem, 8vw, 4.6rem); letter-spacing: -0.01em; }
.grad { color: var(--primary); position: relative; white-space: nowrap; }
.grad::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0.06em; height: 0.2em; background: var(--honey); border-radius: 999px; z-index: -1; }
.w-hero h1 { position: relative; z-index: 0; }
.w-sub { font-size: 1.16rem; color: var(--muted); max-width: 560px; }
.w-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 22px 0; }
.w-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; max-width: 560px; }
.w-stats div { padding: 12px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--edge); }
.w-stats dt { font-size: 0.76rem; color: var(--muted); font-weight: 700; }
.w-stats dd { margin: 0; font: 600 1.55rem var(--display); }
@media (max-width: 520px) { .w-stats { grid-template-columns: repeat(2, 1fr); } }
.w-art { position: relative; }
.w-art img { width: 100%; height: auto; display: block; border-radius: 30px; border: 3px solid var(--line-2); box-shadow: 0 8px 0 var(--edge); }
.demo-card { position: relative; width: min(330px, 86%); margin: -120px 0 0 auto; padding: 16px; border-radius: 24px; color: #202343;
  background: #ffffff; border: 3px solid #e0e2ee; box-shadow: 0 6px 0 #cfd2e6; }
.demo-head { display: flex; align-items: center; gap: 12px; }
.demo-head div { flex: 1; display: flex; flex-direction: column; font-family: var(--display); font-weight: 600; }
.demo-head small { font-family: var(--body); font-weight: 600; color: #575b77; }
.demo-emoji { font-size: 1.9rem; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: #fff1e8; border: 3px solid #ff7a3d; }
.demo-level { font: 600 1rem var(--display); padding: 4px 12px; border-radius: 999px; background: #ff7a3d; color: #202343; border: 2px solid #c2410c; }
.demo-level b { font-size: 1.2rem; }
.demo-xp { height: 16px; border-radius: 999px; background: #e9eaf5; border: 2px solid #cacdde; margin: 14px 0; overflow: hidden; }
.demo-xp span { display: block; height: 100%; width: 40%; border-radius: inherit; transition: width 0.9s cubic-bezier(0.2, 1.1, 0.4, 1);
  background: repeating-linear-gradient(-45deg, #ff7a3d 0 10px, #ffa577 10px 20px); }
.demo-track { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-bottom: 14px; }
.demo-tier { aspect-ratio: 1; display: grid; place-items: center; font-size: 1.15rem; border-radius: 50%; background: #f4f5fb; border: 2px solid #e0e2ee; opacity: 0.6; }
.demo-tier.done { opacity: 1; background: #d3f3e6; border-color: #008466; }
.demo-tier.now { opacity: 1; background: #ffe5d6; border-color: #ff7a3d; animation: bob 2s infinite; }
.demo-quest { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: #f4f5fb; }
.demo-quest > span:first-child { font-size: 1.5rem; }
.demo-quest div { flex: 1; display: flex; flex-direction: column; font-weight: 800; }
.demo-quest small { font-weight: 600; color: #575b77; }
.demo-done { font: 600 0.85rem var(--display); padding: 6px 12px; border-radius: 12px; color: #ffffff; background: #d44214; border: 2px solid #a8260a; transition: background 0.3s; }
.demo-done.ok { background: #008466; border-color: #03654e; }
.demo-pop { position: absolute; left: 50%; top: 40%; translate: -50% -50%; white-space: nowrap; font: 600 1.9rem var(--display); letter-spacing: 0.06em;
  color: #202343; background: #fec92f; border: 3px solid #dd9314; padding: 4px 20px; border-radius: 14px; box-shadow: 0 5px 0 #dd9314;
  opacity: 0; scale: 0.5; transition: opacity 0.25s, scale 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); pointer-events: none; }
.demo-pop.on { opacity: 1; scale: 1; }
.w-steps { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); margin: 10px 0 54px; }
.w-steps article { padding: 22px; border-radius: 24px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--edge); }
.w-steps span { font-size: 2rem; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--honey) 35%, var(--surface)); }
.w-steps h3 { margin: 12px 0 6px; }
.w-steps p { color: var(--muted); margin: 0; }
.w-season { margin: 10px 0 54px; text-align: center; }
.w-season h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.w-season > .muted { max-width: 640px; margin: 0 auto; }
.w-event-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin: 22px 0; text-align: left; }
.w-event { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 22px; text-decoration: none; color: var(--t); background: var(--b);
  border: 2px solid color-mix(in srgb, var(--t) 14%, var(--b)); box-shadow: 0 4px 0 color-mix(in srgb, var(--t) 18%, var(--b)); transition: transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1); }
.w-event:hover { transform: translateY(-3px) rotate(-0.5deg); }
.w-event-emoji { font-size: 2rem; width: 62px; height: 62px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--s); border: 3px solid var(--p); }
.w-event-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.w-event-text strong { font: 600 1.1rem var(--display); }
.w-event-text small { opacity: 0.85; }
.w-event-goal { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--t) 12%, var(--b)); overflow: hidden; margin-top: 4px; }
.w-event-bar { display: block; height: 100%; background: var(--p); border-radius: inherit; }
.w-event-meta { font-size: 0.8rem; font-weight: 700; opacity: 0.85; }.w-featured h2, .w-waitlist h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.w-pass-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); margin: 16px 0; }
.w-pass { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 22px; text-decoration: none; color: var(--t); background: var(--b);
  border: 2px solid color-mix(in srgb, var(--t) 14%, var(--b)); box-shadow: 0 4px 0 color-mix(in srgb, var(--t) 18%, var(--b)); transition: transform 0.2s cubic-bezier(0.2, 1.4, 0.4, 1); }
.w-pass:hover { transform: translateY(-3px) rotate(-0.5deg); }
.w-pass-emoji { font-size: 2rem; width: 60px; height: 60px; display: grid; place-items: center; border-radius: 50%; background: var(--s); border: 3px solid var(--p); flex: none; }
.w-pass-text { display: flex; flex-direction: column; }
.w-pass-text strong { font-family: var(--display); font-weight: 600; font-size: 1.1rem; }
.w-pass-text small { opacity: 0.8; }
.w-pass-price { font: 600 0.75rem var(--display); letter-spacing: 0.08em; color: var(--p); text-transform: uppercase; margin-top: 4px; }
.w-creators { margin: 60px 0; padding: 32px; border-radius: 30px; background: color-mix(in srgb, var(--honey) 28%, var(--surface)); border: 2px solid color-mix(in srgb, var(--honey-edge) 45%, var(--line)); box-shadow: 0 6px 0 var(--edge); }
.w-creators h2 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
.w-creators ul { list-style: none; padding: 0; margin: 18px 0 26px; display: grid; gap: 10px; font-weight: 600; }
.w-waitlist { max-width: 640px; margin: 0 auto; text-align: center; }
.w-form { display: flex; flex-direction: column; gap: 14px; text-align: left; padding: 24px; border-radius: 26px; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--edge); margin: 18px 0; }
.w-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 800; font-size: 0.92rem; }
.w-form label.inline { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.w-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.w-form legend { font-weight: 800; font-size: 0.92rem; margin-bottom: 8px; width: 100%; }
.w-form input:not([type='radio']):not([type='checkbox']), .w-form select { min-height: 48px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; }
.w-form input[type='radio'], .w-form input[type='checkbox'] { width: 20px; height: 20px; accent-color: var(--primary); }
.w-form-msg { min-height: 1.4em; margin: 0; font-weight: 800; }
.w-form-msg.ok { color: #02853c; }
.w-form-msg.bad { color: #d02b31; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
html[data-motion='reduced'] *, html[data-motion='reduced'] *::before, html[data-motion='reduced'] *::after { animation: none !important; transition: none !important; }
.pub-medallion svg { width: 86%; height: 86%; display: block; }
