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

:root {
  --font: 'Inter', sans-serif;
  --font-fa: 'Vazirmatn', sans-serif;
  --white: #ffffff;
  --black: #111111;
  --gray: #666666;
  --light: #f5f5f5;
  --accent: #2c2c2c;
  --transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--black);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body[dir="rtl"] {
  font-family: var(--font-fa);
}

.hidden {
  display: none !important;
}

/* ── Language Switcher ── */
.lang-switcher {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 2rem;
  padding: 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

body[dir="rtl"] .lang-switcher {
  right: auto;
  left: 1.25rem;
}

.lang-btn {
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.75rem;
  border: none;
  border-radius: 2rem;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.3s ease;
}

.lang-btn:hover {
  color: var(--white);
}

.lang-btn.active {
  background: var(--white);
  color: var(--black);
}

.main ~ .lang-switcher,
body.on-main .lang-switcher {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.08);
}

body.on-main .lang-btn {
  color: var(--gray);
}

body.on-main .lang-btn.active {
  background: var(--black);
  color: var(--white);
}

body.on-main .lang-btn:hover:not(.active) {
  color: var(--black);
}

body:not(.on-main) .lang-switcher {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
}

body:not(.on-main) .lang-btn {
  color: rgba(0, 0, 0, 0.5);
}

body:not(.on-main) .lang-btn:hover {
  color: var(--black);
}

body:not(.on-main) .lang-btn.active {
  background: var(--black);
  color: var(--white);
}

/* ── Splash (Page 1) ── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.splash-bg {
  position: absolute;
  inset: 0;
  background: url('../assets/splash-bg.png') center / cover no-repeat;
  transform: scale(1.05);
  transition: transform 8s ease-out;
}

.splash.active .splash-bg {
  transform: scale(1);
}

.splash-overlay {
  position: absolute;
  inset: 0;
  background: transparent;
}

.splash-hint {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(0, 0, 0, 0.45);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: pulse 2.5s ease-in-out infinite;
  transition: opacity 0.5s ease;
  white-space: nowrap;
}

.splash-hint.fade-out {
  opacity: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.splash-content {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 1.5rem;
  text-align: center;
}

.typing-text {
  font-size: clamp(1.8rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.02em;
  line-height: 1.2;
  min-height: 1.2em;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.typing-text.visible {
  opacity: 1;
}

.typing-text .cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--black);
  margin-inline-start: 2px;
  vertical-align: text-bottom;
  animation: blink 0.7s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.countdown {
  font-size: clamp(6rem, 20vw, 14rem);
  font-weight: 700;
  color: var(--black);
  line-height: 1;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.countdown.visible {
  opacity: 1;
  transform: scale(1);
}

.countdown.tick {
  animation: countPop 0.4s ease;
}

@keyframes countPop {
  0% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

.splash.exit {
  animation: splashOut 0.8s ease forwards;
}

@keyframes splashOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* ── Main (Page 2) ── */
.main {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 3rem;
  opacity: 0;
  animation: mainIn 0.8s ease 0.2s forwards;
}

@keyframes mainIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.main-inner {
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.main-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: var(--black);
}

.main-subtitle {
  font-size: 0.9rem;
  color: var(--gray);
  letter-spacing: 0.06em;
  margin-bottom: 3rem;
}

.main-actions {
  margin-bottom: 2.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  padding: 1rem 2rem;
  border: none;
  border-radius: 3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  min-width: 220px;
}

.btn-primary {
  background: var(--black);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: var(--light);
  color: var(--black);
}

.btn-secondary:hover {
  background: #eaeaea;
  transform: translateY(-2px);
}

.upload-btn {
  width: 100%;
  max-width: 320px;
}

.upload-preview {
  position: relative;
  margin-top: 1.5rem;
  display: inline-block;
}

.upload-preview img {
  max-width: 280px;
  max-height: 200px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.remove-preview {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--black);
  color: var(--white);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

body[dir="rtl"] .remove-preview {
  right: auto;
  left: -8px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.replay-link {
  display: block;
  margin-top: 2rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--gray);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s;
}

.replay-link:hover {
  color: var(--black);
}

.btn-whatsapp:hover {
  background: #25d366;
  color: var(--white);
}

/* ── Gallery Page ── */
.gallery-page {
  min-height: 100vh;
  background: var(--white);
  padding: 5rem 1.5rem 3rem;
}

.gallery-header {
  max-width: 900px;
  margin: 0 auto 3rem;
  text-align: center;
}

.gallery-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.gallery-header p {
  color: var(--gray);
  font-size: 0.95rem;
}

.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gray);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: color 0.3s;
}

.gallery-back:hover {
  color: var(--black);
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.5rem 1.25rem;
  border: 1px solid #ddd;
  border-radius: 2rem;
  background: transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.gallery-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-item-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
}

body[dir="rtl"] .lightbox-close {
  right: auto;
  left: 1.5rem;
}

/* ── About Page ── */
.about-page {
  min-height: 100vh;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5rem 1.5rem 3rem;
}

.about-inner {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.about-inner h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.about-subtitle {
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

.about-content {
  text-align: start;
}

body[dir="rtl"] .about-content {
  text-align: right;
}

.about-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--accent);
  margin-bottom: 1.25rem;
}

.about-tagline {
  font-weight: 600;
  font-size: 1.1rem !important;
  color: var(--black) !important;
  text-align: center !important;
  margin-top: 2rem !important;
  letter-spacing: 0.04em;
}

@media (max-width: 480px) {
  .lang-switcher {
    top: 0.75rem;
    right: 0.75rem;
  }

  body[dir="rtl"] .lang-switcher {
    left: 0.75rem;
  }

  .splash-hint {
    font-size: 0.75rem;
    bottom: 2rem;
  }

  .btn {
    min-width: 100%;
  }
}
