/* ===== Design Tokens ===== */
:root {
  --brand-primary: #7c3aed;
  --brand-secondary: #a855f7;
  --brand-accent: #c084fc;
  --brand-glow: rgba(124, 58, 237, 0.35);
  --bg-primary: #0c0c16;
  --bg-secondary: #161625;
  --bg-tertiary: #1a1a2e;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.1);
  --surface-elevated: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --shadow-soft: 0 10px 35px rgba(0, 0, 0, 0.28);
  --shadow-elevated: 0 18px 50px rgba(0, 0, 0, 0.34);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --content-width: 1120px;
  --content-width-narrow: 760px;
  --header-height: 84px;
  --transition: 0.25s ease;
}

@media (prefers-color-scheme: light) {
  :root {
    --brand-glow: rgba(124, 58, 237, 0.14);
    --bg-primary: #f5f5fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --surface-elevated: rgba(255, 255, 255, 0.96);
    --border: rgba(15, 23, 42, 0.08);
    --border-strong: rgba(15, 23, 42, 0.12);
    --text-primary: #1e1b4b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --shadow-soft: 0 10px 35px rgba(15, 23, 42, 0.08);
    --shadow-elevated: 0 18px 50px rgba(15, 23, 42, 0.1);
  }
}

/* ===== Base ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.18), transparent 38%),
    var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

main {
  flex: 1;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

[dir="rtl"] {
  direction: rtl;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(var(--content-width), calc(100% - 32px));
  margin: 0 auto;
}

.container-narrow {
  width: min(var(--content-width-narrow), calc(100% - 32px));
  margin: 0 auto;
}

.page-shell {
  padding-top: calc(var(--header-height) + 22px);
}

.gradient-text {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--surface);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.section {
  padding: 88px 0;
}

.section-sm {
  padding: 48px 0;
}

.section-header {
  margin-bottom: 28px;
}

.section-title {
  font-size: clamp(2rem, 2.8vw, 2.75rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-description,
.lead {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.12);
  color: var(--brand-accent);
  font-size: 0.88rem;
  font-weight: 700;
}

/* ===== Shared Header ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(12,12,22,0.7);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
}
@media (prefers-color-scheme: light) {
  .site-header {
    background: rgba(255,255,255,0.75);
  }
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 10px 28px var(--brand-glow);
  flex-shrink: 0;
}

.brand-name {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Hamburger button — hidden on desktop, visible on smaller screens */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 60;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile-only actions inside nav (hidden on desktop) */
.nav-mobile-actions { display: none; }

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 2px;
}

.site-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text-primary);
  background: rgba(124, 58, 237, 0.12);
}

.header-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  flex-shrink: 0;
}

.language-select {
  min-width: 0;
  width: auto;
  padding: 6px 28px 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8rem;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2394A3B8' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
  cursor: pointer;
}

.header-button,
.button,
.button-secondary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.header-button:hover,
.button:hover,
.button-secondary:hover,
.button-ghost:hover {
  transform: translateY(-1px);
}

.button,
.header-button.primary {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  box-shadow: 0 12px 30px var(--brand-glow);
}

.button-secondary,
.header-button.secondary {
  background: rgba(124, 58, 237, 0.12);
  color: var(--text-primary);
  border-color: rgba(124, 58, 237, 0.18);
}

.button-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ===== Shared Footer ===== */
.site-footer {
  margin-top: 56px;
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

/* ===== Hero + Marketing ===== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 34px 0 34px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.hero-copy {
  max-width: 640px;
}

.hero-title {
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 900;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.store-badge {
  display: inline-flex;
  border-radius: 14px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.store-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px var(--brand-glow);
}

.store-badge img {
  height: 52px;
  width: auto;
}

.pills,
.platform-pills,
.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 600;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.device-frame,
.mac-frame,
.device-slab {
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-elevated), 0 0 60px var(--brand-glow);
}

.device-frame {
  width: min(300px, 88vw);
  border-radius: 38px;
  padding: 10px;
}

.device-frame img {
  border-radius: 28px;
}

.mac-frame {
  border-radius: 18px;
  overflow: hidden;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 42px;
  align-items: center;
}

.feature-grid.reverse .feature-media {
  order: 2;
}

.feature-grid.reverse .feature-content {
  order: 1;
}

.feature-content .section-description {
  margin-bottom: 22px;
}

.feature-media {
  display: flex;
  justify-content: center;
}

.device-showcase {
  display: grid;
  gap: 22px;
}

.device-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 18px;
}

.device-ipad,
.device-iphone,
.device-watch,
.device-mac {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-soft);
  background: var(--surface-elevated);
}

.device-ipad {
  width: min(350px, 90vw);
  border-radius: 22px;
}

.device-iphone {
  width: min(240px, 65vw);
  border-radius: 34px;
}

.device-watch {
  width: min(100px, 28vw);
  border-radius: 24px;
}

.device-mac {
  width: min(560px, 100%);
  border-radius: 16px;
}

.privacy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.info-card,
.article-section,
.travel-card {
  padding: 24px;
}

.info-card h3,
.article-section-title,
.travel-card-title {
  font-size: 1.12rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.info-card p,
.article-section-content,
.page-intro-text {
  color: var(--text-secondary);
}

.page-intro {
  text-align: center;
  margin-bottom: 30px;
}

.page-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.18), rgba(168, 85, 247, 0.14));
  font-size: 2rem;
}

.page-title {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 900;
  margin-bottom: 10px;
}

.page-meta {
  color: var(--text-tertiary);
  font-size: 0.95rem;
}

.article-list {
  display: grid;
  gap: 16px;
}

.article-section {
  border-radius: var(--radius-md);
}

.article-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.article-section-icon,
.travel-card-icon,
.info-card-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(168, 85, 247, 0.12));
  font-size: 1.15rem;
}

.article-section-content {
  white-space: pre-line;
}

/* ===== Travel Planner ===== */
.travel-layout {
  display: grid;
  gap: 20px;
}

.travel-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-tertiary);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.form-input,
.form-select {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.form-input:focus,
.form-select:focus,
.language-select:focus {
  outline: none;
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.days-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.days-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1.2rem;
}

.style-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.style-btn {
  padding: 14px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-weight: 700;
}

.style-btn.active {
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 14px 28px var(--brand-glow);
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-of-type {
  border-bottom: 0;
}

.result-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
}

.result-value {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.cost-bar {
  display: flex;
  height: 10px;
  margin: 18px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.cost-bar-seg.seg-acc { background: #7c3aed; }
.cost-bar-seg.seg-food { background: #a855f7; }
.cost-bar-seg.seg-trans { background: #f59e0b; }
.cost-bar-seg.seg-act { background: #10b981; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--text-tertiary);
  font-size: 0.83rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

.total-panel {
  margin-top: 16px;
  padding: 22px;
  text-align: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(168, 85, 247, 0.08));
}

.total-label {
  color: var(--text-tertiary);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
}

.total-amount {
  margin-top: 8px;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 900;
}

.total-converted {
  margin-top: 6px;
  color: var(--text-secondary);
}

.note {
  margin-top: 8px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.cta-card {
  text-align: center;
}

.cta-card .lead {
  margin-bottom: 18px;
}

/* ===== Motion ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */

/* Collapse to hamburger menu below 1100px */
@media (max-width: 1100px) {
  .hamburger { display: flex; }
  .header-actions-desktop { display: none; }

  .site-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0; right: 0; bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 16px 24px 32px;
    background: rgba(12,12,22,0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow-y: auto;
    z-index: 55;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    font-size: 1rem;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
  }
  .nav-mobile-actions .header-button {
    text-align: center;
    padding: 12px;
  }
  .nav-mobile-lang {
    padding: 10px;
    font-size: 0.9rem;
  }

  .hero-grid,
  .feature-grid,
  .privacy-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid.reverse .feature-media,
  .feature-grid.reverse .feature-content {
    order: initial;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 52px;
  }

  .section {
    padding: 64px 0;
  }

  .hero-actions,
  .footer-inner,
  .footer-links {
    justify-content: center;
  }

  .page-shell {
    padding-top: calc(var(--header-height) + 18px);
  }

  .style-picker {
    grid-template-columns: 1fr;
  }

  .days-input-wrap {
    gap: 8px;
  }

  .article-section,
  .info-card,
  .travel-card {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .site-nav { display: none; }
  .header-button.secondary { display: none; }
}

/* Persian font for RTL */
html[lang="fa"], html[lang="fa"] * { font-family: 'Vazirmatn', -apple-system, sans-serif !important; }

