/* ==========================================================================
   ⚡ INNMLUV.DESIGN SPATIAL INTERACTION & MAGNETIC SUCTION ENGINE (1:1 REPLICA)
   - Magnetic Elastic Pull & Smooth Inertial Scroll (Zero Lag)
   - Universal Text Selection with Custom ::selection
   - 100% Mobile & TikTok Bio WebView Optimization
   - Haoqi Floating Scrollbar & 120fps Pure Performance
   ========================================================================== */

/* --- 1. HIDE NATIVE BROWSER SCROLLBAR (CHROME, BRAVE, SAFARI, EDGE, FIREFOX) --- */
::-webkit-scrollbar {
  display: none !important;
  width: 0px !important;
  height: 0px !important;
  background: transparent !important;
}

* {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  -webkit-tap-highlight-color: transparent;
}

/* --- 2. UNIVERSAL TEXT SELECTION (CHO PHÉP QUÉT MỌI CHỮ TRÊN WEB) --- */
html, body, p, h1, h2, h3, h4, h5, h6, span, a, div, section, article, footer, header, aside, label {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

/* KHÓA CHẶT CHỈ RIÊNG ẢNH, CANVAS, SCROLLBAR KHÔNG BỊ QUÉT CHỌN/KÉO LÊ */
img, canvas, svg, .art-card, .art-img, .haoqi-scrollbar, .scrollbar-track, .scrollbar-thumb, .scanlines, .noise-layer {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  -webkit-user-drag: none !important;
}

/* Tùy chỉnh màu quét chọn chữ cực đẹp */
::selection {
  background: var(--selection-bg);
  color: var(--selection-color);
  text-shadow: none;
}

::-moz-selection {
  background: var(--selection-bg);
  color: var(--selection-color);
  text-shadow: none;
}

/* --- Lenis Smooth Scroll Engine Rules --- */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

/* --- Dark Theme Tokens (Default) --- */
:root, [data-theme="dark"] {
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;

  --bg-color: #06070a;
  --card-surface: rgba(14, 16, 22, 0.92);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-border-hover: rgba(255, 255, 255, 0.3);
  --popup-bg: rgba(16, 18, 24, 0.98);

  --hud-bg: rgba(6, 7, 10, 0.85);
  --hud-border: rgba(255, 255, 255, 0.08);
  --scanline-opacity: 0.12;

  --text-pure: #ffffff;
  --text-l1: #ededed;
  --text-l2: #a1a3af;
  --text-l3: #525562;

  --accent-neon: #c0fe04;
  --dotted-line: rgba(255, 255, 255, 0.4);
  --shadow-card: 0 30px 80px -15px rgba(0, 0, 0, 0.85);

  --scrollbar-track: rgba(255, 255, 255, 0.18);
  --scrollbar-thumb: #ffffff;

  /* Selection: Acid Lime Highlight with Deep Black Text */
  --selection-bg: #c0fe04;
  --selection-color: #000000;
}

/* --- Light Theme Tokens --- */
[data-theme="light"] {
  --bg-color: #f6f7fa;
  --card-surface: #ffffff;
  --card-border: rgba(0, 0, 0, 0.12);
  --card-border-hover: rgba(0, 0, 0, 0.3);
  --popup-bg: rgba(255, 255, 255, 0.98);

  --hud-bg: rgba(246, 247, 250, 0.92);
  --hud-border: rgba(0, 0, 0, 0.08);
  --scanline-opacity: 0.02;

  --text-pure: #000000;
  --text-l1: #12141a;
  --text-l2: #484b55;
  --text-l3: #7a7e8c;

  --accent-neon: #0062ff;
  --dotted-line: rgba(0, 0, 0, 0.5);
  --shadow-card: 0 20px 50px -10px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);

  --scrollbar-track: rgba(0, 0, 0, 0.15);
  --scrollbar-thumb: #000000;

  /* Selection: Midnight Than Đen with Pure White Text */
  --selection-bg: #12141a;
  --selection-color: #ffffff;
}

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

html {
  font-size: 16px;
  background-color: var(--bg-color);
  color: var(--text-l1);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-l1);
  line-height: 1.75;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 3. Haoqi Floating Vertical Custom Scrollbar (1:1 Match) --- */
.haoqi-scrollbar {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  padding: 8px 4px;
}

.scrollbar-track {
  width: 5px;
  height: 160px;
  background: var(--scrollbar-track);
  border-radius: 999px;
  position: relative;
  transition: width 0.2s ease, background-color 0.3s ease;
}

.haoqi-scrollbar:hover .scrollbar-track {
  width: 7px;
}

.scrollbar-thumb {
  width: 100%;
  height: 48px;
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: background-color 0.3s ease;
}

/* --- 4. Top Scroll Progress Bar --- */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent-neon);
  z-index: 100;
  transition: width 0.05s linear;
}

/* --- 5. CRT Scanlines & Film Grain --- */
.scanlines {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 20;
  opacity: var(--scanline-opacity);
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%);
  background-size: 100% 4px;
  transition: opacity 0.3s ease;
}

.noise-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* --- 6. Interactive Crosshair & Dot Matrix Canvas --- */
#spatial-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* --- 7. Top Fixed HUD --- */
.hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  z-index: 60;
  background: var(--hud-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--hud-border);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.hud-brand-wrap, .hud-nav {
  pointer-events: auto;
}

.hud-brand {
  color: var(--text-pure);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  letter-spacing: -0.02em;
  padding: 6px 10px;
  position: relative;
  display: inline-block;
  transition: color 0.2s ease;
}

.hud-brand:before, .hud-link:before {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px dotted transparent;
  pointer-events: none;
  transition: border-color 0.2s ease;
}

.hud-brand:hover:before, .hud-link:hover:before {
  border-color: var(--dotted-line);
}

.hud-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.hud-link {
  color: var(--text-l1);
  text-decoration: none;
  padding: 6px 8px;
  position: relative;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  transition: color 0.2s ease;
}

.hud-link:hover {
  color: var(--text-pure);
}

.active-dotted {
  border: 1px dotted var(--dotted-line) !important;
}

.sound-btn.active {
  color: var(--accent-neon);
}

/* --- 8. Theme Popup Dialog --- */
.theme-popup {
  position: fixed;
  top: 56px;
  right: 28px;
  width: 480px;
  max-width: calc(100vw - 32px);
  background: var(--popup-bg);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.4);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-l1);
  display: flex;
  flex-direction: column;
  gap: 18px;
  z-index: 90;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-popup.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.popup-prose {
  display: flex;
  flex-direction: column;
  gap: 10px;
  line-height: 1.65;
}

.kbd-tag {
  color: var(--accent-neon);
  font-weight: 700;
}

.popup-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px dashed var(--card-border);
  font-size: 0.74rem;
  color: var(--text-l2);
  letter-spacing: 0.05em;
}

.detected-browser {
  color: var(--text-pure);
  font-weight: 600;
}

.viewport-dims {
  font-variant-numeric: tabular-nums;
}

/* --- 9. Bottom Fixed HUD --- */
.hud-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  background: var(--hud-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--hud-border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-l2);
  letter-spacing: 0.04em;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.hud-bottom span, .hud-tiktok-link {
  font-variant-numeric: tabular-nums;
  pointer-events: auto;
}

.hud-tiktok-link {
  color: var(--text-l2);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.hud-tiktok-link:hover {
  color: var(--accent-neon);
}

/* --- 10. Spatial Scroll Wrapper --- */
.spatial-wrapper {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 120px 28px 100px;
  display: flex;
  flex-direction: column;
  gap: 120px;
}

/* --- 11. Hero Statement Section --- */
.hero-statement-section {
  width: 100%;
  padding: 40px 0 20px;
}

.hero-statement-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 36px;
}

@media (min-width: 1024px) {
  .hero-statement-grid {
    grid-template-columns: 3fr 7fr;
    gap: 48px;
    align-items: flex-end;
  }
}

.hero-intro-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-neon);
  font-weight: 600;
  letter-spacing: 0.1em;
}

.hero-lead-text {
  font-size: 1.15rem;
  color: var(--text-l2);
  line-height: 1.65;
}

.hero-massive-text {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6.8vw, 5.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  color: var(--text-pure);
}

.text-highlight {
  color: var(--accent-neon);
}

/* Section Labels */
.section-label-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

.section-mono-tag {
  color: var(--text-pure);
  font-weight: 700;
}

.section-status-dot, .section-status-tag {
  color: #10b981;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

/* --- 12. Master Announcement Letter Card --- */
.announcement-section {
  width: 100%;
}

.master-card {
  position: relative;
  background: var(--card-surface);
  backdrop-filter: blur(36px);
  -webkit-backdrop-filter: blur(36px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 22px;
  transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.master-card:hover {
  border-color: var(--card-border-hover);
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-l3);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--card-border);
}

.meta-field {
  display: flex;
  gap: 6px;
}

.field-val {
  color: var(--text-l2);
  font-weight: 600;
}

.card-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stamp-pill {
  display: inline-flex;
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-l1);
  padding: 3px 8px;
  border: 1px dotted var(--dotted-line);
  border-radius: 4px;
  letter-spacing: 0.08em;
}

.card-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-pure);
}

.card-sub {
  font-size: 0.96rem;
  color: var(--text-l2);
}

.hairline {
  width: 100%;
  height: 1px;
  background: var(--card-border);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.prose-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.2s ease;
}

.prose-row:hover {
  transform: translateX(6px);
}

.prose-row:hover .num {
  color: var(--accent-neon);
}

.num {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-l3);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.prose-row p {
  font-size: 1.04rem;
  color: var(--text-l1);
  line-height: 1.8;
  letter-spacing: -0.015em;
}

.quote-row p {
  color: var(--text-pure);
  font-weight: 500;
}

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

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-l3);
  padding-top: 4px;
}

/* --- 13. Kho Phim Gallery Section --- */
.spatial-gallery-section {
  width: 100%;
}

.spatial-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  width: 100%;
}

.art-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background-color: var(--card-surface);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.art-card:hover {
  transform: translateY(-4px);
  border-color: var(--card-border-hover);
}

@media (min-width: 768px) {
  .art-card.col-4 { grid-column: span 4; }
  .art-card.col-6 { grid-column: span 6; }
  .art-card.col-8 { grid-column: span 8; }
  .art-card.col-12 { grid-column: span 12; }
}

@media (max-width: 767px) {
  .art-card { grid-column: span 12 !important; }
}

.aspect-3-4 { aspect-ratio: 3 / 4; }

.art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.art-card:hover .art-img {
  transform: scale(1.04);
}

/* --- 14. Massive Kinetic Footer (Haoqi Style) --- */
.kinetic-footer {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 50px 0 20px;
  border-top: 1px solid var(--card-border);
}

.footer-huge-title {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 7vw, 5.2rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}

.outline-txt {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--card-border-hover);
}

.footer-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-l3);
  letter-spacing: 0.06em;
}

/* --- 📱 TỐI ƯU HÓA TOÀN DIỆN CHO ĐIỆN THOẠI (MOBILE & TIKTOK WEBVIEW) --- */
@media (max-width: 768px) {
  .hud-top {
    padding: 12px 14px;
    font-size: 0.72rem;
  }

  .hud-brand {
    font-size: 0.82rem;
    padding: 4px 6px;
  }

  .hud-nav {
    gap: 4px;
  }

  .hud-link {
    padding: 4px 6px;
    font-size: 0.7rem;
  }

  .hud-bottom {
    padding: 10px 14px;
    font-size: 0.7rem;
  }

  .haoqi-scrollbar {
    display: none !important;
  }

  .spatial-wrapper {
    padding: 80px 14px 60px;
    gap: 55px;
  }

  .hero-statement-section {
    padding: 10px 0 10px;
  }

  .hero-statement-grid {
    gap: 20px;
  }

  .hero-lead-text {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .hero-massive-text {
    font-size: 2.1rem;
    line-height: 1.1;
  }

  .master-card {
    padding: 22px 16px;
    border-radius: 16px;
    gap: 16px;
  }

  .card-meta {
    font-size: 0.68rem;
    flex-wrap: wrap;
    gap: 8px;
  }

  .card-title {
    font-size: 1.6rem;
  }

  .prose-row {
    gap: 10px;
  }

  .prose-row p {
    font-size: 0.94rem;
    line-height: 1.68;
  }

  .num {
    font-size: 0.7rem;
    padding-top: 2px;
  }

  .card-foot {
    font-size: 0.66rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .spatial-grid {
    gap: 16px;
  }

  .footer-huge-title {
    font-size: 1.95rem;
  }

  .footer-info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.7rem;
  }

  .hide-mobile {
    display: none !important;
  }

  .theme-popup {
    top: 50px;
    right: 10px;
    left: 10px;
    width: auto;
    padding: 16px 14px;
    font-size: 0.74rem;
  }
}
