/* ---------- Fonts ---------- */
@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/vazirmatn-arabic.woff2) format("woff2");
  unicode-range: U+6??, U+750-77F, U+870-88E, U+890-891, U+897-8E1, U+8E3-8FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: Vazirmatn;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/vazirmatn-latin.woff2) format("woff2");
  unicode-range: U+??, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+??, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin.woff2) format("woff2");
  unicode-range: U+??, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Design tokens ---------- */
:root {
  --ink: #05060f;
  --ink-2: #0a0c1c;
  --surface: #0d1024;
  --line: #1e2242;
  --brand: #38e8ff;
  --brand-2: #7c5cff;
  --brand-3: #ff5cc8;
  --accent: #4ade80;
  --fg: #eef1ff;
  --muted: #9aa2c6;
  --faint: #5b6390;

  --font-sans: Vazirmatn, Inter, ui-sans-serif, system-ui, sans-serif;
  --font-latin: Inter, Vazirmatn, ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --radius: 1.25rem;
  --radius-lg: 1.75rem;
  --gutter: clamp(1rem, 3vw, 1.5rem);
  --section-gap: clamp(5rem, 11vw, 9rem);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --gradient: linear-gradient(90deg, var(--brand), var(--brand-2) 55%, var(--brand-3));

  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; border-color: var(--line); }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.8;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { display: block; }

::selection { background: color-mix(in oklab, var(--brand) 40%, transparent); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--brand-2), var(--brand));
  border: 2px solid var(--ink);
  border-radius: 999px;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: .5rem;
}

.skip-link {
  position: fixed;
  inset-block-start: .75rem;
  inset-inline-start: .75rem;
  z-index: 100;
  padding: .6rem 1rem;
  border-radius: .75rem;
  background: var(--fg);
  color: var(--ink);
  font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.container {
  width: 100%;
  max-width: calc(80rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Latin brand names and identifiers inside Persian copy */
.latin { font-family: var(--font-latin); }
.mono { font-family: var(--font-mono); }

/* ---------- Shared visual language ---------- */
.glass {
  background: rgb(13 16 36 / .6);
  border: 1px solid rgb(255 255 255 / .08);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grid-bg {
  background-image:
    linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px),
    linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(80% 60% at 50% 0, #000 40%, transparent 100%);
  mask-image: radial-gradient(80% 60% at 50% 0, #000 40%, transparent 100%);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .95rem 1.6rem;
  border-radius: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  transition: transform .25s var(--ease), background-color .25s, box-shadow .25s;
}
.btn svg { width: 1.2rem; height: 1.2rem; transition: transform .25s var(--ease); }
.btn:hover svg { transform: translateY(2px); }
.btn:active { transform: scale(.98); }

.btn-primary {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  color: var(--ink);
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--brand) 30%, transparent),
    0 20px 60px -20px color-mix(in oklab, var(--brand) 45%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost:hover { background: rgb(255 255 255 / .05); }
html:not(.can-install) [data-install] { display: none; }

.install-help {
  width: min(calc(100% - 2rem), 26rem);
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--ink-2);
  color: var(--fg);
}
.install-help::backdrop { background: rgb(5 6 15 / .75); }
.install-help h2 { font-size: 1.15rem; font-weight: 700; line-height: 1.6; }
.install-help ol { display: grid; gap: .5rem; margin-block: 1rem; padding-inline-start: 1.25rem; list-style: persian; font-size: .92rem; }
.install-help .btn { width: 100%; padding-block: .7rem; }

/* ---------- Header ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  height: 2px;
  background: linear-gradient(270deg, var(--brand), var(--brand-2), var(--brand-3));
  transform: scaleX(var(--progress, 0));
  transform-origin: right;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding-block: 1rem;
  transition: padding .4s var(--ease);
}

.header-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background-color .4s, border-color .4s, box-shadow .4s;
}

.site-header.is-scrolled { padding-block: .5rem; }
.site-header.is-scrolled .header-bar,
.site-header.is-open .header-bar {
  background: rgb(13 16 36 / .72);
  border-color: rgb(255 255 255 / .08);
  box-shadow: 0 16px 50px -24px color-mix(in oklab, var(--brand) 50%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.logo { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.logo-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: .75rem;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.logo-mark svg { position: relative; width: 1.25rem; height: 1.25rem; }
.logo-mark::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in oklab, var(--brand) 40%, transparent);
  animation: pulse-ring 3s ease-out infinite;
}
.logo-text { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }

.main-nav { display: flex; align-items: center; gap: .25rem; }
.main-nav a {
  padding: .45rem .85rem;
  border-radius: .6rem;
  color: var(--muted);
  font-size: .875rem;
  transition: color .2s;
}
.main-nav a:hover { color: var(--fg); }
.main-nav a.nav-login {
  margin-inline-start: .5rem;
  background: var(--fg);
  color: var(--ink);
  font-weight: 600;
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .75rem;
}
.menu-toggle svg { width: 1.25rem; height: 1.25rem; }

@keyframes pulse-ring {
  0% { opacity: .7; transform: scale(.9); }
  70%, 100% { opacity: 0; transform: scale(1.6); }
}

@media (min-width: 40rem) and (max-width: 72rem) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 62rem) {
  .menu-toggle { display: grid; }

  .main-nav {
    position: absolute;
    inset-block-start: calc(100% + .5rem);
    inset-inline: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: .5rem;
    border: 1px solid rgb(255 255 255 / .08);
    border-radius: var(--radius);
    background: var(--surface);
  }
  .main-nav a { padding: .75rem 1rem; font-size: 1rem; color: var(--fg); }
  .site-header.is-open .main-nav { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 62svh;
  padding-block: clamp(7rem, 12vh, 9rem) clamp(2rem, 5vh, 3.5rem);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 10rem;
  background: linear-gradient(to top, var(--ink), transparent);
  pointer-events: none;
}

.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.aurora i {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  animation: aurora 18s ease-in-out infinite;
}
.aurora i:nth-child(1) {
  inset-block-start: -10rem;
  left: 25%;
  width: 38rem;
  height: 38rem;
  background: color-mix(in oklab, var(--brand) 20%, transparent);
}
.aurora i:nth-child(2) {
  inset-block-start: 33%;
  right: -8rem;
  width: 34rem;
  height: 34rem;
  background: color-mix(in oklab, var(--brand-2) 20%, transparent);
  animation-delay: -6s;
}
.aurora i:nth-child(3) {
  inset-block-end: -10rem;
  left: 2.5rem;
  width: 30rem;
  height: 30rem;
  background: color-mix(in oklab, var(--brand-3) 10%, transparent);
  animation-delay: -12s;
}
@keyframes aurora {
  0%, 100% { opacity: .75; transform: translate(0) scale(1); }
  50% { opacity: 1; transform: translate(4%, -6%) scale(1.15); }
}

.hero-grid { position: absolute; inset: 0; pointer-events: none; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .7; pointer-events: none; }

.hero-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2.5rem, 5vw, 4.5rem);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem 1rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: .875rem;
}
.hero-badge svg { width: 1rem; height: 1rem; color: var(--brand); }

.hero-title {
  margin-block-start: 1.5rem;
  font-size: clamp(1.75rem, 1rem + 2.75vw, 3.6rem);
  font-weight: 800;
  line-height: 1.3;
}
.hero-title .text-gradient { padding-block-end: .1em; }

.hero-lead {
  max-width: 38rem;
  margin-block-start: 1.5rem;
  color: var(--muted);
  font-size: clamp(1.02rem, .98rem + .25vw, 1.15rem);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-block-start: 2.25rem; }

@media (max-width: 62rem) {
  .hero { min-height: 0; }
  .hero-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Workspace window */
.workspace-window {
  position: relative;
  min-width: 0;
  border: 1px solid rgb(255 255 255 / .1);
  border-radius: var(--radius-lg);
  background: rgb(10 12 28 / .78);
  box-shadow:
    0 0 0 1px color-mix(in oklab, var(--brand) 12%, transparent),
    0 24px 70px -30px color-mix(in oklab, var(--brand-2) 70%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem 1.1rem;
  border-block-end: 1px solid rgb(255 255 255 / .07);
}
.window-dots { display: flex; gap: .35rem; }
.window-dots i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--line); }
.window-title { flex: 1; min-width: 0; overflow: hidden; color: var(--muted); font-size: .75rem; white-space: nowrap; text-overflow: ellipsis; }

.terminal {
  padding: .9rem 1.1rem 1.1rem;
  font-size: clamp(.66rem, .6rem + .3vw, .8rem);
  line-height: 1.95;
  text-align: left;
  overflow: hidden;
}
.terminal p { min-height: 1.95em; white-space: pre; }
.t-prompt { color: var(--brand); }
.t-agent { color: #a896ff; }
.t-human { color: var(--brand-3); }
.t-ok { color: var(--accent); }
.t-dim { color: var(--muted); }

/* Lines keep their height while hidden so the window never resizes */
.terminal.is-running [data-pending] { visibility: hidden; }
.terminal .is-typing::after {
  content: "";
  display: inline-block;
  width: .55em;
  height: 1em;
  margin-inline-start: 1px;
  background: var(--brand);
  vertical-align: text-bottom;
}

/* ---------- Sections ---------- */
.section { padding-block-start: var(--section-gap); }

.section-head { max-width: 46rem; margin-block-end: clamp(2.5rem, 5vw, 4rem); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .2rem .8rem;
  border: 1px solid color-mix(in oklab, var(--brand) 25%, transparent);
  border-radius: 999px;
  background: color-mix(in oklab, var(--brand) 8%, transparent);
  color: var(--brand);
  font-size: .78rem;
  font-weight: 600;
}
.eyebrow::before {
  content: "";
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: currentColor;
}

.section-title {
  margin-block-start: 1rem;
  font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.25;
  text-wrap: balance;
}

.section-lead {
  margin-block-start: 1rem;
  color: var(--muted);
  font-size: clamp(1rem, .95rem + .3vw, 1.15rem);
}

/* ---------- Tools ---------- */
.tools-section { padding-block-start: clamp(3rem, 6vw, 5rem); }

/* New tools flow into this grid without further layout changes */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr));
  gap: 1.25rem;
}
.tool-grid > li { display: flex; }
.tool { display: flex; flex: 1; flex-direction: column; }
.tool:hover .tool-link svg { transform: translate(2px, -2px); }

.tool-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 12rem;
  padding: 1.5rem;
  border-block-end: 1px solid var(--line);
  background: radial-gradient(70% 90% at 50% 0, color-mix(in oklab, var(--brand-2) 14%, transparent), transparent 70%);
}
.tool-body { display: flex; flex: 1; flex-direction: column; padding: 1.5rem; }
.tool-body h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.5; }
.tool-body p { margin-block: .5rem 1.25rem; color: var(--muted); font-size: .94rem; line-height: 1.85; }
.tool-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .4rem;
  margin-block-start: auto;
  color: var(--brand);
  font-size: .82rem;
}
.tool-link svg { flex-shrink: 0; width: 1rem; height: 1rem; transition: transform .25s var(--ease); }

/* Tool visuals */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; width: 100%; max-width: 16rem; }
.kanban div {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  min-height: 7.25rem;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--ink-2);
}
.kanban i { display: block; height: 1.3rem; border-radius: .35rem; background: var(--line); }
.kanban .is-brand { background: color-mix(in oklab, var(--brand) 55%, var(--line)); }
.kanban .is-violet { background: color-mix(in oklab, var(--brand-2) 75%, var(--line)); }
.kanban .is-ok { background: color-mix(in oklab, var(--accent) 35%, var(--line)); }

.slots { display: grid; gap: .5rem; width: 100%; max-width: 13rem; font-size: .84rem; }
.slots li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--ink-2);
  line-height: 1.6;
}
.slots i {
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.commit-graph { width: 100%; max-width: 16rem; }

.cloud-mock { display: grid; gap: .5rem; width: 100%; max-width: 13rem; font-size: .72rem; }
.cloud-mock li {
  display: grid;
  gap: .3rem;
  padding: .4rem .7rem;
  border: 1px solid var(--line);
  border-radius: .7rem;
  background: var(--ink-2);
  line-height: 1.6;
}
.cloud-mock i { display: block; height: .25rem; border-radius: 1rem; background: var(--line); }
.cloud-mock i.is-done { background: var(--accent); }
.cloud-mock i.is-half { background: linear-gradient(90deg, var(--brand) 55%, var(--line) 55%); }

/* ---------- Teams ---------- */
.teams {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}
.card.team { overflow: visible; padding: 1.6rem; }
.team-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: color-mix(in oklab, var(--brand-2) 22%, var(--ink-2));
  color: var(--brand);
}
.team-icon svg { width: 1.4rem; height: 1.4rem; }
.team h3 { margin-block-start: 1rem; font-size: 1.15rem; font-weight: 700; line-height: 1.6; }
.team > p { color: var(--muted); font-size: .92rem; }

/* Each team connects down to the shared tools bar */
.team::after {
  content: "";
  position: absolute;
  inset-block-start: 100%;
  left: 50%;
  width: 2px;
  height: 2.5rem;
  background: linear-gradient(var(--line), color-mix(in oklab, var(--brand) 60%, var(--line)));
}

.team-bus {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  margin-block-start: 2.5rem;
  padding: 1rem 1.5rem;
  border: 1px solid color-mix(in oklab, var(--brand) 35%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(90deg, color-mix(in oklab, var(--brand-2) 18%, var(--ink-2)), color-mix(in oklab, var(--brand) 12%, var(--ink-2)));
  font-weight: 600;
}
.team-bus ul { display: flex; flex-wrap: wrap; gap: .5rem; font-size: .8rem; font-weight: 500; }
.team-bus li { padding: .1rem .7rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--ink-2); }

@media (max-width: 44rem) {
  .teams { grid-template-columns: minmax(0, 1fr); }
  .team::after { height: 1.25rem; }
  .team-bus { margin-block-start: 1.25rem; }
}

/* ---------- Cards ---------- */
.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgb(13 16 36 / .85), rgb(10 12 28 / .85));
  overflow: hidden;
  transition: border-color .35s;
}
.card:hover { border-color: color-mix(in oklab, var(--brand) 35%, var(--line)); }

/* ---------- Footer ---------- */
.site-footer { margin-block-start: var(--section-gap); padding-block: 3rem 2rem; border-block-start: 1px solid var(--line); }
.footer-layout { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.footer-tagline { margin-block-start: .85rem; color: var(--muted); font-size: .9rem; }
.footer-version { margin-block-start: .25rem; color: var(--muted); font-size: .78rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.footer-nav a { color: var(--muted); font-size: .9rem; transition: color .2s; }
.footer-nav a:hover { color: var(--fg); }

/* ---------- Reveal on scroll and card glow ---------- */
@media screen and (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(1.5rem);
    transition: opacity .7s var(--ease), transform .7s var(--ease), border-color .35s;
  }
  .js [data-reveal].is-visible { opacity: 1; transform: none; }
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  background: radial-gradient(22rem circle at var(--mx, 50%) var(--my, 50%), color-mix(in oklab, var(--brand) 11%, transparent), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.card > * { position: relative; z-index: 1; }
@media (hover: hover) {
  .card:hover::before { opacity: 1; }
}

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