/* ============================================================
   TOKENS
   ============================================================ */
:root{
  --void:      #120F0C;
  --ink:       #1B1613;
  --ink-2:     #241D18;
  --gold:      #C89A3C;
  --gold-bright:#E8C264;
  --maroon:    #6E1E26;
  --maroon-bright:#8F2A34;
  --sand:      #EFE6D3;
  --muted:     #9C8F7A;
  --line:      rgba(200,154,60,0.22);

  --display: 'Vazirmatn', sans-serif;
  --body:    'Vazirmatn', sans-serif;
  --script:  'Noto Naskh Arabic', serif;

  --container: 560px;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }

body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 50% -10%, #241a10 0%, transparent 60%),
    var(--void);
  color:var(--sand);
  font-family:var(--body);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

img{ max-width:100%; display:block; }

a{ color:inherit; text-decoration:none; }

button{ font-family:inherit; }

::selection{ background:var(--gold); color:var(--void); }

/* Ambient dust canvas */
#dust{
  position:fixed; inset:0;
  width:100%; height:100%;
  z-index:0;
  pointer-events:none;
  opacity:.55;
}

/* Focus visibility */
a:focus-visible, button:focus-visible{
  outline:2px solid var(--gold-bright);
  outline-offset:3px;
  border-radius:6px;
}

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

/* ============================================================
   HEADER
   ============================================================ */
.head{
  position:relative;
  z-index:1;
  max-width:var(--container);
  margin:0 auto;
  padding-bottom:38px;
  text-align:center;
}

.head__banner-wrap{
  position:relative;
  height:min(46vh, 360px);
  min-height:260px;
  border-radius:0 0 46% 46% / 0 0 60px 60px;
  overflow:hidden;
  box-shadow:0 18px 50px rgba(0,0,0,.55);
}

.head__banner{
  width:100%; height:100%;
  object-fit:cover;
  object-position:50% 35%;
  transform:scale(1.02);
}

.head__banner-fade{
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(18,15,12,0) 45%, var(--void) 96%);
}

.head__avatar-wrap{
  position:relative;
  width:132px; height:132px;
  margin:-66px auto 0;
}

.head__avatar{
  width:100%; height:100%;
  border-radius:50%;
  overflow:hidden;
  border:4px solid var(--void);
  box-shadow:0 0 0 2px var(--gold), 0 10px 30px rgba(0,0,0,.6);
}

.head__avatar img{
  width:100%; height:100%;
  object-fit:cover;
  object-position:50% 30%;
}

.head__avatar-ring{
  position:absolute; inset:-8px;
  border-radius:50%;
  border:1px solid var(--line);
  animation:spin 22s linear infinite;
}
@keyframes spin{ to{ transform:rotate(360deg); } }

.head__eyebrow{
  font-family:var(--script);
  font-weight:700;
  color:var(--gold-bright);
  font-size:1.05rem;
  letter-spacing:.02em;
  margin:22px 0 6px;
  opacity:.95;
}

.head__title{
  font-family:var(--display);
  font-weight:900;
  font-size:clamp(1.7rem, 6vw, 2.3rem);
  margin:0 0 8px;
  color:var(--sand);
  letter-spacing:-.01em;
}

.head__subtitle{
  font-size:.98rem;
  color:var(--muted);
  margin:0 20px;
  font-weight:500;
}

.head__divider{
  display:flex; align-items:center; justify-content:center;
  gap:10px;
  margin-top:28px;
}
.head__divider span{
  width:44px; height:1px;
  background:linear-gradient(90deg, transparent, var(--gold), transparent);
}
.head__divider i{
  width:6px; height:6px;
  border-radius:50%;
  background:var(--gold);
  transform:rotate(45deg);
  flex:none;
}

/* ============================================================
   SECTION LABEL
   ============================================================ */
.section-label{
  display:flex; align-items:center; gap:10px;
  max-width:var(--container);
  margin:0 auto 18px;
  padding:0 22px;
  font-family:var(--display);
  font-weight:700;
  font-size:1.05rem;
  color:var(--sand);
}
.section-label i{
  font-style:normal;
  font-family:var(--body);
  font-weight:800;
  font-size:.72rem;
  color:var(--void);
  background:var(--gold);
  padding:3px 7px;
  border-radius:6px;
  letter-spacing:.03em;
}

/* ============================================================
   GALLERY — the signature 3D flag carousel
   ============================================================ */
.gallery{
  position:relative;
  z-index:1;
  padding:52px 0 10px;
}

.gallery__viewport{
  perspective:1400px;
  overflow-x:auto;
  overflow-y:hidden;
  scroll-snap-type:x mandatory;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  padding:20px 0 30px;
}
.gallery__viewport::-webkit-scrollbar{ display:none; }

.gallery__track{
  display:flex;
  gap:18px;
  padding:0 calc(50vw - 118px);
  width:max-content;
}

.card{
  position:relative;
  flex:none;
  width:236px;
  height:314px;
  margin:0;
  border-radius:18px;
  overflow:hidden;
  scroll-snap-align:center;
  box-shadow:0 20px 40px rgba(0,0,0,.5);
  transform-style:preserve-3d;
  transition:transform .5s cubic-bezier(.22,.9,.32,1), filter .5s ease, box-shadow .5s ease;
  will-change:transform;
  border:1px solid var(--line);
  background:var(--ink);
}

.card img{
  width:100%; height:100%;
  object-fit:cover;
}

.card::after{
  content:'';
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(18,15,12,0) 55%, rgba(18,15,12,.92) 100%);
}

.card figcaption{
  position:absolute;
  bottom:14px; right:16px; left:16px;
  z-index:2;
  font-size:.86rem;
  font-weight:600;
  color:var(--sand);
  text-align:right;
}

/* 3D tilt states applied via JS */
.card.is-center{
  transform:translateZ(0) rotateY(0deg) scale(1);
  filter:brightness(1);
  box-shadow:0 26px 55px rgba(0,0,0,.6), 0 0 0 1px var(--gold);
}
.card.is-left{
  transform:translateZ(-120px) rotateY(28deg) scale(.86);
  filter:brightness(.55);
}
.card.is-right{
  transform:translateZ(-120px) rotateY(-28deg) scale(.86);
  filter:brightness(.55);
}
.card.is-far{
  transform:translateZ(-220px) scale(.74);
  filter:brightness(.35);
}

.gallery__dots{
  display:flex; justify-content:center; gap:7px;
  margin-top:6px;
}
.gallery__dots span{
  width:6px; height:6px;
  border-radius:50%;
  background:var(--line);
  transition:background .3s ease, transform .3s ease;
}
.gallery__dots span.active{
  background:var(--gold);
  transform:scale(1.3);
}

/* ============================================================
   PANELS (social / contact / faq wrapper)
   ============================================================ */
.panel{
  position:relative;
  z-index:1;
  max-width:var(--container);
  margin:0 auto;
  padding:44px 22px 0;
}

/* Social card */
.social-card{
  display:flex; align-items:center; gap:14px;
  background:linear-gradient(160deg, var(--ink-2), var(--ink));
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px 18px;
  transition:transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.social-card:hover{
  transform:translateY(-3px) rotateX(2deg);
  border-color:var(--gold);
  box-shadow:0 16px 34px rgba(0,0,0,.45);
}
.social-card__icon{
  flex:none;
  width:46px; height:46px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 35% 30%, var(--gold-bright), var(--gold) 65%);
  color:var(--void);
  box-shadow:0 6px 16px rgba(200,154,60,.35);
}
.social-card__text{
  display:flex; flex-direction:column; gap:3px;
  flex:1;
}
.social-card__text strong{
  font-size:.98rem;
  font-weight:700;
  color:var(--sand);
}
.social-card__text em{
  font-style:normal;
  font-size:.8rem;
  color:var(--muted);
}
.social-card__arrow{
  font-size:1.4rem;
  color:var(--gold);
  transform:rotate(180deg);
}

/* Contact card */
.contact-card{
  display:flex; align-items:center; gap:14px;
  background:linear-gradient(160deg, var(--ink-2), var(--ink));
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px 18px;
  transition:transform .35s ease, border-color .35s ease, box-shadow .35s ease;
}
.contact-card:hover{
  transform:translateY(-3px) rotateX(2deg);
  border-color:var(--maroon-bright);
  box-shadow:0 16px 34px rgba(0,0,0,.45);
}
.contact-card__icon{
  flex:none;
  width:46px; height:46px;
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:linear-gradient(160deg, var(--maroon-bright), var(--maroon));
  color:var(--sand);
  box-shadow:0 6px 16px rgba(110,30,38,.5);
}
.contact-card__text{
  display:flex; flex-direction:column; gap:3px;
}
.contact-card__text strong{
  font-size:.95rem;
  font-weight:700;
  color:var(--sand);
}
.contact-card__text em{
  font-style:normal;
  font-size:.8rem;
  color:var(--muted);
}
.contact-card__number{
  margin-top:4px;
  font-weight:700;
  color:var(--gold-bright);
  font-size:1rem;
  letter-spacing:.03em;
}

/* ============================================================
   FAQ
   ============================================================ */
.faq{
  border:1px solid var(--line);
  border-radius:16px;
  overflow:hidden;
  background:linear-gradient(160deg, var(--ink-2), var(--ink));
}

.faq__q{
  width:100%;
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  background:none;
  border:none;
  color:var(--sand);
  padding:18px 18px;
  font-size:.98rem;
  font-weight:700;
  text-align:right;
  cursor:pointer;
}

.faq__chevron{
  flex:none;
  font-size:1.3rem;
  color:var(--gold);
  transition:transform .35s ease;
}
.faq__q[aria-expanded="true"] .faq__chevron{
  transform:rotate(180deg);
}

.faq__a{
  max-height:0;
  overflow:hidden;
  transition:max-height .45s ease;
  padding:0 18px;
  color:var(--muted);
  font-size:.92rem;
  line-height:1.9;
  border-top:1px solid transparent;
}
.faq__a.open{
  max-height:520px;
  padding-bottom:20px;
  border-top:1px solid var(--line);
  padding-top:14px;
}
.faq__a b{ color:var(--gold-bright); font-weight:700; }

.faq__steps{
  list-style:none;
  margin:14px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.faq__steps li{
  display:flex; align-items:center; gap:12px;
  background:rgba(200,154,60,.06);
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  font-size:.88rem;
  color:var(--sand);
}
.faq__steps-num{
  flex:none;
  width:26px; height:26px;
  border-radius:50%;
  background:var(--gold);
  color:var(--void);
  font-weight:800;
  font-size:.82rem;
  display:flex; align-items:center; justify-content:center;
}

/* ============================================================
   FOOTER
   ============================================================ */
.foot{
  position:relative; z-index:1;
  max-width:var(--container);
  margin:56px auto 0;
  padding:30px 22px 40px;
  text-align:center;
  border-top:1px solid var(--line);
}
.foot__phrase{
  font-family:var(--script);
  color:var(--gold-bright);
  font-size:1.05rem;
  margin:0 0 10px;
}
.foot__name{
  font-size:.78rem;
  color:var(--muted);
  margin:0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width:640px){
  .card{ width:260px; height:340px; }
}
