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

/* Same colour variables as /home/style.css */
:root {
  --card: #ffc8dd;
  --muted: #c9184a;
  --accent: #bde0fe;
  --orchid: #d473d4;
  --sakura: #ffb7c5;
}

body {
  font-family: "Poppins", sans-serif;
  color: #fff;
  background: #150c17;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* === FULL-PAGE ARTWORK === */
.stage {
  position: fixed;
  inset: 0;
  z-index: 0;
}

.stage-bg {
  position: absolute;
  inset: 0;
  background: no-repeat center center / cover;
  transition: background-image 0.5s ease-in-out;
}

/* Wide banners (fit-width): the whole picture, sharp, across the top. It fades
   at the bottom into a plain dark gradient in the banner's own colours
   (no blur anywhere). */
.stage-front {
  display: none;
  position: absolute;
  inset: 0;
  background: no-repeat center top / 100% auto;
  -webkit-mask-image: linear-gradient(#000 0, #000 calc(36vw - 110px), transparent 36vw);
  mask-image: linear-gradient(#000 0, #000 calc(36vw - 110px), transparent 36vw);
}

.stage.fit-width .stage-front {
  display: block;
  /* no fade: the reflection below continues the picture */
  -webkit-mask-image: none;
  mask-image: none;
}

.stage.fit-width {
  background: linear-gradient(100deg, #0c0b0f 0%, #17111a 50%, #3a1730 100%);
}

/* Under the banner: the same picture again, upside down like a reflection,
   so the lower part of the page shows the artwork instead of plain black.
   36vw = height of the banner (2932 × 1056) when it fills the width. */
.stage.fit-width .stage-bg {
  inset: calc(36vw - 3px) 0 auto 0;
  height: 36vw;
  background-size: 100% auto;
  background-position: center top !important;
  transform: scaleY(-1);
  opacity: 0.75;
  -webkit-mask-image: linear-gradient(0deg, #000 35%, transparent 100%);
  mask-image: linear-gradient(0deg, #000 35%, transparent 100%);
}

/* Very light veil: only darkens the top (menu) and the left (list) edges,
   the artwork itself stays fully visible. (top = menu, bottom = character strip) */
.stage-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(21, 12, 23, 0.55) 0, rgba(21, 12, 23, 0) 150px),
    linear-gradient(0deg, rgba(21, 12, 23, 0.6) 0, rgba(21, 12, 23, 0) 240px);
}

/* === TOPBAR (transparent, over the artwork) === */
.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
  padding: 16px 60px 12px;
}

.logo-link {
  color: #fff;
  text-decoration: none;
}

.logo {
  display: flex;
  gap: 10px;
  align-items: center;
}

.logo .icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #c77dff, #e0aaff, #f4acb7, #efcfe3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo .icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.logo-title {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  text-shadow: 0 1px 8px rgba(21, 12, 23, 0.7);
}

.logo-sub {
  font-size: 12px;
  color: var(--sakura);
  text-shadow: 0 1px 6px rgba(21, 12, 23, 0.8);
}

.menu {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 40px;
}

.nav-link {
  position: relative;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
  padding: 10px 0;
  text-shadow: 0 1px 8px rgba(21, 12, 23, 0.8);
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--sakura);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0%;
  height: 2px;
  background: var(--sakura);
  border-radius: 2px;
  transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.auth {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn {
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.btn.primary {
  background: linear-gradient(90deg, var(--orchid), var(--sakura));
  border-color: transparent;
  color: #2e0a33;
  font-weight: 600;
}

.btn.primary:hover {
  filter: brightness(1.08);
}

/* === HERO, then the character strip at the bottom === */
.layout {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column-reverse; /* the strip comes first in the HTML */
}

/* === CHARACTER STRIP: horizontal row of cards === */
.sidebar {
  flex: none;
  margin: 0 60px 22px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar ul {
  list-style: none;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  width: max-content;
  margin: 0 auto;
}

.sidebar ul li {
  position: relative;
  width: 178px;
  height: 104px;
  flex: none;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  outline-offset: -3px;
  transition: width 0.3s ease, height 0.3s ease;
}

.sidebar ul li img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
  /* --zoom / --origin (set inline) frame one face inside a wide picture */
  transform: scale(var(--zoom, 1));
  transform-origin: var(--origin, center);
  transition: opacity 0.3s ease, transform 0.4s ease;
}

/* tint over each card: dark by default, orchid on the active one */
.sidebar ul li::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(21, 12, 23, 0.75), rgba(21, 12, 23, 0.15));
  transition: background 0.3s ease;
}

.sidebar ul li span {
  position: relative;
  z-index: 1;
  padding: 12px 14px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.sidebar ul li:hover img {
  opacity: 0.85;
  transform: scale(calc(var(--zoom, 1) * 1.05));
}

.sidebar ul li.active {
  width: 230px;
  height: 128px;
  font-size: 14px;
}

.sidebar ul li.active img {
  opacity: 1;
}

.sidebar ul li.active::after {
  background: linear-gradient(90deg, rgba(212, 115, 212, 0.7), rgba(255, 183, 197, 0.1));
}

.sidebar ul li:focus-visible {
  outline: 3px solid var(--sakura);
}

/* === HERO: text straight on the artwork, no box === */
.hero {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 0 60px 24px;
}

.hero.pos-left {
  justify-content: flex-start;
}

/* text at the bottom (banner view: keeps the painted title clear) */
.hero.is-low {
  align-items: flex-end;
}

.hero.is-low .hero-content h1 {
  font-size: clamp(28px, 3vw, 46px);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.hero.is-low .hero-role {
  margin-bottom: 6px;
}

.hero.pos-center {
  justify-content: center;
}

.hero.pos-right {
  justify-content: flex-end;
}

.hero-content {
  max-width: 460px;
  text-shadow: 0 2px 14px rgba(21, 12, 23, 0.85), 0 0 2px rgba(21, 12, 23, 0.6);
}

.hero.pos-center .hero-content {
  text-align: center;
}

.hero-role {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sakura);
}

.hero-content h1 {
  display: inline-block;
  padding-bottom: 14px;
  margin-bottom: 22px;
  font-size: clamp(40px, 5.2vw, 76px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: linear-gradient(90deg, var(--orchid), var(--sakura)) no-repeat left bottom / 100% 4px;
}

.hero-desc {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.7;
  text-shadow: 0 1px 3px rgba(21, 12, 23, 0.95), 0 2px 16px rgba(21, 12, 23, 0.9), 0 0 30px rgba(21, 12, 23, 0.6);
}

.hero-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: underline;
  text-decoration-color: var(--sakura);
  text-underline-offset: 6px;
}

.hero-more[hidden] {
  display: none;
}

.hero-more:hover {
  color: var(--sakura);
}

/* Picture card on the right (welcome view, characters without a wide artwork) */
.hero-card {
  width: min(48%, 640px);
  margin-left: auto;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 18px 50px rgba(21, 12, 23, 0.55);
}

.hero-card[hidden] {
  display: none;
}

/* Text entrance */
.hero.is-entering .hero-content,
.hero.is-entering .hero-card {
  animation: hero-in 0.5s ease both;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-bg,
  .sidebar ul li,
  .sidebar ul li img {
    transition: none;
  }

  .hero.is-entering .hero-content,
  .hero.is-entering .hero-card {
    animation: none;
  }
}

/* === RESPONSIVE: the list becomes a strip at the bottom === */
@media (max-width: 820px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 16px 8px;
  }

  .menu {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    justify-content: center;
    gap: 28px;
  }

  .sidebar {
    margin: 0 0 10px;
  }

  .sidebar ul {
    margin: 0;
  }

  .sidebar ul li,
  .sidebar ul li.active {
    width: 150px;
    height: 96px;
    font-size: 12px;
  }

  .hero {
    flex-direction: column;
    justify-content: center !important;
    align-items: flex-start;
    gap: 20px;
    padding: 16px 20px;
    overflow-y: auto;
  }

  .hero.pos-center {
    align-items: center;
  }

  .hero-card {
    width: 100%;
    margin: 0;
  }
}

/* Tall or narrow windows (and phones): the wide banner would leave the lower
   half of the page empty. It is shown taller instead (the characters stay in
   view) with its reflection under it, so the picture fills the page. */
@media (max-aspect-ratio: 3/2) {
  .stage.fit-width .stage-front {
    background-size: auto 52vh;
    background-position: 72% top;
  }

  .stage.fit-width .stage-bg {
    inset: calc(52vh - 3px) 0 auto 0;
    height: 52vh;
    background-size: auto 100%;
    background-position: 72% top !important;
  }
}
