@font-face {
  font-family: Vazirmatn;
  src: local("Vazirmatn"), local("Vazir");
  font-display: swap;
}

:root {
  --ink: #f3f0e8;
  --muted: #aaa99f;
  --gold: #c6a86b;
  --green: #162d28;
  --surface: rgba(14, 25, 23, .82);
  --line: rgba(255, 255, 255, .12);
  --radius: 5px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #0c1513;
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.ambient { position: fixed; inset: 0; z-index: -2; overflow: hidden; }
.ambient-image {
  position: absolute;
  inset: -50px;
  background-position: center;
  background-size: cover;
  filter: blur(35px) saturate(.45);
  opacity: .22;
  transform: scale(1.08);
  transition: background-image .7s ease;
}
.ambient-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(182, 139, 67, .13), transparent 27rem),
    linear-gradient(180deg, rgba(8, 17, 15, .5), #0c1513 80%);
}

.site-header {
  width: min(1380px, calc(100% - 72px));
  margin: auto;
  min-height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 46px; height: 46px; display: grid; place-items: center;
  color: var(--gold); border: 1px solid rgba(198,168,107,.55); border-radius: 50%;
  font-family: Georgia, serif; font-size: 24px;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.2px; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.header-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 11px; }
.header-meta .eyebrow { color: var(--gold); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: #6d716a; }

main { width: min(1380px, calc(100% - 72px)); margin: auto; }
.intro { max-width: 700px; margin: 68px 0 40px; }
.kicker { display: flex; align-items: center; gap: 10px; color: var(--gold); font-size: 12px; margin: 0 0 12px; }
.kicker span { display: inline-block; width: 28px; height: 1px; background: var(--gold); }
h1 { margin: 0; font-size: clamp(45px, 7vw, 84px); line-height: 1.15; letter-spacing: -4px; font-weight: 400; }
h1 b { color: var(--gold); font-weight: 300; }
.description { max-width: 610px; margin: 20px 0 0; color: #b8b9b1; font-size: 15px; line-height: 2; }

.gallery { direction: ltr; }
.stage {
  position: relative;
  height: min(69vw, 740px);
  min-height: 480px;
  overflow: hidden;
  background: #070b0a;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 35px 90px rgba(0,0,0,.38);
  isolation: isolate;
  touch-action: pan-y;
}
.image-wrap { position: absolute; inset: 0; display: grid; place-items: center; }
.image-wrap::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 100px rgba(0,0,0,.15); pointer-events: none; }
#mainImage {
  width: 100%; height: 100%; object-fit: contain; user-select: none;
  opacity: 1; transform: scale(1); transition: opacity .22s ease, transform .55s cubic-bezier(.2,.7,.2,1);
}
#mainImage.changing { opacity: 0; transform: scale(.985); }
.loader {
  position: absolute; width: 32px; height: 32px; border: 2px solid rgba(255,255,255,.18);
  border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; opacity: 0;
}
.loader.visible { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.nav-button {
  position: absolute; z-index: 3; top: 50%; transform: translateY(-50%);
  width: 54px; height: 76px; display: grid; place-items: center;
  color: #fff; background: rgba(10,16,15,.48); border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(10px); cursor: pointer; transition: .2s ease;
}
.nav-button:hover { background: var(--gold); color: #15231f; border-color: var(--gold); }
.nav-prev { left: 22px; }
.nav-next { right: 22px; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.stage-topbar { position: absolute; z-index: 3; inset: 22px 22px auto; display: flex; justify-content: space-between; align-items: center; }
.photo-badge { direction: rtl; padding: 7px 11px; color: #dddcd4; background: rgba(8,13,12,.56); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.13); font-size: 10px; }
.icon-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: #fff; background: rgba(8,13,12,.56); border: 1px solid rgba(255,255,255,.15); cursor: pointer; }
.icon-button:hover { color: var(--gold); border-color: var(--gold); }
.stage-footer { position: absolute; z-index: 3; inset: auto 28px 25px; display: flex; justify-content: space-between; align-items: flex-end; }
.counter { display: flex; align-items: baseline; gap: 10px; direction: ltr; text-shadow: 0 2px 18px #000; }
.counter strong { font-family: Georgia, serif; font-size: 35px; font-weight: 400; }
.counter span { width: 30px; height: 1px; background: rgba(255,255,255,.6); }
.counter small { color: #bbb; font-family: Georgia, serif; }
.download { direction: rtl; display: flex; align-items: center; gap: 8px; padding: 10px 14px; color: #eee; text-decoration: none; font-size: 11px; background: rgba(8,13,12,.56); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.15); }
.download:hover { color: #14231f; background: var(--gold); border-color: var(--gold); }
.download svg { width: 17px; }

.gallery-controls { direction: rtl; padding: 22px 0 12px; }
.progress-track { width: 100%; height: 1px; background: var(--line); }
.progress-track span { display: block; height: 2px; background: var(--gold); transform-origin: right; transition: width .45s ease; }
.control-row { min-height: 78px; display: flex; align-items: center; gap: 15px; }
.play-button, .mini-nav button { display: grid; place-items: center; color: var(--ink); background: transparent; border: 1px solid var(--line); cursor: pointer; }
.play-button { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; }
.play-button:hover, .mini-nav button:hover { border-color: var(--gold); color: var(--gold); }
.play-button svg { width: 17px; }
.pause-icon { display: none; }
.play-button.playing .play-icon { display: none; }
.play-button.playing .pause-icon { display: block; }
.control-row p { margin: 0; flex: 1; }
.control-row p strong, .control-row p small { display: block; }
.control-row p strong { font-size: 12px; font-weight: 500; }
.control-row p small { color: var(--muted); font-size: 10px; margin-top: 5px; }
.mini-nav { display: flex; direction: ltr; }
.mini-nav button { width: 42px; height: 38px; }
.mini-nav button + button { border-left: 0; }
.mini-nav svg { width: 17px; }

.filmstrip-heading { direction: rtl; margin: 34px 0 17px; display: flex; justify-content: space-between; align-items: end; }
.filmstrip-heading h2 { margin: 0; font-size: 18px; font-weight: 500; }
.filmstrip-heading span { color: var(--muted); font-size: 10px; }
.filmstrip { display: flex; gap: 10px; padding: 0 0 18px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-color: var(--gold) rgba(255,255,255,.06); scrollbar-width: thin; }
.thumb {
  position: relative; flex: 0 0 128px; height: 88px; padding: 0; overflow: hidden; scroll-snap-align: center;
  background: #090d0c; border: 1px solid transparent; opacity: .52; cursor: pointer; transition: opacity .2s, border-color .2s, transform .2s;
}
.thumb:hover { opacity: .9; transform: translateY(-2px); }
.thumb.active { opacity: 1; border-color: var(--gold); }
.thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.thumb span { position: absolute; left: 5px; bottom: 4px; min-width: 20px; padding: 2px 4px; color: #fff; background: rgba(0,0,0,.62); font: 9px Georgia, serif; }

footer {
  width: min(1380px, calc(100% - 72px)); margin: 70px auto 0; padding: 26px 0 40px;
  display: flex; align-items: center; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px;
}
footer span { color: var(--gold); }
footer p { margin: 0; flex: 1; }
footer a { color: #c9cac4; text-underline-offset: 4px; }

.stage:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; background: #050706; }

@media (max-width: 700px) {
  .site-header, main, footer { width: min(100% - 30px, 1380px); }
  .site-header { min-height: 78px; }
  .header-meta { display: none; }
  .intro { margin: 45px 0 27px; }
  h1 { font-size: 49px; letter-spacing: -3px; }
  .description { font-size: 13px; }
  .stage { height: 66vh; min-height: 440px; }
  .nav-button { top: auto; bottom: 20px; width: 45px; height: 45px; }
  .nav-prev { left: 18px; }
  .nav-next { right: 18px; }
  .stage-footer { inset: auto 75px 25px; justify-content: center; }
  .download { display: none; }
  .counter strong { font-size: 27px; }
  .counter span { width: 18px; }
  .thumb { flex-basis: 105px; height: 74px; }
  .filmstrip-heading span, .control-row p small { display: none; }
  footer { margin-top: 45px; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
