/* Mew's design system, borrowed from iggy.land (the contact card + the rolodex):
   a slow pastel fluid backdrop (fluid.js) with rising ✦ sparkles, Fredoka everywhere,
   liquid-glass cards (WebGL lenses refracting that fluid, see liquid-glass.js),
   jelly-token chips, concave glass fields, glass pill CTAs, etched white type, gradient
   eyebrows, and white ✦ fireworks for wins.

   Every glass element also has a CSS look (.gl-off, the default), used until the WebGL
   glass is ready or when a browser can't run it. Once it's running the root gets .gl-on
   and the CSS fills step aside so the shader's lenses show through. */
:root {
  --ink: #1e293b;              /* slate-800: values, names */
  --ink-soft: #7a6690;         /* unselected token text */
  --ink-deep: #34294a;         /* selected token text */
  --plum: lab(59 23.72 -26.71);  /* CTA text */
  --lilac: #c084fc;            /* purple-400: info text */
  --pink: #e879f9;
  --sky: #38bdf8;
  --etched: 0 1px 0 rgba(255,255,255,0.28), 0 1px 2px lab(43 14.63 -16.77 / 0.45), 0 3px 6px lab(43 14.63 -16.77 / 0.28);
  --spring: cubic-bezier(0.34, 1.6, 0.5, 1);
  --font: "Fredoka", ui-rounded, Arial, Helvetica, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { overscroll-behavior: none; background: #fff; }
body.mewpage { margin: 0; min-height: 100vh; background: #fff; color: var(--ink); font: 400 16px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── backdrop: the fluid (fluid.js) + sparkles canvas. The gradient is what shows without WebGL;
   the four stops per palette match PALETTES in fluid.js (pick one with ?bg= or data-mew-bg). */
:root { --fl0: #f6c4e4; --fl1: #dfbdf2; --fl2: #bfc6f6; --fl3: #b5dcf3; }
:root[data-mew-bg="pearl-dawn"] { --fl0: #fbdbe9; --fl1: #f2d4ec; --fl2: #e2d9f5; --fl3: #d6e5f6; }
:root[data-mew-bg="moonlit-lagoon"] { --fl0: #d9abd9; --fl1: #ae9fe0; --fl2: #93b2e2; --fl3: #9bcfe0; }
:root[data-mew-bg="opal-mist"] { --fl0: #f4cde8; --fl1: #d9d0f6; --fl2: #c4e2f3; --fl3: #d3efe9; }
.mew-fluid { position: fixed; inset: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(135deg, var(--fl0), var(--fl1) 35%, var(--fl2) 68%, var(--fl3)); }
.mew-fluid-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mew-sparkles { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ── glass surfaces. CSS fallback first (the fluid seen through frosted milk), shader when .gl-on */
.liquid-glass, .liquid-glass-refract, .glass-token, .glass-inset {
  transition: transform .3s var(--spring), opacity .5s ease, background-color .3s; }
.gl-off .liquid-glass {
  background: rgba(255,255,255,.38); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 30px 60px -30px rgba(70, 50, 110, .35); }
.gl-off .liquid-glass-refract { background: rgba(255,255,255,.62); backdrop-filter: blur(8px) saturate(1.4);
  -webkit-backdrop-filter: blur(8px) saturate(1.4); box-shadow: 0 1px 0 #fff inset, 0 8px 22px rgba(70, 50, 110, .16); }
.gl-off .glass-token { background: rgba(255,255,255,.5); box-shadow: 0 1px 0 #fff inset, 0 2px 6px rgba(70, 50, 110, .1); }
.gl-off .glass-token[data-tint] { background: var(--tint-css, rgba(251,177,255,.6)); }
.gl-off .glass-inset { background: rgba(255,255,255,.55); box-shadow: inset 0 2px 6px rgba(70, 50, 110, .18); }
.gl-on .liquid-glass, .gl-on .liquid-glass-refract, .gl-on .glass-token, .gl-on .glass-inset { background: transparent; }

.liquid-glass { position: relative; border-radius: 44px; --card-radius: 3rem; }
.liquid-glass-refract { border: 0; cursor: pointer; border-radius: 999px; }
.liquid-glass-refract:hover { transform: scale(1.04); }
.liquid-glass-refract:active { transform: scale(.95); }

/* CTA: the rolodex "next ↵" */
.cta { padding: 10px 26px; font-size: 14px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--plum); }
.cta.small { padding: 7px 14px; font-size: 13px; }
.cta:disabled { opacity: .4; cursor: not-allowed; }

/* jelly tokens (chips) */
.glass-token { border: 0; cursor: pointer; border-radius: 999px; padding: 6px 16px; font-size: 14px; font-weight: 700;
  color: var(--ink-soft); display: inline-flex; align-items: center; gap: 6px; }
.glass-token:hover { transform: scale(1.05); }
.glass-token:active { transform: scale(.95); }
.glass-token[data-tint] { color: var(--ink-deep); }

/* concave glass field */
.glass-inset { width: 100%; min-width: 0; border: 0; border-radius: 26px; padding: 12px 16px; font-size: 17px; text-align: center;
  color: lab(50 19.02 -21.69); outline: none; }
.glass-inset::placeholder { color: var(--lilac); }

/* type */
.etched { color: #fff; text-shadow: var(--etched); }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
  background: linear-gradient(90deg, #e879f9, #c084fc, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow.sky { background-image: linear-gradient(90deg, #38bdf8, #22d3ee, #60a5fa); letter-spacing: .25em; }
.deep { position: relative; }
.deep::before, .deep::after { content: attr(data-text); position: absolute; left: 0; top: 0; color: rgba(255,255,255,.1); pointer-events: none; }
.deep::before { transform: translate(1px, 1px); } .deep::after { transform: translate(2px, 2px); }
.thankyou-3d { color: #fff; text-shadow: 0 1px 0 #ede9fe, 0 2px 0 #e3d9fb, 0 3px 0 #d9c8f7, 0 4px 0 #cfb7f2, 0 5px 0 #c4a5ec,
  0 6px 1px rgba(70,50,110,.18), 0 0 5px rgba(70,50,110,.1), 0 1px 3px rgba(70,50,110,.3), 0 3px 5px rgba(70,50,110,.2),
  0 5px 10px rgba(70,50,110,.25), 0 10px 20px rgba(70,50,110,.15); }
.rainbow-glow { position: relative; isolation: isolate; }
.rainbow-glow::before { content: attr(data-text); position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, hsl(0 90% 62%) 0%, hsl(28 90% 62%) 14%, hsl(190 90% 62%) 17%, hsl(232 90% 62%) 42%,
    hsl(284 90% 62%) 66%, hsl(322 90% 62%) 84%, hsl(360 90% 62%) 100%);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; filter: blur(5px);
  animation: rainbow-scroll 3s linear infinite; pointer-events: none; }
@keyframes rainbow-scroll { to { background-position: 300% 0; } }

/* contact-card rows: a tinted disc, a tiny colored label, a bold value */
.row-glass { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-radius: 26px; text-align: left; width: 100%; }
.disc { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: var(--disc-bg, rgba(56,189,248,.12)); box-shadow: inset 0 2px 4px rgba(0,0,0,.05); transition: transform .3s var(--spring); }
.row-glass:hover .disc { transform: scale(1.1); }
.row-label { font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--c, #38bdf8); }
.row-value { font-size: 15px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* fireworks: white ✦ bang out and drift down */
.starburst { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none;
  animation: fw-gravity 1.7s ease-in forwards; z-index: 40; }
.starburst span { position: absolute; color: #fff; text-shadow: 0 0 6px rgba(255,255,255,.85), 0 0 2px rgba(120,80,180,.5);
  animation: fw-bang 1s ease-out forwards; }
@keyframes fw-bang { from { transform: translate(0, 0) scale(.3); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1); opacity: 1; } }
@keyframes fw-gravity { 0% { transform: translateY(0); opacity: 1; } 60% { opacity: 1; } 100% { transform: translateY(60px); opacity: 0; } }

/* Mew stage */
.mew-stage { position: relative; touch-action: pan-y; }
.mew-canvas { width: 100%; height: 100%; display: block; cursor: grab; position: relative; z-index: 1; }
.mew-canvas:active { cursor: grabbing; }
.mew-ring { position: absolute; top: 50%; left: 50%; width: 150%; max-width: none; transform: translate(-50%, -50%);
  animation: spin 44s linear infinite; pointer-events: none; opacity: .9; }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.mew-flat { width: 100%; height: 100%; border: 0; background: none; cursor: pointer; font-size: 80px; line-height: 1; position: relative; z-index: 1; }
.mew-flat.jiggle { animation: jiggle .6s var(--spring); }
@keyframes jiggle { 25% { transform: scale(1.15, .85); } 50% { transform: scale(.92, 1.1); } 75% { transform: scale(1.04, .97); } }
.mew-bubble { position: absolute; left: 50%; top: -6px; z-index: 3; transform: translate(-50%, 6px) scale(.6); opacity: 0; pointer-events: none;
  background: #fff; color: var(--plum); font-weight: 700; font-size: 14px; padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(70, 50, 110, .18); white-space: nowrap; transition: opacity .15s, transform .3s var(--spring); }
.mew-bubble.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.spark { position: absolute; pointer-events: none; z-index: 3; transform: translate(-50%, -50%);
  animation: spark .85s cubic-bezier(.2, .8, .3, 1) forwards; text-shadow: 0 0 6px rgba(255,255,255,.9); }
@keyframes spark { to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.3) rotate(120deg); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .mew-ring, .rainbow-glow::before { animation: none; }
}
