/* ==========================================================================
   Ihsan Website — Design System (matches app tokens)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens (from app: Constants.swift, BRAND_GUIDE.md)
   -------------------------------------------------------------------------- */
:root {
  /* Backgrounds */
  --bg-primary: #000000;
  --bg-card: #1C1C1E;
  --bg-card-secondary: #242426;

  /* Accent */
  --accent-teal: #1CA094;
  --accent-teal-hover: #22b3a6;
  --gradient-start: #0E8C7F;
  --gradient-end: #3D2D7A;

  /* Text */
  --text-primary: rgba(255, 255, 255, 1);
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-disabled: rgba(255, 255, 255, 0.35);

  /* Semantic */
  --color-error: #E25C5C;
  --color-success: #34C759;
  --color-warning: #FF9500;

  /* Surfaces (opacity on card) */
  --surface-whisper: 0.05;
  --surface-faint: 0.08;
  --surface-row: 0.55;
  --surface-card: 0.65;
  --surface-hero: 1;

  /* Corner radius (app: DesignTokens.CornerRadius) */
  --radius-micro: 4px;
  --radius-mini: 8px;
  --radius-small: 12px;
  --radius-standard: 16px;
  --radius-large: 20px;

  /* Spacing (app: Spacing) */
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 16px;
  --space-l: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  --space-hero: 80px;
  --space-section: 120px;

  /* Layout */
  --container-max: 1100px;
  --nav-height: 72px;

  /* Transitions */
  --ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration-fast: 0.2s;
  --duration-normal: 0.35s;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--accent-teal-hover);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, .heading-1, .heading-2, .heading-3 {
  margin: 0 0 0.5em;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1, .heading-1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
}

h2, .heading-2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3, .heading-3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  margin: 0 0 1em;
  color: var(--text-secondary);
}

p:last-child {
  margin-bottom: 0;
}

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent-teal); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-m);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--space-xl);
  }
}

.section {
  padding: var(--space-section) 0;
}

.section--sm {
  padding: var(--space-hero) 0;
}

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-m);
  transition: background-color var(--duration-normal) var(--ease-out),
              backdrop-filter var(--duration-normal) var(--ease-out);
}

.nav.is-scrolled {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav__inner {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}

.nav__logo:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav__logo img {
  height: 32px;
  width: auto;
}

.nav__links {
  display: none;
  align-items: center;
  gap: var(--space-xl);
}

@media (min-width: 768px) {
  .nav__links {
    display: flex;
  }
}

.nav__links a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--duration-fast);
}

.nav__links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.nav__cta {
  display: none;
}

@media (min-width: 768px) {
  .nav__cta {
    display: block;
  }
}

.nav__hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0;
}

@media (min-width: 768px) {
  .nav__hamburger {
    display: none;
  }
}

/* Mobile menu */
.nav__mobile {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  transform: translateX(100%);
  transition: transform var(--duration-normal) var(--ease-out);
  overflow: auto;
}

.nav__mobile.is-open {
  transform: translateX(0);
}

.nav__mobile a {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
}

.nav__mobile .btn {
  margin-top: var(--space-m);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  padding: 14px 24px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  border: none;
  border-radius: var(--radius-standard);
  cursor: pointer;
  transition: background-color var(--duration-fast), color var(--duration-fast),
              transform var(--duration-fast);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent-teal);
  color: white;
}

.btn--primary:hover {
  background: var(--accent-teal-hover);
  color: white;
  text-decoration: none;
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  text-decoration: none;
}

.btn--large {
  padding: 18px 32px;
  font-size: 1.0625rem;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-standard);
  padding: var(--space-l);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.card--large {
  padding: var(--space-xl);
  border-radius: var(--radius-large);
}

/* --------------------------------------------------------------------------
   iPhone device frame (CSS-only mockup)
   -------------------------------------------------------------------------- */
.phone-mockup {
  position: relative;
  width: 280px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .phone-mockup {
    width: 300px;
  }
}

@media (min-width: 1200px) {
  .phone-mockup {
    width: 320px;
  }
}

.phone-mockup__frame {
  position: relative;
  background: #1a1a1a;
  border-radius: 44px;
  padding: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5),
              0 0 0 2px rgba(255, 255, 255, 0.06);
}

.phone-mockup__screen {
  position: relative;
  background: var(--bg-primary);
  border-radius: 34px;
  overflow: hidden;
  aspect-ratio: 9 / 19.5;
}

.phone-mockup__notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 28px;
  background: #000;
  border-radius: 0 0 20px 20px;
  z-index: 2;
}

.phone-mockup__screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.phone-mockup__placeholder {
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: linear-gradient(165deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Scroll-triggered fade-in (JS adds .is-visible)
   -------------------------------------------------------------------------- */
.animate-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

.animate-in--delay-1 { transition-delay: 0.1s; }
.animate-in--delay-2 { transition-delay: 0.2s; }
.animate-in--delay-3 { transition-delay: 0.3s; }

/* --------------------------------------------------------------------------
   Page content (below fixed nav)
   -------------------------------------------------------------------------- */
.page {
  padding-top: var(--nav-height);
  min-height: 100vh;
}

/* --------------------------------------------------------------------------
   Hero gradient text
   -------------------------------------------------------------------------- */
.gradient-text {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--bg-card);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: var(--space-xxl) 0 var(--space-xl);
}

.footer__grid {
  display: grid;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

@media (min-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr auto auto;
    align-items: start;
  }
}

.footer__logo {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  text-decoration: none;
}

.footer__logo:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.footer__links a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  text-decoration: none;
}

.footer__links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.footer__bottom {
  padding-top: var(--space-l);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
}

.footer__tagline {
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.footer__copyright {
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

/* --------------------------------------------------------------------------
   Utility
   -------------------------------------------------------------------------- */
.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;
}

.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-s { margin-bottom: var(--space-s); }
.mb-m { margin-bottom: var(--space-m); }
.mb-l { margin-bottom: var(--space-l); }
.mb-xl { margin-bottom: var(--space-xl); }

.font-semibold { font-weight: 600; }

/* Badge */
.badge {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-teal);
  background: rgba(28, 160, 148, 0.15);
  border-radius: var(--radius-mini);
}

.badge--teal {
  color: var(--accent-teal);
  background: rgba(28, 160, 148, 0.15);
}

/* Pillars grid (three cards) */
.pillars {
  display: grid;
  gap: var(--space-m);
}

@media (min-width: 768px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-l);
  }
}

.pillar-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: var(--space-m);
  line-height: 1;
}

/* Feature row (content + phone) */
.feature-row {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
}

@media (min-width: 1024px) {
  .feature-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xxl);
  }

  .feature-row--reverse .feature-row__content {
    order: 2;
  }

  .feature-row--reverse .feature-row__media {
    order: 1;
  }
}

.feature-row__media .phone-mockup {
  margin-left: 0;
  margin-right: 0;
}

@media (min-width: 1024px) {
  .feature-row__media .phone-mockup {
    margin-left: auto;
    margin-right: 0;
  }

  .feature-row--reverse .feature-row__media .phone-mockup {
    margin-left: 0;
    margin-right: auto;
  }
}

.feature-list {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.feature-list li {
  margin-bottom: var(--space-s);
  color: var(--text-secondary);
}

.feature-list li:last-child {
  margin-bottom: 0;
}

/* Pricing grid */
.pricing-grid {
  display: grid;
  gap: var(--space-m);
  max-width: 720px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  .pricing-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-l);
  }
}

/* Email form */
.email-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s);
  justify-content: center;
  max-width: 420px;
  margin: 0 auto;
}

.email-form__input {
  flex: 1;
  min-width: 200px;
  padding: 14px 18px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-standard);
  outline: none;
  transition: border-color var(--duration-fast);
}

.email-form__input::placeholder {
  color: var(--text-tertiary);
}

.email-form__input:focus {
  border-color: var(--accent-teal);
}

/* About / Story page */
.about-hero {
  padding-top: var(--space-hero);
}

.about-hero__arabic {
  font-size: clamp(2.5rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.about-prose {
  max-width: 680px;
}

.about-prose p {
  font-size: 1.0625rem;
  line-height: 1.65;
}

.about-block {
  margin-top: var(--space-xl);
  padding-top: var(--space-l);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.about-block:first-of-type {
  margin-top: var(--space-l);
  padding-top: 0;
  border-top: none;
}

.pull-quote {
  margin: 0;
  padding: var(--space-xl) 0;
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  border: none;
}

.pull-quote::before,
.pull-quote::after {
  content: none;
}

.mt-m { margin-top: var(--space-m); }
.mt-l { margin-top: var(--space-l); }
.mt-xl { margin-top: var(--space-xl); }

/* Legal / Privacy page */
.legal-prose {
  max-width: 680px;
}

.legal-prose h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-s);
}

.legal-prose h2:first-of-type {
  margin-top: 0;
}

.legal-list {
  margin: 0 0 1em;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.legal-list li {
  margin-bottom: var(--space-s);
}

/* FAQ / Support */
.faq {
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

.faq__item {
  padding-bottom: var(--space-l);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.faq__item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.faq__question {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-s);
}

.faq__answer {
  margin: 0;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Hero section
   -------------------------------------------------------------------------- */
.section--hero {
  padding: var(--space-hero) 0 var(--space-xxl);
  background: radial-gradient(ellipse at 50% 0%, rgba(14, 140, 127, 0.12) 0%, transparent 60%);
}

.hero-icon {
  margin: 0 auto var(--space-l);
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(14, 140, 127, 0.25),
              0 0 0 1px rgba(255, 255, 255, 0.06);
}

.hero-subtitle {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.125rem;
}

.hero-phones {
  margin-top: var(--space-xxl);
  margin-bottom: var(--space-xl);
}

.hero-cta {
  margin-top: var(--space-l);
}

/* Nav wordmark */
.nav__wordmark {
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

/* Privacy card */
.card--privacy {
  background: linear-gradient(135deg, rgba(14, 140, 127, 0.08), rgba(61, 45, 122, 0.08));
  border-color: rgba(14, 140, 127, 0.2);
}

/* Pro card */
.card--pro {
  border-color: var(--accent-teal);
  position: relative;
}

/* CTA icon */
.cta-icon {
  margin: 0 auto var(--space-l);
  border-radius: 20px;
}

/* App Store badge */
.app-store-badge {
  display: inline-block;
  transition: transform var(--duration-fast), opacity var(--duration-fast);
}

.app-store-badge:hover {
  transform: scale(1.03);
  opacity: 0.9;
  text-decoration: none;
}

.app-store-badge svg {
  display: block;
}

/* Pillar icon (SVG) */
.pillar-icon {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 56px;
  height: 56px;
  background: rgba(28, 160, 148, 0.1);
  border-radius: var(--radius-small);
  margin-bottom: var(--space-m);
  line-height: 1;
}

.pillar-icon svg {
  margin: auto;
}

.text-center .pillar-icon {
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}
