/* ==========================================================================
   Wukong Trade — Coming Soon
   ========================================================================== */

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

:root {
  --ink: #0a0907;
  --ink-2: #14110d;
  --gold: #e2b98a;
  --gold-hi: #f8e4c2;
  --gold-lo: #a97f55;
  --mist: #d8c3a3;
  --seal: #c33025;
  --text: #efe4d2;
  --text-dim: rgba(239, 228, 210, 0.74);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --f-ui: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --f-brush: "Ma Shan Zheng", "STKaiti", "KaiTi", serif;

  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; overflow: hidden; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  min-height: 100svh;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

::selection { background: var(--gold); color: var(--ink); }

/* --------------------------------------------------------------------------
   Stage: background image, fog, embers, overlays
   -------------------------------------------------------------------------- */

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--ink);
}

/* Cover-fit box that keeps the painting's aspect, so moon glow stays aligned. */
.scene {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(112vw, 112vh * 1672 / 941);
  height: max(112vh, 112vw * 941 / 1672);
  transform: translate3d(-50%, -50%, 0);
  will-change: transform;
}

.scene__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.scene__moon {
  position: absolute;
  left: 44.3%;
  top: 60.2%;
  width: 34%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 180, 0.42) 0%, rgba(255, 210, 150, 0.14) 22%, rgba(255, 200, 140, 0.04) 42%, transparent 66%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.fx--fog { mix-blend-mode: screen; }
.fx--embers { mix-blend-mode: screen; }

.calligraphy {
  position: absolute;
  left: max(3.5vw, 18px);
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--f-brush);
  font-size: min(15vh, 9vw);
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--gold);
  opacity: 0.09;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 var(--reveal, 100%), transparent calc(var(--reveal, 100%) + 12%));
          mask-image: linear-gradient(to bottom, #000 0%, #000 var(--reveal, 100%), transparent calc(var(--reveal, 100%) + 12%));
}

/* Darken the centre of frame so type stays legible over the bright mist. */
.scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(52% 40% at 50% 72%, rgba(10, 9, 7, 0.7), transparent 75%),
    linear-gradient(to bottom, rgba(10, 9, 7, 0.35), transparent 30%, transparent 70%, rgba(10, 9, 7, 0.55));
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.78) 100%);
}

.grain {
  position: absolute;
  inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 .95  0 0 0 0 .88  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.09;
  animation: grain 0.9s steps(6) infinite;
  pointer-events: none;
}

@keyframes grain {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-6%, 4%); }
  33%  { transform: translate(5%, -7%); }
  50%  { transform: translate(-3%, 9%); }
  67%  { transform: translate(8%, 2%); }
  83%  { transform: translate(-8%, -4%); }
  100% { transform: translate(2%, -2%); }
}

/* --------------------------------------------------------------------------
   Film framing: letterbox and slate
   -------------------------------------------------------------------------- */

.letterbox {
  position: fixed;
  left: 0;
  right: 0;
  height: 0;
  background: #000;
  z-index: 20;
  pointer-events: none;
}
.letterbox--top { top: 0; }
.letterbox--bottom { bottom: 0; }

.js:not(.intro-done) .letterbox { height: 50.5vh; }

.slate {
  position: fixed;
  inset: 0;
  z-index: 21;
  display: grid;
  place-items: center;
  pointer-events: none;
  visibility: hidden;
}
.js .slate { visibility: visible; }
.slate__line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(62vw, 720px);
  height: 1px;
  translate: -50% -50%;
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-hi) 50%, var(--gold) 80%, transparent);
  box-shadow: 0 0 18px rgba(248, 228, 194, 0.65);
  transform: scaleX(0);
}
.slate__label {
  position: absolute;
  top: calc(50% + 18px);
  left: 50%;
  translate: -50% 0;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
  white-space: nowrap;
  opacity: 0;
}
.slate__label i { font-style: normal; color: var(--seal); padding: 0 0.3em; }

.skip {
  position: fixed;
  z-index: 31;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  translate: -50% 0;
  font-family: var(--f-mono);
  font-size: 10.5px;
  appearance: none;
  border: 1px solid rgba(226, 185, 138, 0.3);
  background: transparent;
  color: var(--gold);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}
.skip:hover, .skip:focus-visible { background: rgba(226, 185, 138, 0.12); border-color: var(--gold); outline: none; }
.skip[hidden] { display: none; }
html:not(.js) .skip { display: none; }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  z-index: 10;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vh, 56px) 20px;
  text-align: center;
  overflow-x: clip;
}

/* Copy sits above the logo's ink halo (the logo wrapper is transformed, so it stacks). */
.kicker, .tagline, .sub, .signup { position: relative; z-index: 1; }

.logo-wrap {
  position: relative;
  width: min(520px, 78vw, 50vh * 5175 / 3905);
  aspect-ratio: 5175 / 3905;
  margin-bottom: clamp(4px, 1.6vh, 18px);
  perspective: 900px;
  filter: drop-shadow(0 0 var(--glow, 0px) rgba(248, 220, 170, 0.45)) drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55));
}

/* Ink halo: keeps the wordmark legible where it crosses the moon. */
.logo-wrap::before {
  content: "";
  position: absolute;
  left: -30%;
  right: -30%;
  top: 48%;
  bottom: -38%;
  background: radial-gradient(closest-side, rgba(9, 8, 6, 0.82), rgba(9, 8, 6, 0.5) 55%, transparent);
  pointer-events: none;
  z-index: -1;
}

.logo {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.logo .sheen { opacity: 0; pointer-events: none; }
.js .logo { visibility: hidden; }

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 clamp(6px, 1.4vh, 14px);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--gold-hi);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.9);
}
.kicker__text { padding-left: 0.5em; /* optically balance trailing tracking */ }
.kicker__rule {
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
}
.kicker__rule:last-child { background: linear-gradient(270deg, transparent, var(--gold)); }

.tagline {
  margin: 0;
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(28px, 4.4vh + 1vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--gold-hi);
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
  text-wrap: balance;
}

.sub {
  max-width: 460px;
  margin: clamp(8px, 1.4vh, 14px) 0 0;
  font-size: clamp(15px, 1.1vw + 9px, 18px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--text);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.9);
  text-wrap: pretty;
}

/* split-text helpers */
.w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0.06em 0.02em 0.14em; margin: -0.06em -0.02em -0.14em; }
.w > span { display: inline-block; }
/* Masks are only needed while words rise; afterwards let text-shadows breathe. */
.split-done .w { overflow: visible; }

.js .kicker,
.js .tagline,
.js .sub,
.js .signup { visibility: hidden; }

/* --------------------------------------------------------------------------
   Waitlist form
   -------------------------------------------------------------------------- */

.signup {
  width: min(100%, 470px);
  margin-top: clamp(16px, 3vh, 30px);
  min-height: 92px;
}

.field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  background: rgba(14, 12, 9, 0.62);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: inset 0 0 0 1px rgba(226, 185, 138, 0.22), 0 20px 50px -20px rgba(0, 0, 0, 0.8);
  transition: box-shadow 0.4s var(--ease-out);
}

/* Rotating gold edge */
.field::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  padding: 1px;
  background: conic-gradient(from var(--angle), transparent 0%, rgba(248, 228, 194, 0.95) 8%, transparent 22%, transparent 50%, rgba(226, 185, 138, 0.7) 58%, transparent 72%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.45;
  animation: spin 6s linear infinite;
  transition: opacity 0.4s;
  pointer-events: none;
}
.field:focus-within::before { opacity: 1; animation-duration: 2.6s; }
.field:focus-within { box-shadow: inset 0 0 0 1px rgba(226, 185, 138, 0.35), 0 0 40px -6px rgba(226, 185, 138, 0.35), 0 20px 50px -20px rgba(0, 0, 0, 0.8); }
.field.is-error::before { background: conic-gradient(from var(--angle), transparent, #ff6a55 10%, transparent 30%, transparent 50%, #ff6a55 60%, transparent 80%); opacity: 1; }

@keyframes spin { to { --angle: 360deg; } }

.field input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: 500 16px/1 var(--f-ui);
  letter-spacing: 0.01em;
  outline: none;
}
.field input::placeholder { color: rgba(239, 228, 210, 0.38); }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  overflow: hidden;
  cursor: pointer;
  color: var(--ink);
  font: 700 13px/1 var(--f-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #c99a66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 24px -8px rgba(226, 185, 138, 0.7);
  transition: box-shadow 0.3s var(--ease-out), filter 0.3s;
  will-change: transform;
}
.btn:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 10px 34px -6px rgba(226, 185, 138, 0.95); }
.btn:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.btn:active { filter: brightness(0.94); }
.btn__label, .btn__arrow { position: relative; transition: transform 0.45s var(--ease-out), opacity 0.2s; }
.btn__arrow { width: 16px; height: 16px; }
.btn:hover .btn__arrow { transform: translateX(4px); }
.btn__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.75) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ease-out);
}
.btn:hover .btn__shine { transform: translateX(120%); }
.btn__spinner {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(10, 9, 7, 0.25);
  border-top-color: var(--ink);
  opacity: 0;
  animation: rotate 0.8s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }
.is-loading .btn__label, .is-loading .btn__arrow { opacity: 0; }
.is-loading .btn__spinner { opacity: 1; }
.is-loading .btn { cursor: progress; }

.turnstile:empty { display: none; }
.turnstile { display: flex; justify-content: center; margin-top: 12px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-msg {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}
.form-msg.is-error { color: #ff9b8a; }

/* Success */
.success {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px 14px 14px;
  border-radius: 16px;
  text-align: left;
  background: rgba(14, 12, 9, 0.66);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 0 0 1px rgba(226, 185, 138, 0.28), 0 20px 50px -20px rgba(0, 0, 0, 0.8);
}
.success[hidden] { display: none; }
.success__seal {
  position: relative;
  flex: none;
  width: 58px; height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--seal);
  box-shadow: inset 0 0 0 3px rgba(255, 235, 220, 0.22), inset 0 0 18px rgba(0, 0, 0, 0.35), 0 6px 24px -6px rgba(195, 48, 37, 0.9);
  font-family: var(--f-brush);
  font-size: 38px;
  line-height: 1;
  color: #fff2e8;
}
.success__ring {
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  border: 2px solid var(--seal);
  opacity: 0;
}
.success__title {
  margin: 0;
  font-family: var(--f-serif);
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  line-height: 1.1;
  color: var(--gold-hi);
  outline: none;
}
.success__sub { margin: 4px 0 0; font-size: 14px; color: var(--text-dim); }
.success__sub b { color: var(--gold); font-family: var(--f-mono); font-weight: 500; letter-spacing: 0.06em; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 560px) {
  .calligraphy { opacity: 0.06; font-size: 13vh; left: 8px; }
  .logo-wrap { width: min(68vw, 34vh * 5175 / 3905); margin-bottom: 14px; }
  .kicker { font-size: 9.5px; gap: 10px; margin-bottom: 8px; }
  .kicker__rule { width: 28px; }
  .tagline { font-size: clamp(24px, 7.4vw, 30px); }
  .sub { font-size: 14px; margin-top: 8px; }
  .signup { margin-top: 20px; }
  .scrim {
    background:
      radial-gradient(90% 46% at 50% 66%, rgba(10, 9, 7, 0.72), transparent 78%),
      linear-gradient(to bottom, rgba(10, 9, 7, 0.35), transparent 30%, transparent 70%, rgba(10, 9, 7, 0.6));
  }
  /* Stacked: input and button become a matched pair of 48px boxes. */
  .field {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0;
    background: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .field::before { display: none; }
  .field:focus-within { box-shadow: none; }
  .field input {
    flex: none;
    height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    background: rgba(14, 12, 9, 0.66);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: inset 0 0 0 1px rgba(226, 185, 138, 0.3);
    transition: box-shadow 0.3s var(--ease-out);
  }
  .field input:focus { box-shadow: inset 0 0 0 1px var(--gold), 0 0 24px -6px rgba(226, 185, 138, 0.45); }
  .field.is-error input { box-shadow: inset 0 0 0 1px #ff6a55; }
  .btn { width: 100%; height: 48px; border-radius: 12px; font-size: 12px; }
  .success { padding: 12px; gap: 14px; }
}

@media (max-height: 640px) and (min-width: 561px) {
  .logo-wrap { width: min(400px, 44vh * 5175 / 3905); }
  .sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .grain, .field::before { animation: none; }
}
