/* HamApps — landing page styles
   Stark monochrome, Apple-inspired.
   Persian primary (Vazirmatn) + English (Geist) */

:root {
  --bg: #fbfbfd;
  --bg-elev: #ffffff;
  --bg-dark: #0a0a0c;
  --fg: #1d1d1f;
  --fg-muted: #6e6e73;
  --fg-faint: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --inverse: #f5f5f7;
  --live: #1d8a4a;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;

  --maxw: 1240px;
  --pad-x: clamp(20px, 5vw, 72px);

  --nav-h: 56px;

  --ease: cubic-bezier(.4,.0,.2,1);
}

html[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-elev: #131317;
  --bg-dark: #f5f5f7;
  --fg: #f5f5f7;
  --fg-muted: #a1a1a6;
  --fg-faint: #6e6e73;
  --line: #2a2a30;
  --line-soft: #1c1c20;
  --inverse: #0a0a0c;
  --live: #3ecf8e;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Vazirmatn", "Geist", ui-sans-serif, system-ui, sans-serif;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  transition: background .4s var(--ease), color .4s var(--ease);
}

html[lang="en"] body {
  font-family: "Geist", "Vazirmatn", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.015em;
}

html[lang="fa"] [data-lang="en"] { display: none !important; }
html[lang="en"] [data-lang="fa"] { display: none !important; }

/* Farsi always renders in Vazirmatn (including labels that use Geist in EN) */
html[lang="fa"] body,
html[lang="fa"] .lang-toggle,
html[lang="fa"] .chips-label,
html[lang="fa"] .about-label,
html[lang="fa"] .status,
html[lang="fa"] .footer-brand .copyright .url,
html[lang="fa"] footer .copyright .url,
[data-lang="fa"] {
  font-family: "Vazirmatn", "Geist", ui-sans-serif, system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

/* ============ NAV ============ */
nav.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
}
nav.site-nav .wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
nav.site-nav .logo {
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
nav.site-nav .logo .dot {
  width: 8px; height: 8px;
  background: var(--fg);
  border-radius: 50%;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  font-size: 12px;
  font-family: "Geist", ui-monospace, monospace;
  font-weight: 500;
}
.lang-toggle button {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--fg-muted);
  letter-spacing: 0.04em;
  transition: all .2s var(--ease);
}
.lang-toggle button.active {
  background: var(--fg);
  color: var(--bg);
}

.nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.theme-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--fg);
  transition: all .2s var(--ease);
  position: relative;
}
.theme-btn:hover {
  border-color: var(--fg);
  transform: rotate(15deg);
}
.theme-btn svg {
  position: absolute;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
html[data-theme="light"] .theme-btn .icon-dark,
html[data-theme="dark"]  .theme-btn .icon-light {
  opacity: 0;
  transform: rotate(-90deg) scale(0.6);
}
html[data-theme="light"] .theme-btn .icon-light,
html[data-theme="dark"]  .theme-btn .icon-dark {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* ============ LAYOUT ============ */
section {
  width: 100%;
  padding: clamp(80px, 12vw, 160px) 0;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.03em; line-height: 1.05; }
html[lang="fa"] h1, html[lang="fa"] h2, html[lang="fa"] h3 { line-height: 1.25; letter-spacing: -0.02em; }

/* ============ HERO ============ */
#hero {
  padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 96px));
  padding-bottom: clamp(64px, 10vw, 120px);
  min-height: 92vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
#hero .wrap { width: 100%; position: relative; z-index: 1; }

.hero-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, color-mix(in oklab, var(--fg) 6%, transparent), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 72%, color-mix(in oklab, var(--fg) 4%, transparent), transparent 65%);
}
html[data-theme="dark"] .hero-atmosphere {
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, color-mix(in oklab, #fff 7%, transparent), transparent 60%),
    radial-gradient(ellipse 55% 45% at 88% 72%, color-mix(in oklab, #fff 4%, transparent), transparent 65%);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

#hero .brand-lockup {
  font-size: clamp(48px, 9vw, 132px);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: .95;
  margin: 0 0 12px;
  color: var(--fg);
  animation: rise .8s var(--ease) both;
}
html[lang="fa"] #hero .brand-lockup {
  letter-spacing: -0.03em;
}

#hero .hero-subtitle {
  margin: 0 0 clamp(28px, 4vw, 40px);
  font-size: clamp(17px, 1.8vw, 22px);
  font-weight: 400;
  color: var(--fg-muted);
  letter-spacing: -0.02em;
  max-width: 28ch;
  line-height: 1.35;
  animation: rise .8s var(--ease) .06s both;
}
html[lang="fa"] #hero .hero-subtitle {
  letter-spacing: 0;
  max-width: 32ch;
  line-height: 1.55;
}

.h-divider {
  height: 1px;
  width: 100%;
  background: var(--line-soft);
  margin: 0 0 clamp(28px, 4vw, 40px);
}

/* ============ APPS GALLERY ============ */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  animation: rise .8s var(--ease) .12s both;
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
@media (max-width: 1100px) { .apps-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .apps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px)  { .apps-grid { grid-template-columns: 1fr; } }

.app-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  transition: all .25s var(--ease);
  overflow: hidden;
  min-height: 168px;
  text-align: start;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 10px 30px -22px rgba(0,0,0,.2);
}
.app-card:hover {
  border-color: var(--line);
  transform: translateY(-2px);
  box-shadow: 0 24px 60px -28px rgba(0,0,0,.18);
}
.app-card:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.app-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f5f7, #d2d2d7);
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.6);
}
html[data-theme="dark"] .app-icon {
  background: linear-gradient(135deg, #2a2a30, #1c1c20);
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
}
.app-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.app-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: auto;
}

.app-card .name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
  color: var(--fg);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Vazirmatn", "Geist", ui-sans-serif, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}
.status.live {
  color: var(--live);
}
.status.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--live);
  flex-shrink: 0;
}
.status.soon {
  color: var(--fg-faint);
}

.app-card.ghost {
  background: color-mix(in oklab, var(--bg-elev) 40%, transparent);
  border-style: dashed;
  border-color: var(--line);
  box-shadow: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  min-height: 168px;
}
.app-card.ghost:hover {
  border-color: var(--fg-faint);
  background: var(--bg-elev);
}
.app-card.ghost .upcoming-visual {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
}
.app-card.ghost .upcoming-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.app-card.ghost .status.soon {
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============ APP DIALOG ============ */
.app-dialog {
  border: none;
  padding: 16px;
  background: transparent;
  color: var(--fg);
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  margin: 0;
}
.app-dialog[open] {
  display: grid;
  place-items: center;
}
.app-dialog::backdrop {
  background: color-mix(in oklab, #0a0a0c 48%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .32s var(--ease);
}
.app-dialog.is-open::backdrop {
  opacity: 1;
}
.app-dialog-panel {
  position: relative;
  margin: 0;
  width: min(440px, calc(100vw - 32px));
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 32px 80px -24px rgba(0,0,0,.35);
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: start;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition:
    opacity .32s var(--ease),
    transform .36s var(--ease);
}
.app-dialog.is-open .app-dialog-panel {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .app-dialog::backdrop,
  .app-dialog-panel {
    transition: none;
  }
  .app-dialog-panel {
    transform: none;
  }
}
.app-dialog-close {
  position: absolute;
  top: 16px;
  inset-inline-end: 16px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  color: var(--fg-muted);
  background: var(--bg);
  transition: all .2s var(--ease);
}
.app-dialog-close:hover {
  color: var(--fg);
  border-color: var(--line);
}
.app-dialog-close:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}
.app-dialog-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-inline-end: 40px;
}
.app-dialog-header .app-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
}
.app-dialog-titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.app-dialog-titles .name {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.app-dialog-body {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--fg-muted);
}

.platforms-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chips-label {
  font-family: "Geist", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-inline-end: 4px;
}
.chip {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  transition: transform .2s var(--ease);
}
.chip:hover { transform: translateY(-1px) scale(1.05); }
.chip:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

/* ============ ABOUT ============ */
#about {
  padding-top: 0;
  padding-bottom: clamp(64px, 10vw, 120px);
}
#about .h-divider {
  margin: 0 0 clamp(40px, 6vw, 64px);
}
.about-block {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}
.about-intro {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.about-label {
  margin: 0 0 16px;
  font-family: "Geist", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
  display: flex;
  align-items: center;
  gap: 12px;
}
.about-label::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--fg-faint);
  display: inline-block;
}
.about-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--fg);
  margin: 0;
}
html[lang="fa"] .about-title {
  letter-spacing: -0.015em;
  line-height: 1.35;
}
.about-copy {
  display: flex;
  flex-direction: column;
  gap: 1em;
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.7;
  color: var(--fg-muted);
  max-width: 58ch;
}
.about-copy p {
  margin: 0;
}
html[lang="fa"] .about-copy {
  max-width: 62ch;
  line-height: 1.85;
}
@media (max-width: 760px) {
  .about-block {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .about-intro {
    position: static;
  }
}

/* ============ FOOTER ============ */
footer.site-footer {
  background: var(--bg);
  border-top: 1px solid var(--line-soft);
  padding: clamp(48px, 6vw, 72px) 0;
}
.footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 36ch;
}
.footer-brand .logo {
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
}
.footer-brand .logo .dot {
  width: 10px; height: 10px;
  background: var(--fg);
  border-radius: 50%;
}
.footer-brand .footer-tagline {
  margin: 0;
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.footer-brand .copyright {
  font-size: 14px;
  color: var(--fg-muted);
  line-height: 1.5;
}
.footer-brand .copyright .url {
  font-family: "Geist", ui-monospace, monospace;
  color: var(--fg);
}

.footer-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 22px;
}

.social-row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.social-link {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  background: var(--bg-elev);
  color: var(--fg);
  transition: all .2s var(--ease);
}
.social-link:hover {
  border-color: var(--fg);
  transform: translateY(-2px);
}

.badges {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
html[lang="fa"] .badges { justify-content: flex-start; }
.badges .slot {
  width: 148px;
  height: 148px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--line-soft);
  display: grid;
  place-items: center;
  transition: all .2s var(--ease);
  flex-shrink: 0;
}
.badges .slot:hover {
  border-color: var(--line);
  transform: translateY(-2px);
}
.badges .slot img,
.badges .slot svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: none;
  object-position: center;
  padding: 10px;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .footer-row { justify-content: center; }
  .footer-brand { align-items: center; text-align: center; }
  .footer-actions { align-items: center; }
  .badges { justify-content: center; }
  html[lang="fa"] .badges { justify-content: center; }
}
@media (max-width: 440px) {
  .badges .slot { width: 120px; height: 120px; }
  .social-link { width: 44px; height: 44px; }
}

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

footer .copyright {
  font-size: 13px;
  color: var(--fg-faint);
  line-height: 1.6;
}
footer .copyright .url {
  font-family: "Geist", ui-monospace, monospace;
  color: var(--fg-muted);
}
