@font-face {
  font-family: "Aurora SC";
  src: url("/fonts/aurora-sc-light.woff2?v=aurora6") format("woff2");
  font-weight: 200 300;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #f4f7ff;
  --ink-dim: rgba(244, 247, 255, 0.66);
  --ink-faint: rgba(244, 247, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.22);
  --glass-border-hi: rgba(255, 255, 255, 0.36);
  --glass-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 1px 2px rgba(0, 8, 24, 0.16),
    0 8px 24px rgba(0, 8, 24, 0.22),
    0 24px 64px rgba(0, 8, 24, 0.24);
  --glass-shadow-hi:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 2px 4px rgba(0, 8, 24, 0.16),
    0 20px 48px rgba(0, 8, 24, 0.32),
    0 48px 112px rgba(0, 8, 24, 0.36);
  --shadow: 0 16px 56px rgba(0, 8, 24, 0.45);
  --radius: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Aurora SC", "PingFang SC", "HarmonyOS Sans SC", "HarmonyOS Sans", "Noto Sans SC",
    "Noto Sans CJK SC", "Source Han Sans SC", "Microsoft YaHei UI Light", "Microsoft YaHei",
    system-ui, -apple-system, sans-serif;
  /* pointer parallax (-1..1), set by JS on desktop */
  --mx: 0;
  --my: 0;
  /* 8px rhythm */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 32px;
  --s5: 40px;
  --s6: 48px;
  --clock-zone: 128px;
  --lh: 1.5;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  background: #07101f;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.stage {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

/* —— Background —— */
.bg {
  position: fixed;
  inset: -16px;
  z-index: -2;
  background: #07101f url("/bg-1920.jpg?v=aurora1") 50% 42% / cover no-repeat;
  transform: translate3d(calc(var(--mx) * -10px), calc(var(--my) * -8px), 0) scale(1.02);
  transition: transform 1.2s var(--ease);
}

@media (min-width: 1280px), (min-width: 900px) and (min-resolution: 1.5dppx) {
  .bg {
    background-image: url("/bg.jpg?v=aurora1");
  }
}

@media (max-aspect-ratio: 3/4) {
  .bg {
    background-position: 60% center;
  }
}

.veil {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(4, 10, 22, 0.22) 0%, rgba(4, 10, 22, 0.12) 40%, rgba(4, 10, 22, 0.5) 100%),
    radial-gradient(ellipse 80% 55% at 50% 42%, rgba(4, 12, 28, 0.04), rgba(4, 10, 22, 0.42));
  pointer-events: none;
}

/* —— Shared frosted glass —— */
.glass {
  position: relative;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.04) 60%, rgba(255, 255, 255, 0.07));
  background-color: rgba(8, 18, 36, 0.12);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}

/* specular highlight that follows the pointer (vars set by JS) */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    240px circle at var(--gx, 30%) var(--gy, 0%),
    rgba(255, 255, 255, 0.16),
    transparent 60%
  );
  opacity: 0.7;
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}

/* —— Layout —— */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s5);
  padding: max(var(--s5), env(safe-area-inset-top)) var(--s3) calc(var(--clock-zone) + 4vh);
  width: 100%;
}

/* —— Headline —— */
.float-a {
  transform: translate3d(calc(var(--mx) * -8px), calc(var(--my) * -8px), 0);
  transition: transform 0.9s var(--ease);
  max-width: 100%;
}

.headline {
  border-radius: 24px;
  padding: var(--s2) var(--s4);
}

.roll {
  position: relative;
  margin: 0;
  display: grid;
  justify-items: center;
  font-weight: 300;
  font-size: clamp(15px, 4vw, 24px);
  line-height: var(--lh);
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.9);
  text-shadow:
    0 0 18px rgba(170, 255, 230, 0.28),
    0 0 2px rgba(255, 255, 255, 0.35),
    0 1px 10px rgba(2, 10, 24, 0.45);
  white-space: nowrap;
}

.roll-line {
  display: block;
  /* optical balance for trailing tracking */
  margin-right: -0.28em;
}

/* one-line rotator (JS): every sentence + an invisible sizer share one grid cell,
   so the panel is fixed to the longest sentence and never jumps */
.roll.is-rotating > * {
  grid-area: 1 / 1;
}

.roll-sizer {
  visibility: hidden;
}

.roll .ch {
  display: inline-block;
  will-change: transform, opacity, filter;
}

/* gentle sheen sweep across the headline glass */
.headline::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.1) 45%, rgba(200, 255, 240, 0.14) 50%, transparent 60%);
  transform: translateX(-160%) skewX(-12deg);
  pointer-events: none;
  animation: sheen 11s var(--ease) 3.2s infinite;
}

@keyframes sheen {
  0% {
    transform: translateX(-160%) skewX(-12deg);
  }
  28%,
  100% {
    transform: translateX(360%) skewX(-12deg);
  }
}

/* —— Deck —— */
.deck {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s2);
  width: min(100%, 360px);
  position: relative;
  transform: translate3d(calc(var(--mx) * -8px), calc(var(--my) * -8px), 0);
  transition: transform 0.9s var(--ease);
  perspective: 900px;
}

@media (min-width: 720px) {
  .deck {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: min(100%, 784px);
    gap: var(--s3);
  }
}

.card {
  border-radius: var(--radius);
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  padding: var(--s2) var(--s3);
  text-align: center;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.25s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.card-face:hover,
.card-face:focus-visible {
  --lift: -8px;
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--glass-border-hi);
  box-shadow: var(--glass-shadow-hi);
  outline: none;
}

.card-face:hover::before {
  opacity: 1;
}

/* sheen sweep on hover */
.card-face::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.16) 45%, rgba(210, 255, 245, 0.22) 50%, transparent 62%);
  transform: translateX(-180%) skewX(-14deg);
  pointer-events: none;
}

@media (hover: hover) {
  .card-face:hover::after {
    animation: card-sheen 0.75s var(--ease) forwards;
  }
}

@keyframes card-sheen {
  to {
    transform: translateX(330%) skewX(-14deg);
  }
}

.card-face:active {
  --lift: -1px;
  scale: 0.97;
  transition-duration: 0.12s;
}

/* touch: press-down then bounce back (class set by JS on release) */
.card-face.bounce {
  animation: card-bounce 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes card-bounce {
  0% { scale: 0.96; }
  55% { scale: 1.025; }
  100% { scale: 1; }
}

.card-label {
  position: relative;
  text-shadow: 0 1px 10px rgba(2, 10, 24, 0.55);
}

.card-label {
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 0 16px rgba(170, 255, 230, 0.25), 0 1px 10px rgba(2, 10, 24, 0.5);
}

.card-icon {
  position: relative;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 6px rgba(170, 255, 230, 0.35));
  transition: transform 0.25s var(--ease);
}

.card-face:hover .card-icon {
  transform: translateY(-2px);
}


.card-music {
  background-image: linear-gradient(150deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06) 60%, rgba(255, 255, 255, 0.1));
}

.card-soon .card-label {
  color: rgba(255, 255, 255, 0.8);
}


.card-stack {
  display: none;
}

/* —— Clock —— */
.clock-wrap {
  position: absolute;
  right: max(56px, env(safe-area-inset-right));
  bottom: max(56px, calc(env(safe-area-inset-bottom) + var(--s3)));
  transform: translate3d(calc(var(--mx) * -8px), calc(var(--my) * -8px), 0);
  transition: transform 0.9s var(--ease);
  z-index: 2;
}

.clock {
  display: inline-flex;
  align-items: center;
  height: 64px;
  padding: 0 var(--s4);
  border-radius: 999px;
  font-size: 38px;
  font-weight: 300;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 0 14px rgba(170, 255, 230, 0.25), 0 1px 8px rgba(2, 10, 24, 0.45);
}

.clock > span {
  position: relative;
}

.clock-colon {
  display: inline-block;
  margin: 0 0.12em;
  transform: translateY(-0.06em);
  animation: colon 2s ease-in-out infinite;
}

@keyframes colon {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.22;
  }
}

/* —— Idle float (desktop / fine pointers) —— */
@media (hover: hover) and (pointer: fine) and (min-width: 720px) {
  .float {
    animation: idle-float 9s ease-in-out infinite;
  }
  .float-b { animation-delay: -1.5s; animation-duration: 8s; }
  .float-c { animation-delay: -3s;   animation-duration: 8.6s; }
  .float-d { animation-delay: -4.5s; animation-duration: 9.2s; }
  .float-e { animation-delay: -2s;   animation-duration: 10s; }
}

@keyframes idle-float {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -6px;
  }
}

/* —— Small / short screens —— */
@media (max-width: 719px) {
  :root {
    --clock-zone: 112px;
  }
  .hero {
    gap: var(--s4);
    padding-left: var(--s3);
    padding-right: var(--s3);
  }
  .headline {
    padding: var(--s2) var(--s3);
    border-radius: 20px;
  }
  .card {
    min-height: 80px;
    flex-direction: row;
    gap: var(--s2);
  }
  .card-icon {
    width: 22px;
    height: 22px;
  }
  .clock {
    height: 52px;
    font-size: 26px;
    padding: 0 var(--s3);
  }
  .clock-wrap {
    right: max(28px, env(safe-area-inset-right));
    bottom: max(28px, calc(env(safe-area-inset-bottom) + var(--s2)));
  }

}

@media (max-width: 719px) and (max-height: 740px) {
  :root {
    --clock-zone: 96px;
  }
  .hero {
    gap: var(--s4);
    padding-top: max(var(--s4), env(safe-area-inset-top));
  }
  .card {
    min-height: 68px;
    padding: var(--s2) var(--s3);
  }
  .clock {
    height: 48px;
    font-size: 24px;
    padding: 0 var(--s3);
  }
  .clock-wrap {
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, calc(env(safe-area-inset-bottom) + var(--s2)));
  }
}

/* —— Toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(var(--s5), calc(env(safe-area-inset-bottom) + var(--s3)));
  transform: translateX(-50%) translateY(12px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(20, 28, 44, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  letter-spacing: 0.12em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  z-index: 40;
  white-space: nowrap;
}


.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* —— Card-deck swipe overlay —— */
.swipe-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 10, 22, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}

.swipe-layer.active {
  display: flex;
  pointer-events: auto;
}

.swipe-stack {
  position: relative;
  width: min(86vw, 340px);
  height: 160px;
}

.swipe-under,
.swipe-flyer {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s3);
}

.swipe-under {
  transform: scale(0.94) translateY(10px);
  opacity: 0.55;
  z-index: 1;
}

.swipe-under::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent);
}

.swipe-flyer {
  z-index: 2;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  will-change: transform, opacity;
}

.swipe-layer.play .swipe-flyer {
  animation: card-fly 620ms var(--ease) forwards;
}

.swipe-layer.play .swipe-under {
  animation: card-rise 620ms var(--ease) forwards;
}

@keyframes card-fly {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate3d(118%, -18%, 0) rotate(14deg);
    opacity: 0;
  }
}

@keyframes card-rise {
  0% {
    transform: scale(0.94) translateY(10px);
    opacity: 0.55;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.stage.leaving {
  animation: stage-out 620ms var(--ease) forwards;
}

@keyframes stage-out {
  0% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 0.35;
    filter: blur(4px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .toast,
  .swipe-flyer,
  .swipe-under,
  .stage,
  .float,
  .bg,
  .deck,
  .clock-colon,
  .headline::after,
  .card-face::after,
  .card-face.bounce {
    transition: none !important;
    animation: none !important;
  }
  .card {
    transform: none !important;
    scale: none !important;
  }
}
