@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-page: #fafafa;
  --bg-surface: #ffffff;
  --bg-elevated: #f3f4f6;
  --bg-dark: #0f172a;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --brand: #dc2626;
  --brand-dark: #b91c1c;
  --brand-soft: rgba(220, 38, 38, 0.1);
  --status-ok: #10b981;
  --radius: 18px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  overflow-x: hidden;
}

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

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 900;
  font-size: 1.1rem;
  white-space: nowrap;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  background: #fff;
}

.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.94rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--brand);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.94rem;
  padding: 0.68rem 1.3rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #ffffff;
  box-shadow: 0 10px 24px -8px rgba(220, 38, 38, 0.55);
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.btn-dark {
  background: var(--bg-dark);
  color: #ffffff;
}

.btn-dark:hover {
  background: #1e293b;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* Hero */
.hero {
  padding-block: 3.25rem 3.5rem;
  background:
    radial-gradient(620px 320px at 88% 12%, rgba(220, 38, 38, 0.08), transparent 70%),
    radial-gradient(520px 320px at 12% 75%, rgba(15, 23, 42, 0.05), transparent 70%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
}

.badge-live {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.36rem 0.9rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 1.1rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--status-ok);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.pulse-dot.is-red {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16);
}

.hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  font-weight: 900;
  line-height: 1.25;
  color: var(--text-main);
}

.hero h1 .highlight {
  color: var(--brand);
  display: block;
}

.lead {
  margin: 0 0 1.65rem;
  font-size: 1.04rem;
  color: var(--text-muted);
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

/* Status Card */
.status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 1.4rem;
  box-shadow: 0 22px 48px -20px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.status-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.status-card-header img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.dns-box {
  background: var(--bg-elevated);
  border: 1px dashed rgba(220, 38, 38, 0.45);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.dns-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  direction: ltr;
}

.node-list {
  display: grid;
  gap: 0.55rem;
}

.node-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  font-size: 0.86rem;
  font-weight: 600;
}

.node-ping {
  color: var(--status-ok);
  font-weight: 800;
}

/* Dual-Lane Motion Graphic */
.dns-motion-box {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.compare-lane {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 0.95rem 1.15rem;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.compare-lane.is-good {
  border-color: rgba(16, 185, 129, 0.35);
}

.compare-lane.is-bad {
  border-color: rgba(220, 38, 38, 0.25);
}

.lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.lane-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 800;
}

.lane-meta {
  font-size: 0.73rem;
  font-weight: 800;
  padding: 0.16rem 0.6rem;
  border-radius: 999px;
}

.lane-meta.is-good {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.lane-meta.is-bad {
  background: rgba(220, 38, 38, 0.1);
  color: var(--brand);
}

.motion-stage {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.motion-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.32rem;
  min-width: 72px;
}

.node-icon-wrap {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: grid;
  place-items: center;
}

.compare-lane.is-good .motion-node.is-core .node-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.28);
}

.compare-lane.is-bad .motion-node.is-core .node-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(220, 38, 38, 0.25);
}

.compare-lane.is-bad .motion-node.is-dest .node-icon-wrap {
  opacity: 0.45;
  color: var(--brand);
  border-color: rgba(220, 38, 38, 0.35);
}

.core-ring {
  position: absolute;
  inset: -5px;
  border-radius: 18px;
  border: 2px solid rgba(16, 185, 129, 0.45);
  opacity: 0;
  pointer-events: none;
}

.compare-lane.is-bad .core-ring {
  border-color: rgba(220, 38, 38, 0.45);
}

.node-caption {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
}

.motion-pipe {
  position: relative;
  height: 44px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.pipe-track {
  width: 100%;
  height: 2px;
  margin-top: 14px;
  background: repeating-linear-gradient(90deg, rgba(16, 185, 129, 0.35) 0 6px, transparent 6px 12px);
}

.compare-lane.is-bad .pipe-track {
  background: repeating-linear-gradient(90deg, rgba(220, 38, 38, 0.35) 0 6px, transparent 6px 12px);
}

.pipe-tag {
  position: absolute;
  left: 50%;
  top: 2px;
  transform: translateX(-50%);
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 0 0.35rem;
  white-space: nowrap;
}

.packet {
  position: absolute;
  left: 0;
  top: calc(50% + 7px);
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--status-ok);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.65);
  transform: translate(-12px, -50%);
  opacity: 0;
}

.compare-lane.is-bad .packet {
  background: var(--brand);
  box-shadow: 0 0 10px rgba(220, 38, 38, 0.65);
}

@media (prefers-reduced-motion: no-preference) {
  .compare-lane.is-good .packet.p1 { animation: packetFlow 2s cubic-bezier(0.4, 0, 0.2, 1) infinite; }
  .compare-lane.is-good .packet.p2 { animation: packetFlow 2s cubic-bezier(0.4, 0, 0.2, 1) 1s infinite; }
  .compare-lane.is-good .core-ring { animation: corePulse 2.4s ease-out infinite; }
  .compare-lane.is-bad .packet.p1,
  .compare-lane.is-bad .packet.p2 { animation: packetFlow 3.4s linear infinite; }
  .compare-lane.is-bad .motion-pipe.is-fast .packet.p1,
  .compare-lane.is-bad .motion-pipe.is-fast .packet.p2 { animation: packetStall 2.8s ease-in-out infinite; }
  .compare-lane.is-bad .core-ring { animation: corePulse 2.8s ease-out infinite; }
}

@keyframes packetFlow {
  0% { transform: translate(-8px, -50%) scale(0.7); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translate(140px, -50%) scale(0.85); opacity: 0; }
}

@keyframes packetStall {
  0% { transform: translate(-8px, -50%) scale(0.75); opacity: 0; }
  25% { opacity: 1; }
  55% { transform: translate(40px, -50%) scale(0.95); opacity: 0.9; }
  100% { transform: translate(26px, -50%) scale(0.5); opacity: 0; }
}

@keyframes corePulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.25); opacity: 0; }
}

/* Sections */
.section {
  padding-block: 3.5rem;
}

.section-alt {
  background: var(--bg-surface);
  border-block: 1px solid var(--border-color);
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.5rem;
}

.section-header h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 900;
}

.section-header p {
  margin: 0;
  color: var(--text-muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.card h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 800;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* Supported Games & Services Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.game-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.game-card:hover {
  border-color: rgba(220, 38, 38, 0.35);
  transform: translateY(-2px);
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.game-card-top strong {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.35;
  direction: ltr;
  text-align: left;
}

.game-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: var(--brand-soft);
  color: var(--brand);
}

.game-status {
  font-size: 0.78rem;
  font-weight: 700;
  color: #059669;
}

/* Visual Setup Screen Mockups */
.setup-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 1.5rem;
  align-items: center;
}

.device-mockup {
  background: #0f172a;
  color: #f8fafc;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 36px -14px rgba(15, 23, 42, 0.45);
  direction: ltr;
  text-align: left;
  font-size: 0.82rem;
}

.mockup-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.65rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.76rem;
}

.mockup-dots {
  display: inline-flex;
  gap: 5px;
}

.mockup-dots span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
}

.mockup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: 9px;
  margin-bottom: 0.4rem;
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
}

.mockup-row.is-highlight {
  background: rgba(220, 38, 38, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #ffffff;
  font-weight: 700;
}

.mockup-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #34d399;
  font-weight: 800;
}

@media (max-width: 760px) {
  .setup-split {
    grid-template-columns: 1fr;
  }
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.plan-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.plan-card.popular {
  border: 2px solid var(--brand);
  box-shadow: 0 18px 40px -18px rgba(220, 38, 38, 0.25);
}

.plan-price {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--brand);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

/* Tabs */
.tabs-wrap {
  max-width: 780px;
  margin-inline: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.tab-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-main);
}

.tab-btn[aria-selected="true"] {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.steps-list {
  margin: 0;
  padding-inline-start: 1.25rem;
  display: grid;
  gap: 0.65rem;
  color: var(--text-main);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(440px, 100%);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 1.65rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 1.2rem;
}

.form-group {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: 700;
  font-size: 0.9rem;
}

.form-group input {
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  font-family: inherit;
  font-size: 1rem;
}

.modal-alert {
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding-block: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

@media (max-width: 860px) {
  .hero-grid,
  .dns-motion-box {
    grid-template-columns: 1fr;
  }
  .hero-grid > * {
    min-width: 0;
  }
  .nav-links {
    display: none;
  }
}

@media (max-width: 640px) {
  .nav-inner {
    gap: 0.5rem;
    padding-block: 0.65rem;
  }
  .brand {
    font-size: 0.95rem;
    gap: 0.45rem;
  }
  .brand-logo {
    width: 34px;
    height: 34px;
  }
  .site-header .btn {
    padding: 0.42rem 0.7rem;
    font-size: 0.76rem;
    border-radius: 10px;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .dns-box .btn {
    padding: 0.48rem 0.85rem;
    font-size: 0.8rem;
    border-radius: 10px;
  }
  .motion-stage {
    gap: 0.25rem;
  }
  .motion-node {
    min-width: 54px;
  }
  .node-caption {
    font-size: 0.65rem;
  }
}
