/* ============ AMAZIN ($AMAZIN) — TRADING TERMINAL THEATRE ============ */

:root {
  --bg:       #0D0B08;
  --panel:    #12100B;
  --charcoal: #141210;
  --cream:    #F2ECDF;
  --ink:      #1A1712;
  --amber:    #E8862D;
  --carton:   #B07D48;
  --green:    #37D67A;
  --nav-h: 64px;
  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --font-body: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

img, video { max-width: 100%; }

/* fixed decor layers */
.bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.04;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: fixed; inset: 0; z-index: 89; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 62%, rgba(0, 0, 0, 0.38) 100%);
}

.marquee, .nav, main, .footer { position: relative; z-index: 1; }

/* ---------- overline ---------- */

.overline {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--amber);
  margin-bottom: 16px;
}

/* ---------- marquee strips ---------- */

.marquee {
  overflow: hidden;
  background: var(--amber);
  border-block: 1px solid rgba(26, 23, 18, 0.35);
}

.marquee-inner {
  display: inline-flex;
  white-space: nowrap;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  will-change: transform;
  animation: marquee-move 42s linear infinite;
}

.marquee-inner > span { padding-right: 8px; }

@keyframes marquee-move {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- navbar ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid rgba(242, 236, 223, 0.12);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--cream);
}

.nav-brand img { width: 40px; height: 40px; border-radius: 8px; }

.nav-brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.02em;
}

.nav-links { display: flex; align-items: center; gap: 24px; }

.nav-links a {
  color: var(--cream);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
}

.nav-links a:hover { color: var(--amber); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 28px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--cream);
  border: 2px solid var(--amber);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.5); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.5); }

.btn:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
}

.btn-amber, .btn-buy { background: var(--amber); color: var(--ink); }

/* breathing glow on BUY (opacity-only animation on a blurred layer) */
.btn-buy { position: relative; }

.btn-buy::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 16px;
  background: var(--amber);
  filter: blur(14px);
  opacity: 0.28;
  z-index: -1;
  animation: glow-breathe 2s ease-in-out infinite;
}

@keyframes glow-breathe {
  0%, 100% { opacity: 0.22; }
  50%      { opacity: 0.5; }
}

/* ---------- panels (shared) ---------- */

.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--amber);
  border-radius: 12px;
}

.sim-label {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  opacity: 0.45;
  pointer-events: none;
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--amber);
  padding: 10px 14px;
  border-bottom: 1px solid rgba(242, 236, 223, 0.1);
}

.panel-head .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  min-height: calc(100svh - var(--nav-h));
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 24px 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 32px;
  align-items: center;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding-bottom: 32px;
}

/* order flow terminal */
.terminal {
  background: #0D0B08;
  height: 460px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.terminal-log {
  flex: 1;
  overflow: hidden;
  padding: 10px 14px 20px;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  color: var(--cream);
  /* older lines fade out toward the top (mask, so text keeps full contrast for a11y tools) */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
}

.terminal-log .t-dim { opacity: 0.55; }
.terminal-log .t-ok { color: var(--green); font-weight: 700; }
.terminal-log .t-pct { color: var(--amber); font-weight: 700; }
.terminal-log > div { transform: translateZ(0); }

/* headline */
.hero-word {
  font-family: var(--font-display);
  font-size: clamp(48px, 12vw, 180px);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.01em;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  color: var(--cream);
}

.hero-word.is-long {
  font-size: clamp(40px, 8vw, 110px);
  overflow-wrap: anywhere;
}

.hw-char {
  display: inline-block;
  animation: hw-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes hw-in {
  from { opacity: 0; transform: translateY(0.35em); }
  to   { opacity: 1; transform: translateY(0); }
}

/* shine sweep — a translucent band crossing the headline (no gradient text) */
.hero-word::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -35%;
  width: 30%;
  background: rgba(242, 236, 223, 0.09);
  transform: skewX(-18deg) translateX(0);
  animation: shine 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes shine {
  0%, 55% { transform: skewX(-18deg) translateX(0); }
  85%, 100% { transform: skewX(-18deg) translateX(520%); }
}

.word-suffix { font-size: 0.3em; vertical-align: middle; letter-spacing: 0; }

/* ---------- mascot peeking from the word's bottom-right ---------- */

.word-wrap {
  position: relative;
  max-width: 100%;
  transition: margin-bottom 0.45s ease;
}

.word-wrap .hero-word { position: relative; z-index: 2; }

/* text near the mascot always paints above it */
.hero-sub, .btn-how, .hero-counter { position: relative; z-index: 2; }

/* anchored at the word block's bottom-right corner, hanging on the text edge */
.mascot-dock {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1; /* behind the letters */
  transform: translate(52%, 52%);
  transition: transform 0.45s ease;
}

.mascot-float { animation: mascot-bob 3.5s ease-in-out infinite; will-change: transform; }

@keyframes mascot-bob {
  0%, 100% { transform: translateY(-6px); }
  50%      { transform: translateY(6px); }
}

.mascot-img {
  display: block;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  transform: rotate(-6deg);
}

.mascot-img.bounce { animation: mascot-bounce 0.3s ease-out; }

@keyframes mascot-bounce {
  0%   { transform: rotate(-6deg) translateY(0); }
  40%  { transform: rotate(4deg) translateY(-12px); }
  100% { transform: rotate(-6deg) translateY(0); }
}

/* the word always wins: with >14 i's touching the mascot, it slides below */
.word-wrap.mascot-low { margin-bottom: 96px; }

.word-wrap.mascot-low .mascot-dock { transform: translate(20%, 85%) scale(0.6); }

@media (max-width: 960px) {
  .mascot-img { width: 130px; height: 130px; }
  .mascot-dock { transform: translate(55%, 55%); }
  .word-wrap.mascot-low { margin-bottom: 48px; }
  .word-wrap.mascot-low .mascot-dock { transform: translate(15%, 85%) scale(0.6); }
}

.hero-word.is-shaking { animation: shake 0.2s linear; }

@keyframes shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(-5px, 2px) rotate(-0.8deg); }
  50%      { transform: translate(4px, -3px) rotate(0.8deg); }
  75%      { transform: translate(-3px, 2px) rotate(-0.5deg); }
}

.hero-sub { font-size: clamp(14px, 1.8vw, 18px); font-weight: 500; }

.hero-sub [lang="zh"] { display: block; font-size: 0.9em; opacity: 0.72; }

.btn-how { font-size: clamp(17px, 2.2vw, 22px); padding: 14px 40px; }

.hero-counter {
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

/* tracking hash strip */
.hash-strip {
  position: relative;
  overflow: hidden;
  border-top: 1px solid rgba(242, 236, 223, 0.1);
  padding: 6px 0 14px;
}

.hash-strip .sim-label { bottom: 2px; }

.hash-inner {
  display: inline-flex;
  white-space: nowrap;
  font-size: 11px;
  opacity: 0.6;
  will-change: transform;
}

.hash-chunk { padding-right: 24px; }

/* +15.27% burst */
.pct-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-variant-numeric: tabular-nums;
  font-size: clamp(44px, 9vw, 110px);
  color: var(--cream);
  text-shadow: 5px 5px 0 var(--amber);
  white-space: nowrap;
  pointer-events: none;
  z-index: 3;
  animation: flyup 1.3s ease-out forwards;
}

@keyframes flyup {
  0%   { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  18%  { opacity: 1; transform: translate(-50%, -55%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -170%) scale(1.1); }
}

/* button burst particles */
.burst-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.burst-p {
  position: absolute;
  border-radius: 2px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  animation: burst-fly ease-out forwards;
}

@keyframes burst-fly {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--tx, 0px), var(--ty, -60px)) rotate(var(--spin, 180deg)); opacity: 0; }
}

/* ---------- sections ---------- */

.section { padding: 80px 24px; }

.wrap { max-width: 880px; margin: 0 auto; }

.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.section-title [lang="zh"] { font-size: 0.55em; display: block; opacity: 0.72; margin-top: 8px; }

/* scroll reveal (class added by JS so no-JS still shows everything) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.revealed { opacity: 1; transform: none; }

/* ---------- ONE BOX. ONE ADDRESS. ---------- */

.ca-section {
  background: var(--charcoal);
  border-block: 2px solid var(--amber);
  box-shadow: 0 0 48px rgba(232, 134, 45, 0.14) inset;
}

.ca-section :focus-visible { outline-color: var(--cream); }

.ca-warning {
  font-style: italic;
  font-size: 15px;
  opacity: 0.85;
  max-width: 640px;
  margin-bottom: 24px;
}

.ca-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 16px;
}

.ca {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(15px, 2.4vw, 24px);
  word-break: break-all;
  color: #F2ECDF;
  flex: 1 1 320px;
  display: flex;
  align-items: center;
  background: rgba(242, 236, 223, 0.06);
  border: 1px dashed var(--amber);
  border-radius: 10px;
  padding: 16px;
  line-height: 1.4;
}

.btn-copy { min-width: 48px; min-height: 48px; }

.ca-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.ca-links .btn { flex: 1 1 220px; }

@media (max-width: 480px) {
  .ca-links { flex-direction: column; }
  .ca-links .btn { flex: 1 1 auto; width: 100%; }
}

/* ---------- live chart tape ---------- */

.chart-section { padding: 40px 0; }

.chart-wrap {
  position: relative;
  height: 90px;
  background: var(--panel);
  border-block: 1px solid rgba(242, 236, 223, 0.1);
}

.chart-wrap canvas { display: block; width: 100%; height: 90px; }

.chart-axis {
  position: absolute;
  right: 12px;
  top: 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--green);
  opacity: 0.85;
}

/* ---------- video strip ---------- */

.video-strip video {
  display: block;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(242, 236, 223, 0.18);
  background: var(--carton) url('assets/img/hero-poster.jpg') center / cover no-repeat;
}

.video-strip .overline { max-width: 960px; margin-inline: auto; }

.video-strip .wrap { max-width: 960px; }

/* ---------- warehouse status board ---------- */

.board {
  padding: 24px 16px;
  font-size: clamp(13px, 1.8vw, 16px);
  overflow: hidden;
}

.board-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: 16px;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(242, 236, 223, 0.08);
}

.board-row:last-of-type { border-bottom: 0; }

.board-label { opacity: 0.6; letter-spacing: 0.06em; }

.board-value { font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; }

.board-value.v-green { color: var(--green); }
.board-value.v-amber { color: var(--amber); }

.board-value span { display: inline-block; }

.flap-in { animation: flap-in 0.32s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

@keyframes flap-in {
  from { transform: translateY(-105%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---------- how to buy ---------- */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.step {
  background: var(--panel);
  border: 1px solid rgba(242, 236, 223, 0.14);
  border-radius: 12px;
  padding: 24px 20px;
}

.step-num {
  display: inline-block;
  font-size: 12px;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 12px;
}

.step h3 {
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 16px;
  margin-bottom: 8px;
}

.step p { font-size: 14.5px; opacity: 0.85; }

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
}

/* ---------- parcel card ---------- */

.parcel-card { max-width: 560px; margin: 0 auto; text-align: center; }

.parcel-frame {
  background: var(--carton);
  border: 1px solid rgba(242, 236, 223, 0.2);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.parcel-frame img { width: 100%; height: 100%; object-fit: cover; }

.parcel-frame.img-missing img { display: none; }
.parcel-frame.img-missing::after { content: '📦'; font-size: 56px; }

.parcel-card figcaption {
  margin-top: 16px;
  font-size: 14px;
  font-style: italic;
  opacity: 0.8;
}

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid rgba(242, 236, 223, 0.12);
  padding: 40px 24px 48px;
  text-align: center;
  font-size: 13.5px;
}

.footer-logo { width: 56px; height: 56px; border-radius: 12px; margin-bottom: 16px; }

.footer p { max-width: 560px; margin: 0 auto; opacity: 0.85; }

/* ---------- floating BUY ---------- */

.btn-buy-float {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 55;
  min-height: 48px;
  padding: 10px 20px;
  font-size: 14px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.btn-buy-float.hide {
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

@media (max-width: 768px) {
  .btn-buy-float { bottom: 84px; }
}

/* ---------- sticky CA bar (mobile) ---------- */

.sticky-ca {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--charcoal);
  border-top: 2px solid var(--amber);
  color: var(--cream);
}

.sticky-ca[hidden] { display: none !important; }

.sticky-ca-text {
  flex: 1 1 auto;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-sticky-copy {
  min-width: 48px;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--cream);
  background: transparent;
  border: 2px solid var(--amber);
  border-radius: 8px;
  cursor: pointer;
}

.btn-sticky-close {
  min-width: 44px;
  min-height: 44px;
  font-size: 22px;
  line-height: 1;
  color: var(--cream);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.sticky-ca :focus-visible { outline-color: var(--cream); }

@media (max-width: 768px) {
  .sticky-ca { display: flex; }
  body.has-sticky { padding-bottom: 64px; }
}

/* ---------- hero responsive ---------- */

@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 24px; }
  .hero-main { order: -1; padding-top: 8px; }
  .terminal { height: 216px; }
}

/* ---------- hidden tab: freeze CSS animations ---------- */

.anim-paused *, .anim-paused *::before, .anim-paused *::after {
  animation-play-state: paused !important;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .btn, .btn:hover, .btn:active { transition: none; transform: none; }

  .marquee-inner,
  .hw-char,
  .hero-word::after,
  .hero-word.is-shaking,
  .btn-buy::before,
  .flap-in,
  .burst-p,
  .mascot-float,
  .mascot-img.bounce { animation: none; }

  .mascot-dock, .word-wrap { transition: none; }

  .hw-char { opacity: 1; transform: none; }

  .hero-word::after { display: none; }

  .reveal { opacity: 1; transform: none; transition: none; }

  .btn-buy-float { transition: none; }

  .terminal-log {
    -webkit-mask-image: none;
            mask-image: none;
  }

  /* the number still shows — static, centered, no motion */
  .pct-burst {
    animation: none;
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}
