:root {
  --bg: #070912;
  --bg-soft: #0e1220;
  --card: rgba(255, 255, 255, 0.04);
  --card-border: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: #9aa3b8;
  --primary: #6c5ce7;
  --primary-2: #00d1b2;
  --danger: #ff5f7a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(16, 20, 40, 0.08);
  --text: #12162a;
  --muted: #5b6478;
  --shadow: 0 18px 45px rgba(20, 25, 50, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: "Vazirmatn", "IRANSans", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); font-size: 0.9em; }

.inline-link {
  color: var(--primary-2);
  border-bottom: 1px dashed currentColor;
}

/* ---------- ambient glows ---------- */
.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}
.glow-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, var(--primary), transparent 65%);
  top: -180px; right: -120px;
}
.glow-2 {
  width: 460px; height: 460px;
  background: radial-gradient(circle, var(--primary-2), transparent 65%);
  bottom: -160px; left: -140px;
  opacity: 0.3;
}

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 48px);
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--card-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 800;
}

.php-chip {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  direction: ltr;
  font-family: var(--mono);
}

.nav-links {
  display: flex;
  gap: 22px;
  margin-inline-start: auto;
  font-size: 0.95rem;
  color: var(--muted);
}
.nav-links a { transition: color 0.2s; }
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--text); }

.theme-toggle {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.theme-toggle:hover { transform: scale(1.08); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(48px, 9vw, 100px) clamp(16px, 4vw, 32px) 40px;
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 22px;
}

.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.6rem);
  line-height: 1.35;
  margin: 0 0 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.grad {
  display: block;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 660px;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.6vw, 1.08rem);
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 46px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #8b7bff);
  color: #fff;
  box-shadow: 0 10px 26px rgba(108, 92, 231, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(108, 92, 231, 0.45); }

.btn-ghost {
  background: var(--card);
  border-color: var(--card-border);
  color: var(--text);
}
.btn-ghost:hover { background: color-mix(in srgb, var(--text) 8%, transparent); }

.full { width: 100%; }

/* ---------- code window ---------- */
.hero-card {
  max-width: 680px;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--bg-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: right;
  direction: ltr;
}
.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--card-border);
  background: rgba(127, 127, 127, 0.06);
}
.dot { width: 11px; height: 11px; border-radius: 50%; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.window-title {
  margin-inline-start: auto;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
  direction: ltr;
}

.hero-card pre {
  margin: 0;
  padding: 20px 22px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.9;
  color: #c9d1e6;
}
.c-key { color: #ff7b9c; }
.c-str { color: #7ee7c7; }
.c-fn { color: #ffd479; }

/* ---------- sections ---------- */
.section {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(46px, 7vw, 84px) clamp(16px, 4vw, 32px);
}

.section-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 6px;
  font-weight: 800;
}
.section-sub { color: var(--muted); margin: 0 0 32px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(8px);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--primary) 45%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}
.card h3 { margin: 12px 0 8px; font-size: 1.05rem; }
.card > p { margin: 0 0 10px; color: var(--muted); font-size: 0.92rem; }

.card-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  font-size: 1.25rem;
}

/* ---------- runtime panel ---------- */
.runtime { margin: 0; font-size: 0.88rem; }
.runtime > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--card-border);
}
.runtime > div:last-child { border-bottom: 0; }
.runtime dt { color: var(--muted); }
.runtime dd { margin: 0; font-weight: 600; font-family: var(--mono); }

.ok-line { color: var(--primary-2); font-size: 0.9rem; }
.err-line { color: var(--danger); font-size: 0.9rem; }

.mini-pre {
  margin: 14px 0 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.9;
  overflow-x: auto;
}

/* ---------- stats ---------- */
.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px clamp(16px, 4vw, 32px);
  border-block: 1px solid var(--card-border);
  text-align: center;
}
.stat .num {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .label { color: var(--muted); font-size: 0.88rem; }

/* ---------- pricing ---------- */
.price-card { display: flex; flex-direction: column; position: relative; }
.price-card h3 { margin: 0 0 4px; }
.price {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 16px;
}
.price small { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.ticks {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}
.ticks li { padding: 5px 0; }
.ticks li::before {
  content: "✓";
  color: var(--primary-2);
  font-weight: 800;
  margin-inline-end: 8px;
}

.featured {
  border-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 25%, transparent), var(--shadow);
}
.tag {
  position: absolute;
  top: -12px;
  inset-inline-start: 20px;
  padding: 3px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ---------- contact ---------- */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 34px;
  align-items: start;
}
.contact-list { list-style: none; padding: 0; margin: 0 0 16px; color: var(--muted); }
.contact-list li { display: flex; gap: 10px; padding: 6px 0; }
.hint { color: var(--muted); font-size: 0.82rem; }

.form { padding: 26px; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input,
.field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  color: var(--text);
  font-family: inherit;
  font-size: 0.93rem;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
}
.field.invalid input,
.field.invalid textarea { border-color: var(--danger); }

.err { display: block; min-height: 18px; color: var(--danger); font-size: 0.78rem; padding-top: 3px; }

/* Honeypot: visible to bots only. */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

.flash {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  text-align: center;
  border: 1px solid transparent;
}
.flash-success {
  background: color-mix(in srgb, var(--primary-2) 16%, transparent);
  border-color: color-mix(in srgb, var(--primary-2) 40%, transparent);
  color: var(--text);
}
.flash-error {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  border-color: color-mix(in srgb, var(--danger) 38%, transparent);
  color: var(--text);
}
.success {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary-2) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-2) 40%, transparent);
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- table ---------- */
.table-wrap { padding: 0; overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 720px;
}
.table thead th {
  text-align: start;
  padding: 14px 16px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}
.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.num-cell { font-family: var(--mono); color: var(--primary-2); width: 64px; }
.email-cell { font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.body-cell { max-width: 420px; color: var(--muted); }
.date-cell { white-space: nowrap; color: var(--muted); font-size: 0.8rem; }
.empty { text-align: center; color: var(--muted); padding: 34px 16px; }

/* ---------- errors ---------- */
.error-page { text-align: center; padding-block: clamp(60px, 10vw, 120px); }
.error-page .lead { margin-inline: auto; }

/* ---------- footer ---------- */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 24px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .nav-links { display: none; }
}
@media (max-width: 820px) {
  .contact-wrap { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .card:hover, .btn-primary:hover { transform: none; }
}
