/* ============================================================
   SELF-HOSTED FONTS
   ============================================================ */
@font-face {
  font-family: Marcellus;
  src: url('../fonts/marcellus-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'The Seasons';
  src: url('../fonts/Fontspring-DEMO-theseasons-reg.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url('../fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   BASE RESET
   ============================================================ */
body,
html {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  width: 100%;
  height: 100%;
  background-color: #0d0d1a;
  background-image: linear-gradient(135deg, #0d0d1a 0%, #1a0d2e 35%, #2a1040 60%, #0d1a2e 100%);
  color: white;
  font-size: 100%;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  overflow: hidden;
}

body * {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
}

/* Auto-hide cursor: hidden by default, shown on mouse movement via JS */
html.cursor-hidden,
html.cursor-hidden *,
html.cursor-hidden *::before,
html.cursor-hidden *::after {
  cursor: none !important;
}

/* Restore pointer cursor for interactive controls */
html.cursor-hidden a,
html.cursor-hidden button,
html.cursor-hidden input,
html.cursor-hidden textarea,
html.cursor-hidden select,
html.cursor-hidden label,
html.cursor-hidden [role='button'],
html.cursor-hidden [role='link'] {
  cursor: pointer !important;
}

img,
video {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   COMPONENT STYLES
   ============================================================ */

/* Initial loader */
#initial-loader {
  background-color: #000;
  opacity: 1;
}

/* Backwards compatibility */
#initial-loader.fade-out,
#initial-loader.opacity-0 {
  opacity: 0;
  pointer-events: none;
}

.serif {
  font-family: 'Times New Roman', serif;
}

/* Device Info Panel */
.device-info {
  display: none;
  background-color: rgb(10 14 25 / 85%);
  background-image: linear-gradient(to bottom, rgb(35 50 80 / 90%), rgb(25 35 60 / 95%));
  border: 1px solid rgb(100 150 255 / 20%);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -5px 10px rgb(0 0 30 / 30%);
  font-size: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
}

.device-info.visible {
  display: block;
  animation: slide-up-fade-in 0.4s ease forwards;
}

.device-info.hiding {
  animation: slide-down-fade-out 0.4s ease forwards;
}

.device-info.closing {
  animation: modal-slide-down 0.4s ease-in forwards;
}

.device-info > p {
  margin: 0.5rem 0;
}

.device-info-title {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 16px;
  color: white;
  padding-bottom: 8px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.device-info-container {
  max-height: calc(80vh - 100px);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.device-info-container::-webkit-scrollbar {
  width: 6px;
}

.device-info-container::-webkit-scrollbar-track {
  background: rgb(255 255 255 / 5%);
  border-radius: 4px;
}

.device-info-container::-webkit-scrollbar-thumb {
  background-color: rgb(100 150 255 / 30%);
  border-radius: 4px;
}

.device-info-container::-webkit-scrollbar-thumb:hover {
  background-color: rgb(100 170 255 / 50%);
}

.device-info-card {
  background-color: rgb(15 25 40 / 85%);
  border-radius: 12px;
  border: 1px solid rgb(100 150 255 / 15%);
  overflow: hidden;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    border-color 0.2s;
  box-shadow:
    0 4px 12px rgb(0 0 0 / 40%),
    0 0 20px rgb(50 100 200 / 10%);
}

.device-info-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 16px rgb(0 0 0 / 40%),
    0 0 25px rgb(70 130 255 / 20%);
  border-color: rgb(100 170 255 / 30%);
}

.device-info-card-header {
  padding: 14px 16px;
  background-color: rgb(30 45 75 / 90%);
  border-bottom: 1px solid rgb(100 150 255 / 20%);
  background-image: linear-gradient(to right, rgb(40 60 100 / 80%), rgb(30 45 80 / 80%));
}

.device-info-card-title {
  margin: 0;
  color: rgb(255 255 255 / 100%);
  text-shadow:
    0 1px 3px rgb(0 0 0 / 40%),
    0 0 10px rgb(70 130 255 / 30%);
}

.device-info-card-icon {
  margin-right: 10px;
  font-size: 20px;
  text-shadow: 0 0 10px rgb(100 170 255 / 50%);
}

.device-info-card-body {
  padding: 6px 0;
  margin: 0;
}

.device-info-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 5%);
  transition: background-color 0.2s ease;
  margin-bottom: 2px;
}

.device-info-item:last-child {
  border-bottom: none;
}

.device-info-item:hover {
  background-color: rgb(255 255 255 / 5%);
}

.device-info-item-label {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 5px;
  color: rgb(255 255 255 / 90%);
}

.device-info-item-icon {
  width: 24px;
  height: 24px;
  font-size: 14px;
  background-color: rgb(0 0 0 / 20%);
  border-radius: 6px;
  margin-right: 8px;
  text-shadow: 0 1px 3px rgb(0 0 0 / 40%);
}

.device-info-item-value {
  color: rgb(255 255 255 / 75%);
  font-size: 13px;
  text-shadow: 0 1px 1px rgb(0 0 0 / 20%);
  display: block;
  padding-left: 32px;
  margin-left: 4px;
  overflow: visible;
  text-align: left;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

.media-playback-card {
  margin-bottom: 20px;
  overflow: visible !important;
}

.media-playback-body {
  overflow: visible !important;
}

.media-playback-item {
  overflow: visible !important;
}

.media-playback-label {
  font-weight: 600;
}

.media-playback-value {
  font-size: 14px;
  margin-top: 5px;
}

.device-info-not-available {
  color: rgb(180 180 180 / 70%);
  font-style: italic;
  text-shadow: 0 1px 1px rgb(0 0 0 / 30%);
}

.device-info-table thead:not(:first-child) {
  padding-top: 15px;
}

.device-info-table thead:not(:first-child) th {
  padding-top: 20px;
}

/* Media container — display:none is the initial hidden state; JS adds .flex to reveal */
.media-container {
  display: none;
}

.media-container.visible {
  display: flex;
  opacity: 1;
}

.media-container.flex {
  display: flex;
}

.media-container.opacity-100 {
  opacity: 1;
}

.media-player {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
}

.media-player video,
.media-player img.main-media {
  position: absolute;
  z-index: 10;
  height: 100vh;
  width: 100vw;
  object-fit: contain;
  transform: translateZ(0);
  will-change: transform;
}

.media-player .background {
  position: absolute;
  z-index: 1;
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* ============================================================
   WEB REGISTRATION SCREEN
   ============================================================ */
#content-reg {
  background-color: #25262b;
  text-align: center;
  padding: 3vh 1rem 2vh;
  gap: clamp(0.5rem, 1.5vh, 1.5rem);
  justify-content: center;
  overflow: visible;
}

.reg-logo {
  width: clamp(80px, 12vh, 160px);
}

.reg-title {
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(3rem, 10vh, 9rem);
  font-weight: 900;
  line-height: 0.85;
  margin: 0;
  color: white;
  letter-spacing: -0.03em;
}

.reg-title-bold {
  -webkit-text-stroke: 1.5px white;
}

.reg-title-accent {
  font-family: 'The Seasons', Georgia, serif;
  color: #d295e4;
  font-weight: 400;
  font-style: normal;
  font-size: 1.15em;
  display: block;
  margin-top: -0.15em;
}

.reg-subtitle {
  font-family: Marcellus, ui-serif, Georgia, serif;
  font-style: italic;
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: rgb(255 255 255 / 80%);
  line-height: 1.6;
  margin: 0;
  max-width: 28rem;
}

.reg-qr-frame {
  position: relative;
  padding: 1.5rem 1.75rem;
  margin: 0 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Corner brackets */
.reg-qr-frame::before,
.reg-qr-frame::after {
  content: '';
  position: absolute;
  width: 2.5rem;
  height: 2.5rem;
  border-color: #d295e4;
  border-style: solid;
}

.reg-qr-frame::before {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-radius: 8px 0 0;
}

.reg-qr-frame::after {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-radius: 0 8px 0 0;
}

/* Bottom corners via inner pseudo-elements on labels */
.reg-qr-label-bottom::before,
.reg-qr-label-bottom::after {
  content: '';
  position: absolute;
  width: 2.5rem;
  height: 2.5rem;
  border-color: #d295e4;
  border-style: solid;
}

.reg-qr-label-bottom::before {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 8px;
}

.reg-qr-label-bottom::after {
  bottom: 0;
  right: 0;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 8px;
}

.reg-qr-label {
  position: absolute;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: #d295e4;
}

.reg-qr-label-top {
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
}

.reg-qr-label-bottom {
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);

  /* Container for bottom corner pseudo-elements */
  width: 100%;
  text-align: center;
}

.reg-qr-label-left {
  left: -0.5rem;
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
}

.reg-qr-label-right {
  right: -0.5rem;
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%);
}

#qrcode-reg {
  background-color: white;
  border-radius: 12px;
  padding: 12px;
}

.reg-help {
  font-family: Marcellus, ui-serif, Georgia, serif;
  font-style: italic;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  color: rgb(255 255 255 / 70%);
  line-height: 1.6;
  margin: 0;
}

.reg-help-link {
  color: rgb(255 255 255 / 90%);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Platform badge */
#platform-badge {
  background-color: rgb(194 147 208 / 15%);
  border: 1px solid rgb(194 147 208 / 40%);
  border-radius: 24px;
  padding: 8px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #d295e4;
  letter-spacing: 0.03em;
}

/* Loading modal */
#loading-modal {
  background-color: rgb(0 0 0 / 80%);
}

/* Spinner */
.animate-spin {
  animation: spin 1s linear infinite;
  display: inline-block;
  width: 4rem;
  height: 4rem;
  border: 4px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.fade-in {
  animation: fade-in 0.5s ease-in;
}

/* Fullscreen interaction — shown/hidden by mousemove JS */
.fullscreen-interaction {
  transition: opacity 0.3s ease;
}

.fullscreen-interaction .medium {
  height: 5.2rem;
  width: 5.2rem;
}

.fullscreen-interaction .control-medium {
  height: 4.4rem;
  width: 4.4rem;
}

/* stylelint-disable-next-line no-descending-specificity --
   Lower specificity than html.cursor-hidden button is intentional;
   these selectors target unrelated concerns. */
.fullscreen-interaction button {
  background-color: transparent;
  border-radius: 0.2rem;
  border: none;
  box-sizing: border-box;
  color: rgb(255 255 255);
  cursor: pointer;
  margin: 0;
  padding: 0;
  position: relative;
  transition: transform 150ms;
  will-change: height, width;
}

.fullscreen-interaction button:hover,
.fullscreen-interaction button:focus {
  transform: scale(1.3);
}

.fullscreen-interaction svg {
  height: 100%;
  width: 100%;
}

.fullscreen-interaction .control-fullscreen-enter {
  display: block;
}

.fullscreen-interaction .control-fullscreen-exit {
  display: none;
}

:full-screen .fullscreen-interaction .control-fullscreen-enter {
  display: none;
}

:fullscreen .fullscreen-interaction .control-fullscreen-enter {
  display: none;
}

:full-screen .fullscreen-interaction .control-fullscreen-exit {
  display: block;
}

:fullscreen .fullscreen-interaction .control-fullscreen-exit {
  display: block;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: rgb(0 0 0 / 75%);
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  z-index: 9999;
}

.notification-visible {
  opacity: 1;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.notification-hidden {
  opacity: 0;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

/* Modal state classes */
.modal-base {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.modal-hidden {
  display: none !important;
}

.modal-visible {
  display: flex !important;
  opacity: 1;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.modal-fade-in {
  opacity: 1;
}

.modal-fade-out {
  opacity: 0;
}

/* Debug state classes */
.debug-enabled {
  color: #008000;
}

.debug-disabled {
  color: rgb(255 255 255 / 75%);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes slide-up-fade-in {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes slide-down-fade-out {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
  }
}

@keyframes modal-slide-up {
  0% {
    opacity: 0.3;
    transform: translateX(-50%) translateY(100%);
  }

  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes modal-slide-down {
  0% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
    pointer-events: none;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* content-beams animation removed for performance */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgb(0 0 0 / 70%);
  }

  50% {
    opacity: 1;
    transform: scale(1.3);
    box-shadow: 0 0 0 10px rgb(0 0 0 / 0%);
  }

  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgb(0 0 0 / 0%);
  }
}

/* pulse-slow-opacity animation removed for performance */

/* ============================================================
   RESPONSIVE GRID
   ============================================================ */

@media (width >= 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .md\:col-span-2 {
    grid-column: span 2 / span 2;
  }
}

@media (width >= 1081px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Mobile browser (≤ 480px) */
@media (width <= 480px) {
  #platform-badge {
    font-size: 0.75rem;
    padding: 6px 12px;
  }

  .device-info {
    font-size: 13px;
  }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

/* --- Display --- */
.flex {
  display: flex !important;
}

.block {
  display: block !important;
}

.hidden {
  display: none !important;
}

.grid {
  display: grid;
}

.inline-flex {
  display: inline-flex;
}

/* --- Flexbox --- */
.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.flex-shrink-0 {
  flex-shrink: 0;
}

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

.items-start {
  align-items: flex-start;
}

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

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

/* --- Grid columns --- */
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* --- Column gaps --- */
.gap-x-8 {
  column-gap: 2rem;
}

.gap-y-10 {
  row-gap: 2.5rem;
}

/* --- Sizing --- */
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.w-screen {
  width: 100vw;
}

.h-screen {
  height: 100vh;
}

.max-w-7xl {
  max-width: 80rem;
}

.max-w-sm {
  max-width: 24rem;
}

.max-w-90pct {
  max-width: 90%;
}

.min-w-250 {
  min-width: 250px;
}

/* --- Spacing --- */
.p-4 {
  padding: 1rem;
}

.p-5 {
  padding: 20px;
}

.p-6 {
  padding: 1.5rem;
}

.p-8 {
  padding: 2rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-5 {
  padding-left: 20px;
  padding-right: 20px;
}

.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.py-3 {
  padding-top: 10px;
  padding-bottom: 10px;
}

.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-8 {
  margin-top: 2rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mb-90 {
  margin-bottom: 90px;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* --- Typography --- */
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.text-base {
  font-size: 1rem;
  line-height: 1.5rem;
}

.text-lg {
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}

.text-4xl {
  font-size: 2.25rem;
  line-height: 2.5rem;
}

.text-6xl {
  font-size: 3.75rem;
  line-height: 1;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.text-center {
  text-align: center;
}

.text-white {
  color: #fff;
}

.text-green {
  color: #008000;
}

.text-red {
  color: #f00;
}

.leading-tight {
  line-height: 1.25;
}

/* --- Font stacks --- */
.font-display {
  font-family: Marcellus, ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif;
}

.font-body {
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
}

/* --- Position --- */
.fixed {
  position: fixed;
}

.absolute {
  position: absolute;
}

.relative {
  position: relative;
}

.inset-0 {
  inset: 0;
}

.top-0 {
  top: 0;
}

.top-5 {
  top: 20px;
}

.bottom-0 {
  bottom: 0;
}

.bottom-5 {
  bottom: 20px;
}

.left-0 {
  left: 0;
}

.left-5 {
  left: 20px;
}

.right-0 {
  right: 0;
}

.right-5 {
  right: 20px;
}

.top-50 {
  top: 50px;
}

.left-50 {
  left: 50px;
}

/* --- Z-index --- */
.z-10 {
  z-index: 10;
}

.z-20 {
  z-index: 20;
}

.z-30 {
  z-index: 30;
}

.z-50 {
  z-index: 50;
}

.z-max {
  z-index: 9999;
}

.z-100 {
  z-index: 100;
}

/* --- Opacity --- */
.opacity-0 {
  opacity: 0;
}

.opacity-100 {
  opacity: 1;
}

/* --- Overflow --- */
.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

/* --- Visibility --- */
.invisible {
  visibility: hidden !important;
}

.visible {
  visibility: visible !important;
}

/* --- Border radius --- */
.rounded {
  border-radius: 5px;
}

.rounded-lg {
  border-radius: 8px;
}

.rounded-2xl {
  border-radius: 16px;
}

.rounded-full {
  border-radius: 9999px;
}

/* --- Pointer Events --- */
.pointer-events-none {
  pointer-events: none;
}

.pointer-events-auto {
  pointer-events: auto;
}

/* --- Cursor --- */
.cursor-pointer {
  cursor: pointer;
}

.cursor-none {
  cursor: none;
}

/* --- Transitions --- */
.transition {
  transition-property: opacity, transform;
  transition-timing-function: ease;
}

.transition-opacity {
  transition-property: opacity;
  transition-timing-function: ease;
}

.transition-transform {
  transition-property: transform;
  transition-timing-function: ease;
}

.duration-300 {
  transition-duration: 0.3s;
}

.duration-400 {
  transition-duration: 0.4s;
}

.duration-500 {
  transition-duration: 0.5s;
}

.ease {
  transition-timing-function: ease;
}

.ease-in {
  transition-timing-function: ease-in;
}

.ease-out {
  transition-timing-function: ease-out;
}

.ease-in-out {
  transition-timing-function: ease-in-out;
}

/* --- Backgrounds --- */
.bg-black-75 {
  background-color: rgb(0 0 0 / 75%);
}

.bg-green-600 {
  background-color: #16a34a;
}

.bg-yellow-600 {
  background-color: #ca8a04;
}

.bg-red-600 {
  background-color: #dc2626;
}

.bg-red-600\/40 {
  background-color: rgb(220 38 38 / 40%);
}
