/* Motion layer for the landing page. Everything here is progressive: without fx.js
   (or with reduced motion) the page renders exactly as site.css draws it. */

/* ---------- welcome: logo traces itself, name and slogan rise, the curtain splits ---------- */
#intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; cursor: pointer; }
#intro .half { position: absolute; top: 0; bottom: 0; width: 50.5%; background: #0b0b0e; transition: transform .7s cubic-bezier(.77, 0, .18, 1); }
#intro .half.a { right: 0; background: radial-gradient(circle at 0% 50%, rgba(228, 87, 46, .18), transparent 45%), #0b0b0e; }
#intro .half.b { left: 0; background: radial-gradient(circle at 100% 50%, rgba(228, 87, 46, .18), transparent 45%), #0b0b0e; }
#intro.out .half.a { transform: translateX(101%); }
#intro.out .half.b { transform: translateX(-101%); }
#intro .mark { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: opacity .3s ease, transform .5s cubic-bezier(.77, 0, .18, 1); }
#intro.out .mark { opacity: 0; transform: scale(1.08); }
#intro .logo { position: relative; width: 78px; height: 78px; display: grid; place-items: center; margin-bottom: 6px; }
#intro .logo svg { width: 56px; height: 56px; overflow: visible; animation: lift .5s 1s cubic-bezier(.3, 1.5, .5, 1) both; }
#intro .trace { fill: none; stroke: #ff7a45; stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 120; stroke-dashoffset: 120; animation: trace .6s .1s cubic-bezier(.6, 0, .3, 1) forwards; }
#intro .fill { fill: #e4572e; opacity: 0; animation: fillin .3s .65s ease forwards; }
#intro .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(228, 87, 46, .6); transform: scale(.4); opacity: 0; animation: ring .8s .7s ease-out forwards; }
#intro .word { font-weight: 900; font-size: 34px; letter-spacing: -.5px; clip-path: inset(0 0 100% 0); transform: translateY(12px); animation: up .45s .55s cubic-bezier(.2, .8, .2, 1) forwards; }
#intro .word i { font-style: normal; background: linear-gradient(90deg, #ff7a45, #e4572e); -webkit-background-clip: text; background-clip: text; color: transparent; }
#intro .line { width: 0; height: 2px; border-radius: 2px; background: linear-gradient(90deg, transparent, #e4572e, transparent); animation: grow .5s .8s ease forwards; }
#intro .slogan { color: var(--ink-3); font-size: 13px; letter-spacing: .3px; opacity: 0; transform: translateY(6px); animation: up .4s .95s ease forwards; }
@keyframes trace { to { stroke-dashoffset: 0; } }
@keyframes fillin { to { opacity: 1; } }
@keyframes lift { 50% { transform: translate(3px, -3px) rotate(-6deg); } }
@keyframes ring { 30% { opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
@keyframes up { to { clip-path: inset(0 0 -20% 0); transform: none; opacity: 1; } }
@keyframes grow { to { width: 160px; } }

/* ---------- ambient background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora span { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(80px); opacity: .22; animation: drift 26s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: var(--accent); top: -18vmax; right: -12vmax; }
.aurora span:nth-child(2) { background: var(--accent-2); bottom: -22vmax; left: -14vmax; opacity: .12; animation-duration: 32s; }
.aurora span:nth-child(3) { background: var(--accent); top: 40%; left: 30%; width: 30vmax; height: 30vmax; opacity: .08; animation-duration: 38s; }
.aurora::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px); background-size: 56px 56px; mask-image: radial-gradient(circle at 50% 20%, #000, transparent 70%); }
@keyframes drift { to { transform: translate(-8vmax, 6vmax) scale(1.15); } }
body { background: transparent; overflow-x: clip; }
html { background: var(--bg); }
.spot { position: fixed; z-index: -1; width: 520px; height: 520px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, rgba(228, 87, 46, .10), transparent 65%); transform: translate(-50%, -50%); transition: opacity .3s; }

/* ---------- scroll progress + nav ---------- */
.progress { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 50; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transform-origin: right; transform: scaleX(0); }
.nav { transition: padding .3s ease, background .3s ease, box-shadow .3s ease; }
.nav.small { padding-block: 9px; background: rgba(15, 15, 19, .92); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.nav nav a { position: relative; }
.nav nav a::after { content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .25s ease; }
.nav nav a:hover::after { transform: scaleX(1); }
.nav .brand svg { transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.nav .brand:hover svg { transform: translate(-4px, -4px) rotate(-12deg); }

/* ---------- reveal on scroll ---------- */
.fx .rv { opacity: 0; transform: translateY(18px); filter: blur(4px); transition: opacity .45s cubic-bezier(.2, .7, .2, 1), transform .45s cubic-bezier(.2, .7, .2, 1), filter .45s ease; transition-delay: calc(var(--d, 0) * 45ms); }
.fx .rv.in { opacity: 1; transform: none; filter: none; }

/* headline words rise from a mask */
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.hero h1 .w > b { display: inline-block; font-weight: inherit; transform: translateY(110%); transition: transform .5s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--i) * 35ms + 60ms); }
.hero h1.in .w > b { transform: none; }
.hero h1 .accent { background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 5s linear infinite; }
.hero h1 .accent .w > b { color: transparent; background: inherit; -webkit-background-clip: text; background-clip: text; }
@keyframes shine { to { background-position: -200% 0; } }

/* rotating word in the tag */
.hero .tag { position: relative; overflow: hidden; }
.hero .tag::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .18), transparent 70%); transform: translateX(100%); animation: sweep 3.6s ease-in-out infinite 1.6s; }
@keyframes sweep { 60%, 100% { transform: translateX(-100%); } }

/* ---------- buttons ---------- */
.btn { position: relative; overflow: hidden; will-change: transform; }
.btn.primary { box-shadow: 0 10px 30px -10px rgba(228, 87, 46, .7); }
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .35), transparent 65%); transform: translateX(120%); transition: transform .7s ease; }
.btn.primary:hover::after { transform: translateX(-120%); }
.btn.ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn .rip { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .45); transform: scale(0); animation: rip .6s ease-out forwards; pointer-events: none; }
@keyframes rip { to { transform: scale(4); opacity: 0; } }

/* ---------- phone chat ---------- */
.phone-wrap { perspective: 1100px; overflow: visible; }
.phone { transform-style: preserve-3d; transition: transform .25s ease-out; animation: floaty 7s ease-in-out infinite; min-height: 470px; }
@keyframes floaty { 50% { translate: 0 -10px; } }
.phone .head .av { position: relative; }
.phone .head .av::after { content: ""; position: absolute; bottom: 0; left: 0; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--panel); }
.fx .phone .b, .fx .phone .note { opacity: 0; transform: translateY(14px) scale(.96); transition: opacity .45s ease, transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.fx .phone .b.show, .fx .phone .note.show { opacity: 1; transform: none; }
.fx .phone .b.in { transform-origin: right bottom; }
.fx .phone .b.out { transform-origin: left bottom; }
.typing { align-self: flex-end; display: none; gap: 4px; padding: 12px 14px; border-radius: 16px; border-bottom-left-radius: 5px; background: rgba(228, 87, 46, .18); }
.typing.on { display: inline-flex; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.phone .note.show { animation: pulse 1.8s ease-in-out infinite .5s; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(247, 178, 103, .12); } }

/* the plane that flies around the phone */
.flyer { position: absolute; width: 34px; height: 34px; color: var(--accent-2); offset-path: path("M -40 380 C 60 200, 140 520, 260 300 S 420 60, 520 -40"); offset-rotate: auto; animation: fly 9s linear infinite; opacity: 0; filter: drop-shadow(0 6px 14px rgba(247, 178, 103, .5)); pointer-events: none; }
@keyframes fly { 0% { offset-distance: 0%; opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }

/* ---------- strip + marquee ---------- */
.strip div { transition: background .3s ease; }
.strip div:hover { background: var(--panel); }
.strip b { background: linear-gradient(180deg, var(--ink), var(--ink-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.marquee { overflow: hidden; border-bottom: 1px solid var(--line); padding: 16px 0; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee .track { display: flex; gap: 44px; width: max-content; animation: marq 32s linear infinite; color: var(--ink-3); font-weight: 700; font-size: 15px; }
.marquee .track span::before { content: "✦"; color: var(--accent); margin-inline-end: 12px; font-size: 12px; }
.marquee:hover .track { animation-play-state: paused; }
@keyframes marq { to { transform: translateX(50%); } }

/* ---------- feature cards: spotlight + tilt ---------- */
.grid article { position: relative; isolation: isolate; transition: transform .35s cubic-bezier(.2, .8, .2, 1), border-color .3s ease; transform: perspective(800px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); }
.grid article::before { content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px; background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 60%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s ease; }
.grid article::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 50%), rgba(228, 87, 46, .10), transparent 60%); opacity: 0; transition: opacity .3s ease; }
.grid article:hover::before, .grid article:hover::after { opacity: 1; }
.grid article:hover { border-color: transparent; }
.grid h3 { display: flex; align-items: center; gap: 10px; }
.grid h3 .ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(228, 87, 46, .14); color: var(--accent); font-size: 17px; transition: transform .4s cubic-bezier(.3, 1.6, .5, 1); }
.grid article:hover .ic { transform: rotate(-10deg) scale(1.12); }

/* ---------- steps: a line that draws itself ---------- */
.steps { position: relative; }
.steps::before { content: ""; position: absolute; top: 39px; inset-inline: 40px; height: 2px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transform-origin: right; transform: scaleX(0); transition: transform .8s cubic-bezier(.6, 0, .2, 1) .1s; z-index: 0; }
.steps.in::before { transform: scaleX(1); }
.steps li { position: relative; z-index: 1; transition: transform .3s ease, border-color .3s ease; }
.steps li:hover { transform: translateY(-6px); border-color: var(--accent); }
.steps span { box-shadow: 0 0 0 6px var(--panel), 0 0 0 7px rgba(228, 87, 46, .4); transition: transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.steps li.in span { animation: pop .6s cubic-bezier(.3, 1.6, .5, 1) both; animation-delay: calc(var(--d, 0) * 120ms + 150ms); }
@keyframes pop { from { transform: scale(0) rotate(-90deg); } }

/* ---------- pricing ---------- */
.plan { transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease, border-color .3s ease; }
.plan:hover { transform: translateY(-8px); box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .7); border-color: rgba(228, 87, 46, .5); }
.plan.best { border-color: transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, conic-gradient(from var(--ang, 0deg), var(--accent), var(--accent-2), var(--accent)) border-box; border: 1.5px solid transparent; animation: spin 6s linear infinite; }
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes spin { to { --ang: 360deg; } }
.plan .badge { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-3px); } }

/* ---------- faq ---------- */
.faq details { transition: border-color .3s ease, background .3s ease; overflow: hidden; }
.faq details[open] { border-color: rgba(228, 87, 46, .45); }
.faq summary::after { transition: transform .3s ease; }
.faq details[open] summary::after { content: "+"; transform: rotate(45deg); }

/* ---------- final call ---------- */
.final { position: relative; overflow: hidden; }
.final .planes span { position: absolute; bottom: -40px; width: 22px; height: 22px; color: var(--accent); opacity: .5; animation: rise linear infinite; }
.final .planes svg { width: 100%; height: 100%; }
@keyframes rise { to { transform: translate(-60px, -520px) rotate(-20deg); opacity: 0; } }
.final h2, .final .btn { position: relative; z-index: 1; }

/* ---------- respect the user's settings ---------- */
@media (prefers-reduced-motion: reduce) {
  #intro, .aurora span, .flyer, .marquee .track, .phone, .plan.best, .plan .badge, .final .planes, .hero .tag::before { animation: none !important; }
  .flyer, .final .planes, .spot { display: none; }
  .fx .rv, .hero h1 .w > b { transition: none; opacity: 1; transform: none; filter: none; }
}
@media (max-width: 900px) {
  .steps::before { display: none; }
  .spot { display: none; }
  .phone { min-height: 0; }
}

/* ---------- one palette: near-black + the Directchi orange ramp ----------
   Every section sits on the same background; depth comes from glass surfaces and
   light, never from switching colours. Orange is reserved for action and emphasis. */
:root { --surface: rgba(255, 255, 255, .035); --surface-2: rgba(255, 255, 255, .055); --edge: rgba(255, 255, 255, .08); --grad: linear-gradient(135deg, #ff7a45, #e4572e 55%, #c2410c); }
.block.alt, .strip div, .strip { background: transparent; }
.block.alt { border-block: 0; }
.strip { border-block: 1px solid var(--edge); gap: 0; }
.strip div + div { border-inline-start: 1px solid var(--edge); }
.strip div:hover { background: var(--surface); }
.grid article, .block.alt .grid article, .steps li, .plan, .faq details, .phone { background: var(--surface); border-color: var(--edge); backdrop-filter: blur(12px); }
.grid h3 { color: var(--ink); }
.grid h3 .ic { background: rgba(228, 87, 46, .12); color: var(--accent); border: 1px solid rgba(228, 87, 46, .25); }
.grid h3 .ic svg { width: 18px; height: 18px; }
.hero .tag, .phone .note { color: #ffb08f; background: rgba(228, 87, 46, .10); border: 1px solid rgba(228, 87, 46, .28); }
.hero h1 .accent { background-image: linear-gradient(90deg, #ff7a45, #e4572e, #ffb08f, #e4572e); }
.btn.primary, .steps span, .plan .badge, .phone .b.out { background: var(--grad); border-color: transparent; }
.phone .b.in { background: var(--surface-2); }
.progress { background: var(--grad); }
.plan.best { background: linear-gradient(#141418, #141418) padding-box, conic-gradient(from var(--ang, 0deg), #e4572e, #ffb08f, #c2410c, #e4572e) border-box; }
.steps::before { background: var(--grad); }
.flyer { color: #ff7a45; filter: drop-shadow(0 6px 14px rgba(228, 87, 46, .5)); }
.aurora span:nth-child(2) { background: #c2410c; opacity: .14; }
.aurora span:nth-child(3) { opacity: .06; }
.final { background: radial-gradient(circle at 50% 0%, rgba(228, 87, 46, .16), transparent 60%); border-top: 1px solid var(--edge); }
.nav, .nav.small { border-bottom-color: var(--edge); }
footer { border-top-color: var(--edge); }
.ticks li::before, .faq summary::after { color: var(--accent); }
.typing { background: var(--surface-2); }
/* hide the page until the welcome screen is in place, so it never flashes first */
.pre body { background: #0b0b0e; }
.pre body > :not(#intro) { visibility: hidden; }

/* ---------- polish pass (design review 2026-10-31) ---------- */
html, body { overflow-x: clip; max-width: 100%; }
.hero { overflow-x: clip; padding-top: 96px; }
.hero h1 { line-height: 1.35; letter-spacing: 0; text-wrap: balance; }
/* the chat reads as a real DM screen: an input bar sits at the bottom */
.phone::after { content: "پیام بنویسید…"; margin-top: auto; display: flex; align-items: center; height: 40px; padding-inline: 16px; border-radius: 999px; border: 1px solid var(--edge); background: var(--surface-2); color: var(--ink-3); font-size: 12px; }
.phone .b + .b, .phone .b + .note { margin-top: 2px; }
/* legible small text */
.ticks, .strip span, .phone .head span, .phone .note, .hero .tag { font-size: 13px; }
:root { --ink-3: #b0b0bb; }
/* one accent pair everywhere */
.grid h3 { color: #ffb08f; }
.grid h3 .ic, .phone .av { color: var(--accent); }
.phone .av { background: var(--grad); }
/* secondary button visible against the glow */
.btn.ghost { border-color: rgba(255, 255, 255, .18); color: var(--ink); }
.btn.ghost:hover { background: rgba(255, 255, 255, .06); }
/* comfortable tap targets */
.nav .brand { min-height: 44px; }
.nav .btn, .nav nav a { min-height: 44px; display: inline-flex; align-items: center; }
footer nav a { padding: 10px 6px; }
@media (max-width: 640px) {
  .flyer { display: none; }
  .hero { padding-top: 40px; }
  .nav { padding: 8px 16px; gap: 12px; }
  .grid { gap: 10px; }
  .grid article { padding: 16px; }
  .strip div { padding: 18px 12px; }
}
.plan .badge { font-size: 12px; }
