/* JellyCube coming-soon page.
   Each flavour (green, blue, purple, pink) is a set of colours sampled from its
   logo's own background. The colours are registered with @property so they glide
   from one flavour to the next instead of snapping.
   To add a flavour: a logo in assets/, a [data-cw] block below, a <img> and a
   .flav button in index.html, and its name in ORDER in cycle.js. */

@property --bg-deep  { syntax: '<color>'; inherits: true; initial-value: #023a01; }
@property --bg-mid   { syntax: '<color>'; inherits: true; initial-value: #0d6a08; }
@property --bg-hi    { syntax: '<color>'; inherits: true; initial-value: #2c9c14; }
@property --glow     { syntax: '<color>'; inherits: true; initial-value: #a8ff3e; }
@property --ink      { syntax: '<color>'; inherits: true; initial-value: #052a03; }
@property --on       { syntax: '<color>'; inherits: true; initial-value: #ffffff; }
@property --on-soft  { syntax: '<color>'; inherits: true; initial-value: rgba(255,255,255,.84); }
@property --chipbg   { syntax: '<color>'; inherits: true; initial-value: rgba(0,0,0,.28); }
@property --chipline { syntax: '<color>'; inherits: true; initial-value: rgba(255,255,255,.25); }

:root {
  --f-brand: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --f-pixel: "Pixelify Sans", ui-monospace, Consolas, monospace;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #023a01; }
body { font-family: var(--f-body); -webkit-font-smoothing: antialiased; }
p, h1 { margin: 0; }
[hidden] { display: none !important; }

/* ---------- flavours ---------- */
.site {
  --bg-deep: #023a01; --bg-mid: #0d6a08; --bg-hi: #2c9c14; --glow: #a8ff3e; --ink: #052a03;
  --on: #ffffff; --on-soft: rgba(255,255,255,.84); --chipbg: rgba(0,0,0,.28); --chipline: rgba(255,255,255,.25);
  --t: 1.8s;
}
.site[data-cw="blue"]   { --bg-deep: #00319a; --bg-mid: #0a4fc4; --bg-hi: #2f86ec; --glow: #a6ecff; --ink: #021a55; }
.site[data-cw="purple"] { --bg-deep: #3e0c6c; --bg-mid: #5f179a; --bg-hi: #8d43d6; --glow: #ebbcff; --ink: #21063d; }
.site[data-cw="pink"]   { --bg-deep: #f465bf; --bg-mid: #fb7ccb; --bg-hi: #ffc2e7; --glow: #ffffff; --ink: #540d3d;
  --on: #4a0a36; --on-soft: #6b1a52; --chipbg: rgba(255,255,255,.55); --chipline: rgba(84,13,61,.22); }

/* ---------- page ---------- */
.site {
  position: relative; overflow: hidden; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(16px, env(safe-area-inset-left, 0px));
  color: var(--on);
  background: radial-gradient(ellipse 62% 78% at 28% 50%, var(--bg-hi) 0%, var(--bg-mid) 40%, var(--bg-deep) 100%);
  transition: --bg-deep var(--t) ease, --bg-mid var(--t) ease, --bg-hi var(--t) ease, --glow var(--t) ease, --ink var(--t) ease,
              --on var(--t) ease, --on-soft var(--t) ease, --chipbg var(--t) ease, --chipline var(--t) ease;
}
.px { position: absolute; inset: 0; pointer-events: none; }
.px span { position: absolute; background: var(--glow); opacity: .2; }

/* Sizes below use cqi = 1% of the frame's width, capped by clamp() so text stays readable. */
.frame { container-type: inline-size; width: min(100%, 1280px); }
.site-in { display: grid; grid-template-columns: 46% 1fr; align-items: center; gap: 3cqi; padding: 4cqi 2cqi; }

/* ---------- logo ---------- */
.logo {
  position: relative; display: block; width: 100%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%;
  background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.logo:focus-visible { outline: 3px solid var(--glow); outline-offset: 4px; }
.logo-float { position: absolute; inset: 0; animation: float 4.5s ease-in-out infinite; }
.logo img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity var(--t) ease;
  -webkit-mask-image: radial-gradient(closest-side, #000 82%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 82%, transparent 100%);
}
.logo img.on { opacity: 1; }
.logo.bump .logo-float { animation: squish .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes float  { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.4%); } }
@keyframes squish { 0% { transform: scale(1,1); } 30% { transform: scale(1.07,.92); } 60% { transform: scale(.96,1.05); } 100% { transform: scale(1,1); } }

/* ---------- text ---------- */
.copy { display: grid; gap: clamp(14px, 2.1cqi, 28px); min-width: 0; justify-items: start; }
.kicker {
  display: flex; align-items: center; gap: .6em;
  font: 600 clamp(12px, 1.7cqi, 18px)/1 var(--f-pixel); letter-spacing: .14em; text-transform: uppercase; color: var(--on-soft);
}
.kicker::before { content: ""; width: .7em; height: .7em; background: var(--glow); box-shadow: 0 0 .8em var(--glow); }
.word {
  font: 400 clamp(52px, 8.4cqi, 112px)/.95 var(--f-brand); color: #fff; letter-spacing: .01em;
  text-shadow: 0 .06em 0 var(--ink), .04em .04em 0 var(--ink), -.04em .04em 0 var(--ink),
               .04em -.025em 0 var(--ink), -.04em -.025em 0 var(--ink), 0 .16em .28em rgba(0,0,0,.25);
}
.lede { font: 500 clamp(15px, 2.05cqi, 22px)/1.45 var(--f-body); color: var(--on-soft); max-width: 38ch; }

.addr {
  display: grid; gap: .6em; width: 100%; max-width: 560px;
  background: var(--chipbg); border: 1px solid var(--chipline); border-radius: 16px; padding: clamp(14px, 1.6cqi, 22px) clamp(16px, 1.8cqi, 24px);
}
.addr-label { font: 400 clamp(11px, 1.5cqi, 15px)/1 var(--f-pixel); letter-spacing: .1em; text-transform: uppercase; color: var(--on-soft); }
.addr-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.addr-row code { font: 600 clamp(20px, 2.9cqi, 34px)/1 var(--f-pixel); color: var(--on); letter-spacing: .02em; min-width: 0; overflow-wrap: anywhere; }
.copy-btn {
  flex: none; font: 600 clamp(14px, 1.7cqi, 17px)/1 var(--f-body); color: #3d2600; cursor: pointer;
  border: 0; border-radius: 10px; padding: .75em 1.15em;
  background: linear-gradient(#ffd75a, #f2a813); box-shadow: 0 4px 0 #b97a06;
}
.copy-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #b97a06; }

.discord {
  display: inline-flex; align-items: center; gap: .55em; text-decoration: none;
  font: 600 clamp(15px, 1.9cqi, 18px)/1 var(--f-body); color: var(--ink); background: #fff;
  border-radius: 12px; padding: .8em 1.25em; box-shadow: 0 4px 0 color-mix(in srgb, var(--ink) 55%, transparent);
}
.discord svg { width: 1.25em; height: 1.25em; }

.foot { display: flex; align-items: center; flex-wrap: wrap; gap: clamp(12px, 2cqi, 24px); }
.flav { display: flex; gap: 10px; }
.flav button {
  width: clamp(16px, 1.9cqi, 20px); height: clamp(16px, 1.9cqi, 20px); padding: 0; cursor: pointer;
  border: 3px solid rgba(255,255,255,.75); background: var(--c); opacity: .55; transition: opacity .3s, transform .3s;
}
.flav button[aria-pressed="true"] { opacity: 1; transform: scale(1.25); }
.soon { font: 400 clamp(11px, 1.5cqi, 15px)/1 var(--f-pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--on-soft); }

.copy-btn:focus-visible, .discord:focus-visible, .flav button:focus-visible { outline: 2px solid var(--glow); outline-offset: 3px; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: #fff; color: #1b1b1b; font: 600 14px/1 var(--f-body); padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); white-space: nowrap;
}

/* ---------- phones and narrow windows: stack ---------- */
@container (max-width: 800px) {
  .site-in { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 20px; padding: 28px 0 40px; }
  .logo { width: min(78%, 420px); }
  .copy { justify-items: center; gap: 18px; width: 100%; max-width: 520px; }
  .kicker { font-size: clamp(12px, 3.6cqi, 16px); }
  .word { font-size: clamp(52px, 15cqi, 96px); }
  .lede { font-size: clamp(15px, 4.3cqi, 19px); }
  .addr { text-align: left; }
  .addr-row code { font-size: clamp(20px, 6cqi, 30px); }
  .foot { flex-direction: column; }
}

/* When stacked, centre the glow behind the cube instead of to its left. */
@media (max-width: 832px) {
  .site { background: radial-gradient(ellipse 95% 55% at 50% 26%, var(--bg-hi) 0%, var(--bg-mid) 45%, var(--bg-deep) 100%); }
}

@media (prefers-reduced-motion: reduce) {
  .site { --t: 0s; }
  .logo-float, .logo.bump .logo-float { animation: none; }
}
