@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #07123d;
  --muted: #56627f;
  --line: rgba(20, 40, 85, 0.14);
  --blue: #086dff;
  --blue-dark: #031257;
  --cyan: #19c6ff;
  --mint: #20d6a3;
  --paper: #fbfdff;
  --soft: #eef6ff;
  --panel: rgba(255, 255, 255, 0.82);
  --shadow: 0 24px 80px rgba(5, 28, 76, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 8%, rgba(25, 198, 255, 0.18), transparent 28rem),
    radial-gradient(circle at 82% 22%, rgba(32, 214, 163, 0.14), transparent 24rem),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 46%, #f4f8ff 100%);
  font-family: Vazirmatn, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  direction: rtl;
  text-align: right;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  min-height: 100vh;
  overflow: hidden;
}

.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 50%;
  display: grid;
  width: min(1180px, calc(100% - 32px));
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 42px rgba(7, 18, 61, 0.08);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
  direction: rtl;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: 168px;
}

.brand img,
.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #33405f;
  font-size: 0.92rem;
  font-weight: 650;
}

.nav-links a,
.nav-cta,
.button {
  min-height: 42px;
  border-radius: 8px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
}

.nav-links a:hover {
  background: rgba(8, 109, 255, 0.08);
  color: var(--blue-dark);
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  padding: 0 16px;
  color: #ffffff;
  background: var(--blue-dark);
  font-weight: 750;
}

.hero {
  position: relative;
  min-height: min(100vh, 980px);
  padding: 128px 24px 54px;
}

#flow-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero::after {
  position: absolute;
  left: -18vw;
  bottom: -28vw;
  width: 58vw;
  max-width: 760px;
  aspect-ratio: 1;
  border: 1px solid rgba(8, 109, 255, 0.12);
  border-radius: 999px;
  content: "";
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1180px, 100%);
  min-height: min(calc(100vh - 182px), 760px);
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
  margin: 0 auto;
}

.hero-copy {
  animation: enter-up 760ms ease both;
}

.hero-logo {
  width: min(330px, 72vw);
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 22px;
  font-size: clamp(3rem, 5.5vw, 5.2rem);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 1.18;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.18rem;
  line-height: 1.2;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.7vw, 1.24rem);
  line-height: 1.7;
}

.hero-actions,
.metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.hero-actions {
  margin-top: 34px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  font-weight: 780;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #003eaa);
  box-shadow: 0 18px 34px rgba(8, 109, 255, 0.24);
}

.button.secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.metrics {
  margin-top: 34px;
  color: var(--muted);
}

.metrics span {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.metrics strong {
  color: var(--ink);
}

.gateway-stage {
  position: relative;
  display: grid;
  min-height: 580px;
  align-items: center;
  animation: enter-up 860ms 120ms ease both;
}

.gateway-stage::before,
.gateway-stage::after {
  position: absolute;
  left: 15%;
  right: 15%;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(8, 109, 255, 0.48), rgba(32, 214, 163, 0.44), transparent);
  content: "";
}

.gateway-stage::before {
  top: 36%;
  transform: rotate(14deg);
}

.gateway-stage::after {
  bottom: 34%;
  transform: rotate(-13deg);
}

.gateway-card,
.node {
  position: absolute;
  z-index: 2;
  display: grid;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.gateway-card {
  left: 50%;
  top: 50%;
  width: min(320px, 58vw);
  min-height: 340px;
  place-items: center;
  padding: 28px;
  text-align: center;
  transform: translate(-50%, -50%);
}

.gateway-card img {
  width: min(178px, 42vw);
  height: auto;
  mix-blend-mode: multiply;
  animation: pulse-mark 3.2s ease-in-out infinite;
}

.gateway-card span,
.node span {
  color: var(--blue-dark);
  font-size: 1.02rem;
  font-weight: 850;
}

.gateway-card small,
.node small {
  color: var(--muted);
  display: block;
  font-size: 0.84rem;
  line-height: 1.45;
  max-width: 100%;
}

.node {
  width: 182px;
  min-height: 104px;
  padding: 20px;
}

.node.client {
  right: 0;
  top: 20%;
}

.node.services {
  left: 0;
  bottom: 18%;
}

.packet {
  position: absolute;
  z-index: 3;
  width: 13px;
  height: 13px;
  border-radius: 99px;
  background: var(--mint);
  box-shadow: 0 0 0 8px rgba(32, 214, 163, 0.14), 0 0 30px rgba(32, 214, 163, 0.72);
}

.packet-a {
  animation: packet-one 4s linear infinite;
}

.packet-b {
  animation: packet-two 4.8s 700ms linear infinite;
}

.packet-c {
  background: var(--blue);
  animation: packet-three 5.4s 1.2s linear infinite;
}

.section,
.traffic-section,
.deploy-section {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 84px 0;
}

.section-heading {
  max-width: 830px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 42px;
}

.feature {
  min-height: 280px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 54px rgba(7, 18, 61, 0.07);
  transition: transform 180ms ease, border-color 180ms ease;
}

.feature:hover {
  border-color: rgba(8, 109, 255, 0.35);
  transform: translateY(-6px);
}

.feature-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-bottom: 34px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--blue-dark);
  font-size: 0.78rem;
  font-weight: 850;
}

.feature p,
.traffic-copy p,
.deploy-list p {
  color: var(--muted);
  line-height: 1.68;
}

.traffic-section {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(360px, 1.15fr);
  align-items: center;
  gap: 42px;
}

.traffic-copy {
  max-width: 560px;
}

.terminal {
  overflow: hidden;
  border: 1px solid rgba(9, 23, 73, 0.18);
  border-radius: 8px;
  background: #07123d;
  box-shadow: var(--shadow);
  direction: ltr;
  text-align: left;
}

.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.terminal-bar span {
  width: 11px;
  height: 11px;
  border-radius: 20px;
  background: #20d6a3;
}

.terminal-bar span:nth-child(2) {
  background: #19c6ff;
}

.terminal-bar span:nth-child(3) {
  background: #ffcf5a;
}

pre {
  margin: 0;
  padding: 26px;
  overflow-x: auto;
  color: #d8ecff;
  font: 600 0.96rem/2.05 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.deploy-section {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
  gap: 48px;
  align-items: start;
  padding-bottom: 120px;
}

.deploy-list {
  display: grid;
  gap: 14px;
}

.deploy-list p {
  margin: 0;
  padding: 22px;
  border-right: 4px solid var(--blue);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 44px rgba(7, 18, 61, 0.06);
}

.site-footer {
  position: relative;
  z-index: 2;
  padding: 0 24px 34px;
}

.footer-content {
  display: flex;
  width: min(1180px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: grid;
  gap: 12px;
  max-width: 440px;
}

.footer-brand img {
  display: block;
  width: 172px;
  height: auto;
  mix-blend-mode: multiply;
}

.footer-brand p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.trust-seal {
  display: inline-flex;
  width: 112px;
  min-width: 112px;
  min-height: 112px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 36px rgba(7, 18, 61, 0.07);
}

.trust-seal img {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: pointer;
}

@keyframes enter-up {
  from {
    transform: translateY(22px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes pulse-mark {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes packet-one {
  0% {
    left: 88%;
    top: 30%;
    opacity: 0;
  }
  15%,
  90% {
    opacity: 1;
  }
  48% {
    left: 49%;
    top: 45%;
  }
  100% {
    left: 9%;
    top: 66%;
    opacity: 0;
  }
}

@keyframes packet-two {
  0% {
    left: 82%;
    top: 70%;
    opacity: 0;
  }
  15%,
  88% {
    opacity: 1;
  }
  50% {
    left: 51%;
    top: 52%;
  }
  100% {
    left: 12%;
    top: 27%;
    opacity: 0;
  }
}

@keyframes packet-three {
  0% {
    left: 10%;
    top: 23%;
    opacity: 0;
  }
  15%,
  82% {
    opacity: 1;
  }
  48% {
    left: 50%;
    top: 50%;
  }
  100% {
    left: 85%;
    top: 62%;
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero-grid,
  .traffic-section,
  .deploy-section {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: auto;
  }

  .gateway-stage {
    min-height: 520px;
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-content {
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .topbar {
    width: min(100% - 20px, 1180px);
    margin-top: 10px;
    padding: 10px;
  }

  .brand {
    width: 142px;
  }

  .nav-cta {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.9rem;
  }

  .hero {
    min-height: auto;
    padding: 104px 18px 34px;
  }

  h1 {
    font-size: clamp(2.45rem, 12.5vw, 3.65rem);
  }

  .hero-text {
    font-size: 1rem;
  }

  .gateway-stage {
    min-height: 470px;
  }

  .node {
    width: 150px;
    min-height: 92px;
    padding: 16px;
  }

  .gateway-card {
    width: min(250px, 70vw);
    min-height: 284px;
  }

  .section,
  .traffic-section,
  .deploy-section {
    width: min(100% - 36px, 1180px);
    padding: 58px 0;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .feature {
    min-height: 230px;
  }

  pre {
    padding: 20px;
    font-size: 0.78rem;
  }

  .site-footer {
    padding: 0 18px 28px;
  }

  .footer-content {
    flex-direction: column;
    padding: 22px 0 0;
  }
}
