/* Solflix entry card. Pairs with entry.js (the sequence is described at the top of that file). */

/* Covers the page from the first paint, before any script runs. The vignette matches the one the
   scene draws in SVG (ellipse 75 % at 50 % 45 %), so the handover on "Enter" is seamless. */
.entry {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(ellipse 75% 75% at 50% 45%, #31281F 0%, #282119 60%, #1E1812 100%);
  color: #E5D8BD;
  font-family: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  --tile: clamp(112px, 22vmin, 184px);
}
.intro-skip .entry, .entry--done { display: none; }
/* If the script never takes over (blocked, crashed), get out of the way. */
.entry:not(.entry--live) { animation: entry-failsafe .3s 12s forwards; }
@keyframes entry-failsafe { to { opacity: 0; visibility: hidden; } }
html.intro-lock, html.intro-lock body { overflow: hidden; }

.entry__glow {
  position: absolute;
  left: 50%;
  top: 44%;
  width: min(96vmin, 760px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(201, 115, 56, .2) 0%, rgba(201, 115, 56, .07) 38%, rgba(201, 115, 56, 0) 64%);
  pointer-events: none;
  animation: entry-breathe 4.8s ease-in-out infinite alternate;
}
@keyframes entry-breathe { from { opacity: .55; transform: translate(-50%, -50%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } }

/* Film grain, re-seeded 12 times a second (the drawing grid). entry.js supplies the texture. */
.entry__grain {
  position: absolute;
  inset: -40%;
  background-image: var(--entry-grain, none);
  background-size: 128px 128px;
  opacity: .085;
  pointer-events: none;
  animation: entry-grain 1s steps(1) infinite;
  transition: opacity .2s ease;
}
@keyframes entry-grain {
  0% { transform: translate(0, 0); }
  8% { transform: translate(-7%, 4%); }
  17% { transform: translate(5%, -9%); }
  25% { transform: translate(-12%, -3%); }
  33% { transform: translate(9%, 6%); }
  42% { transform: translate(-3%, 11%); }
  50% { transform: translate(12%, -6%); }
  58% { transform: translate(-9%, -11%); }
  67% { transform: translate(4%, 9%); }
  75% { transform: translate(-6%, -5%); }
  83% { transform: translate(11%, 2%); }
  92% { transform: translate(-2%, -8%); }
}

.entry__stage { position: relative; display: flex; flex-direction: column; align-items: center; padding: 24px; text-align: center; }
.entry__mark { display: block; width: var(--tile); height: var(--tile); }
.entry__title { margin: 28px 0 0; font-size: clamp(38px, 6vmin, 56px); font-weight: 700; line-height: 1; letter-spacing: -.02em; color: #E5D8BD; }
.entry__tagline { margin: 12px 0 0; font-size: 15px; font-weight: 500; color: #A09582; }
/* "Enter" and the contract address below it share one width, whichever is wider. */
.entry__actions { display: grid; gap: 16px; width: max-content; margin-top: 34px; }
.entry__enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  height: 60px;
  padding: 0 48px;
  border: 0;
  border-radius: 12px;
  background: #C97338;
  color: #1E1812;
  font: 700 21px/1 'Barlow', system-ui, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 12px 34px rgba(201, 115, 56, .28);
  transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
/* Letter-spacing trails the last letter, so pull it back to centre the word; trim the line box to
   the capitals so it centres vertically too. */
.entry__enter span { margin-right: -.2em; text-box: trim-both cap alphabetic; }
.entry__enter:hover { background: #DA8A52; transform: translateY(-1px); box-shadow: 0 16px 40px rgba(201, 115, 56, .36); }
.entry__enter:active { transform: scale(.97); }
.entry__enter:focus-visible { outline: 2px solid #DA8A52; outline-offset: 4px; }

/* Contract address: the address box and its copy button, one height, one frame. The row keeps its
   space (invisible) until entry.js has the address, so nothing moves when it appears. */
.entry__ca { display: flex; gap: 8px; opacity: 0; visibility: hidden; }
.entry__ca.is-ready { opacity: 1; visibility: visible; transition: opacity .3s ease; }
.entry__ca-box, .entry__ca-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1px solid rgba(229, 216, 189, .18);
  border-radius: 10px;
  background: rgba(229, 216, 189, .04);
  color: #E5D8BD;
  font: 600 14px/1 'Barlow', system-ui, sans-serif;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.entry__ca-box { flex: 1; gap: 10px; padding: 0 14px 0 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.entry__ca-label { padding: 5px 6px; border-radius: 5px; background: rgba(201, 115, 56, .16); color: #DA8A52; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.entry__ca-dots { margin: 0 .3em; color: #A09582; }
.entry__ca-copy { width: 40px; padding: 0; color: #BCB09A; }
.entry__ca-copy svg { width: 16px; height: 16px; }
.entry__ca-box:hover, .entry__ca-copy:hover { background: rgba(229, 216, 189, .1); color: #F4ECDC; border-color: rgba(229, 216, 189, .3); }
.entry__ca-copy:focus-visible { outline: 2px solid #DA8A52; outline-offset: 2px; }
.entry__ca.is-copied .entry__ca-copy { color: #A3B97F; border-color: rgba(163, 185, 127, .55); }
/* Before launch: the box says "Coming soon" and isn't a button. */
.entry__ca.is-soon .entry__ca-box { cursor: default; color: #BCB09A; }
.entry__ca.is-soon .entry__ca-box:hover { background: rgba(229, 216, 189, .04); border-color: rgba(229, 216, 189, .18); color: #BCB09A; }

/* Top right: sound toggle and X, one height. */
.entry__corner {
  position: absolute;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
}
.entry__sound, .entry__x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid rgba(229, 216, 189, .18);
  border-radius: 10px;
  background: rgba(229, 216, 189, .04);
  color: #BCB09A;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.entry__sound {
  gap: 8px;
  padding: 0 12px;
  font: 600 12px/1 'Barlow', system-ui, sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.entry__x { width: 36px; padding: 0; }
.entry__sound:hover, .entry__x:hover { background: rgba(229, 216, 189, .1); color: #F4ECDC; border-color: rgba(229, 216, 189, .3); }
.entry__sound:focus-visible, .entry__x:focus-visible { outline: 2px solid #DA8A52; outline-offset: 2px; }
.entry__sound svg { width: 16px; height: 16px; }
.entry__x svg { width: 15px; height: 15px; }

/* On "Enter": the words step back, the scene (drawn by entry.js) takes the stage. */
.entry--pressed .entry__title, .entry--pressed .entry__tagline, .entry--pressed .entry__enter, .entry--pressed .entry__ca, .entry--pressed .entry__corner {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s cubic-bezier(.3, 0, 1, 1), transform .18s cubic-bezier(.3, 0, 1, 1);
}
.entry--pressed .entry__corner { transform: none; }
.entry--playing { background: none; }
.entry--playing .entry__mark { visibility: hidden; }
.entry--diving .entry__grain { opacity: 0; }
.entry__scene { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: none; overflow: visible; }
.entry--fading { opacity: 0; transition: opacity .35s ease; }

/* Warm afterglow over the site as the entry lets go. */
.entry-afterglow {
  position: fixed;
  inset: 0;
  z-index: 2147482999;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 70% at 50% 50%, rgba(232, 219, 193, .16), rgba(232, 219, 193, 0) 70%);
  animation: entry-afterglow .45s ease-out forwards;
}
@keyframes entry-afterglow { to { opacity: 0; } }

/* Short screens (phones on their side): tighten the stack so it all fits. */
@media (max-height: 520px) {
  .entry { --tile: clamp(84px, 20vmin, 120px); }
  .entry__title { margin-top: 16px; font-size: 34px; }
  .entry__tagline { margin-top: 8px; }
  .entry__actions { gap: 12px; margin-top: 20px; }
  .entry__enter { height: 52px; }
}
