/* ==========================================================
   MOKAAB7 — Six Faces + One World
   Dark intro → light world (Knowledge today, a brighter tomorrow)
   The logo is always the original artwork (assets/brand/*), never redrawn.
   ========================================================== */

:root {
  --black: #0D0D0D;
  --white: #F5F3EE;
  --cream: #ECE8E0;
  --gray: #8A8A8A;
  --light-gray: #C9C6BE;
  --gold: #CDAE67;
  --ink: #1A1916;

  --font-fa: "Vazirmatn", system-ui, sans-serif;
  --font-en: "Jost", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-fa);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="en"] body { font-family: var(--font-en); line-height: 1.7; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.en-caps { font-family: var(--font-en); text-transform: uppercase; letter-spacing: .38em; direction: ltr; unicode-bidi: isolate; }
.rule { width: 64px; height: 1px; background: var(--gold); }

/* ---------- Brand images ---------- */
.wordmark-img { height: auto; direction: ltr; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  transition: background .4s, border-color .4s, opacity .6s, transform .6s var(--ease);
  border-bottom: 1px solid transparent;
}
.topbar .container { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar .brand { display: flex; align-items: center; gap: 12px; direction: ltr; }
.topbar .brand .icon { width: 32px; }
.topbar .brand .wordmark-img { width: 118px; }
.topbar .brand .on-light-only { display: none; }
.topbar.on-light .brand .on-dark-only { display: none; }
.topbar.on-light .brand .on-light-only { display: block; }
body.intro-playing .topbar { opacity: 0; transform: translateY(-12px); }
.topbar.solid { background: rgba(13,13,13,.8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-color: rgba(245,243,238,.08); }
.topbar.on-light { background: rgba(245,243,238,.85); color: var(--ink); border-color: rgba(0,0,0,.06); }
.topbar .right { display: flex; align-items: center; gap: 14px; }
.topbar .back { font-size: .88rem; opacity: .75; }
.topbar .back:hover { opacity: 1; }

.lang-toggle {
  border: 1px solid currentColor; border-radius: 999px;
  padding: 4px 14px; font-size: .82rem; letter-spacing: .06em; opacity: .75;
  transition: opacity .2s, color .2s, border-color .2s;
}
.lang-toggle:hover { opacity: 1; color: var(--gold); border-color: var(--gold); }

/* ---------- Logo stage (original pieces, stacked pixel-exact) ---------- */
.logo-stage { position: relative; width: min(340px, 66vw); aspect-ratio: 462 / 515; }
.logo-stage .piece { position: absolute; pointer-events: none; transform-origin: center; transition: filter .35s, opacity .35s, transform .35s var(--ease); }
.logo-stage .hits { position: absolute; inset: 0; width: 100%; height: 100%; }
.logo-stage .hit { fill: transparent; cursor: pointer; outline: none; }
.logo-stage.hovering .piece.bar:not(.lit) { opacity: .35; }
.logo-stage .piece.lit { transform: scale(1.05); filter: brightness(1.12) drop-shadow(0 0 16px var(--glow)); }
.logo-stage .piece.cube.lit { transform: scale(1.03); filter: brightness(1.04) drop-shadow(0 0 26px rgba(245,243,238,.35)); }

/* ---------- Intro (dark) ---------- */
.intro {
  position: relative; min-height: 100svh;
  display: grid; place-items: center; text-align: center;
  padding: 96px var(--gutter) 40px;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(245,243,238,.11), transparent 70%),
    var(--black);
  overflow: hidden;
}
.intro-inner { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.cube-hint { height: 1.8em; font-size: .95rem; color: var(--light-gray); transition: opacity .3s; opacity: 0; }
.cube-hint.show { opacity: 1; }
.intro .wordmark-img { width: min(560px, 82vw); margin-top: 6px; }
.intro .tagline-img { width: min(540px, 80vw); }
.intro .faces-line { font-size: clamp(1.25rem, 3vw, 1.75rem); font-weight: 300; margin-top: 14px; line-height: 1.6; }
.intro .faces-line-alt { font-size: .68rem; color: var(--gray); }
html[lang="en"] .intro .faces-line-alt { font-family: var(--font-fa); letter-spacing: 0; text-transform: none; font-size: .9rem; }
.scroll-cue {
  margin-top: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: .78rem; color: var(--gray);
}
.scroll-cue i { width: 1px; height: 38px; background: linear-gradient(var(--gold), transparent); animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0%,100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(8px); } }

.skip-intro {
  position: absolute; bottom: 22px; inset-inline-end: var(--gutter);
  font-size: .78rem; color: var(--gray); opacity: 0; pointer-events: none; transition: opacity .4s;
}
body.intro-playing .skip-intro { opacity: 1; pointer-events: auto; }
.skip-intro:hover { color: var(--white); }

/* Intro sequence */
html.js .seq { opacity: 0; }
body.intro-playing .piece.cube { animation: cubeIn 1.2s .15s both var(--ease); }
body.intro-playing .piece.bar { animation: barIn .9s both var(--ease); }
body.intro-playing .wipe { animation: wipe 1.5s 1.9s both cubic-bezier(.6,0,.2,1); }
body.intro-playing .fade-up { animation: fadeUp 1s both var(--ease); }
body.intro-done .seq { opacity: 1; }
body.intro-done .float { animation: float 7s ease-in-out infinite; }

@keyframes cubeIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes barIn { from { opacity: 0; transform: translate(var(--dx), var(--dy)); } to { opacity: 1; transform: none; } }
@keyframes wipe { from { opacity: 1; clip-path: inset(0 100% 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- Story (dark) ---------- */
.story { padding-block: clamp(90px, 14vw, 170px); text-align: center; }
.story .lines { font-size: clamp(1.25rem, 3.4vw, 2.1rem); font-weight: 300; line-height: 2; color: var(--light-gray); }
html[lang="en"] .story .lines { font-family: var(--font-display); font-size: clamp(1.5rem, 3.8vw, 2.5rem); line-height: 1.5; }
.story .punch { font-size: clamp(1.6rem, 4.6vw, 3rem); font-weight: 600; margin-top: 8px; line-height: 1.6; }
html[lang="en"] .story .punch { font-family: var(--font-display); line-height: 1.25; }
.story .rule { margin: 40px auto; }
.story .about { max-width: 46ch; margin-inline: auto; color: var(--light-gray); font-size: clamp(1rem, 1.8vw, 1.15rem); }
.story .about strong { color: var(--white); font-weight: 500; }

/* ---------- Dark → light ---------- */
.dawn { height: clamp(160px, 26vw, 320px); background: linear-gradient(180deg, var(--black) 0%, #2a2824 35%, #9d988e 75%, var(--white) 100%); }

/* ---------- Faces (light) ---------- */
.light { background: var(--white); color: var(--ink); }
.faces { padding-block: 40px clamp(80px, 12vw, 140px); }
.section-head { text-align: center; margin-bottom: clamp(40px, 6vw, 72px); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.section-head h2 { font-size: clamp(1.9rem, 5vw, 3.2rem); font-weight: 700; line-height: 1.4; }
html[lang="en"] .section-head h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; }
.section-head .alt { font-size: .7rem; color: #77736b; }
html[lang="en"] .section-head .alt { font-family: var(--font-fa); letter-spacing: 0; text-transform: none; font-size: .9rem; }
.section-head p { max-width: 50ch; color: #55524b; margin-top: 6px; }

.faces-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 980px) { .faces-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .faces-grid { grid-template-columns: 1fr; } }

/* Card styled like the Instagram posts: cream paper, framed photo, the face's color as an accent line */
.face {
  --v: #555; --c: #555;
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--cream); border-radius: 6px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 18px 40px -28px rgba(0,0,0,.35);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
  scroll-margin-top: 110px;
}
.face:hover, .face.flash { transform: translateY(-5px); box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 30px 60px -30px rgba(0,0,0,.5); }
.face .art { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 4px solid var(--c); }
.face .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.face:hover .art img, .face.flash .art img { transform: scale(1.05); }
.face .body { flex: 1; padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 8px; }

.face .tag { display: flex; align-items: center; gap: 10px; color: var(--v); font-size: .9rem; font-weight: 600; }
.face .tag img { height: 24px; width: auto; }
.face .tag .line { flex: 1; max-width: 56px; height: 1px; background: var(--v); opacity: .6; }
.face h3 { font-size: 1.55rem; font-weight: 800; line-height: 1.45; margin-top: 4px; }
html[lang="en"] .face h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.85rem; line-height: 1.1; }
.face .alt { font-size: .6rem; color: #8a867d; letter-spacing: .3em; text-align: start; }
.face p { color: #4d4a44; font-size: .95rem; margin-top: 6px; }
.face .kw { font-size: .82rem; color: var(--v); margin-top: auto; padding-top: 6px; }

/* ---------- One world (light) ---------- */
.world { padding-block: clamp(70px, 10vw, 130px); border-top: 1px solid rgba(0,0,0,.07); }
.world .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 7vw, 96px); align-items: center; }
@media (max-width: 860px) { .world .wrap { grid-template-columns: 1fr; text-align: center; } .world .equation { justify-content: center; } }
.world .logo-full { width: min(300px, 64vw); margin-inline: auto; }
.world .equation { display: flex; align-items: center; gap: 14px; font-size: clamp(1.8rem, 4.6vw, 3rem); font-weight: 800; line-height: 1.3; flex-wrap: wrap; }
html[lang="en"] .world .equation { font-family: var(--font-display); font-weight: 600; }
.world .equation .plus { color: var(--gold); font-weight: 300; }
.world p { color: #4d4a44; font-size: 1.08rem; margin-top: 20px; max-width: 46ch; }
@media (max-width: 860px) { .world p { margin-inline: auto; } }
.world .closing { margin-top: 26px; font-weight: 600; color: var(--ink); }
.world .to-you { display: inline-flex; margin-top: 26px; gap: 8px; align-items: center; font-weight: 500; border-bottom: 1px solid var(--gold); padding-bottom: 2px; }
.world .to-you:hover { color: #8A6A22; }

/* ---------- Follow (dark) ---------- */
.follow { padding-block: clamp(80px, 11vw, 130px) 34px; text-align: center; background: var(--black); color: var(--white); position: relative; }
.follow::before { content: ""; position: absolute; top: 0; inset-inline: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6; }
.follow h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 500; line-height: 1.5; }
html[lang="en"] .follow h2 { font-family: var(--font-display); line-height: 1.15; }
.follow .sub { color: var(--light-gray); margin-top: 10px; }
.follow .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 26px; border-radius: 999px; border: 1px solid rgba(245,243,238,.25);
  font-size: .95rem; transition: border-color .2s, background .2s, transform .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--gold); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--black); font-weight: 500; }
.btn-gold:hover { background: #dcc084; }
.btn svg { width: 18px; height: 18px; }
.btn .handle { direction: ltr; unicode-bidi: isolate; opacity: .7; font-size: .85rem; }
.follow .foot { margin-top: clamp(70px, 9vw, 110px); padding-top: 22px; border-top: 1px solid rgba(245,243,238,.08); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; color: var(--gray); font-size: .82rem; }
.follow .foot .wordmark-img { width: 110px; }

/* ---------- "You" page ---------- */
.you-hero { min-height: 100svh; display: grid; place-items: center; padding: 110px var(--gutter) 60px; text-align: center;
  background: radial-gradient(55% 45% at 50% 30%, rgba(245,243,238,.10), transparent 70%), var(--black); }
.you-hero .inner { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 720px; }
.you-hero .cube-only { width: min(210px, 48vw); }
.you-hero .eyebrow { color: var(--gold); font-size: .95rem; letter-spacing: .08em; margin-top: 12px; }
html[lang="en"] .you-hero .eyebrow { font-family: var(--font-en); text-transform: uppercase; letter-spacing: .32em; font-size: .75rem; }
.you-hero h1 { font-size: clamp(2rem, 6vw, 3.8rem); font-weight: 700; line-height: 1.4; }
html[lang="en"] .you-hero h1 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; }
.you-hero p { color: var(--light-gray); font-size: clamp(1rem, 1.9vw, 1.15rem); max-width: 52ch; }

.compose { padding-block: clamp(80px, 11vw, 130px); text-align: center; }
.compose h2 { font-size: clamp(1.6rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.4; }
html[lang="en"] .compose h2 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; }
.compose .sub { color: #55524b; margin-top: 8px; }
.compose .stage-wrap { display: grid; place-items: center; margin-top: 44px; }
.compose .logo-stage { width: min(300px, 64vw); }
.compose .logo-stage .piece.bar { opacity: .22; }
.compose .logo-stage .piece.bar.chosen { opacity: 1; filter: drop-shadow(0 6px 14px var(--glow)); }
.compose .logo-stage.hovering .piece.bar.lit:not(.chosen) { opacity: .7; }
.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 40px; }
.choice {
  --v: #555;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px; border: 1px solid rgba(0,0,0,.15);
  font-size: .95rem; color: #3b3934; transition: all .25s;
}
.choice img { height: 18px; width: auto; }
.choice:hover { border-color: var(--v); }
.choice[aria-pressed="true"] { border-color: var(--v); color: var(--ink); background: #fff; box-shadow: 0 6px 18px -10px var(--v); font-weight: 600; }
.result { min-height: 3.6em; margin-top: 34px; font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 600; }
html[lang="en"] .result { font-family: var(--font-display); font-size: clamp(1.4rem, 2.8vw, 1.9rem); }
.result.complete { color: #8A6A22; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.faces-grid .reveal:nth-child(3n+2) { transition-delay: .08s; }
.faces-grid .reveal:nth-child(3n) { transition-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .seq, .reveal { opacity: 1 !important; transform: none !important; }
}

/* English version shows English only: hide the Persian secondary lines */
html[lang="en"] .intro .faces-line-alt,
html[lang="en"] .section-head .alt,
html[lang="en"] .face .alt { display: none; }
