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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #0a0806;
  font-family: 'Georgia', 'Times New Roman', serif;
}

#scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* ── Sky canvas (clouds, landscape, sun) ── */
#sky-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}

/* ── Interior overlay ── */
#interior {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
}

/* ── Window frame ── */
#window-frame {
  position: absolute;
  top: 8vh; left: 10vw;
  width: 80vw; height: 50vh;
  border: 1.2vmin solid #3a2a1a;
  border-radius: 2vmin 2vmin 0.5vmin 0.5vmin;
  box-shadow:
    inset 0 0 3vmin rgba(0,0,0,0.5),
    0 0 5vmin rgba(0,0,0,0.6),
    0 0.5vmin 1vmin rgba(60,40,20,0.4);
  overflow: hidden;
  z-index: 2;
  background: transparent;
}

#window-glass {
  width: 100%; height: 100%;
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.03) 0%,
    rgba(255,255,255,0.0) 40%,
    rgba(255,255,255,0.02) 100%
  );
}

#window-reflection {
  position: absolute;
  top: -20%; left: -10%;
  width: 60%; height: 140%;
  background: linear-gradient(
    120deg,
    rgba(255,220,180,0.0) 0%,
    rgba(255,220,180,0.04) 45%,
    rgba(255,220,180,0.0) 55%
  );
  transform: rotate(-15deg);
  pointer-events: none;
  animation: reflection-shift 12s ease-in-out infinite;
}

@keyframes reflection-shift {
  0%, 100% { transform: rotate(-15deg) translateX(0); }
  50% { transform: rotate(-15deg) translateX(5vw); }
}

/* ── Ceiling ── */
#ceiling {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 8vh;
  background: linear-gradient(180deg, #2a1c10 0%, #3a2818 70%, #4a3420 100%);
  z-index: 3;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 5vw;
}

.ceiling-beam {
  width: 2vw; height: 100%;
  background: linear-gradient(90deg, #2a1c10, #3d2a18, #2a1c10);
  box-shadow: 0 0.5vh 1vh rgba(0,0,0,0.3);
}

/* ── Gas lamps ── */
#gas-lamps { position: absolute; top: 6vh; left: 0; width: 100%; z-index: 10; }

.gas-lamp {
  position: absolute;
  transform: translateX(-50%);
}

.lamp-bracket {
  width: 0.4vmin; height: 3vh;
  background: #5a4a38;
  margin: 0 auto;
}

.lamp-glass {
  width: 3vmin; height: 4vmin;
  margin: 0 auto;
  background: radial-gradient(ellipse, rgba(255,200,100,0.15), rgba(255,180,80,0.05));
  border: 0.2vmin solid rgba(200,170,120,0.3);
  border-radius: 50% 50% 40% 40%;
}

.lamp-flame {
  width: 0.8vmin; height: 1.5vmin;
  margin: -3vmin auto 0;
  background: radial-gradient(ellipse, #ffdd88, #ff9944);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: flame-flicker 0.8s ease-in-out infinite alternate;
  position: relative;
  z-index: 11;
}

.lamp-glow {
  width: 20vmin; height: 20vmin;
  margin: -12vmin auto 0;
  background: radial-gradient(ellipse, rgba(255,180,80,0.12), rgba(255,160,60,0.04), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: glow-pulse 3s ease-in-out infinite alternate;
}

@keyframes flame-flicker {
  0% { opacity: 0.85; transform: scaleY(1) scaleX(1); }
  25% { opacity: 1; transform: scaleY(1.1) scaleX(0.95); }
  50% { opacity: 0.9; transform: scaleY(0.95) scaleX(1.05); }
  75% { opacity: 1; transform: scaleY(1.05) scaleX(0.98); }
  100% { opacity: 0.88; transform: scaleY(1) scaleX(1); }
}

@keyframes glow-pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* ── Table ── */
#table {
  position: absolute;
  bottom: 0; left: 5vw;
  width: 90vw;
  z-index: 5;
}

#table-surface {
  width: 100%; height: 22vh;
  background: linear-gradient(
    180deg,
    #5c3d24 0%,
    #4a3018 20%,
    #3d2614 80%,
    #2e1c0e 100%
  );
  border-radius: 0.5vmin 0.5vmin 0 0;
  position: relative;
  box-shadow:
    inset 0 0.5vh 2vh rgba(255,200,120,0.08),
    inset 0 -1vh 2vh rgba(0,0,0,0.3);
  overflow: visible;
}

#table-cloth {
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 40vw; height: 100%;
  background: linear-gradient(
    180deg,
    rgba(240,235,220,0.08) 0%,
    rgba(240,235,220,0.04) 100%
  );
  border-left: 1px solid rgba(240,235,220,0.06);
  border-right: 1px solid rgba(240,235,220,0.06);
}

#table-edge {
  width: 100%; height: 2vh;
  background: linear-gradient(180deg, #2e1c0e, #1a0f08);
  box-shadow: 0 0.5vh 2vh rgba(0,0,0,0.5);
}

/* ── Absinthe setup ── */
#absinthe-setup {
  position: absolute;
  bottom: 3vh; left: 50%;
  transform: translateX(-50%);
  width: 25vw; height: 18vh;
}

#absinthe-glass {
  position: absolute;
  bottom: 0; left: 35%;
  width: 4vmin; height: 9vmin;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.08) 0%,
    rgba(255,255,255,0.04) 100%
  );
  border: 0.15vmin solid rgba(255,255,255,0.15);
  border-radius: 0.3vmin 0.3vmin 1vmin 1vmin;
  overflow: hidden;
}

#absinthe-liquid {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 55%;
  background: linear-gradient(
    180deg,
    rgba(120,180,80,0.5) 0%,
    rgba(85,140,55,0.6) 100%
  );
  animation: liquid-sway 6s ease-in-out infinite;
}

@keyframes liquid-sway {
  0%, 100% { transform: skewX(0deg); }
  25% { transform: skewX(2deg); }
  75% { transform: skewX(-2deg); }
}

#glass-rim {
  position: absolute;
  top: 0; left: -5%; width: 110%;
  height: 0.4vmin;
  background: rgba(255,255,255,0.2);
  border-radius: 0.2vmin;
}

#absinthe-spoon {
  position: absolute;
  bottom: 8vmin; left: 33%;
  width: 7vmin; height: 0.5vmin;
  background: linear-gradient(90deg, #b0a090, #d0c0a8, #b0a090);
  border-radius: 0.2vmin;
  transform: rotate(-5deg);
}

#sugar-cube {
  position: absolute;
  top: -1.2vmin; left: 2vmin;
  width: 1.5vmin; height: 1.2vmin;
  background: linear-gradient(135deg, #f0ece0, #ddd8c8);
  border-radius: 0.15vmin;
  box-shadow: 0 0.1vmin 0.3vmin rgba(0,0,0,0.2);
}

#absinthe-bottle {
  position: absolute;
  bottom: 0; left: 60%;
  width: 3.5vmin; height: 12vmin;
  background: linear-gradient(
    90deg,
    rgba(40,80,30,0.85) 0%,
    rgba(50,100,40,0.9) 40%,
    rgba(40,80,30,0.85) 100%
  );
  border-radius: 0.5vmin 0.5vmin 0.3vmin 0.3vmin;
  box-shadow: 0 0.2vmin 1vmin rgba(0,0,0,0.3);
}

#bottle-label {
  position: absolute;
  top: 40%; left: 10%;
  width: 80%; height: 25%;
  background: rgba(240,230,200,0.2);
  border-radius: 0.2vmin;
}

#water-carafe {
  position: absolute;
  bottom: 0; left: 12%;
  width: 4vmin; height: 10vmin;
  background: linear-gradient(
    90deg,
    rgba(200,220,240,0.1) 0%,
    rgba(200,220,240,0.15) 50%,
    rgba(200,220,240,0.1) 100%
  );
  border: 0.15vmin solid rgba(255,255,255,0.1);
  border-radius: 1vmin 1vmin 0.5vmin 0.5vmin;
  overflow: hidden;
}

#carafe-water {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 60%;
  background: linear-gradient(
    180deg,
    rgba(180,210,240,0.15) 0%,
    rgba(160,200,235,0.2) 100%
  );
}

/* ── Napkin & bread ── */
#napkin {
  position: absolute;
  bottom: 2vh; left: 15%;
  width: 5vmin; height: 5vmin;
  background: rgba(240,235,225,0.08);
  border: 0.1vmin solid rgba(240,235,225,0.06);
  transform: rotate(45deg);
}

#bread-plate {
  position: absolute;
  bottom: 2vh; right: 18%;
  width: 6vmin; height: 2.5vmin;
  background: rgba(220,210,190,0.1);
  border: 0.1vmin solid rgba(220,210,190,0.08);
  border-radius: 50%;
}

#bread-roll {
  position: absolute;
  top: -0.8vmin; left: 50%;
  transform: translateX(-50%);
  width: 2.5vmin; height: 1.8vmin;
  background: radial-gradient(ellipse, #a08050, #7a6040);
  border-radius: 50% 50% 40% 40%;
}

/* ── Floor ── */
#floor {
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2vh;
  background: #1a0f08;
  z-index: 4;
}

/* ── Walls (sides of window) ── */
#interior::before, #interior::after {
  content: '';
  position: absolute;
  top: 0; width: 10vw; height: 100%;
  z-index: 3;
}

#interior::before {
  left: 0;
  background: linear-gradient(90deg, #2a1c10 60%, rgba(42,28,16,0.0));
}

#interior::after {
  right: 0;
  background: linear-gradient(-90deg, #2a1c10 60%, rgba(42,28,16,0.0));
}

/* ── Vignette ── */
#vignette {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(
    ellipse 70% 60% at 50% 45%,
    transparent 30%,
    rgba(10,8,4,0.5) 100%
  );
  z-index: 20;
  pointer-events: none;
}

/* ── Sway indicator (pendulum) ── */
#sway-indicator {
  position: absolute;
  top: 8.5vh; right: 4vw;
  z-index: 25;
  opacity: 0.3;
}

#pendulum-line {
  width: 0.1vmin; height: 4vh;
  background: rgba(200,180,140,0.4);
  margin: 0 auto;
  transform-origin: top center;
}

#pendulum-bob {
  width: 0.8vmin; height: 0.8vmin;
  background: radial-gradient(circle, #c8b48c, #a09070);
  border-radius: 50%;
  margin: 0 auto;
}

/* ── Title overlay ── */
#title-overlay {
  position: absolute;
  bottom: 3vh; left: 3vw;
  z-index: 30;
  color: rgba(220,200,170,0.6);
  text-shadow: 0 0.1vmin 0.5vmin rgba(0,0,0,0.5);
}

#title-text {
  font-size: clamp(1.4rem, 3vw, 2.8rem);
  font-weight: normal;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 0.5vh;
}

#subtitle-text {
  font-size: clamp(0.7rem, 1.2vw, 1.1rem);
  letter-spacing: 0.5em;
  opacity: 0.6;
  margin-bottom: 0.3vh;
}

#altitude-text {
  font-size: clamp(0.6rem, 1vw, 0.9rem);
  letter-spacing: 0.2em;
  opacity: 0.4;
  font-variant-numeric: tabular-nums;
}

/* ── Gentle sway animation for whole scene ── */
#scene {
  animation: zeppelin-sway 14s ease-in-out infinite;
  transform-origin: 50% 0%;
}

@keyframes zeppelin-sway {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  25% { transform: rotate(0.15deg) translateX(0.2vw); }
  50% { transform: rotate(-0.1deg) translateX(-0.15vw); }
  75% { transform: rotate(0.12deg) translateX(0.1vw); }
}

/* ── Particle dust motes (added via JS) ── */
.dust-mote {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,220,160,0.3);
  pointer-events: none;
  z-index: 15;
  animation: mote-float linear infinite;
}

@keyframes mote-float {
  0% { transform: translateY(0) translateX(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-30vh) translateX(5vw); opacity: 0; }
}

/* ── Chemical overlay canvas ── */
#chem-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 18;
  pointer-events: none;
}

/* ── DuPont investor panel ── */
#dupont-panel {
  position: absolute;
  bottom: 3vh;
  right: 3vw;
  z-index: 30;
  background: rgba(5, 10, 5, 0.72);
  border: 1px solid rgba(57, 255, 20, 0.12);
  border-radius: 0.3rem;
  padding: 0.8rem 1rem;
  font-family: 'Courier New', monospace;
  color: rgba(57, 255, 20, 0.8);
  backdrop-filter: blur(4px);
  min-width: 10rem;
}

.dp-header {
  font-size: clamp(0.45rem, 0.8vw, 0.7rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.45;
  margin-bottom: 0.2rem;
  color: rgba(200, 200, 200, 0.45);
}

.dp-return {
  font-size: clamp(1.1rem, 2.2vw, 1.8rem);
  font-weight: bold;
  color: rgba(57, 255, 20, 0.9);
  text-shadow: 0 0 8px rgba(57, 255, 20, 0.25);
  line-height: 1.1;
}

.dp-pct {
  font-size: 0.45em;
  opacity: 0.55;
  margin-left: 0.2em;
}

.dp-chart {
  height: 2.5rem;
  margin: 0.3rem 0;
  border-bottom: 1px solid rgba(57, 255, 20, 0.08);
}

.dp-chart canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.dp-stats {
  display: flex;
  justify-content: space-between;
  font-size: clamp(0.5rem, 0.75vw, 0.7rem);
  margin: 0.25rem 0;
  opacity: 0.6;
}

.dp-tagline {
  font-size: clamp(0.4rem, 0.6vw, 0.55rem);
  opacity: 0.25;
  font-style: italic;
  margin-top: 0.3rem;
  color: rgba(200, 200, 200, 0.4);
}

.dp-hugs {
  font-size: clamp(0.35rem, 0.55vw, 0.5rem);
  opacity: 0.18;
  text-align: right;
  margin-top: 0.15rem;
  color: rgba(255, 180, 200, 0.5);
}
