/* ==========================================================================
   Hosternet — Base & Design Tokens
   Premium dark hosting UI · primary #3de083 · IranYekanX-first font stack
   ========================================================================== */

/* ---- Self-hosted fonts (YekanBakh primary + Vazirmatn fallback) ---- */
@font-face {
  font-family: "YekanBakh";
  src: url("/assets/fonts/YekanBakh-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "YekanBakh";
  src: url("/assets/fonts/YekanBakh-semibold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "YekanBakh";
  src: url("/assets/fonts/YekanBakh-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "YekanBakh";
  src: url("/assets/fonts/YekanBakh-bold.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
  font-style: normal;
}
/* Fanum (فارسی-رقم) variants for Persian digits */
@font-face {
  font-family: "YekanBakh FaNum";
  src: url("/assets/fonts/YekanBakh-regular-fanum.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "YekanBakh FaNum";
  src: url("/assets/fonts/YekanBakh-semibold-fanum.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "YekanBakh FaNum";
  src: url("/assets/fonts/YekanBakh-bold-fanum.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "YekanBakh FaNum";
  src: url("/assets/fonts/YekanBakh-bold-fanum.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
  font-style: normal;
}
/* Vazirmatn fallback (variable, 48KB) */
@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn[wght].woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
}
/* JetBrains Mono (local, for English text/numbers only) */
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
  font-style: normal;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/JetBrainsMono-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
  font-style: normal;
}

/* ---- Design Tokens ------------------------------------------------------ */
:root {
  /* Surfaces (dark, green-tinted) */
  --bg-void:     #050807;
  --bg-darkest:  #070b09;
  --bg-dark:     #0a0f0d;
  --bg-mid:      #0f1613;
  --bg-elevated: #131c18;
  --bg-light:    #1a2520;

  /* Lines / borders */
  --border:        rgba(61, 224, 131, 0.10);
  --border-soft:   rgba(255, 255, 255, 0.06);
  --border-strong: rgba(61, 224, 131, 0.28);

  /* Brand */
  --primary:        #3de083;
  --primary-bright: #5cf09a;
  --primary-glow:   #8ff5bf;
  --primary-dim:    rgba(61, 224, 131, 0.12);
  --primary-soft:   rgba(61, 224, 131, 0.06);

  /* Accents (status) */
  --warn:   #fbbf24;
  --danger: #f87171;
  --info:   #60a5fa;

  /* Text */
  --text:        #e8efe9;
  --text-strong: #ffffff;
  --text-muted:  rgba(232, 239, 233, 0.62);
  --text-dim:    rgba(232, 239, 233, 0.40);

  /* Typography */
  --font-sans: "YekanBakh", "Vazirmatn", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Radii */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;
  --r-pill: 100px;

  /* Shadows */
  --shadow-sm: 0 2px 8px -2px rgba(0,0,0,0.4);
  --shadow-md: 0 10px 30px -10px rgba(0,0,0,0.55);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,0.65);
  --glow-primary: 0 0 0 1px rgba(61,224,131,0.18), 0 18px 50px -12px rgba(61,224,131,0.35);
  --glow-soft:    0 0 24px -4px rgba(61,224,131,0.25);

  /* Layout */
  --container: 1320px;
  --container-wide: 1480px;
  --nav-h: 72px;

  /* Motion */
  --ease-quiet:    cubic-bezier(.22, 1, .36, 1);
  --ease-precise:  cubic-bezier(.4, 0, .2, 1);
  --ease-emphasis: cubic-bezier(.16, 1, .3, 1);
  --ease-spring:   cubic-bezier(.34, 1.56, .64, 1);

  /* Z-index scale */
  --z-nav: 100;
  --z-mega: 90;
  --z-overlay: 200;
  --z-toast: 300;
}

/* ---- Reset -------------------------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  background: var(--bg-void);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Sticky footer: main grows, footer sits at bottom on short pages */
main { flex: 1 0 auto; width: 100%; }
.site-footer { flex-shrink: 0; }

img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: 100%; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }
::selection { background: var(--primary); color: var(--bg-void); }

/* ---- Typography --------------------------------------------------------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--text-strong);
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.8rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 3.8vw, 3.3rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }
h4 { font-size: 1.1rem; }
p { line-height: 1.8; }

.eyebrow {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.eyebrow::before {
  content: '';
  width: 1.8rem;
  height: 1px;
  background: var(--primary);
  flex-shrink: 0;
}
.eyebrow.centered { justify-content: center; }
.eyebrow.centered::after {
  content: '';
  width: 1.8rem;
  height: 1px;
  background: var(--primary);
  flex-shrink: 0;
}

.text-gradient {
  background: linear-gradient(120deg, var(--primary-bright), var(--primary-glow));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.accent { color: var(--primary); }

/* ---- Layout helpers ----------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 2rem;
}
.container-wide { max-width: var(--container-wide); }

.section { padding: 8rem 0; position: relative; }
.section-sm { padding: 6rem 0; }
.section-head { display: flex; flex-direction: column; gap: 1.4rem; margin-bottom: 4rem; max-width: 720px; }
.section-head.centered { align-items: center; text-align: center; margin-inline: auto; }
.section-head h2 { max-width: 20ch; }
.section-head.centered h2 { margin-inline: auto; }
.section-head .lead {
  font-size: 1.02rem;
  color: var(--text-muted);
  line-height: 1.8;
  max-width: 62ch;
}
.section-head.centered .lead { margin-inline: auto; }

/* ---- Utilities ---------------------------------------------------------- */
.ltr { direction: ltr; }
.rtl { direction: rtl; }
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.full-bleed { width: 100vw; margin-left: calc(50% - 50vw); }

.grid { display: grid; gap: 1.25rem; }
.flex { display: flex; }
.hidden { display: none !important; }

/* Divider */
.hr {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border) 20%, var(--border) 80%, transparent);
  border: none;
  margin: 0;
}

/* Focus visibility for a11y */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Scrollbar (subtle, themed) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-darkest); }
::-webkit-scrollbar-thumb {
  background: var(--bg-light);
  border-radius: 10px;
  border: 2px solid var(--bg-darkest);
}
::-webkit-scrollbar-thumb:hover { background: #243029; }

/* Custom scrollbar utility for scrollable panels */
.scroll-y { max-height: 24rem; overflow-y: auto; }
.scroll-y::-webkit-scrollbar { width: 6px; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--bg-light); border-radius: 6px; border: none; }

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