/* ============================================================
   FEKRA — Responsive Breakpoints (mobile-last, largest → smallest)
   ============================================================ */

/* ════════════════════════════════════════════════════════════
   LARGE — 1600px+
   ════════════════════════════════════════════════════════════ */
@media (min-width: 1600px) {
  .hero-title-sub { font-size: 0.78em !important; line-height: 0.9 !important; }

  .section-title { font-size: clamp(2.8rem, 3.5vw, 3.8rem); }
  .section-desc  { font-size: 1.15rem; line-height: 1.9; }

  .svc-card {
    padding: 64px 36px 58px;
    min-height: 360px;
    gap: 0;
  }
  .svc-icon    { width: 64px; height: 64px; margin-bottom: 30px; }
  .svc-title   { font-size: 1.3rem; margin-bottom: 14px; line-height: 1.4; }
  .svc-subtitle { font-size: .95rem; line-height: 1.7; }

  .why-card       { min-height: 200px; padding: 40px 36px; }
  .why-card-title { font-size: 1.2rem; line-height: 1.4; }
  .why-card-text  { font-size: 1rem; line-height: 1.8; }

  .folder-title { font-size: 1.15rem; line-height: 1.35; }
}

/* ════════════════════════════════════════════════════════════
   DESKTOP — min-width 992px (social links)
   ════════════════════════════════════════════════════════════ */
@media (min-width: 992px) {
  .social-links { gap: 18px !important; justify-content: center !important; }
  .social-links a {
    min-width: 180px !important;
    padding: 18px 28px !important;
    justify-content: center !important;
    gap: 12px !important;
    border-radius: 999px !important;
  }
}

/* ════════════════════════════════════════════════════════════
   TABLET — max-width 1024px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Layout */
  .services-preview-grid   { grid-template-columns: repeat(2, 1fr); }
  .svc-card                { min-height: 260px; padding: 40px 20px 36px; }
  .contact-info-grid       { grid-template-columns: 1fr; }
  .footer-grid             { grid-template-columns: 1fr 1fr; }
  .why-us-grid             { grid-template-columns: 1fr; }
  .values-grid             { grid-template-columns: 1fr; }
  .about-philosophy-grid   { grid-template-columns: 1fr; }
  .about-preview           { padding: 80px 0; min-height: 560px; }

  /* Page hero padding */
  .about-hero      { padding: 130px 0 80px; }
  .contact-hero    { padding: 130px 0 70px; }
  .svc-hero        { padding: 130px 0 70px !important; }
  .pf-hero-section { padding: 130px 0 70px !important; }

  /* Services showcase */
  .svc-block-inner   { gap: 0 50px; }
  .svc-block-visual  { height: 320px; }
}

/* ════════════════════════════════════════════════════════════
   TABLET-NARROW — max-width 991px (services hero character)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
  .hero-character {
    position: relative;
    bottom: auto;
    display: block;
    margin: 0 auto 36px;
    height: auto;
    width: 300px;
  }
  .svc-hero-container { padding-inline-end: 0; }
  .svc-char-fg        { display: none; }
}

/* ════════════════════════════════════════════════════════════
   TABLET-NARROW — max-width 980px (folder grids)
   ════════════════════════════════════════════════════════════ */
@media (max-width: 980px) {
  .home-folder-grid      { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 62px 36px; }
  .portfolio-folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 62px 36px; }
}

/* ════════════════════════════════════════════════════════════
   TABLET-NARROW — max-width 900px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .abt-hero-char      { width: 32%; }
  .pf-hero-char       { width: 36%; }
  .pf-hero-container  { padding-inline-end: 38%; }
}

/* ════════════════════════════════════════════════════════════
   MOBILE — max-width 768px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Global */
  .section { padding: 80px 0; }
  .hero-title { font-size: clamp(2.2rem, 8vw, 3.5rem); }

  /* Nav */
  .nav       { gap: 16px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-logo img,
  .site-logo { width: 150px !important; max-width: 170px !important; height: auto !important; }

  /* Cards & grids */
  .services-preview-grid { grid-template-columns: 1fr; }
  .svc-card              { min-height: auto; padding: 36px 24px 32px; }
  .footer-grid           { grid-template-columns: 1fr; }
  .footer-bottom         { flex-direction: column; gap: 8px; text-align: center; }
  .footer::after         { display: none; }

  /* Cursor hidden on touch */
  .cursor, .cursor-follower { display: none; }
  body { cursor: auto; }

  /* Hero (default RTL/Arabic centering) */
  .hero-content {
    text-align: right !important;
    align-items: flex-end !important;
  }
  .hero-badge, .hero-title, .hero-sub-line, .hero-desc {
    text-align: right !important;
    width: 100%;
    margin-inline-start: 0 !important;
    margin-inline-end: 0 !important;
  }
  .hero-cta {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    display: flex !important;
  }
  .hero-cta .btn { width: min(310px, 88vw); justify-content: center; }
  .hero-title-sub { display: block; line-height: .95; }
  .hero-sub-line,
  .hero-desc { text-align: center; margin-inline: auto; max-width: 88vw; }

  /* Arabic hero title sizes */
  html[lang="ar"] .hero-title     { font-size: 54px !important; line-height: 1.3 !important; }
  html[lang="ar"] .hero-title-sub { font-size: 46px !important; line-height: .9 !important; }
  html[lang="ar"] .hero-sub-line  { font-size: 22px !important; line-height: 1.2 !important; color: #fff !important; }

  /* Page hero */
  .page-hero-title {
    font-size: clamp(1.8rem, 6.5vw, 2.8rem) !important;
    white-space: normal !important;
    word-break: break-word;
    letter-spacing: -.01em;
  }
  .page-hero-text { font-size: .9rem; }

  /* Page hero padding */
  .about-hero      { padding: 110px 0 60px; }
  .contact-hero    { padding: 110px 0 56px; }
  .svc-hero        { padding: 110px 0 56px !important; }
  .pf-hero-section { padding: 110px 0 56px !important; }

  /* About preview (index homepage) */
  .about-preview         { padding: 72px 0; min-height: 460px; }
  .about-preview-content { max-width: 100%; }
  .about-preview-title   { font-size: clamp(1.5rem, 5vw, 2rem); }
  .about-preview-bg {
    background-size: cover;
    background-position: 30% center !important;
    opacity: 0.18;
  }
  .about-preview-bg::before {
    background: radial-gradient(
      ellipse 70% 60% at 50% 52%,
      rgba(18,60,230,0.10) 0%,
      rgba(10,30,120,0.05) 45%,
      transparent 72%
    );
  }
  .about-preview-bg::after {
    background:
      linear-gradient(to bottom, var(--bg-2) 0%, transparent 18%),
      linear-gradient(to top,    var(--bg-2) 0%, transparent 18%);
  }
  .about-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6,13,26,0.52);
    z-index: 1;
    pointer-events: none;
  }
  .about-preview .container  { position: relative; z-index: 2; }
  .about-preview-content     { position: relative; z-index: 2; }

  /* Section */
  .section-title { font-size: clamp(1.5rem, 5vw, 2.2rem); }

  /* Phil cards */
  .phil-card-title { white-space: normal !important; font-size: 1rem; line-height: 1.45; }

  /* Values */
  .values-grid { grid-template-columns: repeat(2, 1fr); }

  /* Glow blobs */
  .glow-1 { width: 280px; height: 280px; top: -50px; right: -50px; }
  .glow-2 { width: 220px; height: 220px; bottom: 0; left: 5%; }
  .glow-3 { width: 170px; height: 170px; top: 45%; right: 12%; }
  .grid-lines { background-size: 44px 44px; }

  /* Social */
  .social-links { flex-direction: column; align-items: center; }

  /* About hero char */
  .abt-hero-char { left: 0; bottom: 0; width: 100%; height: 100%; z-index: 0; }
  .abt-hero-char::before,
  .abt-hero-char::after { background: none; }
  .abt-hero-char-img {
    position: absolute;
    left: 50%; top: 45%;
    width: 120%; max-width: none; height: auto;
    transform: translate(-50%, -50%);
    object-fit: contain;
    object-position: center center;
    opacity: 0.26;
    filter: brightness(0.65);
  }
  .about-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6,13,26,0.55);
    z-index: 1;
    pointer-events: none;
  }
  .about-hero { padding-top: 190px !important; }
  .about-hero .page-hero-title { margin-top: 14px !important; }
  .about-philosophy-grid { margin-top: 70px !important; }
  .about-hero .container { text-align: center !important; align-items: center !important; }
  .about-hero .page-hero-label { margin-inline: auto !important; }
  .about-hero .page-hero-title,
  .about-hero .page-hero-text { text-align: center !important; margin-inline: auto !important; white-space: normal !important; }
  .about-hero .page-hero-title {
    font-size: 30px !important;
    line-height: 1.05 !important;
    letter-spacing: -0.03em;
    max-width: 92%;
    margin-inline: auto;
  }
  .about-hero .page-hero-title .gradient-text { display: block !important; margin-top: 8px !important; }
  .about-hero .page-hero-text { font-size: .95rem !important; line-height: 1.8; max-width: 88%; margin-inline: auto; }
  .abt-hero-char-img { opacity: 0.54 !important; }

  /* Services hero */
  .svc-hero { padding-top: 150px !important; padding-bottom: 40px !important; min-height: auto !important; }
  .svc-showcase { padding-top: 60px !important; }
  .svc-hero .page-hero-title {
    font-size: 30px !important;
    line-height: 1.15 !important;
    padding-block: 8px !important;
    overflow: visible !important;
    letter-spacing: -0.03em;
    white-space: normal !important;
    max-width: 92%;
    margin-inline: auto;
  }
  .svc-hero .page-hero-title span,
  .svc-hero .page-hero-title .gradient-text {
    line-height: 1.15 !important;
    padding-block: 4px !important;
    overflow: visible !important;
    display: block;
    margin-top: 6px;
  }
  .svc-hero-container { overflow: visible !important; text-align: center; display: flex; flex-direction: column; align-items: center; }
  .svc-hero .page-hero-label { margin-inline: auto; }
  .svc-hero .page-hero-text  { font-size: 1rem; line-height: 1.8; max-width: 88%; margin-inline: auto; }
  .hero-character {
    position: absolute;
    left: 45%; top: 50%; bottom: auto;
    width: 90%; max-width: 420px; height: auto;
    margin: 0;
    transform: translate(-58%, -50%);
    object-fit: contain;
    object-position: center center;
    opacity: 0.20;
    filter: brightness(0.45) contrast(1.05);
    z-index: 0;
    display: block;
  }
  .svc-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6,13,26,0.60);
    z-index: 1;
    pointer-events: none;
  }

  /* Services showcase blocks */
  .svc-block { padding: 72px 0; }
  .svc-block-inner { grid-template-columns: 1fr; gap: 48px 0; }
  .svc-block:nth-child(even) .svc-block-inner { direction: rtl; }
  .svc-block-visual { height: 280px; }
  .svc-ghost-num { font-size: clamp(6rem, 18vw, 10rem); }

  /* Portfolio hero */
  .pf-hero-section { padding-top: 150px !important; padding-bottom: 40px !important; min-height: auto !important; }
  .pf-hero-char { left: 0; bottom: 0; width: 100%; height: 100%; z-index: 0; }
  .pf-hero-char::before,
  .pf-hero-char::after { background: none; }
  .pf-hero-char-img {
    position: absolute;
    left: 50%; top: 50%;
    width: 90%; max-width: 420px; height: auto;
    transform: translate(-50%, -50%);
    object-fit: contain;
    object-position: center center;
    opacity: 0.22;
    filter: brightness(0.55) contrast(1.05);
    z-index: 0;
  }
  .pf-hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(6,13,26,0.58);
    z-index: 1;
    pointer-events: none;
  }
  .pf-hero-container {
    padding-inline-end: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .pf-hero-section .page-hero-title {
    font-size: clamp(2rem, 8vw, 3.2rem) !important;
    line-height: 1.05 !important;
    white-space: normal !important;
    max-width: 92%;
    margin-inline: auto;
  }
  .pf-hero-section .page-hero-text  { font-size: 1rem; line-height: 1.9; max-width: 88%; margin-inline: auto; }
  .pf-hero-section .page-hero-label { margin-inline: auto; }

  /* Contact hero */
  .contact-hero {
    min-height: auto !important;
    padding-top: 190px !important;
    padding-bottom: 60px !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .contact-hero .container,
  .contact-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 14px;
  }
  .contact-hero .page-hero-label { margin-inline: auto; }
  .contact-hero .page-hero-title {
    font-size: clamp(2.2rem, 9vw, 3.4rem) !important;
    text-align: center;
    margin-inline: auto;
    line-height: 1.05 !important;
    margin-top: 8px !important;
    margin-bottom: 10px !important;
  }
  .contact-hero .page-hero-text {
    text-align: center;
    max-width: 320px;
    margin-inline: auto;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  .social-section .section-tag   { margin-top: 0 !important; }
  .social-section                { padding-top: 24px !important; }
  .social-section .section-title { font-size: 2.4rem !important; line-height: 1.1 !important; text-align: center !important; margin-bottom: 26px !important; }
  .social-links {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important;
    margin-top: 24px !important;
  }
  .social-links .social-link {
    width: auto !important;
    min-width: 92px !important;
    height: auto !important;
    padding: 14px 16px !important;
    font-size: .95rem !important;
    border-radius: 999px !important;
  }
  .contact-info-grid  { margin-top: 55px !important; grid-template-columns: 1fr !important; gap: 22px !important; padding-inline: 18px !important; }
  .contact-info-card  { min-height: auto !important; padding: 28px 22px !important; }
  .contact-map-box    { height: 320px !important; border-radius: 22px !important; }
  .contact-map-box iframe { opacity: 1 !important; filter: none !important; }
}

/* ════════════════════════════════════════════════════════════
   SMALL MOBILE — max-width 640px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* Folder cards */
  .folder-card,
  .folder-shape { min-height: 300px; }
  .folder-body  { min-height: 265px; }
  .folder-tab   { width: 58%; }
  .folder-info  { inset-inline: 20px; bottom: 22px; }

  /* Folder grids — single column */
  .home-folder-grid      { grid-template-columns: 1fr; gap: 52px; }
  .portfolio-folder-grid { grid-template-columns: 1fr; gap: 52px; }

  /* Services character */
  .hero-character { width: 200px; margin-bottom: 28px; }

  /* About & portfolio character on mobile */
  .abt-hero-char { width: 50%; opacity: 0.18; }
  .pf-hero-char  { width: 60%; opacity: 0.98; }
  .pf-hero-container { padding-inline-end: 0; }
}

/* ════════════════════════════════════════════════════════════
   SMALL MOBILE — max-width 480px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .container { padding: 0 18px; }

  /* Page hero padding */
  .about-hero      { padding: 90px 0 48px; }
  .contact-hero    { padding: 90px 0 40px; }
  .svc-hero        { padding: 90px 0 40px !important; }
  .pf-hero-section { padding: 90px 0 40px !important; }
  .page-hero-title {
    font-size: clamp(1.45rem, 5.5vw, 1.9rem) !important;
    white-space: normal !important;
  }

  /* Section */
  .section       { padding: 56px 0; }
  .section-title { font-size: 1.6rem; }
  .section-tag   { font-size: .6rem; letter-spacing: .14em; }

  /* About preview */
  .about-preview       { padding: 60px 0; min-height: 380px; }
  .about-preview-bg    { background-position: center center !important; opacity: 0.24; }
  .about-preview::after { background: rgba(6,13,26,0.48); }
  .about-preview-title { font-size: 1.5rem; }
  .about-preview-text  { font-size: .9rem; }

  /* Phil cards */
  .phil-card       { padding: 28px 20px; }
  .phil-card-title { font-size: .9rem; line-height: 1.45; white-space: normal !important; }

  /* Layout */
  .values-grid  { grid-template-columns: 1fr; }
  .why-us-grid  { grid-template-columns: 1fr; }

  /* Glow blobs */
  .glow-1 { width: 200px; height: 200px; top: -35px; right: -35px; }
  .glow-2 { width: 170px; height: 170px; }
  .glow-3 { width: 130px; height: 130px; right: 8%; }

  /* Service preview cards */
  .svc-card { padding: 40px 22px 36px; min-height: auto; }

  /* Services showcase */
  .svc-showcase    { padding: 40px 0 100px; }
  .svc-block       { padding: 56px 0; }
  .svc-block-visual { height: 240px; }

  /* Final CTA */
  .final-cta       { padding: 60px 0; }
  .final-cta-title { font-size: clamp(1.4rem, 5vw, 1.9rem); }
  .final-cta-sub   { font-size: .88rem; margin-bottom: 32px; }
  .final-cta-line  { height: 56px; margin-bottom: 32px; }

  /* Contact */
  .contact-info-grid  { gap: 14px; }
  .contact-info-card  { padding: 24px 20px; }
  .contact-info-value { font-size: .88rem; word-break: break-all; }
  .social-link        { padding: 10px 18px; font-size: .8rem; }

  /* Portfolio modal */
  .pf-modal { padding: 36px 22px 40px; }

  /* Footer */
  .footer       { padding: 56px 0 32px; }
  .footer-grid  { gap: 36px; }
  .footer-brand p { max-width: 100%; }

  /* Buttons */
  .btn    { padding: 11px 22px; font-size: .88rem; }
  .btn-lg { padding: 13px 28px; font-size: .9rem; }
  .hero-cta { gap: 12px; }

  .hero-title { font-size: 2.9rem; }
  .site-logo  { height: 38px; }
}

/* ════════════════════════════════════════════════════════════
   EXTRA-SMALL — max-width 430px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 430px) {
  html[lang="en"] .about-hero .page-hero-title { font-size: 2.9rem !important; }
}

/* ════════════════════════════════════════════════════════════
   MINIMUM — max-width 360px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .container { padding: 0 14px; }

  .about-hero      { padding: 80px 0 40px; }
  .contact-hero    { padding: 80px 0 36px; }
  .svc-hero        { padding: 80px 0 36px !important; }
  .pf-hero-section { padding: 80px 0 36px !important; }
  .page-hero-title { font-size: 1.4rem !important; }
  .section         { padding: 48px 0; }
  .section-title   { font-size: 1.45rem; }
  .hero-title      { font-size: 1.7rem; }

  .site-logo { height: 32px; }

  .phil-card       { padding: 22px 16px; }
  .phil-card-title { font-size: .85rem; }

  .footer-social      { gap: 6px; }
  .footer-social-link { width: 32px; height: 32px; font-size: .88rem; }

  .contact-info-grid { gap: 12px; }
  .contact-info-card { padding: 20px 16px; }

  .folder-card, .folder-shape { min-height: 270px; }
  .folder-body { min-height: 235px; }

  .svc-block-visual { height: 200px !important; }
}

/* ════════════════════════════════════════════════════════════
   ACCESSIBILITY — reduced motion
   ════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
