/* ===== PistonApp landing ===== */
:root {
  --primary: #ff6a1a;
  --primary-dark: #e63b2e;
  --dark: #14161f;
  --dark-2: #1d2030;
  --text: #2b2f3a;
  --muted: #6b7180;
  --bg: #f6f7fb;
  --white: #fff;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(20, 22, 31, .08);
  --header-h: 76px;
  --grad: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  font-family: Vazirmatn, Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
svg { stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.container { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.5rem; border-radius: 12px; border: 0;
  font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn--primary { background: var(--grad); color: var(--white); box-shadow: 0 8px 24px rgba(255, 106, 26, .35); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(255, 106, 26, .45); }
.btn--block { width: 100%; padding-block: .9rem; }

/* ---------- Header ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  background: rgba(20, 22, 31, .55); backdrop-filter: blur(12px);
  transition: background .3s, box-shadow .3s;
}
.header.scrolled { background: rgba(20, 22, 31, .95); box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }
.header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.logo { display: flex; align-items: center; gap: .6rem; }
.logo__text { font-family: system-ui, sans-serif; font-size: 1.35rem; font-weight: 800; color: var(--white); direction: ltr; unicode-bidi: isolate; letter-spacing: -.5px; }
.logo__text b { color: var(--primary); }
.logo__text small { font-size: .8rem; opacity: .6; font-weight: 600; }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav__list { display: flex; gap: .4rem; }
.nav__link {
  position: relative; display: block; padding: .4rem .9rem;
  color: rgba(255, 255, 255, .8); font-weight: 500; border-radius: 10px; transition: color .2s, background .2s;
}
.nav__link:hover, .nav__link.active { color: var(--white); background: rgba(255, 255, 255, .08); }
.nav__link.active::after {
  content: ""; position: absolute; bottom: 2px; right: 50%; transform: translateX(50%);
  width: 18px; height: 3px; border-radius: 3px; background: var(--primary);
}

.burger { display: none; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; flex-direction: column; justify-content: center; gap: 6px; padding: 10px; }
.burger span { display: block; height: 2px; background: var(--white); border-radius: 2px; transition: transform .3s, opacity .3s; }
.burger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero banner ---------- */
.hero__banner {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: min(92vh, 760px); display: flex; align-items: center;
  padding-top: var(--header-h);
  background:
    radial-gradient(circle at 15% 80%, rgba(255, 106, 26, .35), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(230, 59, 46, .3), transparent 40%),
    linear-gradient(160deg, var(--dark) 0%, var(--dark-2) 100%);
  color: var(--white);
}
.hero__banner::before { /* subtle grid */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.hero__glow { position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--grad); filter: blur(140px); opacity: .25; top: -160px; left: -120px; z-index: -1; }
.hero__content { text-align: center; padding-block: 4rem; }
.hero__badge {
  display: inline-block; padding: .35rem 1rem; margin-bottom: 1.5rem; border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06);
  font-family: system-ui, sans-serif; letter-spacing: 1px; font-size: .9rem; color: #ffb48a;
}
.hero__title { font-size: clamp(2rem, 5.5vw, 4rem); font-weight: 900; line-height: 1.35; }
.hero__title span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { margin: 1.25rem auto 0; max-width: 620px; font-size: clamp(1rem, 2vw, 1.2rem); color: rgba(255, 255, 255, .75); }

.hero__gear { position: absolute; fill: rgba(255, 255, 255, .05); stroke: none; z-index: -1; animation: spin 30s linear infinite; }
.hero__gear--1 { width: 340px; bottom: -110px; right: -90px; }
.hero__gear--2 { width: 180px; top: 120px; left: 6%; animation-direction: reverse; animation-duration: 22s; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Sections ---------- */
.section { padding-block: 6rem; }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 3.5rem; }
.section__tag {
  display: inline-block; padding: .2rem .9rem; border-radius: 99px; margin-bottom: .8rem;
  background: rgba(255, 106, 26, .12); color: var(--primary-dark); font-weight: 700; font-size: .9rem;
}
.section__title { font-size: clamp(1.6rem, 3.5vw, 2.3rem); font-weight: 800; color: var(--dark); line-height: 1.5; }
.section__desc { margin-top: .8rem; color: var(--muted); }

/* ---------- Services ---------- */
.services__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.75rem; }
.card {
  position: relative; padding: 2.25rem 2rem; border-radius: var(--radius);
  background: var(--white); box-shadow: var(--shadow); overflow: hidden;
  transition: transform .3s, box-shadow .3s;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--grad); transform: scaleX(0); transform-origin: right; transition: transform .4s; }
.card:hover { transform: translateY(-8px); box-shadow: 0 20px 50px rgba(20, 22, 31, .12); }
.card:hover::before { transform: scaleX(1); }
.card__icon {
  width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 1.4rem;
  border-radius: 16px; background: var(--grad); color: var(--white);
  box-shadow: 0 10px 24px rgba(255, 106, 26, .35);
}
.card__icon svg { width: 32px; height: 32px; }
.card__title { font-size: 1.2rem; font-weight: 800; color: var(--dark); margin-bottom: .6rem; }
.card__text { color: var(--muted); }

/* ---------- About ---------- */
.about { background: var(--white); }
.about__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 4rem; align-items: center; }
.about__text .section__title { margin-bottom: 1.2rem; }
.about__text p { color: var(--muted); margin-bottom: 1rem; text-align: justify; }
.about__points { margin-top: 1.5rem; display: grid; gap: .7rem; }
.about__points li { display: flex; align-items: center; gap: .7rem; font-weight: 600; color: var(--dark); }
.about__points li::before {
  content: "✓"; flex: none; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(255, 106, 26, .12); color: var(--primary-dark); font-size: .85rem;
}
.about__stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
.stat {
  padding: 2rem 1.25rem; border-radius: var(--radius); text-align: center;
  background: linear-gradient(160deg, var(--dark), var(--dark-2)); color: var(--white);
}
.stat:nth-child(2), .stat:nth-child(3) { background: var(--grad); }
.stat strong { display: block; font-size: 2.2rem; font-weight: 900; line-height: 1.4; }
.stat span { font-size: .95rem; opacity: .8; }

/* ---------- Contact ---------- */
.contact__grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 2rem; align-items: start; }
.contact__info, .contact__form { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem; }
.contact__info { display: grid; gap: 1.1rem; }
.info-item { display: flex; align-items: center; gap: 1rem; padding: .4rem; border-radius: 12px; transition: background .2s; }
a.info-item:hover { background: var(--bg); }
.info-item__icon {
  flex: none; width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 14px; background: rgba(255, 106, 26, .12); color: var(--primary-dark);
}
.info-item__icon svg { width: 22px; height: 22px; }
.info-item small { display: block; color: var(--muted); font-size: .82rem; }
.info-item b { color: var(--dark); font-weight: 700; }
.contact__map { width: 100%; height: 220px; border: 0; border-radius: 14px; }

.field { margin-bottom: 1.1rem; }
.field label { display: block; margin-bottom: .35rem; font-weight: 600; color: var(--dark); font-size: .95rem; }
.field input, .field textarea {
  width: 100%; padding: .8rem 1rem; border: 1.5px solid #e3e5ec; border-radius: 12px;
  font: inherit; color: var(--text); background: #fbfbfd; resize: vertical; transition: border-color .2s, box-shadow .2s;
}
.field input[dir="ltr"] { text-align: right; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255, 106, 26, .15); background: var(--white); }
.field--error input, .field--error textarea { border-color: #e5484d; }
.field__error { display: block; margin-top: .3rem; color: #e5484d; font-size: .85rem; }

.alert { padding: .9rem 1.1rem; border-radius: 12px; margin-bottom: 1.2rem; font-weight: 600; }
.alert--success { background: #e7f8ef; color: #18794e; }
.alert--error { background: #fdecec; color: #c62828; }

.socials { display: flex; gap: .6rem; flex-wrap: wrap; }
.socials a {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: rgba(255, 106, 26, .12); color: var(--primary-dark); transition: background .2s, color .2s, transform .2s;
}
.socials a:hover { background: var(--grad); color: var(--white); transform: translateY(-3px); }
.socials svg { width: 20px; height: 20px; }

/* ---------- Footer ---------- */
.footer { background: var(--dark); color: rgba(255, 255, 255, .7); padding-top: 4rem; }
.footer__inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding-bottom: 3rem; }
.footer__brand p { margin-top: 1rem; max-width: 360px; }
.footer__col h4 { color: var(--white); margin-bottom: 1rem; font-size: 1.05rem; }
.footer__col ul { display: grid; gap: .5rem; margin-bottom: 1rem; }
.footer__col li[dir="ltr"] { text-align: right; }
.footer__col a:hover { color: var(--primary); }
.footer .socials a { background: rgba(255, 255, 255, .08); color: var(--white); }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding-block: 1.25rem; text-align: center; font-size: .9rem; }
.footer__bottom a { color: var(--primary); }

/* ---------- Back to top ---------- */
.to-top {
  position: fixed; left: 1.5rem; bottom: 1.5rem; z-index: 90; width: 48px; height: 48px;
  border: 0; border-radius: 14px; background: var(--grad); color: var(--white); cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 10px 24px rgba(255, 106, 26, .4);
  opacity: 0; visibility: hidden; transform: translateY(20px); transition: .3s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 24px; height: 24px; stroke-width: 2.5; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; transition-delay: calc(var(--delay, 0) * 120ms); }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero__gear { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .services__grid { grid-template-columns: 1fr 1fr; }
  .about__inner, .contact__grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .burger { display: flex; }
  .nav {
    position: fixed; top: var(--header-h); inset-inline: 0; flex-direction: column; align-items: stretch; gap: 1rem;
    padding: 1.25rem; background: rgba(20, 22, 31, .98);
    transform: translateY(-120%); opacity: 0; pointer-events: none; transition: transform .35s, opacity .35s;
  }
  .nav.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav__list { flex-direction: column; }
  .nav__link { padding: .75rem 1rem; }
  .nav__link.active::after { display: none; }
}
@media (max-width: 600px) {
  .section { padding-block: 4rem; }
  .services__grid, .footer__inner { grid-template-columns: 1fr; }
  .contact__info, .contact__form { padding: 1.4rem; }
  .stat strong { font-size: 1.7rem; }
}
