/* -------------------------------------------------------------
   Ali Miri (Dakto Studio) — Portfolio & App Showcase
   Design system: quiet editorial dark UI, single brand accent,
   app colors used only as small identity cues.
   All layout uses CSS logical properties for RTL/LTR support.
------------------------------------------------------------- */

:root {
  /* ---- Surfaces ---- */
  --bg: #07080b;
  --bg-soft: #0b0d13;
  --surface: #0f1219;
  --surface-2: #151922;
  --surface-3: #1c212c;
  --footer-bg: #05060a;

  /* ---- Ink ---- */
  --ink: #f3f5fb;
  --ink-2: #a3abba;
  --ink-3: #71798a;

  /* ---- Lines ---- */
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* ---- Brand ---- */
  --brand: #6d6cf7;
  --brand-hover: #7d7cff;
  --brand-ink: #a5a4ff;
  --brand-soft: rgba(109, 108, 247, 0.12);
  --brand-glow: rgba(109, 108, 247, 0.3);
  --accent-primary: var(--brand);
  --accent-primary-hover: var(--brand-hover);
  --accent-primary-glow: var(--brand-glow);
  --accent-indigo: var(--brand);
  --accent-indigo-glow: var(--brand-glow);

  /* ---- App identity colours ---- */
  --accent-kaghaz: #f59e0b;
  --accent-kaghaz-glow: rgba(245, 158, 11, 0.3);
  --accent-artilo: #f43f5e;
  --accent-artilo-glow: rgba(244, 63, 94, 0.3);
  --accent-danak: #06b6d4;
  --accent-danak-glow: rgba(6, 182, 212, 0.3);
  --accent-shakhes: #10b981;
  --accent-shakhes-glow: rgba(16, 185, 129, 0.3);
  --accent-modam: #8b5cf6;
  --accent-modam-glow: rgba(139, 92, 246, 0.3);

  /* ---- Chrome ---- */
  --nav-bg: rgba(7, 8, 11, 0.72);
  --drawer-bg: #0b0d13;

  /* ---- Elevation ---- */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 14px 34px -18px rgba(0, 0, 0, 0.7);
  --shadow-3: 0 34px 70px -34px rgba(0, 0, 0, 0.85);

  /* ---- Type ---- */
  --font-fa: "Vazirmatn", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-en: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --tracking: -0.015em;

  /* ---- Metrics ---- */
  --max-w: 1120px;
  --gutter: clamp(18px, 4.5vw, 32px);
  --section-y: clamp(56px, 8vw, 96px);
  --nav-h: 66px;
  --radius-xs: 8px;
  --radius-sm: 11px;
  --radius-md: 15px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-full: 9999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ---- Light theme ---- */
:root[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-soft: #ffffff;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --surface-3: #e4e8f1;
  --footer-bg: #eceff6;

  --ink: #0d1424;
  --ink-2: #4b5568;
  --ink-3: #6a7387;

  --line: rgba(13, 20, 36, 0.09);
  --line-strong: rgba(13, 20, 36, 0.18);

  --brand: #4f46e5;
  --brand-hover: #4338ca;
  --brand-ink: #4338ca;
  --brand-soft: rgba(79, 70, 229, 0.09);
  --brand-glow: rgba(79, 70, 229, 0.22);

  --accent-kaghaz: #b45309;
  --accent-kaghaz-glow: rgba(245, 158, 11, 0.22);
  --accent-artilo: #be123c;
  --accent-artilo-glow: rgba(244, 63, 94, 0.2);
  --accent-danak: #0e7490;
  --accent-danak-glow: rgba(6, 182, 212, 0.2);
  --accent-shakhes: #047857;
  --accent-shakhes-glow: rgba(16, 185, 129, 0.2);
  --accent-modam: #6d28d9;
  --accent-modam-glow: rgba(139, 92, 246, 0.2);

  --nav-bg: rgba(246, 247, 251, 0.82);
  --drawer-bg: #ffffff;

  --shadow-1: 0 1px 2px rgba(13, 20, 36, 0.06);
  --shadow-2: 0 14px 34px -20px rgba(13, 20, 36, 0.3);
  --shadow-3: 0 34px 70px -38px rgba(13, 20, 36, 0.4);

  --tracking: -0.02em;
}

/* ---------- RESET & BASE ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  background-color: var(--bg);
  color: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-block-start: calc(var(--nav-h) + 16px);
}

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-en);
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

html[dir="rtl"] body {
  font-family: var(--font-fa);
  line-height: 1.9;
}

/* One soft brand wash at the top — no coloured smudges. */
body::before {
  content: "";
  position: fixed;
  inset-block-start: calc(var(--nav-h) * -3);
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: min(1100px, 100vw);
  height: 620px;
  background: radial-gradient(ellipse at center, var(--brand-glow) 0%, transparent 62%);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

:root[data-theme="light"] body::before {
  opacity: 0.35;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: var(--tracking);
  text-wrap: balance;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5 {
  letter-spacing: 0;
  line-height: 1.5;
  font-weight: 800;
}

p {
  text-wrap: pretty;
}

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

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

svg {
  flex-shrink: 0;
}

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
  z-index: 1;
}

::selection {
  background: var(--brand);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- SHARED SECTION PIECES ---------- */

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-ink);
  margin-bottom: 12px;
}

html[dir="rtl"] .section-eyebrow {
  letter-spacing: 0;
  font-size: 0.86rem;
}

.section-eyebrow::before {
  content: "";
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.7;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  line-height: 1.4;
  letter-spacing: var(--tracking);
  margin-bottom: 12px;
  color: var(--ink);
}

.section-desc {
  font-size: 1.02rem;
  color: var(--ink-2);
  max-width: 620px;
  margin-bottom: 36px;
  line-height: 1.85;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: clamp(28px, 4vw, 44px);
  max-width: 660px;
}

.section-head .section-eyebrow,
.section-head .section-title {
  margin-bottom: 10px;
}

.section-head .section-desc {
  margin-bottom: 0;
}

.section-block {
  margin-top: clamp(48px, 6vw, 80px);
}

/* ---------- BADGES / CHIPS ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--row-glow, var(--line-strong));
  background: var(--surface-2);
  color: var(--row-accent, var(--brand-ink));
  margin-bottom: 18px;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  flex-shrink: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-2);
  font-weight: 600;
  line-height: 1.6;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.pill svg {
  color: var(--brand);
}

.pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.tech-tag {
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-2);
  font-weight: 600;
  line-height: 1.7;
  transition: all 0.2s ease;
}

.tech-tag:hover {
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* ---------- BUTTONS ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  white-space: nowrap;
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease, transform 0.22s var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--surface-3);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px -14px var(--brand-glow);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 14px 30px -14px var(--brand-glow);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--brand);
  color: var(--brand-ink);
}

.btn .btn-arrow,
.back-link .btn-arrow {
  transition: translate 0.22s var(--ease);
}

html[dir="ltr"] .btn .btn-arrow,
html[dir="ltr"] .back-link .btn-arrow {
  transform: scaleX(-1);
}

.btn:hover .btn-arrow {
  translate: -3px 0;
}

html[dir="ltr"] .btn:hover .btn-arrow {
  translate: 3px 0;
}

/* Store badges */
.store-badges {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: all 0.22s ease;
}

.store-badge:hover {
  border-color: var(--brand);
  background: var(--surface-3);
  transform: translateY(-1px);
}

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

/* ---------- TOPBAR ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-block-end: 1px solid var(--line);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.topbar.scrolled {
  box-shadow: var(--shadow-2);
  border-block-end-color: var(--line-strong);
}

.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--nav-h);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}

.logo-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--brand) 0%, #a855f7 130%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 20px -10px var(--brand-glow);
  flex-shrink: 0;
}

.nav-name {
  font-family: var(--font-en);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-desktop .nav-link {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-desktop .nav-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.nav-desktop .nav-link.active {
  color: var(--ink);
}

.nav-desktop .nav-link.active::after {
  content: "";
  position: absolute;
  inset-inline: 12px;
  inset-block-end: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

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

.lang-toggle {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 3px;
}

.lang-btn {
  font-family: var(--font-en);
  color: var(--ink-3);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.lang-btn[aria-pressed="true"] {
  background: var(--brand);
  color: #fff;
}

.lang-btn:hover:not([aria-pressed="true"]) {
  color: var(--ink);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.theme-toggle:active {
  transform: scale(0.94);
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

.mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  transition: all 0.2s ease;
}

.mobile-toggle:hover {
  background: var(--surface-2);
  border-color: var(--line-strong);
}

.mobile-toggle .icon-close { display: none; }
.mobile-toggle[aria-expanded="true"] .icon-hamburger { display: none; }
.mobile-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Mobile drawer */
.nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1990;
  background: rgba(3, 4, 7, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.nav-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.nav-menu {
  display: none;
}

/* ---------- HERO ---------- */

.hero {
  padding-block: clamp(44px, 6vw, 76px) clamp(32px, 4vw, 56px);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: stretch;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-title {
  font-size: clamp(2.15rem, 4.4vw, 3.35rem);
  line-height: 1.22;
  letter-spacing: var(--tracking);
  margin-bottom: 18px;
  color: var(--ink);
}

html[dir="rtl"] .hero-title {
  line-height: 1.4;
  letter-spacing: 0;
}

html[dir="ltr"] .hero-title {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  line-height: 1.16;
}

.gradient-text {
  color: var(--ink);
}

.highlight-text {
  background: linear-gradient(96deg, var(--brand) 0%, #c084fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

:root[data-theme="light"] .highlight-text {
  background: linear-gradient(96deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(1rem, 1.2vw, 1.08rem);
  color: var(--ink-2);
  line-height: 1.9;
  margin-bottom: 28px;
  max-width: 34rem;
}

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

.hero-stats {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 0;
  padding-block-start: 22px;
  border-block-start: 1px solid var(--line);
  width: 100%;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-inline: 22px;
}

.stat-item:first-child {
  padding-inline-start: 0;
}

.stat-item + .stat-item {
  border-inline-start: 1px solid var(--line);
}

.stat-val {
  font-family: var(--font-en);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

html[dir="rtl"] .stat-val {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

.stat-lbl {
  font-size: 0.78rem;
  color: var(--ink-3);
  line-height: 1.6;
}

/* Hero app dock */
.hero-panel {
  position: relative;
  display: flex;
  align-self: stretch;
  padding: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(120% 80% at 50% 0%, var(--brand-soft) 0%, transparent 60%),
    linear-gradient(168deg, var(--surface) 0%, var(--bg-soft) 100%);
  box-shadow: var(--shadow-3);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset-inline: 18%;
  inset-block-start: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.hero-apps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  width: 100%;
}

.app-tile {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-height: 60px;
  padding: 8px 14px 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface-2);
  text-align: start;
  transition: transform 0.22s var(--ease), border-color 0.22s ease, background 0.22s ease;
}

html[dir="rtl"] .app-tile {
  padding: 8px 12px 8px 14px;
}

.app-tile-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-bounce);
}

.app-tile-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-tile-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.app-tile-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tile-tag {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-3);
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-tile-arrow {
  color: var(--ink-3);
  opacity: 0.55;
  flex-shrink: 0;
  transition: translate 0.22s var(--ease), opacity 0.22s ease, color 0.22s ease;
}

html[dir="ltr"] .app-tile-arrow {
  transform: scaleX(-1);
}

.app-tile:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
  transform: translateX(-2px);
}

html[dir="ltr"] .app-tile:hover {
  transform: translateX(2px);
}

.app-tile:hover .app-tile-logo {
  transform: scale(1.05);
}

.app-tile:hover .app-tile-arrow {
  color: var(--brand-ink);
  opacity: 1;
  translate: -2px 0;
}

html[dir="ltr"] .app-tile:hover .app-tile-arrow {
  translate: 2px 0;
}

.app-tile--more {
  border: 1px dashed var(--line-strong);
  background: transparent;
}

.app-tile--more .app-tile-name {
  color: var(--ink-3);
  font-size: 0.86rem;
}

.app-tile-more-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line-strong);
  color: var(--ink-3);
  flex-shrink: 0;
}

.app-tile--more:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.app-tile--more:hover .app-tile-name {
  color: var(--brand-ink);
}

.app-tile--more:hover .app-tile-more-icon {
  border-color: var(--brand);
  color: var(--brand-ink);
}

/* ---------- APPS SHOWCASE ---------- */

.app-showcase {
  padding-block: var(--section-y);
  border-block-start: 1px solid var(--line);
  position: relative;
}

.app-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(28px, 4vw, 52px);
}

.app-row + .app-row {
  border-block-start: 1px solid var(--line);
}

.app-row-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.app-row-media {
  position: relative;
  order: 2;
  min-width: 0;
  isolation: isolate;
}

.app-row:nth-of-type(even) .app-row-body {
  order: 2;
}

.app-row:nth-of-type(even) .app-row-media {
  order: 1;
}

.app-row-media::before {
  content: "";
  position: absolute;
  inset: 6% 0;
  z-index: -1;
  background: radial-gradient(closest-side, var(--row-glow, var(--brand-glow)) 0%, transparent 72%);
  opacity: 0.85;
  filter: blur(24px);
}

.card-kaghaz { --row-glow: var(--accent-kaghaz-glow); --row-accent: var(--accent-kaghaz); }
.card-artilo { --row-glow: var(--accent-artilo-glow); --row-accent: var(--accent-artilo); }
.card-danak { --row-glow: var(--accent-danak-glow); --row-accent: var(--accent-danak); }
.card-shakhes { --row-glow: var(--accent-shakhes-glow); --row-accent: var(--accent-shakhes); }
.card-modam { --row-glow: var(--accent-modam-glow); --row-accent: var(--accent-modam); }

.accent-kaghaz { --row-glow: var(--accent-kaghaz-glow); --row-accent: var(--accent-kaghaz); }
.accent-artilo { --row-glow: var(--accent-artilo-glow); --row-accent: var(--accent-artilo); }
.accent-danak { --row-glow: var(--accent-danak-glow); --row-accent: var(--accent-danak); }
.accent-shakhes { --row-glow: var(--accent-shakhes-glow); --row-accent: var(--accent-shakhes); }
.accent-modam { --row-glow: var(--accent-modam-glow); --row-accent: var(--accent-modam); }
.accent-default { --row-glow: var(--brand-glow); --row-accent: var(--brand); }

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

.app-logo-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  box-shadow: var(--shadow-1);
  flex-shrink: 0;
}

.app-meta {
  min-width: 0;
}

.app-meta h3 {
  font-size: 1.3rem;
  line-height: 1.4;
  margin-bottom: 3px;
}

.app-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-3);
}

.app-category::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--row-accent, var(--brand));
}

.app-category.kaghaz { color: var(--accent-kaghaz); }
.app-category.artilo { color: var(--accent-artilo); }
.app-category.danak { color: var(--accent-danak); }
.app-category.shakhes { color: var(--accent-shakhes); }
.app-category.modam { color: var(--accent-modam); }

.app-card-desc {
  font-size: 0.98rem;
  color: var(--ink-2);
  line-height: 1.9;
  max-width: 48ch;
}

.feature-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Phone fan (home showcase) */
.phone-fan {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-block: 14px;
  padding-inline: 12px;
}

.fan-phone {
  width: 38%;
  flex: 0 0 auto;
  position: relative;
  transition: transform 0.45s var(--ease);
}

.fan-phone:nth-child(2) {
  margin-inline: -8%;
  z-index: 2;
}

.fan-phone:nth-child(3) {
  z-index: 1;
}

.fan-phone:nth-child(1) {
  z-index: 1;
  transform: rotate(-5deg) translateY(3%);
}

.fan-phone:nth-child(2) {
  transform: translateY(-2%) scale(1.04);
}

.fan-phone:nth-child(3) {
  transform: rotate(5deg) translateY(3%);
}

.app-row:hover .fan-phone:nth-child(1) {
  transform: rotate(-7deg) translateY(3%) translateX(-3%);
}

.app-row:hover .fan-phone:nth-child(3) {
  transform: rotate(7deg) translateY(3%) translateX(3%);
}

/* Screenshot tiles (shared by fan + detail galleries) */
.screenshot-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
  aspect-ratio: 9 / 16;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-2);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.screenshot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.screenshot-item:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-3);
}

.screenshot-item:hover img {
  transform: scale(1.03);
}

.fan-phone .screenshot-item {
  border-radius: var(--radius-lg);
}

/* Detail-page gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery-shell {
  padding: clamp(16px, 3vw, 28px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--surface) 0%, var(--bg-soft) 100%);
  max-width: 760px;
  margin-inline: auto;
}

/* ---------- ABOUT ---------- */

.about-section {
  padding-block: var(--section-y);
  border-block-start: 1px solid var(--line);
}

.about-box {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--surface) 0%, var(--bg-soft) 100%);
  padding: clamp(24px, 4vw, 44px);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 44px);
  align-items: center;
}

.profile-avatar,
.avatar-placeholder {
  width: 190px;
  height: 190px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  margin: 0 auto;
}

.profile-avatar {
  object-fit: cover;
}

.avatar-placeholder {
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--brand-ink);
}

.about-bio {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.95;
  margin-bottom: 20px;
  max-width: 68ch;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 24px;
}

/* ---------- PAGE HERO (app detail / dev) ---------- */

.page-hero {
  padding-block: clamp(40px, 6vw, 76px) clamp(28px, 4vw, 48px);
  position: relative;
}

.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}

.page-hero-grid > * {
  min-width: 0;
}

.hero-logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(320px, 100%);
  justify-self: center;
  padding: clamp(20px, 4vw, 34px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(168deg, var(--surface) 0%, var(--bg-soft) 100%);
  box-shadow: var(--shadow-3);
  position: relative;
}

.hero-logo-card::before {
  content: "";
  position: absolute;
  inset: 12%;
  z-index: 0;
  background: radial-gradient(closest-side, var(--row-glow, var(--brand-glow)) 0%, transparent 70%);
  filter: blur(22px);
}

.app-hero-logo {
  position: relative;
  z-index: 1;
  width: min(200px, 55vw);
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-3);
}

.page-title {
  font-size: clamp(1.85rem, 3.6vw, 2.7rem);
  line-height: 1.3;
  letter-spacing: var(--tracking);
  margin-bottom: 14px;
}

html[dir="rtl"] .page-title {
  line-height: 1.45;
  letter-spacing: 0;
}

.back-link {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 18px;
  transition: color 0.2s ease, gap 0.2s ease;
}

.back-link:hover {
  color: var(--brand-ink);
  gap: 10px;
}

/* Spec cards */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-block: clamp(32px, 5vw, 56px);
  counter-reset: spec;
}

.spec-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.28s ease, transform 0.28s var(--ease), background 0.28s ease;
}

.spec-card::before {
  counter-increment: spec;
  content: "0" counter(spec);
  display: block;
  font-family: var(--font-en);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 14px;
}

.spec-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.spec-card h4 {
  font-size: 1.02rem;
  margin-bottom: 8px;
  line-height: 1.6;
}

.spec-card p {
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.85;
}

/* ---------- DEV PAGE ---------- */

.skills-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  gap: 16px;
}

.skill-category-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 0.28s ease, background 0.28s ease;
}

.skill-category-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.skill-category-card h4 {
  font-size: 0.98rem;
  margin-bottom: 14px;
  color: var(--ink);
}

.skill-category-card .tech-tags {
  margin-bottom: 0;
}

.timeline-container {
  position: relative;
  max-width: 780px;
  margin-inline: auto;
}

.timeline-container::before {
  content: "";
  position: absolute;
  inset-inline-start: 7px;
  inset-block: 14px;
  width: 1px;
  background: var(--line);
}

.timeline-card-item {
  position: relative;
  padding-inline-start: 34px;
  margin-bottom: 14px;
}

.timeline-card-dot {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 26px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.timeline-card-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.timeline-card-item:hover .timeline-card-content {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.timeline-card-content h4 {
  font-size: 1rem;
  margin-bottom: 6px;
  line-height: 1.6;
}

.timeline-card-content p {
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.85;
}

.timeline-date-tag {
  display: inline-block;
  font-family: var(--font-en);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brand-ink);
  margin-bottom: 6px;
}

html[dir="rtl"] .timeline-date-tag {
  font-family: var(--font-fa);
  letter-spacing: 0;
  font-size: 0.8rem;
}

.stats-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 5vw, 56px);
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: var(--surface);
}

.stats-band .stat-item {
  align-items: center;
  text-align: center;
  padding-inline: 0;
  border: none;
}

/* ---------- CONTACT ---------- */

.contact-section {
  padding-block: var(--section-y);
  border-block-start: 1px solid var(--line);
}

.contact-card {
  background: linear-gradient(170deg, var(--surface) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 5vw, 56px);
  text-align: center;
  max-width: 780px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-card .section-eyebrow::before {
  display: none;
}

.contact-card .section-desc {
  margin-bottom: 0;
  margin-inline: auto;
}

.contact-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 28px;
  width: 100%;
}

.contact-btn-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.22s ease;
}

.contact-btn-item svg {
  color: var(--ink-3);
  transition: color 0.22s ease;
}

.contact-btn-item:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -14px var(--brand-glow);
}

.contact-btn-item:hover svg {
  color: #fff;
}

/* ---------- FAQ ---------- */

.faq-section {
  padding-block: var(--section-y);
  border-block-start: 1px solid var(--line);
}

.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 800px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.faq-item:hover {
  border-color: var(--line-strong);
}

.faq-item[open] {
  border-color: var(--brand);
  background: var(--surface-2);
}

.faq-question {
  padding: 16px 20px;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::after {
  content: "+";
  font-family: var(--font-en);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink-3);
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.faq-item[open] .faq-question::after {
  content: "−";
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.faq-answer {
  padding: 0 20px 20px;
  color: var(--ink-2);
  font-size: 0.93rem;
  line-height: 1.9;
}

/* ---------- FOOTER ---------- */

.footer {
  border-block-start: 1px solid var(--line);
  background: var(--footer-bg);
  padding-block: clamp(40px, 6vw, 64px) 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 40px);
  margin-bottom: 36px;
}

.footer-brand p {
  color: var(--ink-3);
  font-size: 0.88rem;
  margin-top: 12px;
  max-width: 260px;
  line-height: 1.8;
}

.footer-col h5 {
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 12px;
  font-weight: 700;
}

html[dir="rtl"] .footer-col h5 {
  letter-spacing: 0;
  font-size: 0.82rem;
}

.footer-col a {
  display: block;
  font-size: 0.88rem;
  color: var(--ink-2);
  margin-bottom: 8px;
  transition: color 0.2s ease;
  width: fit-content;
}

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

.footer-bottom {
  padding-block-start: 22px;
  border-block-start: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--ink-3);
}

/* ---------- LIGHTBOX ---------- */

.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(3, 4, 7, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  display: flex;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.lightbox-modal.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  max-width: min(90vw, 460px);
  max-height: 88vh;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  object-fit: contain;
  box-shadow: var(--shadow-3);
  transform: scale(0.96);
  transition: transform 0.28s var(--ease);
}

.lightbox-modal.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  inset-block-start: 20px;
  inset-inline-end: 20px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all 0.2s ease;
}

.lightbox-close:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---------- SCROLL REVEAL ---------- */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  will-change: opacity, transform;
}

.reveal-on-scroll:not(.visible) {
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

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

/* Rotated fan phones must keep their rotation while revealing. */
.fan-phone.reveal-on-scroll {
  opacity: 0.001;
}

.fan-phone.reveal-on-scroll.visible {
  opacity: 1;
}

/* =============================================================
   RESPONSIVE
   ============================================================= */

#apps,
#about,
#contact,
.faq-section {
  scroll-margin-block-start: calc(var(--nav-h) + 20px);
}

@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .hero-panel {
    max-width: 520px;
    width: 100%;
    margin-inline: auto;
    order: 2;
  }

  .page-hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .page-hero-grid .hero-logo-card {
    order: -1;
    max-width: 300px;
    width: 100%;
    margin-inline: auto;
  }

  .app-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-block: 36px;
  }

  .app-row-media,
  .app-row:nth-of-type(even) .app-row-media {
    order: 0;
  }

  .app-row-body {
    order: 1;
  }

  .about-box {
    grid-template-columns: minmax(0, 1fr);
    text-align: center;
    justify-items: center;
  }

  .about-bio {
    margin-inline: auto;
  }

  .tech-tags {
    justify-content: center;
  }

  .about-box .btn {
    align-self: center;
  }
}

@media (max-width: 860px) {
  /* Fan becomes a snap-scroll rail */
  .app-row-media {
    margin-inline: calc(var(--gutter) * -1);
    width: auto;
  }

  .app-row-media::before {
    display: none;
  }

  .phone-fan {
    overflow-x: auto;
    justify-content: flex-start;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-inline: var(--gutter);
    padding-block-end: 10px;
    scrollbar-width: none;
  }

  .phone-fan::-webkit-scrollbar {
    display: none;
  }

  .fan-phone {
    width: 58%;
    max-width: 240px;
    transform: none !important;
    scroll-snap-align: center;
  }

  .fan-phone:nth-child(2) {
    margin-inline: 0;
  }

  .app-row:hover .fan-phone {
    transform: none !important;
  }

  .gallery-shell {
    padding: 14px;
    max-width: 100%;
  }

  .gallery-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    scrollbar-width: none;
  }

  .gallery-grid::-webkit-scrollbar {
    display: none;
  }

  .gallery-grid .screenshot-item {
    flex: 0 0 64%;
    max-width: 240px;
    scroll-snap-align: center;
  }
}

@media (max-width: 820px) {
  :root {
    --nav-h: 60px;
  }

  .nav-desktop {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
  }

  .nav-menu {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(320px, 86vw);
    z-index: 2000;
    background: var(--drawer-bg);
    border-inline-start: 1px solid var(--line);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    padding: 18px;
    transform: translateX(100%);
    transition: transform 0.32s var(--ease);
    visibility: hidden;
    overflow-y: auto;
  }

  html[dir="rtl"] .nav-menu {
    transform: translateX(-100%);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.5);
    border-inline-start: none;
    border-inline-end: 1px solid var(--line);
  }

  .nav-menu.open,
  html[dir="rtl"] .nav-menu.open {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block-end: 16px;
    border-block-end: 1px solid var(--line);
    margin-block-end: 12px;
  }

  .nav-menu-close {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
    transition: all 0.2s ease;
  }

  .nav-menu-close:hover {
    color: var(--ink);
    border-color: var(--line-strong);
  }

  .nav-menu-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    padding-block: 6px;
  }

  .nav-menu-body .nav-link {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--ink-2);
    min-height: 46px;
    transition: all 0.2s ease;
  }

  .nav-menu-body .nav-link:hover {
    background: var(--surface-2);
    color: var(--ink);
  }

  .nav-menu-body .nav-link.active {
    background: var(--brand-soft);
    color: var(--brand-ink);
  }

  .nav-menu-foot {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-block-start: 16px;
    border-block-start: 1px solid var(--line);
    margin-block-start: 16px;
  }

  .nav-menu-foot .lang-toggle {
    display: flex;
  }

  .nav-menu-foot .lang-btn {
    flex: 1;
    padding-block: 7px;
  }
}

body.nav-locked {
  overflow: hidden;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 26px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    text-align: start;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 1.95rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-actions .store-badges {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .hero-actions .store-badge {
    width: 100%;
  }

  .hero-stats {
    padding-block-start: 18px;
  }

  .stat-item {
    padding-inline: 16px;
    flex: 1;
  }

  .stat-item:first-child {
    padding-inline-start: 0;
  }

  .stat-val {
    font-size: 1.25rem;
  }

  .stat-lbl {
    font-size: 0.72rem;
  }

  .hero-panel {
    padding: 10px;
    border-radius: var(--radius-lg);
  }

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

  .app-tile {
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    padding: 13px 6px;
    text-align: center;
  }

  .app-tile-text {
    align-items: center;
    flex: 0 1 auto;
  }

  .app-tile-tag,
  .app-tile-arrow {
    display: none;
  }

  .app-tile-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .app-tile-name {
    font-size: 0.78rem;
  }

  .app-tile:hover {
    transform: none;
  }

  .app-meta h3 {
    font-size: 1.1rem;
  }

  .app-logo-img {
    width: 48px;
    height: 48px;
  }

  .app-card-desc {
    font-size: 0.94rem;
  }

  .card-actions {
    width: 100%;
  }

  .card-actions .btn {
    flex: 1;
  }

  .contact-buttons {
    flex-direction: column;
  }

  .contact-btn-item {
    width: 100%;
  }

  .gallery-grid .screenshot-item {
    flex-basis: 74%;
  }

  .fan-phone {
    width: 66%;
  }

  .page-hero-grid .hero-logo-card {
    max-width: 240px;
  }

  .app-hero-logo {
    width: min(160px, 50vw);
  }
}

@media (max-width: 480px) {
  .nav-name {
    font-size: 0.95rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 0.76rem;
  }

  .theme-toggle,
  .mobile-toggle {
    width: 36px;
    height: 36px;
  }

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

  .footer-brand {
    grid-column: auto;
  }

  .about-box {
    padding: 22px 16px;
  }

  .stats-band {
    gap: 18px;
  }
}

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

  .reveal-on-scroll,
  .fan-phone.reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .fan-phone:nth-child(1) { transform: rotate(-5deg) translateY(3%); }
  .fan-phone:nth-child(2) { transform: translateY(-2%) scale(1.04); }
  .fan-phone:nth-child(3) { transform: rotate(5deg) translateY(3%); }
}
