/* ===========================
   Linux Persian Site - Styles
   =========================== */

/* ---------- Fonts ---------- */
@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b1120;
  --bg-soft: #131c30;
  --surface: #1a2540;
  --surface-2: #233156;
  --border: #2c3a5e;
  --text: #e8edf7;
  --text-dim: #9aa7c4;
  --brand: #2ecc71;
  --brand-2: #27ae60;
  --accent: #3498db;
  --accent-2: #e74c3c;
  --gold: #f1c40f;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.25);
  --maxw: 1180px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef2f9;
  --border: #dce4f0;
  --text: #1a2540;
  --text-dim: #5a6685;
  --shadow: 0 10px 30px rgba(20, 40, 80, 0.08);
  --shadow-soft: 0 6px 18px rgba(20, 40, 80, 0.06);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.85;
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--brand);
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 8px 22px rgba(46, 204, 113, 0.35);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(46, 204, 113, 0.45);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .site-header {
  background: rgba(244, 247, 252, 0.9);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--text);
}

.brand-logo .logo-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border-radius: 12px;
  font-size: 1.4rem;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-links a {
  color: var(--text-dim);
  font-weight: 600;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition);
  display: grid;
  place-items: center;
}

.theme-toggle:hover {
  transform: rotate(20deg);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 100px 0 120px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(46, 204, 113, 0.15), transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -250px;
  left: -200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(52, 152, 219, 0.15), transparent 70%);
  border-radius: 50%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(46, 204, 113, 0.12);
  border: 1px solid rgba(46, 204, 113, 0.3);
  border-radius: 50px;
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.3;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text) 30%, var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p.lead {
  font-size: 1.15rem;
  color: var(--text-dim);
  margin-bottom: 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section {
  padding: 80px 0;
}

.section-head {
  text-align: center;
  margin-bottom: 56px;
}

.section-head .eyebrow {
  display: inline-block;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 14px;
}

.section-head p {
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 auto;
}

/* ---------- Features Grid ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform var(--transition), border-color var(--transition),
    box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.feature-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  margin-bottom: 20px;
}

.icon.green { background: rgba(46, 204, 113, 0.15); }
.icon.blue { background: rgba(52, 152, 219, 0.15); }
.icon.gold { background: rgba(241, 196, 15, 0.15); }
.icon.red { background: rgba(231, 76, 60, 0.15); }
.icon.purple { background: rgba(155, 89, 182, 0.15); }
.icon.teal { background: rgba(26, 188, 156, 0.15); }

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-dim);
}

/* ---------- Distros ---------- */
.distros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.distro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition),
    border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.distro-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition);
}

.distro-card:hover::before {
  transform: scaleX(1);
}

.distro-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: var(--brand);
}

.distro-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.distro-logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.distro-head h3 {
  font-size: 1.35rem;
}

.distro-head .tag {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.distro-card p {
  color: var(--text-dim);
  margin-bottom: 18px;
  flex-grow: 1;
}

.distro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.chip.dl {
  color: var(--brand);
  background: rgba(46, 204, 113, 0.1);
  border-color: rgba(46, 204, 113, 0.3);
}

.distro-actions {
  display: flex;
  gap: 10px;
}

.distro-actions a {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  transition: background var(--transition);
}

.dl-link {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff !important;
}

.dl-link:hover {
  opacity: 0.9;
}

.mirror-link {
  background: var(--surface-2);
  color: var(--text) !important;
  border: 1px solid var(--border);
}

.mirror-link:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}

/* ---------- Stats ---------- */
.stats-band {
  background: linear-gradient(135deg, var(--bg-soft), var(--surface));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  text-align: center;
  padding: 56px 0;
}

.stat .num {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.stat .label {
  color: var(--text-dim);
  font-weight: 600;
}

/* ---------- Mirrors Table ---------- */
.mirrors-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.mirrors-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.mirrors-table th,
.mirrors-table td {
  padding: 16px 20px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.mirrors-table th {
  background: var(--surface-2);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 0.9rem;
}

.mirrors-table tbody tr:last-child td {
  border-bottom: none;
}

.mirrors-table tbody tr {
  transition: background var(--transition);
}

.mirrors-table tbody tr:hover {
  background: var(--surface-2);
}

.mirrors-table .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status.online .dot { background: var(--brand); box-shadow: 0 0 8px var(--brand); }
.status.syncing .dot { background: var(--gold); }
.status.offline .dot { background: var(--text-dim); }

.mirrors-table code {
  font-family: 'Consolas', 'Courier New', monospace;
  background: var(--surface-2);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--accent);
  direction: ltr;
  unicode-bidi: embed;
}

/* ---------- Timeline (why-linux) ---------- */
.timeline {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  right: 20px;
  width: 2px;
  background: linear-gradient(var(--brand), var(--accent));
}

.tl-item {
  position: relative;
  padding: 0 40px 36px 0;
}

.tl-item:last-child {
  padding-bottom: 0;
}

.tl-item::before {
  content: '';
  position: absolute;
  top: 6px;
  right: 13px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--brand);
  border: 3px solid var(--bg);
}

.tl-item .year {
  color: var(--brand);
  font-weight: 800;
  font-size: 1.1rem;
}

.tl-item h3 {
  margin: 4px 0 6px;
}

.tl-item p {
  color: var(--text-dim);
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color var(--transition);
}

.faq-item.open {
  border-color: var(--brand);
}

.faq-q {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: right;
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.faq-q .arrow {
  transition: transform var(--transition);
  color: var(--brand);
}

.faq-item.open .arrow {
  transform: rotate(180deg);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition);
}

.faq-item.open .faq-a {
  max-height: 300px;
}

.faq-a p {
  padding: 0 24px 22px;
  color: var(--text-dim);
}

/* ---------- CTA Band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 24px;
  padding: 56px 40px;
  text-align: center;
  color: #fff;
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

.cta-band::before {
  content: '🐧';
  position: absolute;
  font-size: 18rem;
  opacity: 0.08;
  left: -30px;
  bottom: -60px;
  transform: rotate(-15deg);
}

.cta-band h2 {
  font-size: 2rem;
  margin-bottom: 12px;
  position: relative;
}

.cta-band p {
  margin-bottom: 24px;
  opacity: 0.95;
  position: relative;
}

.cta-band .btn {
  position: relative;
  background: #fff;
  color: var(--brand-2);
}

.cta-band .btn:hover {
  opacity: 0.92;
  color: var(--brand-2);
}

/* ---------- Page Hero (sub pages) ---------- */
.page-hero {
  padding: 70px 0 50px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(46, 204, 113, 0.1), transparent 65%);
  z-index: 0;
}

.page-hero > * {
  position: relative;
  z-index: 1;
}

.page-hero .eyebrow {
  color: var(--brand);
  font-weight: 700;
  margin-bottom: 12px;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 16px;
}

.page-hero p {
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 50px;
  align-items: center;
}

.about-text h3 {
  font-size: 1.5rem;
  margin: 28px 0 12px;
}

.about-text p {
  color: var(--text-dim);
  margin-bottom: 14px;
}

.about-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.about-visual .penguin {
  font-size: 8rem;
  line-height: 1;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.about-visual h4 {
  font-size: 1.3rem;
  margin: 16px 0 8px;
}

.about-visual p {
  color: var(--text-dim);
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition);
}

.value-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand);
}

.value-card .icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: rgba(46, 204, 113, 0.12);
}

.value-card h4 {
  margin-bottom: 8px;
}

.value-card p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.contact-info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.contact-info-card h3 {
  margin-bottom: 24px;
  font-size: 1.3rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  background: rgba(52, 152, 219, 0.12);
  flex-shrink: 0;
}

.contact-item .label {
  font-size: 0.85rem;
  color: var(--text-dim);
  display: block;
}

.contact-item .value {
  font-weight: 700;
  direction: ltr;
  unicode-bidi: plaintext;
}

.contact-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius, 16px);
  padding: 32px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.15);
}

.field textarea {
  resize: vertical;
  min-height: 140px;
}

.form-note {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-top: 12px;
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 56px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-dim);
  margin: 16px 0;
  max-width: 320px;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-dim);
  font-size: 1.1rem;
  transition: all var(--transition);
}

.social-links a:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: translateY(-3px);
}

.footer-col h4 {
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul a {
  color: var(--text-dim);
}

.footer-col ul a:hover {
  color: var(--brand);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-bottom .made-with {
  color: var(--accent-2);
}

/* ---------- Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .about-visual {
    order: -1;
  }
}

@media (max-width: 700px) {
  .nav-links {
    position: fixed;
    top: 74px;
    right: -100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-soft);
    width: 80%;
    max-width: 320px;
    height: calc(100vh - 74px);
    padding: 30px;
    gap: 8px;
    transition: right var(--transition);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 30px rgba(0,0,0,0.3);
  }

  .nav-links.open {
    right: 0;
  }

  .nav-links a {
    padding: 14px;
    border-radius: 10px;
  }

  .nav-links a.active::after {
    display: none;
  }

  .nav-toggle {
    display: grid;
    place-items: center;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .hero {
    padding: 60px 0 80px;
  }

  .section {
    padding: 56px 0;
  }
}
