:root {
  --night: #0B0C0F;
  --night-2: #141519;
  --hx-h: clamp(600px, calc(100svh - 58px), 980px);
  --tile-gap: 28px;
}

.hx,
.ch--dark,
.cta,
.home nav.is-dark {
  --paper: var(--night);
  --paper-2: var(--night-2);
  --surface: #121318;
  --ink: #F4F4F6;
  --ink-2: #C7C8CF;
  --ink-light: #9294A0;
  --ink-faint: #62646E;
  --rule: rgb(255 255 255 / 0.1);
  --up: var(--up-soft);
  --down: var(--down-soft);
}

/* ---- nav over the hero ---- */
.home nav { transition: background-color 0.25s, border-color 0.25s, color 0.25s; }
.home nav.is-dark {
  background: rgb(11 12 15 / 0.92);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: rgb(255 255 255 / 0.08);
  color: var(--ink);
}

/* ---- hero ---- */
.hx {
  --mx: 0;
  --my: 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: calc(var(--hx-h) + 58px);
  margin-top: -58px;
  padding-top: 58px;
  display: flex;
  flex-direction: column;
  background: var(--night);
  color: var(--ink);
}

.hx-wall { position: absolute; inset: 0; z-index: -3; perspective: 1800px; perspective-origin: 70% 40%; }
.hx-plane {
  position: absolute;
  top: 50%;
  left: 68%;
  width: 1380px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--tile-gap);
  transform:
    translate(-50%, -50%)
    rotateX(calc(32deg - var(--my) * 4deg))
    rotateZ(calc(-21deg + var(--mx) * 3deg));
  transform-style: preserve-3d;
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.hx-col:nth-child(even) { margin-top: -180px; }
.hx-track {
  display: flex;
  flex-direction: column;
  animation: hxRoll var(--dur, 90s) linear infinite;
  will-change: transform;
}
.hx-col:nth-child(1) .hx-track { --dur: 96s; }
.hx-col:nth-child(2) .hx-track { --dur: 118s; animation-direction: reverse; }
.hx-col:nth-child(3) .hx-track { --dur: 84s; }
.hx-col:nth-child(4) .hx-track { --dur: 126s; animation-direction: reverse; }
.hx-col:nth-child(5) .hx-track { --dur: 102s; }
@keyframes hxRoll { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(0, -50%, 0); } }

.hx-card { position: relative; margin: 0 0 var(--tile-gap); container-type: inline-size; }
.hx-card picture, .cta-strip picture { display: block; flex-shrink: 0; }
.hx-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 438 / 610;
  object-fit: cover;
  border-radius: 4.8cqi;
  background: var(--night-2);
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hx-card img.is-in { opacity: 1; }
.hx-card:nth-child(3n + 1)::after {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  aspect-ratio: 438 / 610;
  border-radius: 4.8cqi;
  background: linear-gradient(115deg, transparent 30%, rgb(255 255 255 / 0.2) 46%, rgb(160 215 255 / 0.16) 54%, transparent 70%);
  opacity: 0;
  animation: hxSheen 7s ease-in-out infinite;
  pointer-events: none;
}
.hx-card:nth-child(6n + 4)::after { animation-delay: 2.4s; }
@keyframes hxSheen { 0%, 60%, 100% { opacity: 0; } 78% { opacity: 1; } }

.hx-chip {
  position: absolute;
  left: 7cqi;
  bottom: -12px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 10px;
  background: var(--night);
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.hx-price { color: var(--ink); font-weight: 500; }
.hx-delta { font-weight: 500; }
.hx-card--up .hx-delta { color: var(--up); }
.hx-card--down .hx-delta { color: var(--down); }
.hx-tag, .hx-win { font-size: 10px; letter-spacing: 0.08em; color: var(--ink-faint); }
.hx-tag { color: var(--ink-light); border: 1px solid rgb(255 255 255 / 0.2); padding: 0 4px; border-radius: var(--r-sm); }

.hx-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgb(255 255 255 / 0.018) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, var(--night) 0%, rgb(11 12 15 / 0.95) 30%, rgb(11 12 15 / 0.6) 50%, rgb(11 12 15 / 0) 68%),
    linear-gradient(0deg, var(--night) 0%, rgb(11 12 15 / 0) 26%),
    linear-gradient(180deg, rgb(11 12 15 / 0.6) 0%, rgb(11 12 15 / 0) 18%);
}
.hx-grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hx.is-idle .hx-track,
.hx.is-idle .hx-card::after,
.hx.is-idle .ticker-track { animation-play-state: paused; }

.hx-inner {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  width: 100%;
  padding-top: 64px;
  padding-bottom: 64px;
}
.hx-copy { max-width: 720px; }
.hx-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(46px, 7.4vw, 116px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  margin-bottom: 44px;
  color: var(--ink);
  text-wrap: balance;
}
html[lang="ja"] .hx-title,
html[lang^="zh"] .hx-title { letter-spacing: -0.02em; line-height: 1.1; }
html[lang="ja"] .hx-title { font-size: clamp(40px, 6.4vw, 100px); }
html[lang^="zh"] .hx-title { font-size: clamp(30px, 5.2vw, 84px); }
html[lang="ja"] .hx-title > *,
html[lang^="zh"] .hx-title > * { white-space: nowrap; }
.hx-title em {
  display: block;
  font-style: normal;
  color: transparent;
  -webkit-text-stroke: 0.022em var(--ink);
}
html[lang^="zh"] .hx-title em { color: var(--ink-light); -webkit-text-stroke: 0; }
html[lang="en"] .hx-title { font-size: clamp(42px, 5.4vw, 84px); }

.hx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
.hx-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
  background: #FFFFFF;
  color: var(--night);
  border-radius: var(--r-sm);
  font-size: 16px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.hx-btn:hover { background: var(--accent); color: #FFFFFF; transform: translateY(-2px); }
.hx-btn svg { width: 18px; height: 18px; fill: currentColor; }
.hx-ghost {
  display: inline-flex;
  gap: 8px;
  padding: 12px 2px;
  font-size: 15px;
  color: var(--ink-2);
  border-bottom: 1px solid rgb(255 255 255 / 0.28);
  transition: color 0.15s, border-color 0.15s;
}
.hx-ghost:hover { color: var(--ink); border-color: var(--ink); }

.hx-ticker {
  position: relative;
  background: rgb(11 12 15 / 0.88);
  border-top: 1px solid rgb(255 255 255 / 0.1);
  border-bottom: 0;
}
.hx-ticker .ticker-track { padding-top: 11px; padding-bottom: 11px; animation-duration: 64s; }

.ch, .popular, .faq, .home .cta { content-visibility: auto; contain-intrinsic-size: auto 900px; }

/* ---- lede ---- */
.lede { padding: clamp(64px, 9vw, 120px) 0 clamp(48px, 6vw, 80px); }
.lede-text {
  max-width: 36em;
  font-size: clamp(18px, 2.05vw, 26px);
  font-weight: 500;
  line-height: 1.75;
  color: var(--ink-light);
}
html[lang="en"] .lede-text { line-height: 1.55; }

/* ---- feature chapters ---- */
.ch { position: relative; overflow: hidden; padding: clamp(88px, 11vw, 150px) 0; border-top: var(--line-ink); }
.ch-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.ch--flip .ch-text { order: 2; }
.ch-num {
  position: absolute;
  top: -0.42em;
  left: 0.12em;
  z-index: 0;
  font-family: var(--font-mono);
  font-size: clamp(150px, 24vw, 340px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  opacity: 0.13;
  pointer-events: none;
  user-select: none;
}
.ch--flip .ch-num { left: auto; right: 0.12em; }
.ch-text, .ch-visual { position: relative; z-index: 1; }
.ch-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}
html[lang="ja"] .ch-title,
html[lang^="zh"] .ch-title { letter-spacing: -0.01em; line-height: 1.22; }
html[lang="ja"] .ch-title,
html[lang="ja"] .home .cta h2,
html[lang^="zh"] .ch-title,
html[lang^="zh"] .home .cta h2 { word-break: normal; line-break: strict; }
@supports (word-break: auto-phrase) {
  html[lang="ja"] .ch-title,
  html[lang="ja"] .home .cta h2 { word-break: auto-phrase; }
}
.ch-lead { max-width: 30em; margin-bottom: 30px; font-size: 16px; line-height: 1.8; color: var(--ink-2); }
.ch-note { margin-top: 26px; font-size: 12px; line-height: 1.6; color: var(--ink-faint); }
.ch-visual { display: flex; justify-content: center; }
.ch .markets-card { transform: rotate(-1.6deg); }
.ch .lottery-map { transform: rotate(1.4deg); }

.ch--dark {
  background: var(--night);
  color: var(--ink);
  border-top: 0;
  margin: -1px 0;
  padding: calc(clamp(88px, 11vw, 150px) + 4vw) 0;
  clip-path: polygon(0 0, 100% 4vw, 100% 100%, 0 calc(100% - 4vw));
}
.ch--dark + .ch { border-top: 0; }
.ch--dark .ch-visual::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(560px, 120%);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(10 132 255 / 0.3) 0%, rgb(10 132 255 / 0) 66%);
  pointer-events: none;
}
.ch--dark .phone {
  position: relative;
  background: linear-gradient(180deg, #2B2C32 0%, var(--night-2) 100%);
  outline: 1px solid rgb(255 255 255 / 0.12);
  transform: rotate(3deg);
}

/* ---- faq ---- */
.home .faq { padding: clamp(72px, 9vw, 120px) 0; }
.faq-all > summary {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 30px 0;
  border-top: var(--line-ink-2);
  border-bottom: var(--line-ink);
  list-style: none;
  cursor: pointer;
}
.faq-all > summary::-webkit-details-marker { display: none; }
.faq-all-text { flex: 1; min-width: 0; }
.faq-all h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.4vw, 56px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  transition: color 0.15s;
}
html[lang="ja"] .faq-all h2,
html[lang^="zh"] .faq-all h2 { letter-spacing: -0.01em; }
.faq-all-sub { display: block; margin-top: 8px; font-size: 16px; color: var(--ink-light); }
.faq-all-icon {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  transition: transform 0.3s ease, background 0.15s, color 0.15s;
}
.faq-all-icon::before,
.faq-all-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 2px;
  background: currentColor;
  transform: translate(-50%, -50%);
}
.faq-all-icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq-all > summary:hover .faq-all-icon { background: var(--ink); color: var(--paper); }
.faq-all[open] .faq-all-icon { transform: rotate(45deg); }
.faq-all .faq-list { margin-top: 0; border-top: 0; }
@supports (interpolate-size: allow-keywords) {
  .faq-all { interpolate-size: allow-keywords; }
  .faq-all::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.45s ease, content-visibility 0.45s allow-discrete;
  }
  .faq-all[open]::details-content { block-size: auto; }
}

/* ---- closing cta ---- */
.home .cta {
  position: relative;
  overflow: hidden;
  padding: 0 0 clamp(88px, 10vw, 136px);
  background: var(--night);
  color: var(--ink);
}
.cta-strip {
  margin: 0 -4vw clamp(64px, 8vw, 104px);
  padding-top: 44px;
  transform: rotate(-3deg);
  overflow: hidden;
}
.cta-strip-track {
  display: flex;
  gap: 16px;
  width: max-content;
  animation: tickerScroll 70s linear infinite;
}
.cta-strip img { width: 124px; height: auto; border-radius: 6px; }
.home .cta h2 {
  font-size: clamp(38px, 6.2vw, 88px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}
html[lang="ja"] .home .cta h2,
html[lang^="zh"] .home .cta h2 { letter-spacing: -0.01em; line-height: 1.15; }
.home .cta-sub { color: var(--ink-light); }
.home .cta .btn-primary { padding: 16px 30px; font-size: 16px; background: #FFFFFF; color: var(--night); }
.home .cta .btn-primary:hover { background: var(--accent); color: #FFFFFF; }

@media (max-width: 900px) {
  .ch-grid { grid-template-columns: 1fr; gap: 56px; }
  .ch--flip .ch-text { order: 0; }
  .ch-num { top: -0.3em; }
}

@media (max-width: 760px) {
  :root { --tile-gap: 18px; --hx-h: clamp(580px, calc(100svh - 58px), 860px); }
  .hx-plane { top: 34%; left: 50%; width: 860px; }
  .hx-col:nth-child(even) { margin-top: -110px; }
  .hx-chip { font-size: 11px; gap: 6px; padding: 4px 7px; bottom: -9px; }
  .hx-tag, .hx-win { font-size: 9px; }
  .hx-shade {
    background:
      repeating-linear-gradient(0deg, rgb(255 255 255 / 0.018) 0 1px, transparent 1px 4px),
      linear-gradient(0deg, var(--night) 0%, var(--night) 30%, rgb(11 12 15 / 0.78) 50%, rgb(11 12 15 / 0) 76%),
      linear-gradient(180deg, rgb(11 12 15 / 0.55) 0%, rgb(11 12 15 / 0) 16%);
  }
  .hx-inner { align-items: flex-end; padding-top: 40px; padding-bottom: 32px; }
  .hx-title { font-size: clamp(40px, 11.2vw, 66px); margin-bottom: 30px; }
  html[lang="ja"] .hx-title { font-size: clamp(38px, 11.2vw, 66px); }
  html[lang^="zh"] .hx-title { font-size: clamp(30px, 9.2vw, 56px); }
  .hx-btn { padding: 15px 22px; }
  .cta-strip img { width: 92px; }
}

@media (max-width: 600px) {
  .hx-ticker .ticker-track { animation-duration: 43s; }
}

@media (prefers-reduced-motion: reduce) {
  .hx-track,
  .hx-card::after,
  .cta-strip-track { animation: none; }
  .hx-plane { transition: none; }
  .hx-card img { transition: none; }
  .faq-all::details-content { transition: none; }
}
