html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: 20px;
}

*,
*:before,
*:after {
  box-sizing: border-box;
  position: relative;
}

body {
  background: #000;
  color: #fff;
  height: auto;
  min-height: 100%;
  overflow: hidden;
  font-family: Inter, sans-serif;
}

/* ==========================================
   VIGNETTE
========================================== */

.vignette {
  position: fixed;
  inset: 0;
  background: linear-gradient(to bottom, #000, transparent 20%, transparent 80%, #000);
  pointer-events: none;
  z-index: 200;
}

/* ==========================================
   CONTROLS
========================================== */

.controls {
  position: fixed;
  bottom: 3.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(17,17,17,0.85);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: .6rem 1.2rem;
  border-radius: 999px;
}

.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: .8;
  transition: opacity .2s;
}
.ctrl-btn:hover { opacity: 1; }

.speed-wrap { display: flex; align-items: center; gap: .6rem; }

.speed-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.4);
}

.speed-val {
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  min-width: 28px;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 110px;
  height: 2px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  position: relative;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #c8a46b;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #c8a46b;
  border: none;
  cursor: pointer;
}

/* ==========================================
   CONTACT BAR
========================================== */

.contact-bar {
  position: fixed;
  left: 50%;
  bottom: 0.8rem;
  transform: translateX(-50%);
  z-index: 290;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 12px;
  letter-spacing: 1px;
}
.contact-bar a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: color .25s ease;
}
.contact-bar a:hover { color: #c8a46b; }
.divider { color: rgba(255,255,255,.25); }

/* ==========================================
   TYPOGRAPHY
========================================== */

p { line-height: 1.8; margin: 1rem 0; color: rgb(158, 166, 184); }
h1 { line-height: 1.3; font-size: 5vw; margin: 1rem 0; }
h2 { font-size: 4vw; margin: 1rem 0; }
h3 { font-size: 2vw; font-weight: bold; }
h2.subheader { font-size: 2vw; color: #c8a46b; }
em { font-style: italic; color: #c8a46b; }
img { max-width: 100%; display: block; }

/* ==========================================
   LAYOUT
========================================== */

header {
  min-height: 80vh;
  display: grid;
  align-content: center;
  grid-column: 1 / -1;
}

section { grid-column: auto; }

.callout {
  text-align: center;
  background-color: #c8a46b;
  padding: 1vw 3vw;
}
.callout > p { color: #111; }
.callout h3  { color: #111; }

/* ==========================================
   SCENE — فقط opacity انیمیشن، بدون preserve-3d
   این جداسازی باگ کروم رو حل میکنه:
   کروم وقتی opacity < 1 باشه، preserve-3d رو
   کنسل میکنه. پس opacity رو روی یه لایه
   جداگانه میذاریم که preserve-3d نداره.
========================================== */

.scene {
  animation: fade-scene var(--anim-duration, 11s)
    cubic-bezier(0.6, 0, 0.4, 1) both infinite;
}

/* ==========================================
   CONTAINER — فقط perspective + camera، بدون opacity
========================================== */

.container {
  perspective: 1200px;
  transform-style: preserve-3d;
  animation: cinematic-camera var(--anim-duration, 11s)
    cubic-bezier(0.6, 0, 0.4, 1) both infinite;
}

/* ==========================================
   MAIN
========================================== */

main {
  background: #111;
  border: solid 1px #222;
  padding: 2rem;
  max-width: 100%;
  width: 960px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 2rem;

  transform-origin: top center;
  transform-style: preserve-3d;

  animation: inherit;
  animation-name: cinematic;
}

main > * { grid-column: 1 / -1; }
section  { grid-column: auto; }

/* ==========================================
   IMAGES
========================================== */

main > img {
  display: block;
  transform-style: preserve-3d;
  animation: inherit;
  animation-name: image-pop;
}

main > img:last-of-type {
  animation-delay: 4s;
}

/* ==========================================
   KEYFRAMES
========================================== */

/* opacity روی scene — کروم رو دور میزنیم */
@keyframes fade-scene {
  from { opacity: 0; }
  25%  { opacity: 1; }
  75%  { opacity: 1; }
  to   { opacity: 0; }
}

/* camera pan — بدون opacity */
@keyframes cinematic-camera {
  from { perspective-origin: 60% 40%; }
  to   { perspective-origin: 40% 60%; }
}

/* حرکت اصلی صفحه */
@keyframes cinematic {
  from {
    transform: translateZ(-200px) rotateY(30deg) translateY(50vh);
  }
  to {
    transform: translateZ(-100px) rotateY(-30deg)
               translateY(-100%) translateY(50vh);
  }
}

/* عکس‌ها جلو میان */
@keyframes image-pop {
  70%, 100% {
    transform: translate3d(0, 0, 60px);
  }
}

/* ==========================================
   MOBILE
========================================== */

@media (max-width: 768px) {
  h1 { font-size: 10vw; }
  h2 { font-size: 8vw; }
  h3 { font-size: 5vw; }
  h2.subheader { font-size: 5vw; }
  main { padding: 1.5rem; grid-template-columns: 1fr; }
  section { grid-column: 1 / -1; }
  .controls { bottom: 3rem; }
}
