@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Racing+Sans+One&family=Share+Tech+Mono&display=swap');

/* Rally Persona tokens — pink hot, void stage for type contrast */
:root {
  --accent: #e8b8d0;
  --hot: #ff6eb4;
  --ink: #f4f7f8;
  --void: #000;
  --rotation: 16deg;
  --letter-stagger: 72ms;

  --font-card: 'Racing Sans One', 'Orbitron', system-ui, sans-serif;
  --font-display: 'Orbitron', 'Racing Sans One', system-ui, sans-serif;
  --font-telemetry: 'Share Tech Mono', ui-monospace, monospace;

  --outline-soft:
    2px 0 0 #000, -2px 0 0 #000, 0 2px 0 #000, 0 -2px 0 #000, 1px 1px 0 #000, -1px -1px 0 #000,
    1px -1px 0 #000, -1px 1px 0 #000;
  --outline-strong:
    3px 0 0 #000, -3px 0 0 #000, 0 3px 0 #000, 0 -3px 0 #000, 2px 2px 0 #000, -2px -2px 0 #000,
    2px -2px 0 #000, -2px 2px 0 #000;

  --z-stetic: 5;
  --z-hero: 10;
  --z-action: 15;
  --z-menu: 20;
  --z-controls: 25;

  color-scheme: dark;
  color: var(--ink);
  background-color: var(--void);
  font-family: var(--font-telemetry);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body,
#app,
#main {
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  background: var(--void);
  color: var(--ink);
}
html,
body {
  margin: 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
#app {
  min-height: 100dvh;
  min-height: 100vh;
}
#main {
  position: relative;
  min-height: 100dvh;
  min-height: 100vh;
  background: var(--void);
  user-select: none;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
ul {
  list-style: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Persona menu hero: full-bleed Rally art, pink motifs, crop-weighted right */
.hero {
  position: relative;
  z-index: var(--z-hero);
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  min-height: 100vh;
  overflow: hidden;
  background-color: var(--void);
  background-image: url('/hero/rally-hero-desktop-v22.jpg');
  background-repeat: no-repeat;
  background-position: 72% center;
  background-size: cover;
}
/* Static art layer — always visible (halftone + cyan shadow art) */
.hero-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: var(--void);
}
.hero-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% center;
  user-select: none;
  -webkit-user-drag: none;
}
/* Soft ambient — keep stage airy; art carries the pattern */
.hero-dither {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.2;
  background: radial-gradient(
    ellipse 50% 60% at 78% 42%,
    rgba(255, 110, 180, 0.08) 0%,
    transparent 65%
  );
}
/*
 * Live2D stays visually hidden so the static pink-motif hero always shows.
 * Component still mounts for premade audio; volume dock reveals when ready.
 */
.hero-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.hero-stage .live2d-showcase {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(58vw, 920px);
  height: 100%;
  min-height: 0;
  padding: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.hero-stage .volume-control {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.hero-stage.is-ready .volume-control {
  opacity: 1;
  pointer-events: auto;
}
.hero-stage .facetime-window,
.hero-stage .window-content,
.hero-stage .live2d-container,
.hero-stage #canvas-container {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: hidden;
}
.hero-stage .window-titlebar,
.hero-stage .model-info {
  display: none;
}
.hero-stage .facetime-window {
  display: block;
  max-width: none;
}
.hero-stage .window-content {
  height: 100%;
}
.hero-stage #live2d-canvas {
  width: 100%;
  height: 100%;
  transform: translate(6%, 4%);
}
/* Soft left wash only — white/pink stage stays light so pink outline pops */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.35) 0%,
    rgba(255, 245, 250, 0.12) 28%,
    transparent 52%
  );
}
.content-wrapper {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  min-height: 100vh;
  padding: clamp(1.25rem, 4vw, 3rem) 0 clamp(1.25rem, 4vw, 3rem) 8%;
  pointer-events: none;
}
.content-wrapper > * {
  pointer-events: auto;
}
.content-wrapper .action {
  pointer-events: none;
}
/* Volume dock — bottom-right hard plaque */
.hero-stage .volume-control {
  position: absolute;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: var(--z-controls);
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border: 2px solid #fff;
  background: #000;
  box-shadow: 4px 4px 0 #fff;
  pointer-events: auto;
}
.hero-stage .volume-control input[type='range'] {
  width: 88px;
  accent-color: var(--hot);
}
.hero-stage .mute-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--ink);
  background: transparent;
  border: none;
  cursor: pointer;
}
.hero-stage .mute-button:hover,
.hero-stage .mute-button.muted {
  color: var(--hot);
}
/* tablet: auto-height crop, pull pose left */
@media screen and (max-width: 1100px) {
  .hero {
    background-size: auto 100%;
    background-position: 28% center;
  }

  .hero-art img {
    object-fit: cover;
    object-position: 28% center;
  }

  .content-wrapper {
    padding-left: 5%;
  }

  .hero-stage .live2d-showcase {
    width: min(72vw, 100%);
    right: -4%;
  }

  .hero-stage #live2d-canvas {
    transform: translate(0%, 6%);
  }
}
@media screen and (max-width: 768px) {
  .hero {
    background-image: url('/hero/rally-hero-mobile-v22.jpg');
    background-size: auto 100%;
    background-position: 22% center;
  }

  .hero-art img {
    object-position: 22% center;
  }

  .hero-dither {
    opacity: 0.28;
  }

  .hero-vignette {
    background: linear-gradient(
      180deg,
      transparent 0%,
      transparent 45%,
      rgba(255, 255, 255, 0.35) 78%,
      rgba(255, 245, 250, 0.55) 100%
    );
  }

  .content-wrapper {
    justify-content: flex-end;
    padding: 1rem 0 6.5rem 1.25rem;
  }

  .hero-stage .live2d-showcase {
    width: 100%;
    right: 0;
  }

  .hero-stage #live2d-canvas {
    transform: translate(-4%, 10%) scale(1.05);
  }

  .hero-stage .volume-control {
    right: 0.5rem;
    bottom: 0.5rem;
    box-shadow: 3px 3px 0 #fff;
  }

  .hero-stage .volume-control input[type='range'] {
    width: 64px;
  }
}
@media screen and (max-width: 480px) {
  .hero {
    background-size: auto 100%;
    background-position: 18% center;
  }

  .hero-art img {
    object-position: 18% center;
  }

  .content-wrapper {
    padding-left: 1rem;
  }
}
@media (max-height: 430px) and (orientation: landscape) {
  .hero-stage .live2d-showcase {
    width: min(50vw, 480px);
  }

  .content-wrapper {
    justify-content: center;
    padding: 0.5rem 0 0.5rem 4%;
  }

  .hero-stage .volume-control {
    display: none;
  }
}
#main-menu {
  position: relative;
  z-index: var(--z-menu);
  width: max-content;
  max-width: min(92vw, 34rem);
  margin-top: clamp(-2rem, -4vh, 0);
}
#main-menu ul {
  display: flex;
  flex-direction: column;
  gap: clamp(0.45rem, 1.4vh, 1rem);
  transform: rotate(var(--rotation));
  transform-origin: left center;
}
#main-menu li {
  position: relative;
  display: block;
  padding: 0.12em 0.2em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: none !important;
  cursor: pointer;
  outline: none;
  transform: rotate(calc(-1 * var(--rotation)));
  transform-origin: left center;
}
#main-menu li.is-hidden {
  display: none;
}
#main-menu .literal {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
}
/* Rally: pink telemetry tags only — no extra heart ornaments */
#main-menu .tag {
  flex-shrink: 0;
  color: var(--accent);
  font-family: var(--font-telemetry);
  font-size: clamp(0.7rem, 1.4vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.16em;
  opacity: 0.75;
  transition:
    opacity 160ms ease,
    color 160ms ease;
}
#main-menu li.is-active .tag,
#main-menu li:hover .tag,
#main-menu li:focus-visible .tag {
  color: var(--hot);
  opacity: 1;
}
#main-menu .word {
  display: inline-flex;
  font-family: var(--font-card);
  font-size: clamp(2.1rem, 5.8vw, 4.1rem);
  font-weight: 400;
  line-height: 0.95;
  white-space: nowrap;
}
#main-menu .letter {
  display: inline-block;
  color: var(--ink);
  -webkit-text-fill-color: var(--ink);
  text-shadow: var(--outline-soft);
  transform: translate3d(0, 0, 0);
  transition:
    color 120ms ease,
    -webkit-text-fill-color 120ms ease,
    transform 320ms cubic-bezier(0.2, 0.85, 0.25, 1),
    text-shadow 120ms ease;
  transition-delay: calc(var(--i, 0) * var(--letter-stagger));
  will-change: transform, color;
}
/* Pink solid fill on hover/active — hard outline only, no glow */
#main-menu li.is-active .letter,
#main-menu li:hover .letter,
#main-menu li:focus-visible .letter {
  color: var(--hot) !important;
  -webkit-text-fill-color: var(--hot) !important;
  text-shadow: var(--outline-soft);
  transform: translate3d(0.16em, 0, 0);
  animation: none;
}
@media (max-width: 700px) {
  #main-menu {
    max-width: 100%;
  }

  #main-menu ul {
    gap: 0.25rem;
  }

  #main-menu .word {
    font-size: clamp(1.85rem, 11vw, 2.6rem);
  }
}
@media (prefers-reduced-motion: reduce) {
  #main-menu .letter {
    transition:
      color 80ms ease,
      -webkit-text-fill-color 80ms ease;
    transition-delay: 0ms !important;
  }

  #main-menu li.is-active .letter,
  #main-menu li:hover .letter,
  #main-menu li:focus-visible .letter {
    transform: none;
    animation: none;
  }
}
.action {
  position: absolute;
  left: clamp(4%, 8vw, 9%);
  bottom: clamp(1.25rem, 4vh, 2.75rem);
  z-index: var(--z-action);
  max-width: min(90vw, 36rem);
  pointer-events: none;
  transform: rotate(-6deg);
  transform-origin: left bottom;
}
.action .title {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: var(--outline-strong);
}
.action .description {
  margin-top: 0.35rem;
  max-width: 28rem;
}
.action .description .wrapper {
  display: block;
  color: var(--accent);
  font-family: var(--font-telemetry);
  font-size: clamp(0.72rem, 1.35vw, 0.95rem);
  font-weight: 400;
  letter-spacing: 0.14em;
  line-height: 1.35;
  text-transform: uppercase;
}
@media (max-width: 700px) {
  .action {
    left: 0.85rem;
    bottom: 1rem;
    max-width: calc(100vw - 1.5rem);
    transform: rotate(-4deg);
  }

  .action .title {
    font-size: clamp(1.7rem, 10vw, 2.4rem);
  }

  .action .description .wrapper {
    font-size: 0.68rem;
    letter-spacing: 0.1em;
  }
}
@media (max-height: 430px) and (orientation: landscape) {
  .action {
    bottom: 0.4rem;
    left: 4%;
  }

  .action .title {
    font-size: 1.5rem;
  }

  .action .description .wrapper {
    font-size: 0.62rem;
  }
}
/* Bottom-right social icons — plain glyphs, fixed to corner */
.social-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: calc(var(--z-controls) + 1);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.65rem;
  pointer-events: auto;
}
.social-dock__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
  background: none;
  border: none;
  box-shadow: none;
  opacity: 0.45;
  transition:
    color 120ms ease,
    opacity 120ms ease;
}
.social-dock__link:hover,
.social-dock__link:focus-visible {
  color: var(--ink);
  opacity: 1;
  outline: none;
}
.social-dock__link:active {
  color: var(--hot);
  opacity: 1;
}
@media (max-width: 700px) {
  .social-dock {
    right: 0.75rem;
    bottom: 0.75rem;
    gap: 0.55rem;
  }
}
@media (max-height: 430px) and (orientation: landscape) {
  .social-dock {
    right: 0.5rem;
    bottom: 0.4rem;
    gap: 0.45rem;
  }
}
.stetic-text {
  position: absolute;
  inset: 0;
  z-index: var(--z-stetic);
  pointer-events: none;
  overflow: hidden;
}
.stetic-text .plaque {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35em 0.7em;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.stetic-text .plaque::before,
.stetic-text .plaque::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
}
.stetic-text .plaque .label {
  position: relative;
  z-index: 5;
}
/* Slogan — two stacked bars, top-right */
.stetic-text .slogan {
  position: absolute;
  top: clamp(1.5rem, 5vh, 3.5rem);
  right: clamp(1rem, 4vw, 3.5rem);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.45rem;
}
.stetic-text .slogan .first {
  color: #000;
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  letter-spacing: 0.12em;
  transform: rotate(-8deg) skewX(-8deg);
}
.stetic-text .slogan .first::before {
  background: #fff;
  transform: translate(5px, 5px);
  z-index: 0;
}
.stetic-text .slogan .first::after {
  background: #000;
  transform: translate(0, 0);
  z-index: 1;
}
.stetic-text .slogan .first .label {
  z-index: 5;
  padding: 0.28em 0.65em;
  background: #fff;
  color: #000;
  box-shadow: 4px 4px 0 #000;
}
.stetic-text .slogan .second {
  color: #fff;
  font-size: clamp(0.85rem, 1.6vw, 1.15rem);
  letter-spacing: 0.12em;
  transform: rotate(-4deg) skewX(-6deg);
}
.stetic-text .slogan .second .label {
  padding: 0.28em 0.65em;
  background: #000;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 4px 4px 0 #fff;
}
/* Team / character name */
.stetic-text .team-name {
  position: absolute;
  top: clamp(7rem, 18vh, 11rem);
  right: clamp(1.25rem, 5vw, 4rem);
  color: #fff;
  font-size: clamp(1.1rem, 2.4vw, 1.75rem);
  letter-spacing: 0.18em;
  transform: rotate(12deg) skewX(-10deg);
}
.stetic-text .team-name .label {
  padding: 0.4em 0.85em;
  background: #000;
  border: 3px solid #fff;
  box-shadow:
    6px 6px 0 #fff,
    0 0 0 3px #000;
}
/* Menu // Main telemetry */
.stetic-text .menu-info {
  position: absolute;
  right: clamp(1rem, 3.5vw, 2.75rem);
  bottom: clamp(7.5rem, 18vh, 12rem);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  transform: rotate(-7deg);
}
.stetic-text .menu-info .title {
  padding: 0.25em 0.55em;
  background: #fff;
  color: #000;
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 1.3vw, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 #000;
}
.stetic-text .menu-info .desc {
  max-width: 14rem;
  color: var(--accent);
  font-family: var(--font-telemetry);
  font-size: clamp(0.6rem, 1vw, 0.72rem);
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-align: right;
  text-transform: uppercase;
}
/* Giant selection index */
.stetic-text .current-item {
  position: absolute;
  right: clamp(0.5rem, 2.5vw, 2rem);
  bottom: clamp(0.75rem, 3vh, 2rem);
  display: flex;
  align-items: flex-end;
  gap: 0.05em;
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.85;
  transform: rotate(-12deg);
}
.stetic-text .current-item .first,
.stetic-text .current-item .second {
  position: relative;
  display: inline-flex;
}
.stetic-text .current-item .content {
  position: relative;
  z-index: 5;
  display: block;
  min-width: 0.55em;
  color: #fff;
  font-size: clamp(5rem, 14vw, 10rem);
  text-shadow: var(--outline-strong);
}
.stetic-text .current-item .second .content {
  color: var(--hot);
}
.stetic-text .current-item .first::before,
.stetic-text .current-item .second::before {
  content: '';
  position: absolute;
  inset: 8% 4% 4% 8%;
  z-index: 0;
  background: #000;
  border: 3px solid #fff;
  transform: skewX(-8deg) rotate(4deg);
}
.stetic-text .current-item .second::before {
  border-color: var(--hot);
  box-shadow: 5px 5px 0 #fff;
}
@media (max-width: 1000px) {
  .stetic-text .slogan,
  .stetic-text .menu-info,
  .stetic-text .current-item {
    display: none;
  }

  .stetic-text .team-name {
    top: 1rem;
    right: 0.85rem;
    font-size: 0.95rem;
    transform: rotate(8deg) skewX(-6deg);
  }

  .stetic-text .team-name .label {
    padding: 0.3em 0.55em;
    border-width: 2px;
    box-shadow: 4px 4px 0 #fff;
  }
}
@media (max-width: 700px) {
  .stetic-text .team-name {
    top: 0.65rem;
    right: 0.5rem;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
  }
}
@media (max-height: 430px) and (orientation: landscape) {
  .stetic-text .slogan,
  .stetic-text .menu-info,
  .stetic-text .current-item {
    display: none;
  }

  .stetic-text .team-name {
    top: 0.4rem;
    right: 0.5rem;
    font-size: 0.7rem;
  }
}
/* Live2D host chrome — layout owned by hero.css in persona stage */
.live2d-showcase {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.facetime-window,
.window-content,
.live2d-container,
#canvas-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
}
#live2d-canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.loading-status,
.error-status {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 12;
  max-width: 14rem;
  padding: 0.4rem 0.55rem;
  border: 2px solid #fff;
  background: #000;
  color: var(--ink, #f4f7f8);
  font-family: var(--font-telemetry, ui-monospace, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.error-status {
  border-color: var(--hot, #ff2147);
  color: var(--hot, #ff2147);
}
.volume-control {
  z-index: 12;
}
.volume-control input[type='range'] {
  height: 4px;
  margin: 0;
  padding: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
.volume-control input[type='range']::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.35);
}
.volume-control input[type='range']::-moz-range-track {
  height: 4px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.35);
}
.volume-control input[type='range']::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  margin-top: -4px;
  appearance: none;
  border: 2px solid #000;
  border-radius: 0;
  background: var(--hot, #ff2147);
  cursor: pointer;
}
.volume-control input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 2px solid #000;
  border-radius: 0;
  background: var(--hot, #ff2147);
  cursor: pointer;
}
.volume-control input[type='range']:focus {
  outline: none;
}
.mute-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink, #f4f7f8);
  cursor: pointer;
}
.mute-button.muted::after {
  position: absolute;
  top: 50%;
  left: 10%;
  width: 80%;
  height: 2px;
  background: var(--hot, #ff2147);
  content: '';
  transform: translateY(-50%) rotate(-35deg);
}
