/* =========================================================================
 * shared/css/base.css — Shared styles: design tokens, global nav, landing
 * Loaded after each tool's stylesheet so the nav rules take precedence.
 * Tokens intentionally mirror the tool stylesheets to avoid conflicts.
 * ========================================================================= */

@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/Vazirmatn-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "FA6";
  src: url("../fonts/fa-solid-900.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: block;
  unicode-range: U+f000-f8ff;
}

:root {
  --bg: #0f1117;
  --panel: #171a23;
  --panel-2: #1e2230;
  --border: #2a2f40;
  --text: #e8eaf2;
  --muted: #9aa1b5;
  --accent: #6c8cff;
  --accent-2: #8f6cff;
  --radius: 12px;
  --nav-h: 60px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0;
  padding-top: var(--nav-h);
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* -------------------------------- Icons -------------------------------- */
.ic {
  font-family: "FA6";
  font-weight: 900;
  font-style: normal;
  display: inline-block;
  min-width: 1.1em;
  text-align: center;
}

.ic-bars::before { content: "\f0c9"; }
.ic-close::before { content: "\f00d"; }
.ic-chevron-down::before { content: "\f078"; }
.ic-arrow-left::before { content: "\f060"; }
.ic-wrench::before { content: "\f0ad"; }
.ic-bolt::before { content: "\f0e7"; }
.ic-globe::before { content: "\f0ac"; }
.ic-rocket::before { content: "\f135"; }
.ic-check-circle::before { content: "\f058"; }
.ic-home::before { content: "\f015"; }
.ic-layers::before { content: "\f5fd"; }
.ic-palette::before { content: "\f53f"; }
.ic-font::before { content: "\f031"; }
.ic-fontsize::before { content: "\f034"; }
.ic-vector::before { content: "\f125"; }
.ic-download::before { content: "\f019"; }
.ic-upload::before { content: "\f093"; }
.ic-image::before { content: "\f03e"; }
.ic-code::before { content: "\f121"; }
.ic-expand::before { content: "\f065"; }
.ic-gradient::before { content: "\f1fc"; }
.ic-stroke::before { content: "\f5aa"; }
.ic-shadow::before { content: "\f24d"; }
.ic-hand::before { content: "\f256"; }
.ic-align-right::before { content: "\f038"; }
.ic-align-center::before { content: "\f037"; }
.ic-align-left::before { content: "\f036"; }

/* ================================= Nav ================================= */
.tnav {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 900;
  height: var(--nav-h);
  background: rgba(15, 17, 23, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tnav::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(108, 140, 255, 0.55),
    rgba(143, 108, 255, 0.45),
    transparent
  );
}

.tnav-inner {
  height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 28px);
  display: flex;
  align-items: center;
  gap: 16px;
}

.tnav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
}

.tnav-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px rgba(108, 140, 255, 0.8);
}

.tnav-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.tnav-name b {
  font-weight: 900;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tnav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}

.tnav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.tnav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.tnav-link.active {
  color: #fff;
  background: rgba(108, 140, 255, 0.16);
  border-color: rgba(108, 140, 255, 0.4);
}

.tnav-link .ic { font-size: 11px; transition: transform 0.2s; }
.tnav-dd.open .tnav-dd-btn .ic-chevron-down { transform: rotate(180deg); }

/* ---------------------------- Tools dropdown ---------------------------- */
.tnav-dd { position: relative; }

.tnav-panel {
  position: absolute;
  top: calc(100% + 14px);
  inset-inline-end: 0;
  width: min(540px, calc(100vw - 28px));
  padding: 10px;
  border-radius: 18px;
  background: rgba(20, 23, 34, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  box-shadow: 0 30px 70px -25px rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.tnav-dd.open .tnav-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.tnav-panel::before {
  content: "";
  position: absolute;
  top: -14px;
  inset-inline: 0;
  height: 14px;
}

.tnav-tools {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tnav-tool {
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s, background 0.15s;
}

.tnav-tool:hover,
.tnav-tool.current {
  border-color: rgba(108, 140, 255, 0.4);
  background: rgba(108, 140, 255, 0.08);
}

.tnav-tool-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-decoration: none;
  color: var(--text);
}

.tnav-tool-ic {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  background-color: var(--c, var(--accent));
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
}

.tnav-tool-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tnav-tool-txt b { font-size: 14px; font-weight: 700; }
.tnav-tool-txt small {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tnav-tool-go {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.18s, color 0.18s;
}

.tnav-tool-head:hover .tnav-tool-go { color: var(--accent); transform: translateX(-4px); }

.tnav-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px;
}

.tnav-sub a {
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #12141c;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}

.tnav-sub a:hover,
.tnav-sub a.active { color: #fff; border-color: var(--accent); }

.tnav-panel-foot {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--muted);
}

/* ------------------------------- Mobile ------------------------------- */
.tnav-burger {
  display: none;
  margin-inline-start: auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  place-items: center;
}

.tnav-burger:hover { border-color: var(--accent); }

.tnav-drawer {
  position: fixed;
  top: var(--nav-h);
  right: 0;
  left: 0;
  z-index: 899;
  max-height: calc(100dvh - var(--nav-h));
  overflow-y: auto;
  padding: 14px;
  background: rgba(15, 17, 23, 0.97);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.tnav-drawer.open { opacity: 1; visibility: visible; transform: none; }

.tnav-drawer .tnav-link {
  width: 100%;
  justify-content: space-between;
  height: 44px;
  margin-bottom: 6px;
}

.tnav-drawer .tnav-tools { gap: 8px; }
.tnav-drawer .tnav-tool-txt small { white-space: normal; }

@media (max-width: 880px) {
  .tnav-menu { display: none; }
  .tnav-burger { display: grid; }
}

/* =============================== Landing =============================== */
body.landing { overflow-x: hidden; }

body.landing::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 520px at 88% -8%, rgba(108, 140, 255, 0.22), transparent 62%),
    radial-gradient(760px 520px at 6% 12%, rgba(143, 108, 255, 0.18), transparent 62%),
    radial-gradient(900px 620px at 50% 115%, rgba(64, 190, 255, 0.12), transparent 60%);
}

body.landing::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blob {
  position: fixed;
  z-index: -1;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  pointer-events: none;
  animation: drift 26s ease-in-out infinite alternate;
}

.blob-1 { top: 8%; right: -80px; background: #6c8cff; }
.blob-2 { bottom: 5%; left: -100px; background: #8f6cff; animation-delay: -12s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-40px, 50px, 0) scale(1.15); }
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(30px, 7vh, 76px) clamp(16px, 4vw, 32px) 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
}

.eyebrow .ic { color: var(--accent); font-size: 11px; }

.hero h1 {
  margin: 20px 0 10px;
  font-size: clamp(30px, 6vw, 56px);
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 55%, #4fd1ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: clamp(14px, 1.6vw, 16.5px);
  line-height: 2.1;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12.5px;
}

.hero-stats span { display: inline-flex; align-items: center; gap: 7px; }
.hero-stats .ic { color: var(--accent); font-size: 11px; }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: 46px 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.sec-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.sec-head span { color: var(--muted); font-size: 12.5px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.tcard {
  position: relative;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tcard::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(420px 200px at var(--mx, 50%) 0%, rgba(108, 140, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.tcard:hover {
  transform: translateY(-6px);
  border-color: rgba(108, 140, 255, 0.55);
  box-shadow: 0 30px 60px -28px rgba(108, 140, 255, 0.7);
}

.tcard:hover::before { opacity: 1; }

.tcard > a {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 22px;
  text-decoration: none;
  color: inherit;
}

.tcard-ic {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  background-color: var(--c, var(--accent));
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));
  box-shadow: 0 14px 34px -16px var(--c, var(--accent));
}

.tcard h3 { margin: 10px 0 0; font-size: 18px; font-weight: 700; }
.tcard p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.95; }

.tcard-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
}

.tcard-tags li {
  font-size: 11px;
  color: var(--muted);
  background: #12141c;
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
}

.tcard-cta {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.tcard-cta .ic { transition: transform 0.18s; }
.tcard:hover .tnav-tool-go,
.tcard:hover .tcard-cta .ic { transform: translateX(-5px); }

.tcard.soon {
  border-style: dashed;
  background: none;
  opacity: 0.75;
}

.tcard.soon > a { cursor: default; }

.empty-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}

.foot {
  max-width: 1200px;
  margin: 54px auto 0;
  padding: 22px clamp(16px, 4vw, 32px) 34px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12.5px;
}

.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
