/* lachub.ir — shared stylesheet
   Theme: GTA VI / Vice City sunset — neon pink & turquoise over dusk purple */

/* Font loading moved to <link rel="preconnect"> + <link rel="stylesheet">
   in each page's <head> — @import here was render-blocking: the browser
   had to fetch and parse this whole file, discover the @import mid-parse,
   then fire a second serial request to fonts.googleapis.com before ANY
   styles applied. On a slow/high-latency connection that stalls first
   paint long enough that the page looks stuck on a blank blurred background. */

:root {
  --bg: #180a24;
  --bg-deep: #0e0616;
  --bg-raised: #241134;
  --bg-card: #2a1440;
  --line: #4a2a63;
  --line-soft: rgba(255, 111, 199, 0.18);

  --pink: #ff5eb8;
  --pink-hot: #ff2e9f;
  --cyan: #3ef0d8;
  --orange: #ff8a3d;
  --yellow: #ffd23f;
  --purple: #a259ff;

  --text: #fdf3ff;
  --text-dim: #c6a9dd;
  --text-faint: #7c5c95;

  --green: #4ee8a5;
  --red: #ff5470;
  --blue: #4fc3f7;

  --font-display: 'Vazirmatn', sans-serif;
  --font-headline: 'Bebas Neue', 'Vazirmatn', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 1100px 700px at 85% -8%, rgba(255, 94, 184, 0.22), transparent 60%),
    radial-gradient(ellipse 900px 600px at 8% 12%, rgba(62, 240, 216, 0.14), transparent 55%),
    radial-gradient(ellipse 700px 500px at 50% 100%, rgba(162, 89, 255, 0.16), transparent 60%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 45%, #1c0e2c 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-display);
  direction: rtl;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection { background: var(--pink-hot); color: #180a24; }

a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a, label, button, input { -webkit-tap-highlight-color: transparent; outline: none; }
a:focus, label:focus { outline: none; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 58;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(14, 6, 22, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, var(--pink) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar .brand .dot {
  width: 10px;
  height: 10px;
  background: var(--cyan);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 12px 2px rgba(62, 240, 216, 0.7);
}

/* ---------- Burger trigger ---------- */

.burger {
  position: relative;
  z-index: 70;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  flex-shrink: 0;
}

.burger:hover { border-color: rgba(62, 240, 216, 0.5); }

.burger span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
}

/* checkbox-driven state (no JS) */
.nav-toggle {
  position: fixed;
  top: 0;
  right: 0;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-toggle:checked ~ .topbar .burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle:checked ~ .topbar .burger span:nth-child(2) { opacity: 0; }
.nav-toggle:checked ~ .topbar .burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Slide-in nav panel ---------- */

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(10, 4, 16, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.nav-toggle:checked ~ .nav-scrim {
  opacity: 1;
  pointer-events: auto;
}

.topbar nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 65;
  height: 100vh;
  width: min(78vw, 300px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 84px 22px 32px;
  background: linear-gradient(165deg, var(--bg-card) 0%, var(--bg-deep) 100%);
  border-left: 1px solid var(--line-soft);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.85);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-toggle:checked ~ .topbar nav {
  transform: translateX(0);
}

.topbar nav a {
  padding: 13px 18px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  transition: color 0.15s, background 0.15s;
}

.topbar nav a:hover { color: var(--text); background: rgba(255, 94, 184, 0.1); }
.topbar nav a.active {
  color: var(--bg-deep);
  background: linear-gradient(90deg, var(--pink), var(--cyan));
  font-weight: 700;
}

@media (min-width: 720px) {
  .burger { display: none; }

  .nav-scrim { display: none; }

  .topbar nav {
    position: static;
    height: auto;
    width: auto;
    flex-direction: row;
    gap: 6px;
    padding: 0;
    background: none;
    border-left: none;
    box-shadow: none;
    transform: none;
    transition: none;
  }

  .topbar nav a { padding: 8px 16px; font-size: 0.88rem; }
}


/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 100px 28px 76px;
  max-width: 980px;
  margin: 0 auto;
  overflow: hidden;
}

@media (max-width: 620px) {
  .hero { padding: 56px 16px 48px; }
}

.hero::before {
  content: "";
  position: absolute;
  top: -120px;
  left: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(255, 46, 159, 0.35), transparent 70%);
  filter: blur(10px);
  z-index: -1;
  pointer-events: none;
}

.hero .kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cyan);
  border: 1px solid rgba(62, 240, 216, 0.4);
  background: rgba(62, 240, 216, 0.06);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
  direction: ltr;
}

.hero h1 {
  font-family: var(--font-headline);
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 5.2rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  margin: 0 0 22px;
  max-width: 16ch;
  text-shadow: 0 0 40px rgba(255, 94, 184, 0.25);
}

.hero h1 .accent {
  background: linear-gradient(100deg, var(--pink) 10%, var(--orange) 50%, var(--cyan) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  font-size: 1.14rem;
  color: var(--text-dim);
  max-width: 56ch;
  margin: 0 0 34px;
}

.hero .cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s, filter 0.15s, box-shadow 0.15s;
  border: 1px solid transparent;
}

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

.btn-primary {
  background: linear-gradient(95deg, var(--pink-hot), var(--orange));
  color: #1a0512;
  box-shadow: 0 8px 24px -8px rgba(255, 46, 159, 0.6);
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 10px 28px -6px rgba(255, 46, 159, 0.75); }

.btn-ghost {
  border-color: rgba(62, 240, 216, 0.4);
  color: var(--cyan);
  background: rgba(62, 240, 216, 0.05);
}
.btn-ghost:hover { border-color: var(--cyan); background: rgba(62, 240, 216, 0.12); }

/* ---------- Layout ---------- */

.page {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px 100px;
}

@media (max-width: 880px) {
  .page { grid-template-columns: 1fr; padding: 0 12px 60px; }
  .sidebar { display: none; }
}

.sidebar {
  padding: 32px 0 32px 28px;
  border-left: 1px solid var(--line-soft);
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.sidebar .side-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  direction: ltr;
  text-align: right;
}

.sidebar a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 3px;
  border-right: 2px solid transparent;
  transition: all 0.15s;
}

.sidebar a:hover { color: var(--text); background: rgba(255, 94, 184, 0.08); }
.sidebar a.active {
  color: var(--cyan);
  border-right-color: var(--cyan);
  background: rgba(62, 240, 216, 0.08);
  font-weight: 600;
}

.content { padding: 32px 28px 0 0; min-width: 0; }

@media (max-width: 880px) {
  .content { padding: 24px 16px 0; }
}

/* ---------- Section cards ---------- */

.section-block {
  margin-bottom: 22px;
  scroll-margin-top: 80px;
}

.section-card {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-raised) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 30px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 50px -30px rgba(0, 0, 0, 0.6);
  max-width: 100%;
}

@media (max-width: 620px) {
  .section-card { padding: 20px 16px; border-radius: 12px; }
}

.section-card::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--tag-color, var(--pink)), transparent 140%);
  box-shadow: 0 0 16px 1px var(--tag-color, var(--pink));
}

.section-card::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -20%;
  width: 60%;
  height: 220%;
  background: radial-gradient(circle, color-mix(in srgb, var(--tag-color, var(--pink)) 14%, transparent), transparent 70%);
  pointer-events: none;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tag-color, var(--pink)) 18%, transparent);
  color: var(--tag-color, var(--pink));
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--pink)) 45%, transparent);
  direction: ltr;
}

.section-card h2 {
  font-family: var(--font-headline);
  font-weight: 400;
  letter-spacing: 0.01em;
  font-size: 1.65rem;
  margin: 0;
  position: relative;
}

.section-card > p.desc {
  color: var(--text-dim);
  margin: 0 0 20px;
  font-size: 0.97rem;
  position: relative;
}

/* ---------- Param table (visual, not raw list) ---------- */

.param-grid {
  display: grid;
  gap: 10px;
  position: relative;
}

.param-row {
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr;
  gap: 16px;
  align-items: start;
  padding: 13px 16px;
  background: rgba(24, 10, 36, 0.55);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  transition: border-color 0.15s;
  max-width: 100%;
  overflow: hidden;
}

.param-row:hover { border-color: color-mix(in srgb, var(--tag-color, var(--pink)) 55%, transparent); }

@media (max-width: 700px) {
  .param-row { grid-template-columns: 1fr; gap: 6px; padding: 12px 14px; }
}

.param-name {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--tag-color, var(--cyan));
  direction: ltr;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.param-desc {
  color: var(--text);
  font-size: 0.92rem;
}

.param-desc .hint {
  display: block;
  color: var(--text-faint);
  font-size: 0.82rem;
  margin-top: 4px;
}

/* ---------- Code sample ---------- */

.code-block {
  background: #0e0616;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #e8d6f7;
  direction: ltr;
  text-align: left;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 16px;
  line-height: 1.35;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  max-width: 100%;
}

@media (max-width: 620px) {
  .code-block { padding: 14px 16px; font-size: 0.8rem; }
}

.code-block .kw { color: var(--pink); font-weight: 600; }
.code-block .str { color: var(--green); }
.code-block .cm { color: var(--text-faint); }

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--line-soft);
  padding: 36px 28px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
}
