/* Design Tokens */
:root {
  --c-bg-900: #0a0f1a;
  --c-bg-800: #0f1626;
  --c-bg-700: #131c2e;
  --c-accent-500: #ff7a00;
  --c-accent-400: #ff9533;
  --c-accent-300: #ffb066;
  --c-gold-500: #ffc46b;
  --c-gold-300: #ffe3b0;
  --c-text-100: #ffffff;
  --c-text-200: #ffe3b0;
  --c-text-300: #cbb894;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-full: 999px;
  --dur-fast: 150ms;
  --dur-base: 260ms;
  --dur-slow: 420ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --header-h: 84px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background: var(--c-bg-900);
  color: var(--c-text-100);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--c-accent-300); outline-offset: 4px; border-radius: var(--r-sm); }

.stage { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; isolation: isolate; }
.ambient { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.ambient__orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; will-change: transform; }
.ambient__orb--a { width: 45vmax; height: 45vmax; background: radial-gradient(circle, var(--c-accent-500), transparent 70%); top: -12vmax; right: -10vmax; animation: drift-a 22s ease-in-out infinite alternate; }
.ambient__orb--b { width: 38vmax; height: 38vmax; background: radial-gradient(circle, #1e3a8a, transparent 70%); bottom: -10vmax; left: -8vmax; animation: drift-b 26s ease-in-out infinite alternate; }
@keyframes drift-a { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-4vmax,6vmax,0) scale(1.15); } }
@keyframes drift-b { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(5vmax,-5vmax,0) scale(1.1); } }

.topbar {
  position: relative; z-index: 10; flex: 0 0 var(--header-h); width: 100%; height: var(--header-h);
  padding: 0 clamp(var(--s-4),4vw,var(--s-8)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: linear-gradient(180deg,rgba(10,15,26,.85),rgba(10,15,26,.55));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid rgba(255,122,0,.18);
  animation: fade-down var(--dur-slow) var(--ease-out) both;
}
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg,transparent,rgba(255,122,0,.6),transparent); }
.topbar__side { font-weight: 700; font-size: clamp(12px,1.1vw + 9px,16px); letter-spacing: 1px; white-space: nowrap; color: var(--c-text-200); text-shadow: 0 0 6px rgba(255,180,60,.9),0 0 16px rgba(255,140,0,.6); }
.topbar__side--left { grid-column: 1; justify-self: start; text-align: left; animation: fade-right var(--dur-slow) var(--ease-out) 120ms both; }
.topbar__side--right { grid-column: 3; justify-self: end; text-align: right; animation: fade-left var(--dur-slow) var(--ease-out) 120ms both; }

.brand { grid-column: 2; justify-self: center; position: relative; display: inline-flex; align-items: center; justify-content: center; width: clamp(52px,5vw,64px); height: clamp(52px,5vw,64px); text-decoration: none; border-radius: var(--r-full); animation: pop-in var(--dur-slow) var(--ease-out) 60ms both; }
.brand__img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-full); position: relative; z-index: 2; border: 2px solid var(--c-accent-500); box-shadow: 0 0 14px rgba(255,122,0,.7),inset 0 0 10px rgba(255,122,0,.25); transition: transform var(--dur-base) var(--ease-out),box-shadow var(--dur-base) var(--ease-out); }
.brand__ring { position: absolute; inset: -6px; border-radius: var(--r-full); border: 1px solid rgba(255,196,107,.5); z-index: 1; animation: ring-pulse 3.6s ease-in-out infinite; pointer-events: none; }
.brand:hover .brand__img { transform: scale(1.06); box-shadow: 0 0 22px rgba(255,122,0,1),inset 0 0 12px rgba(255,122,0,.4); }
@keyframes ring-pulse { 0%,100% { transform: scale(1); opacity: .55; box-shadow: 0 0 0 rgba(255,196,107,0); } 50% { transform: scale(1.08); opacity: .15; box-shadow: 0 0 18px rgba(255,196,107,.6); } }

.hero { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; width: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero__media { position: absolute; inset: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; will-change: auto; transform: none !important; animation: none; }
.hero__media picture { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.hero__img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center; user-select: none; -webkit-user-drag: none; }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(120% 80% at 50% 55%,transparent 55%,rgba(10,15,26,.55) 100%); z-index: 2; }

.dock { position: absolute; left: 50%; bottom: clamp(var(--s-4),3vh,var(--s-8)); transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: clamp(var(--s-3),2vw,var(--s-5)); padding: var(--s-3) var(--s-4); border-radius: var(--r-full); background: linear-gradient(180deg,rgba(19,28,46,.7),rgba(10,15,26,.85)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,122,0,.28); box-shadow: 0 10px 40px rgba(0,0,0,.55),0 0 0 1px rgba(255,196,107,.08) inset; animation: dock-in var(--dur-slow) var(--ease-out) 260ms both; }
.dock__item { position: relative; display: inline-flex; align-items: center; justify-content: center; width: clamp(52px,5vw,68px); height: clamp(52px,5vw,68px); border-radius: var(--r-md); background: rgba(19,28,46,.6); border: 1px solid rgba(255,122,0,.3); text-decoration: none; overflow: hidden; transition: transform var(--dur-base) var(--ease-out),border-color var(--dur-base) var(--ease-out),box-shadow var(--dur-base) var(--ease-out); }
.dock__item img { width: 72%; height: 72%; object-fit: contain; position: relative; z-index: 2; transition: transform var(--dur-base) var(--ease-out); }
.dock__glow { position: absolute; inset: -40%; background: radial-gradient(circle at 50% 60%,rgba(255,122,0,.55),transparent 60%); opacity: 0; transition: opacity var(--dur-base) var(--ease-out); pointer-events: none; }
.dock__item:hover { transform: translateY(-6px); border-color: var(--c-accent-400); box-shadow: 0 10px 28px rgba(0,0,0,.5),0 0 22px rgba(255,122,0,.55); }
.dock__item:hover .dock__glow { opacity: 1; }
.dock__item:hover img { transform: scale(1.08); }
.dock__item:active { transform: translateY(-2px) scale(.98); }

@keyframes fade-down { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-left { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fade-right { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.7); } 70% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }
@keyframes dock-in { from { opacity: 0; transform: translate(-50%,24px); } to { opacity: 1; transform: translate(-50%,0); } }

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero__media { transform: none !important; animation: none !important; }
}

@media (max-width: 768px) {
  :root { --header-h: 72px; }
  .topbar { padding: 0 var(--s-4); }
  .dock { padding: var(--s-2) var(--s-3); gap: var(--s-3); }
}

@media (max-width: 480px) {
  :root { --header-h: 64px; }
  .topbar__side { font-size: 11px; letter-spacing: .4px; }
  .brand { width: 46px; height: 46px; }
  .dock__item { width: 54px; height: 54px; }
}

@media (max-height: 480px) {
  :root { --header-h: 56px; }
  .dock { bottom: var(--s-2); padding: var(--s-1) var(--s-3); }
  .dock__item { width: 44px; height: 44px; }
}

/* =========================================================
   Desktop Dock
   ========================================================= */
@media (min-width: 769px) {
  .dock {
    left: auto;
    right: 28px;
    bottom: clamp(var(--s-4), 3vh, var(--s-8));
    transform: none;
    flex-direction: column;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-2);
    border-radius: var(--r-md);
  }

  .dock__item {
    width: clamp(52px, 4.2vw, 64px);
    height: clamp(52px, 4.2vw, 64px);
  }

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

  .dock__item:active {
    transform: translateX(-2px) scale(0.98);
  }
}
