/* Level-Up Project Portal — full-viewport + playful handheld shell */

:root {
  --bg-deep: #080b10;
  --bg-navy: #0e1624;
  --bezel: #151b28;
  --bezel-edge: #1e2738;
  --text: #e8edf5;
  --text-dim: #8b95a8;
  --cyan: #00f5ff;
  --cyan-glow: rgba(0, 245, 255, 0.5);
  --mint: #5cffb0;
  --mint-dim: rgba(92, 255, 176, 0.3);
  --pop: #ff6cab;
  --pop-dim: rgba(255, 108, 171, 0.35);
  --font-display: "Orbitron", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius-bezel: clamp(20px, 4vw, 32px);
  --radius-card: clamp(14px, 3vw, 18px);
  --safe-pad: max(12px, env(safe-area-inset-left, 0));
  --safe-bottom: max(12px, env(safe-area-inset-bottom, 0));
  /* Responsive card width for carousel math */
  --card-w: min(86vw, 300px);
}

@media (min-width: 480px) {
  :root {
    --card-w: min(78vw, 340px);
  }
}

@media (min-width: 768px) {
  :root {
    --card-w: min(360px, 42vw);
  }
}

@media (min-width: 1100px) {
  :root {
    --card-w: min(400px, 36vw);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-mono);
  font-size: clamp(13px, 2.5vw, 15px);
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Parallax starfield — above base gradient, below page content */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
}

/* Drifty neon backdrop (opaque wash was fully covering the canvas at z-index 0) */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 100% 80% at 20% -20%, rgba(0, 245, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 40%, rgba(255, 108, 171, 0.08), transparent 50%),
    radial-gradient(ellipse 70% 50% at 50% 110%, rgba(92, 255, 176, 0.06), transparent 45%),
    linear-gradient(180deg, #0a0e18 0%, var(--bg-deep) 40%, #06080d 100%);
  animation: bg-drift 18s ease-in-out infinite alternate;
}

.bg-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 85% 55%, rgba(0, 245, 255, 0.5), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1px 1px at 72% 12%, rgba(255, 108, 171, 0.45), transparent),
    radial-gradient(1px 1px at 55% 40%, rgba(92, 255, 176, 0.35), transparent);
  background-size: 100% 100%;
  opacity: 0.65;
  animation: twinkle 5s ease-in-out infinite;
}

@keyframes bg-drift {
  0% {
    filter: hue-rotate(-6deg);
  }
  100% {
    filter: hue-rotate(8deg);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.85;
  }
}

.page {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(12px, 3vw, 24px) max(var(--safe-pad), 4vw) calc(16px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.hero {
  text-align: center;
  margin-bottom: clamp(10px, 2.5vw, 18px);
  flex-shrink: 0;
}

.hero__eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: clamp(12px, 3vw, 15px);
  letter-spacing: 0.06em;
  color: var(--cyan);
  text-shadow: 0 0 14px var(--cyan-glow);
  text-transform: none;
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.25rem, 10vw, 3.75rem);
  letter-spacing: 0.05em;
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 55%, var(--mint) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(0, 245, 255, 0.25));
}

.hero__tagline {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.35rem, 5.5vw, 2rem);
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-shadow: 0 0 20px rgba(232, 237, 245, 0.08);
  animation: tagline-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}

@keyframes tagline-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Device fills remaining viewport */
.device {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: clamp(46px, 12vw, 58px);
  max-width: min(1100px, 100%);
  margin-inline: auto;
  width: 100%;
}

.shoulder {
  position: absolute;
  top: 0;
  z-index: 2;
  width: clamp(64px, 16vw, 80px);
  height: clamp(40px, 10vw, 48px);
  border: none;
  border-radius: 14px 14px 10px 10px;
  background: linear-gradient(180deg, #343e56 0%, #1e2638 100%);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 6px 16px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.15s ease,
    color 0.15s ease;
}

.shoulder:hover {
  color: var(--cyan);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 0 2px var(--cyan-glow),
    0 8px 22px rgba(0, 0, 0, 0.5);
}

.shoulder:active {
  transform: translateY(3px) scale(0.97);
}

.shoulder:focus-visible {
  outline: 2px solid var(--pop);
  outline-offset: 3px;
}

.shoulder--l {
  left: clamp(6px, 2vw, 14px);
}

.shoulder--r {
  right: clamp(6px, 2vw, 14px);
}

.shoulder__glyph {
  pointer-events: none;
}

.bezel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  /* Translucent so the fixed starfield shows through (stacked under .page) */
  background: linear-gradient(
    145deg,
    rgba(31, 40, 60, 0.5) 0%,
    rgba(21, 27, 40, 0.46) 42%,
    rgba(13, 18, 28, 0.52) 100%
  );
  border-radius: var(--radius-bezel);
  padding: clamp(10px, 2.5vw, 16px);
  box-shadow:
    inset 0 0 0 1px var(--bezel-edge),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 20px 50px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 245, 255, 0.1),
    0 0 40px -10px var(--pop-dim);
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: clamp(220px, 38vh, 520px);
  background:
    linear-gradient(rgba(0, 245, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.055) 1px, transparent 1px),
    rgba(14, 22, 36, 0.42);
  background-size: 24px 24px, 24px 24px, auto;
  border-radius: calc(var(--radius-bezel) - 10px);
  padding: clamp(12px, 3vw, 22px) 0 clamp(10px, 2vw, 16px);
  box-shadow: inset 0 0 0 1px rgba(0, 245, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.03) 0%,
    transparent 38%,
    transparent 72%,
    rgba(0, 0, 0, 0.06) 100%
  );
  pointer-events: none;
  border-radius: inherit;
}

.carousel {
  flex: 1;
  display: flex;
  align-items: center;
  gap: clamp(14px, 4vw, 24px);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(10px, calc(50% - var(--card-w) / 2));
  padding: 6px max(10px, calc(50% - var(--card-w) / 2)) 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan) transparent;
  -webkit-overflow-scrolling: touch;
}

.carousel::-webkit-scrollbar {
  height: 5px;
}

.carousel::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, var(--cyan), var(--pop));
  border-radius: 4px;
}

.card {
  flex: 0 0 var(--card-w);
  scroll-snap-align: center;
  background: linear-gradient(165deg, #182236 0%, #0e141f 100%);
  border-radius: var(--radius-card);
  border: 2px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
  padding: 0;
  display: block;
  transition:
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s ease;
  opacity: 0.68;
  transform: scale(0.96) translateY(4px);
}

.card:hover {
  opacity: 0.88;
}

.card--active {
  opacity: 1;
  border-color: var(--cyan);
  box-shadow:
    0 0 0 1px var(--cyan),
    0 0 32px var(--cyan-glow),
    0 0 50px -8px var(--pop-dim),
    0 16px 36px rgba(0, 0, 0, 0.45);
  transform: scale(1) translateY(0);
  animation: card-bounce 2.2s ease-in-out infinite;
}

@keyframes card-bounce {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.02) translateY(-3px);
  }
}

.card:focus-visible {
  outline: 2px solid var(--pop);
  outline-offset: 4px;
}

.card__media {
  aspect-ratio: 16 / 10;
  background: #070a10;
  overflow: hidden;
  position: relative;
}

.card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 20px rgba(0, 245, 255, 0.06);
  pointer-events: none;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.card--active .card__media img {
  transform: scale(1.04);
}

.card__body {
  padding: clamp(12px, 3vw, 16px) clamp(12px, 3vw, 16px) clamp(10px, 2.5vw, 14px);
}

.card__title {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.95rem, 3.5vw, 1.08rem);
  letter-spacing: 0.04em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__desc {
  margin: 0;
  font-family: var(--font-mono);
  font-size: clamp(11px, 2.8vw, 13px);
  line-height: 1.45;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card--active .card__desc {
  color: rgba(232, 237, 245, 0.85);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  padding: 0 12px 4px;
  flex-shrink: 0;
}

.pagination__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  padding: 0;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pagination__dot:hover {
  background: rgba(255, 255, 255, 0.4);
  transform: scale(1.1);
}

.pagination__dot--active {
  background: var(--cyan);
  box-shadow:
    0 0 14px var(--cyan-glow),
    0 0 20px var(--pop-dim);
  transform: scale(1.2);
}

.pagination__dot:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 2px;
}

.footer {
  text-align: center;
  margin-top: clamp(16px, 4vw, 28px);
  padding-top: clamp(12px, 3vw, 18px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: clamp(11px, 2.5vw, 13px);
  color: var(--text-dim);
  flex-shrink: 0;
  line-height: 1.55;
}

.footer__credit {
  margin: 0 0 10px;
}

.footer__names {
  color: var(--text);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin: 0;
}

.footer__legal-link {
  color: var(--cyan);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.15s ease,
    color 0.15s ease;
}

.footer__legal-link:hover {
  color: var(--mint);
  border-bottom-color: var(--mint);
}

.footer__legal-link:focus-visible {
  outline: 2px solid var(--pop);
  outline-offset: 3px;
}

.footer__legal-sep {
  color: rgba(255, 255, 255, 0.25);
  user-select: none;
}

/* Simple legal article pages (privacy, cookies) */
.legal-page {
  position: relative;
  z-index: 1;
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) max(var(--safe-pad), 4vw) calc(24px + var(--safe-bottom));
}

.legal-page strong {
  color: var(--text);
  font-weight: 600;
}

.legal-page__back {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.legal-page__back:hover {
  border-bottom-color: var(--cyan);
}

.legal-page__back:focus-visible {
  outline: 2px solid var(--pop);
  outline-offset: 3px;
}

.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.legal-page .legal-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 1.75rem;
}

.legal-page h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin: 1.75rem 0 0.6rem;
  color: var(--text);
}

.legal-page p,
.legal-page li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 0.85rem;
}

.legal-page ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.legal-page a {
  color: var(--cyan);
}

/* Launch overlay */
.launch-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: var(--bg-deep);
  pointer-events: all;
}

.launch-overlay[hidden] {
  display: none;
}

.launch-overlay--wipe {
  animation: wipe-in 0.55s ease forwards;
}

.launch-overlay--out {
  animation: wipe-out 0.35s ease forwards;
}

@keyframes wipe-in {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes wipe-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.launch-panel {
  width: min(340px, 88vw);
  text-align: center;
}

.launch-panel__label {
  font-family: var(--font-display);
  letter-spacing: 0.2em;
  font-size: clamp(0.75rem, 3vw, 0.9rem);
  color: var(--cyan);
  margin: 0 0 18px;
  text-shadow: 0 0 18px var(--cyan-glow);
}

.launch-panel__bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(255, 108, 171, 0.15);
}

.launch-panel__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--pop), var(--mint));
  background-size: 200% 100%;
  animation: bar-shine 1.2s linear infinite;
  transition: width 0.08s linear;
}

@keyframes bar-shine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .bg-fx,
  .bg-fx::after {
    animation: none;
  }

  .hero__tagline {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .card--active {
    animation: none;
  }

  .card--active .card__media img {
    transform: none;
  }

  .launch-panel__fill {
    transition: none;
    animation: none;
    background: linear-gradient(90deg, var(--cyan), var(--mint));
  }
}
