/* Home pages (/, /fa/, /ar/, /es/). Shared parts (colours, top bar, footer) are in base.css.
   Persian and Arabic pages are dir="rtl": use logical properties (inset-inline-*, margin-inline-*, text-align: start/end). */

/* ---------- hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 1010px;
  background: radial-gradient(ellipse at 72% 55%, #dce1eb 0%, transparent 43%), radial-gradient(ellipse at 20% 65%, #f4dce0 0%, transparent 43%), var(--paper);
}
#dust { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.hero-copy { position: relative; z-index: 2; text-align: center; pointer-events: none; padding-top: 78px; }
.eyebrow {
  display: flex; gap: 12px; align-items: center; justify-content: center;
  text-transform: uppercase; font-weight: 700; color: #505967; font-size: 10px; letter-spacing: 2.2px;
}
.dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--red); }
h1 { font-size: clamp(70px, 8vw, 120px); letter-spacing: -.065em; line-height: .98; font-weight: 600; margin: 28px 0 25px; }
h1 span { color: var(--red); }
.hero-copy p { margin: auto; font-size: 17px; color: #505967; max-width: 450px; line-height: 1.75; }
.scene { position: absolute; inset: 340px 5% 140px; z-index: 3; min-height: 410px; touch-action: pan-y; cursor: grab; }
.scene:active { cursor: grabbing; }
.scene canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.poster { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; transition: opacity .4s; animation: floatPoster 7s ease-in-out infinite; }
.poster svg { width: 92%; max-width: 1080px; height: auto; }
.scene.rendered .poster { opacity: 0; }
.orbit {
  position: absolute; left: 50%; top: 64%; width: 60%; height: 25%; z-index: -1;
  border: 1px solid #8893a51c; border-radius: 50%; transform: translate(-50%, -50%) rotate(-14deg);
}
.hero-watermark {
  position: absolute; inset: 480px 0 auto; text-align: center; font-family: Arial, Helvetica, sans-serif;
  font-size: 23vw; font-weight: 800; letter-spacing: -.07em; line-height: 1; color: #ffffff70; pointer-events: none;
}
.side-note {
  position: absolute; top: 61%; inset-inline-start: 6vw; z-index: 4; pointer-events: none;
  font-family: monospace; font-size: 9px; line-height: 2; letter-spacing: 1px; color: #505967;
}
.side-note.end { inset-inline-start: auto; inset-inline-end: 6vw; text-align: end; }
.hero-bottom {
  position: absolute; left: 6vw; right: 6vw; bottom: 38px; z-index: 5;
  display: grid; grid-template-columns: 1fr 340px 1fr; align-items: center; gap: 25px;
}
.cta {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 25px;
  padding: 19px 25px; border: 1px solid var(--ink); border-radius: 100px;
  background: var(--ink); color: white; font-size: 13px; font-weight: 700; transition: transform .2s, background .2s;
}
.cta:hover { transform: translateY(-3px); background: var(--red); border-color: var(--red); }
.cta .icon { width: 18px; height: 18px; }
.small { margin-top: 14px; line-height: 1.7; color: #555d6b; font-size: 11px; }
.load {
  padding: 20px 25px; border: 1px solid #fff; border-radius: 20px;
  background: #ffffffb8; box-shadow: 0 12px 40px #2a35410c; backdrop-filter: blur(20px);
}
.loadtop { display: flex; justify-content: space-between; align-items: center; color: #515b69; letter-spacing: 1px; font-size: 10px; }
.loadtop output { letter-spacing: -1px; font-weight: 700; color: #1c222c; font-size: 29px; }
.loadtop output small { font-size: 10px; margin-inline-start: 3px; color: #5d6572; }
.load input { width: 100%; height: 5px; margin: 18px 0 6px; accent-color: var(--red); cursor: ew-resize; }
.range-labels { display: flex; justify-content: space-between; font: 9px monospace; color: #57616f; }
.load input, .range-labels { direction: ltr; } /* the bar loads left to right in every language */
[dir=rtl] .range-labels span { direction: rtl; unicode-bidi: isolate; }
.scroll-cue { text-align: end; font-size: 10px; color: #4e5968; letter-spacing: 1px; }
.scroll-cue span {
  display: inline-block; width: 1px; height: 43px; margin-inline-start: 18px; vertical-align: middle;
  background: linear-gradient(var(--red), transparent);
}

/* ---------- ribbon + intro ---------- */
.ribbon {
  display: flex; justify-content: space-around; gap: 20px; padding: 32px 5vw;
  border-block: 1px solid #dce0e7; background: white; color: #57616e; font-size: 11px; letter-spacing: 1px;
}
.ribbon b { font-weight: 500; color: #bf293b; }
.shell { margin: auto; max-width: 1450px; padding: 0 8vw; }
.intro { display: grid; grid-template-columns: 1fr 2.5fr; gap: 60px; padding: 160px 0 110px; }
.section-id { font-family: monospace; font-size: 10px; letter-spacing: 2px; line-height: 1.8; color: #535d6c; }
.section-id span { margin-inline-end: 15px; color: var(--red); }
h2 { margin: 0; font-weight: 600; font-size: clamp(38px, 4.9vw, 72px); line-height: 1.13; letter-spacing: -.05em; }
h2 em { font-style: normal; color: #727b89; }
.intro p, .feature p { color: #505b6b; font-size: 17px; line-height: 1.9; max-width: 440px; margin-top: 30px; }

/* ---------- chapters ---------- */
.chapter {
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 8vw;
  min-height: 700px; padding: 110px 0; border-top: 1px solid #d4d9e1;
}
.feature h3 { font-size: clamp(38px, 3.7vw, 57px); font-weight: 500; line-height: 1.12; letter-spacing: -.05em; margin: 26px 0; }
.feature .number { font-family: monospace; font-size: 11px; letter-spacing: 2px; color: #b22034; }
.feature a { display: inline-flex; align-items: center; gap: 25px; padding: 19px 0; border-bottom: 1px solid #9da5b2; font-size: 13px; }
.feature a:hover { color: var(--red); border-color: var(--red); }
.visual {
  position: relative; display: grid; place-items: center; min-height: 460px; border-radius: 35px;
  background: radial-gradient(ellipse at 50% 50%, #fff, #e5e8ef 80%);
}
.plan {
  position: relative; overflow: hidden; width: 82%; max-width: 370px; padding: 32px;
  background: #fff; border: 1px solid #fff; border-radius: 17px; color: #222a36; box-shadow: 25px 35px 70px #515f7c1a;
  transform: perspective(1000px) rotateY(-12deg) rotateX(6deg); transition: transform .3s;
}
.plan::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: #fa4d3e; box-shadow: 0 0 30px 8px #ff483c33; animation: scan 6s ease-in-out infinite;
}
.plan h4 { letter-spacing: -1px; margin: 20px 0; font-size: 29px; font-weight: 500; }
.micro { font-family: monospace; font-size: 10px; letter-spacing: 1px; line-height: 1.7; color: #5b6778; }
.exercise { display: flex; justify-content: space-between; padding: 22px 0; border-top: 1px solid #e0e4eb; font-size: 13px; }
.exercise span { font-family: monospace; font-size: 11px; color: #596576; }
.pill {
  display: inline-block; margin-top: 15px; padding: 7px 9px; border: 1px solid #edccd3; border-radius: 20px;
  background: #faedf0; color: #a91e31; font-family: monospace; font-size: 9px;
}
.floating-label {
  position: absolute; inset-inline-end: -20px; bottom: 45px; display: flex; align-items: center; gap: 12px; padding: 20px;
  background: white; color: #374253; border: 1px solid white; border-radius: 14px; box-shadow: 0 15px 50px #26395719; font-size: 12px;
}
/* chapter 2: the dark band */
.chapter.reverse { position: relative; isolation: isolate; min-height: 760px; margin: 50px 0; border: 0; color: #fafbfc; }
.chapter.reverse::before {
  content: ""; position: absolute; inset: 0 -8vw; z-index: -1; border-radius: 32px;
  background: radial-gradient(ellipse at 100% 100%, #46212a, transparent 65%), #191e27;
}
.reverse .feature p { color: #c7cdd7; }
.reverse .feature .number { color: #ff9daa; }
.reverse .small { color: #b9c0cd; }
.reverse .visual { background: none; }
.reverse .micro { color: #c7cdd9; }
.log {
  width: 90%; max-width: 420px; padding: 30px; border: 1px solid #ffffff20; border-radius: 24px;
  background: #ffffff08; box-shadow: 0 30px 60px #0002;
}
.log-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 25px; }
.log h4 { margin: 0; font-size: 22px; font-weight: 500; }
.set {
  display: grid; grid-template-columns: 30px 1fr 1fr 35px; align-items: center; gap: 12px; padding: 15px 0;
  border-bottom: 1px solid #ffffff20; font-family: monospace; font-size: 12px; color: #b8c1ce;
}
.set.current { color: #fff; }
.set input {
  min-width: 0; width: 100%; padding: 12px; border: 1px solid #ffffff30; border-radius: 8px;
  background: #ffffff0c; color: white; text-align: center; font: 15px monospace;
}
.check { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; background: #234137; color: #a8e2c8; }
.check .icon { width: 17px; height: 17px; }
.log button {
  width: 100%; margin-top: 20px; padding: 17px; border: 1px solid #f0f2f7; border-radius: 50px;
  background: #f0f2f7; color: #212734; font-size: 13px;
}
.toast { min-height: 18px; margin-top: 12px; font-size: 11px; line-height: 1.6; color: #c3e4d5; }
/* chapter 3: chart */
.chart { position: relative; width: 100%; max-width: 450px; padding: 34px; }
.chart .metric { letter-spacing: -4px; margin: 15px 0 0; font-size: 65px; font-weight: 500; }
.metric small { font-size: 13px; letter-spacing: 0; color: #5b6575; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart svg g { stroke: #8490a32b; }
.chart-labels { display: flex; justify-content: space-between; font-family: monospace; font-size: 10px; color: #596576; }
.chart svg, .chart-labels { direction: ltr; } /* time runs left to right on the chart */
[dir=rtl] .chart-labels span { direction: rtl; unicode-bidi: isolate; }
.chartline { stroke-dasharray: 650; stroke-dashoffset: 0; transition: stroke-dashoffset 2s; }

/* ---------- FAQ ---------- */
.faq { max-width: 950px; margin: 0 auto; padding: 90px 7vw; }
.faq h2 { font-size: 36px; margin-bottom: 35px; }
.faq details { border-top: 1px solid var(--line); padding: 22px 0; }
.faq summary { font-size: 16px; cursor: pointer; }
.faq p { font-size: 15px; line-height: 1.9; color: #505b6b; }
.faq p a { color: var(--red); border-bottom: 1px solid currentColor; }

/* ---------- closing + download buttons ---------- */
.closing {
  position: relative; isolation: isolate; overflow: hidden; text-align: center;
  padding: 160px 20px; border-top: 1px solid #d8dce4; background: var(--soft);
}
.closing::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at 50% 130%, #d8abb7, transparent 65%); }
.closing h2 { letter-spacing: -.07em; font-size: clamp(70px, 9vw, 130px); font-weight: 500; margin: 40px 0 50px; }
.closing h2 span { color: #bd2439; }
.closing p { color: #515d70; font-size: 14px; line-height: 1.9; margin-top: 30px; }
.stores { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.store {
  display: inline-flex; align-items: center; gap: 14px; min-width: 240px; padding: 14px 28px; border-radius: 100px;
  background: var(--ink); color: #fff; text-align: start; transition: transform .2s, background .2s;
}
.store:hover { background: var(--red); transform: translateY(-3px); }
.store > svg { width: 26px; height: 26px; flex: none; }
.store b { display: block; font-size: 17px; line-height: 1.3; }
.store small { display: block; font-size: 11px; line-height: 1.5; opacity: .78; }
.store .if-appstore, .has-appstore .store .if-testflight { display: none; }
.has-appstore .store .if-appstore { display: block; }
.tester-link { display: inline-block; margin-top: 24px; padding-bottom: 3px; border-bottom: 1px solid #9da5b2; font-size: 13px; color: #3d4655; }
.tester-link:hover { color: var(--red); border-color: var(--red); }

/* ---------- motion (experience.js adds .motion or .paused to <body>) ---------- */
.reveal { opacity: 1; transform: none; }
.motion .reveal { transition: opacity .8s, transform .9s cubic-bezier(.2, .7, .2, 1); }
.motion .reveal .feature, .motion .intro > div { transition: opacity .8s, transform 1s; }
.motion .reveal:not(.seen) .feature { opacity: .3; transform: translateY(55px); }
.motion .reveal .visual { transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.motion .reveal:not(.seen) .visual { transform: translateY(40px) scale(.96); }
.motion .reveal:not(.seen) .chartline { stroke-dashoffset: 650; }
.paused * { animation-play-state: paused !important; }
.paused .feature { opacity: 1 !important; transform: none !important; }
.paused .visual { transform: none !important; }
.paused .chartline { stroke-dashoffset: 0; }
@keyframes scan { 0%, 15% { top: 0; opacity: 0 } 25% { opacity: 1 } 80% { top: 100%; opacity: 1 } 100% { top: 100%; opacity: 0 } }
@keyframes floatPoster { 0%, 100% { transform: translateY(0) rotate(-1deg) } 50% { transform: translateY(-10px) rotate(1deg) } }
@supports (animation-timeline: view()) {
  .chapter .visual { animation: scenePass linear both; animation-timeline: view(); animation-range: entry 0% exit 100%; }
  .chapter .feature { animation: copyEnter linear both; animation-timeline: view(); animation-range: entry 0% entry 90%; }
  @keyframes scenePass { 0% { translate: 0 50px; scale: .94; rotate: -2deg } 40%, 60% { translate: 0 0; scale: 1; rotate: 0deg } 100% { translate: 0 -35px; scale: .98; rotate: 1deg } }
  @keyframes copyEnter { from { opacity: .25; translate: 0 35px } to { opacity: 1; translate: 0 0 } }
}

/* ---------- Persian and Arabic ---------- */
/* Monospace fonts and letter-spacing break the joined letters of Persian and Arabic: use Estedad, no spacing. */
[dir=rtl] .side-note, [dir=rtl] .section-id, [dir=rtl] .micro, [dir=rtl] .feature .number, [dir=rtl] .exercise span,
[dir=rtl] .pill, [dir=rtl] .set, [dir=rtl] .chart-labels, [dir=rtl] .range-labels {
  font-family: Estedad, Tahoma, Arial, sans-serif;
}
[dir=rtl] .eyebrow, [dir=rtl] .side-note, [dir=rtl] .section-id, [dir=rtl] .micro, [dir=rtl] .feature .number,
[dir=rtl] .ribbon, [dir=rtl] .loadtop, [dir=rtl] .loadtop output, [dir=rtl] .scroll-cue, [dir=rtl] .plan h4, [dir=rtl] .log h4,
[dir=rtl] .chart .metric { letter-spacing: 0; }
[dir=rtl] .side-note { font-size: 11px; }
[dir=rtl] .eyebrow { font-size: 12px; }
[dir=rtl] .loadtop label { font-size: 12px; font-weight: 700; }
[dir=rtl] .ribbon, [dir=rtl] .section-id { font-size: 12px; }
[dir=rtl] .feature .number, [dir=rtl] .micro { font-size: 12px; }
[dir=rtl] h1 { letter-spacing: 0; line-height: 1.3; font-size: clamp(45px, 7vw, 100px); }
[dir=rtl] h2, [dir=rtl] h3 { letter-spacing: 0; line-height: 1.5; }
[dir=rtl] .closing h2 { letter-spacing: 0; }
[dir=rtl] .plan { transform: perspective(1000px) rotateY(12deg) rotateX(6deg); }

@media (min-width: 1500px) {
  .scene { left: 10%; right: 10%; }
}
@media (max-width: 800px) {
  .hero { min-height: 980px; }
  .hero-copy { padding: 58px 25px 0; }
  h1 { font-size: clamp(56px, 12.5vw, 90px); margin: 25px 0; line-height: 1.03; }
  .hero-copy p { font-size: 16px; max-width: 300px; }
  .hero-copy .eyebrow { font-size: 9px; letter-spacing: 1.5px; }
  .scene { inset: 325px -8% 270px; min-height: 0; }
  .poster svg { width: 100%; }
  .hero-watermark { top: 430px; font-size: 26vw; }
  .side-note { top: 610px; inset-inline-start: 7vw; font-size: 8px; }
  .side-note.end, .scroll-cue { display: none; }
  .hero-bottom { grid-template-columns: 1fr; justify-items: center; bottom: 35px; gap: 25px; }
  .hero-bottom > div:first-child { order: 2; text-align: center; }
  .load { width: min(360px, 86vw); padding: 20px 24px; }
  .orbit { top: 50%; width: 90%; height: 20%; }
  .ribbon { flex-wrap: wrap; gap: 15px; padding: 24px 5vw; font-size: 8px; letter-spacing: .3px; }
  .shell { padding: 0 7vw; }
  .intro { grid-template-columns: 1fr; gap: 32px; padding: 100px 0 65px; }
  .intro h2 { font-size: 40px; }
  .intro p, .feature p { font-size: 16px; }
  .chapter { grid-template-columns: 1fr; gap: 50px; min-height: 0; padding: 65px 0 85px; }
  .chapter .feature { order: 0; }
  .chapter .visual { order: 1; animation: none; }
  .chapter.reverse .visual { order: 2; }
  .feature h3 { font-size: 39px; line-height: 1.15; margin-top: 25px; }
  .visual { min-height: 400px; border-radius: 25px; }
  .plan { padding: 26px; }
  .floating-label { inset-inline-end: -5px; bottom: 20px; font-size: 10px; padding: 17px; }
  .chapter.reverse { margin: 20px 0 40px; padding: 70px 0; min-height: 0; }
  .chapter.reverse::before { inset: 0 -7vw; border-radius: 0; }
  .log { width: 100%; padding: 25px; }
  .reverse .visual { min-height: 330px; }
  .chart { padding: 25px; }
  .closing { padding: 100px 25px; }
  .closing h2 { font-size: 77px; margin: 30px 0 40px; }
  .closing .eyebrow { font-size: 8px; letter-spacing: 1.3px; }
  .closing p { font-size: 13px; }
  .stores { flex-direction: column; align-items: center; }
  .store { width: min(320px, 100%); }
  .motion .reveal:not(.seen) .feature { opacity: .5; }
  [dir=rtl] .hero-copy { padding-top: 45px; }
  [dir=rtl] h1 { font-size: 45px; line-height: 1.5; }
  [dir=rtl] .side-note { font-size: 10px; }
  [dir=rtl] .ribbon { font-size: 11px; }
  [dir=rtl] .hero-copy .eyebrow, [dir=rtl] .closing .eyebrow { font-size: 11px; letter-spacing: 0; }
  [lang=es] .closing h2 { font-size: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  .poster, .chapter .visual, .chapter .feature { animation: none !important; translate: none !important; scale: 1 !important; rotate: none !important; opacity: 1 !important; }
  .motion .reveal:not(.seen) .feature, .motion .reveal:not(.seen) .visual { opacity: 1; transform: none; }
  .chartline { stroke-dashoffset: 0; }
}
