/* CSS Variables and Root Styles */
:root {
--ease: cubic-bezier(.22, .61, .36, 1);
--ease-back: cubic-bezier(.34, 1.56, .64, 1);
--o1: #ff8a3d;
--o2: #ff6a00;
--o3: #ffb469;
--line: rgba(255, 196, 140, .28);
--glass-bg: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
--glass-border: linear-gradient(135deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, .08));
--loading-progress: 0%;
}

/* Mobile Optimizations */
body.is-mobile .aurora,
body.is-mobile .reveal,
body.is-mobile .vector,
body.is-mobile .glass,
body.is-mobile .btn,
body.is-mobile .dropBody,
body.is-mobile .shot,
body.is-mobile .modal-bg,
body.is-mobile .modal-glass,
body.is-mobile .modal-player {
animation: none !important;
transition: none !important;
box-shadow: none !important;
filter: none !important;
backdrop-filter: none !important;
-webkit-backdrop-filter: none !important;
}

body.is-mobile .aurora,
body.is-mobile .vector {
opacity: 0.08 !important;
}

body.is-mobile .glass,
body.is-mobile .modal-glass {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18) !important;
background: rgba(18, 20, 26, 0.85) !important;
border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Video Mode Color Scheme */
body.mode-video {
--o1: #ff4d6d;
--o2: #e53755;
--o3: #ff8ea8;
--line: rgba(255, 150, 170, .30);
}

/* Global Reset and Base Styles */
* {
box-sizing: border-box;
}

html, body {
height: 100%;
margin: 0;
}

body {
color: #e8eaee;
font: 16px/1.5 system-ui, -apple-system, Segoe UI, Inter, Arial;
overflow-x: hidden;
background: linear-gradient(180deg, #000000 0%, #0a0a0a 50%, #050505 100%);
scroll-behavior: smooth;
scrollbar-width: none;
-ms-overflow-style: none;
}

body::-webkit-scrollbar {
display: none;
}

/* Background Layers */
.bg {
position: fixed;
inset: 0;
z-index: -3;
transition: opacity .8s var(--ease);
}

#bgPhoto {
opacity: 1;
background:
radial-gradient(1200px 800px at 25% -15%, rgba(255, 170, 80, .12) 0, transparent 65%),
radial-gradient(1000px 700px at 115% 5%, rgba(255, 120, 20, .12) 0, transparent 60%),
linear-gradient(180deg, #0b0c10, #0f1116 40%, #12141a);
}

#bgVideo {
opacity: 0;
background:
radial-gradient(1200px 800px at 25% -15%, rgba(255, 90, 110, .12) 0, transparent 65%),
radial-gradient(1000px 700px at 115% 5%, rgba(255, 40, 70, .12) 0, transparent 60%),
linear-gradient(180deg, #000000, #ffae0093 40%, #ff00ff6e);
}

body.mode-video #bgPhoto { opacity: 0; }
body.mode-video #bgVideo { opacity: 1; }

/* Noise Texture Overlay */
.noise {
position: fixed;
inset: 0;
pointer-events: none;
opacity: .03;
background-image: radial-gradient(rgba(255, 255, 255, .6) 1px, transparent 1.2px);
background-size: 4px 4px;
z-index: -2;
animation: noiseShift 20s linear infinite;
}

@keyframes noiseShift {
0%, 100% { transform: translate(0, 0); }
25% { transform: translate(-2px, -2px); }
50% { transform: translate(2px, -1px); }
75% { transform: translate(-1px, 2px); }
}

.fullscreen-image {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  pointer-events: none;
  transition: all 0.5s var(--ease);
  backdrop-filter: blur(0px) saturate(100%);
}

.fullscreen-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: all 0.5s var(--ease);
}

.fullscreen-image.show {
  pointer-events: auto;
  backdrop-filter: blur(24px) saturate(180%);
}

.fullscreen-image.show::before {
  background: rgba(255, 255, 255, 0.05);
}

.fullscreen-image img {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.5s var(--ease-back);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.fullscreen-image.show img {
  transform: scale(1);
  opacity: 1;
}

/* Aurora Background Animation */
.aurora {
position: fixed;
inset: -25vh -15vw;
pointer-events: none;
filter: blur(80px) saturate(140%);
opacity: .25;
mix-blend-mode: screen;
will-change: transform;
z-index: -1;
}

.aurora::before,
.aurora::after {
content: "";
position: absolute;
inset: 0;
background: conic-gradient(from 0deg at 50% 50%, var(--o1), #f59e0b, var(--o3), #f97316, var(--o2), var(--o1));
animation: spin 32s linear infinite;
}

.aurora::after {
animation-direction: reverse;
animation-duration: 40s;
opacity: .6;
}

@keyframes spin {
to { transform: rotate(1turn); }
}

/* Vector Graphics Background */
.vector {
position: fixed;
inset: 0;
pointer-events: none;
opacity: .28;
filter: blur(.5px);
z-index: -1;
}

.vector path {
stroke: var(--line);
stroke-width: 1.5;
fill: none;
stroke-linecap: round;
}

.v1 {
stroke-dasharray: 280 640;
animation: dash 28s linear infinite;
}

.v2 {
stroke-dasharray: 200 560;
animation: dash 32s linear infinite reverse;
}

.v3 {
stroke-dasharray: 240 620;
animation: dash 36s linear infinite;
opacity: .6;
}

@keyframes dash {
to { stroke-dashoffset: -860; }
}

/* Header with Toggle */
.header {
position: sticky;
top: 0;
z-index: 100;
padding: 20px 0;
backdrop-filter: blur(32px) saturate(180%);
background: rgba(11, 12, 16, .4);
border-bottom: 1px solid rgba(255, 255, 255, .06);
transition: all .4s var(--ease);
}

.header-content {
max-width: 1200px;
margin: 0 auto;
padding: 0 24px;
display: flex;
justify-content: space-between;
align-items: center;
}

.logo {
font-size: 24px;
font-weight: 700;
color: var(--o1);
text-decoration: none;
transition: color .3s var(--ease);
}

.logo:hover {
color: var(--o2);
}

/* Apple-style Liquid Glass Toggle Switch */
.toggle {
position: relative;
user-select: none;
}

.knob {
position: relative;
width: 220px;
height: 44px;
border-radius: 22px;
background: 
linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .04)) padding-box,
linear-gradient(145deg, rgba(255, 255, 255, .2), rgba(255, 255, 255, .06)) border-box;
border: 1px solid transparent;
padding: 2px;
display: grid;
grid-template-columns: 1fr 1fr;
align-items: center;
backdrop-filter: blur(20px) saturate(180%);
box-shadow: 
inset 0 1px 2px rgba(255, 255, 255, .1),
inset 0 -1px 2px rgba(0, 0, 0, .1),
0 8px 32px rgba(0, 0, 0, .25),
0 1px 0 rgba(255, 255, 255, .05);
cursor: pointer;
transition: all .4s cubic-bezier(.25, .46, .45, .94);
overflow: hidden;
}

.knob:hover {
box-shadow: 
inset 0 1px 3px rgba(255, 255, 255, .15),
inset 0 -1px 3px rgba(0, 0, 0, .1),
0 12px 40px rgba(0, 0, 0, .3),
0 1px 0 rgba(255, 255, 255, .08);
transform: scale(1.02);
}

.knob:active {
transform: scale(.98);
transition: transform .1s ease;
}

.pill {
position: absolute;
left: 2px;
top: 2px;
bottom: 2px;
width: calc(50% - 2px);
border-radius: 20px;
background: linear-gradient(145deg, var(--o1) 0%, var(--o2) 100%);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, .3),
inset 0 -1px 0 rgba(0, 0, 0, .1),
0 2px 8px rgba(0, 0, 0, .2),
0 8px 24px rgba(255, 138, 61, .25);
transition: all .6s cubic-bezier(.34, 1.56, .64, 1);
will-change: transform;
}

.pill::before {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
background: linear-gradient(145deg, rgba(255, 255, 255, .3) 0%, transparent 50%);
transition: opacity .3s ease;
}

.pill::after {
content: '';
position: absolute;
inset: 1px;
border-radius: inherit;
background: linear-gradient(145deg, transparent 0%, rgba(0, 0, 0, .1) 100%);
}

.knob:hover .pill {
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, .4),
inset 0 -1px 0 rgba(0, 0, 0, .1),
0 4px 12px rgba(0, 0, 0, .3),
0 12px 32px rgba(255, 138, 61, .35);
}

.lab {
position: relative;
text-align: center;
font-weight: 600;
font-size: 13px;
letter-spacing: .4px;
opacity: .8;
user-select: none;
transition: all .4s cubic-bezier(.25, .46, .45, .94);
z-index: 2;
text-shadow: 0 1px 2px rgba(0, 0, 0, .1);
}

#mode:checked + .knob .pill {
transform: translateX(calc(100% + 2px));
background: linear-gradient(145deg, var(--o1) 0%, var(--o2) 100%);
box-shadow:
inset 0 1px 0 rgba(255, 255, 255, .3),
inset 0 -1px 0 rgba(0, 0, 0, .1),
0 2px 8px rgba(0, 0, 0, .2),
0 8px 24px rgba(229, 55, 85, .25);
}

#mode:checked + .knob .lab:first-of-type {
opacity: .4;
transform: translateX(-2px);
}

.knob .lab:last-of-type {
opacity: .4;
transform: translateX(2px);
}

#mode:checked + .knob .lab:last-of-type {
opacity: .8;
transform: translateX(0);
}

/* Liquid ripple effect */
.knob::before {
content: '';
position: absolute;
inset: 0;
border-radius: inherit;
background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), 
rgba(255, 255, 255, .1) 0%, 
rgba(255, 255, 255, .05) 40%, 
transparent 70%);
opacity: 0;
transition: opacity .3s ease;
pointer-events: none;
}

.knob:hover::before {
opacity: 1;
}

/* Main Layout */
.wrap {
max-width: 1200px;
margin: 0 auto;
padding: 40px 24px 80px;
}

.intro {
text-align: center;
margin-bottom: 60px;
}

.title {
font-size: clamp(32px, 5vw, 48px);
margin: 0 0 16px;
font-weight: 800;
background: linear-gradient(135deg, #fff, #c1c5d0);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}

.hint {
font-size: 16px;
opacity: .75;
max-width: 400px;
margin: 0 auto;
}

/* Grid Layout */
.grid {
display: grid;
gap: 32px;
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* Glass Morphism Cards */
.glass {
border-radius: 20px;
background: var(--glass-bg) padding-box, var(--glass-border) border-box;
border: 1px solid transparent;
box-shadow: 
0 8px 32px rgba(0, 0, 0, .3),
inset 0 1px 0 rgba(255, 255, 255, .1);
backdrop-filter: blur(20px) saturate(150%);
transition: all .4s var(--ease);
cursor: pointer;
position: relative;
overflow: hidden;
}

.glass::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .1), transparent);
transition: left .6s var(--ease);
}

.glass:hover::before {
left: 100%;
}

.glass:hover {
transform: translateY(-8px) scale(1.02);
box-shadow: 
0 20px 60px rgba(0, 0, 0, .4),
0 0 0 1px rgba(255, 255, 255, .15),
inset 0 1px 0 rgba(255, 255, 255, .15);
}

/* Stack Cards */
.stack {
display: flex;
flex-direction: column;
gap: 16px;
align-items: center;
justify-content: center;
min-height: 380px;
padding: 24px;
position: relative;
}

.stackHead {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
font-size: 15px;
margin-bottom: 8px;
}

.stackHead strong {
font-weight: 700;
font-size: 16px;
}

.stackHead span {
opacity: .7;
font-size: 13px;
background: rgba(255, 255, 255, .1);
padding: 4px 8px;
border-radius: 12px;
}

.preview {
position: relative;
width: 85%;
max-width: 280px;
aspect-ratio: 4/5;
}

.pItem {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%) rotate(var(--r));
width: 88%;
aspect-ratio: 3208/4277;
border-radius: 16px;
overflow: hidden;
border: 1px solid rgba(255, 255, 255, .15);
box-shadow: 
0 8px 32px rgba(0, 0, 0, .4),
0 2px 8px rgba(0, 0, 0, .2);
background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02));
transition: all .4s var(--ease);
}

.pItem > img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
transition: transform .4s var(--ease);
}

.stack:hover .pItem {
transform: translate(-50%, -52%) rotate(var(--r)) scale(1.05);
}

.stack:hover .pItem > img {
transform: scale(1.1);
}

/* Overlay Modal */
#ov {
position: fixed;
inset: 0;
opacity: 0;
pointer-events: none;
display: grid;
place-items: center;
z-index: 1000;
transition: opacity 0.8s var(--ease), backdrop-filter 0.8s var(--ease);
backdrop-filter: blur(0px) saturate(100%);
background: rgba(6, 7, 10, 0);
}

#ov.show {
opacity: 1;
pointer-events: auto;
backdrop-filter: blur(32px) saturate(180%);
background: rgba(6, 7, 10, 0.6);
}

#ov::before {
content: "";
position: absolute;
inset: 0;
background: rgba(6, 7, 10, .6);
backdrop-filter: blur(0) saturate(100%);
opacity: 0;
transition: all .6s var(--ease);
}

#ov.show::before {
opacity: 1;
backdrop-filter: blur(20px) saturate(140%);
}

.stageWrap {
position: relative;
width: min(1200px, 95vw);
height: min(85vh, 800px);
padding: 0 20px;
transition: all .5s var(--ease);
}

.bar {
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 0 20px;
padding: 20px 24px;
background: var(--glass-bg) padding-box,
            var(--glass-border) border-box;
border: 1px solid transparent;
border-radius: 16px;
backdrop-filter: blur(24px) saturate(180%);
box-shadow: 
  0 8px 32px rgba(0, 0, 0, .3),
  inset 0 1px 0 rgba(255, 255, 255, .1);
position: relative;
z-index: 5;
opacity: 0;
transform: translateY(-20px);
transition: all 0.8s var(--ease);
}

#ov.show .bar {
opacity: 1;
transform: translateY(0);
}

.bar h2 {
margin: 0;
font-size: 18px;
font-weight: 600;
}

.btn {
appearance: none;
border: 1px solid rgba(255, 255, 255, .2);
background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .05));
color: #e5e7eb;
padding: 12px 20px;
border-radius: 12px;
cursor: pointer;
font-weight: 600;
font-size: 14px;
transition: all .3s var(--ease);
backdrop-filter: blur(10px);
}

.btn:hover {
background: linear-gradient(180deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .08));
border-color: rgba(255, 255, 255, .3);
transform: translateY(-2px);
box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

.btn:active {
transform: translateY(0);
}

.stage {
position: relative;
width: 100%;
height: calc(100% - 80px);
border-radius: 20px;
overflow: hidden;
background: var(--glass-bg) padding-box,
            var(--glass-border) border-box;
border: 1px solid transparent;
backdrop-filter: blur(24px) saturate(180%);
box-shadow: 
  0 12px 40px rgba(0, 0, 0, .4),
  inset 0 1px 0 rgba(255, 255, 255, .1);
z-index: 1;
opacity: 0;
transform: scale(0.95);
transition: all 0.8s var(--ease);
}

#ov.show .stage {
opacity: 1;
transform: scale(1);
}

/* Tile Animations and Effects */
.spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  z-index: 2;
}

.spinner::after {
  content: "";
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--o1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.tile {
  position: absolute;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, .4),
    0 16px 64px rgba(0, 0, 0, .2);
  transform-origin: 50% 70%;
  transition: all .6s var(--ease);
  background: rgba(255, 255, 255, .05);
  will-change: transform, opacity;
  contain: layout style paint;
}

.tile > img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
transition: transform .6s var(--ease);
}

.tile:hover {
transform: translate(var(--x), var(--y)) rotate(var(--rot)) scale(1.08);
box-shadow:
0 16px 48px rgba(0, 0, 0, .5),
0 24px 80px rgba(255, 150, 100, .15);
z-index: 10;
}

.tile:hover > img {
transform: scale(1.1);
}

/* Floating Animation */
@keyframes drift {
0% { transform: translate(var(--x), var(--y)) rotate(var(--rot)); }
50% { transform: translate(var(--x), calc(var(--y) - 12px)) rotate(calc(var(--rot) + .8deg)); }
100% { transform: translate(var(--x), var(--y)) rotate(var(--rot)); }
}

.float {
animation: drift 12s ease-in-out infinite;
}

/* Reveal Animations */
@keyframes fadeUp {
0% {
opacity: 0;
transform: translateY(24px) scale(.96);
filter: blur(8px);
}
100% {
opacity: 1;
transform: none;
filter: none;
}
}

@keyframes fade {
from { opacity: 0; }
to { opacity: 1; }
}

.reveal {
animation-fill-mode: both;
}

.reveal-fade-slow {
animation: fade 1s ease 0.1s both;
}

.reveal-fade-slower {
animation: fade 1.2s ease 0.2s both;
}

.reveal-fade-up {
animation: fadeUp 0.8s ease 0.3s both;
}

.reveal-fade-up-delayed {
animation: fadeUp 0.9s ease 0.4s both;
}

/* Pulse Effect */
.pulse {
position: fixed;
inset: 0;
pointer-events: none;
opacity: 0;
background: radial-gradient(600px 400px at 50% 50%, rgba(255, 180, 120, .2), transparent 70%);
transition: opacity .8s var(--ease);
z-index: 999;
}

.pulse.show {
opacity: 1;
}

/* Hidden checkbox */
#mode {
position: absolute;
opacity: 0;
pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
.header-content {
padding: 0 16px;
}

.wrap {
padding: 20px 16px 60px;
}

.grid {
gap: 24px;
grid-template-columns: 1fr;
}

.knob {
width: 160px;
height: 36px;
}

.lab {
font-size: 12px;
}

.stageWrap {
width: 98vw;
padding: 0 10px;
}

.bar {
padding: 16px 20px;
margin-bottom: 16px;
}

.bar h2 {
font-size: 16px;
}

.title {
font-size: 28px;
}

.hint {
font-size: 14px;
}

.stack {
min-height: 320px;
padding: 20px;
}
}
/* Disable Text Selection */
body,
body * {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* Floating particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent);
  border-radius: 50%;
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) translateX(var(--drift, 0));
    opacity: 0;
  }
}

/* Cursor glow effect */
.cursor-glow {
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s;
}
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  pointer-events: none;
}
