/* ================================================================
   SOULMEDIADIGITAL — Responsive System
   Breakpoints:
     xs  : 0   – 479px   (phones portrait)
     sm  : 480 – 639px   (phones landscape / large phones)
     md  : 640 – 767px   (small tablets)
     lg  : 768 – 1023px  (tablets)
     xl  : 1024– 1279px  (small laptops / iPad landscape)
     2xl : 1280–1439px   (laptops)
     3xl : 1440px+       (desktops / wide)
   ================================================================ */

/* ================================================================
   0. FLUID BASE — applies to all screen sizes
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  overflow-x: hidden;
  min-width: 320px;
}

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

/* Prevent horizontal bleed from decorative blobs */
.hero-blob, .bg-blob {
  pointer-events: none;
  overflow: hidden;
}

/* Container — fluid with max-width */
.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

/* Section padding — fluid */
.section    { padding-block: clamp(3rem, 8vw, 7rem); }
.section-sm { padding-block: clamp(2rem, 5vw, 4rem); }

/* ================================================================
   1. NAVBAR — full responsive
   ================================================================ */

/* Desktop: show nav links, hide hamburger */
.navbar-nav,
.navbar-cta { display: flex; }
.navbar-hamburger { display: none; }

/* Force navbar items to never wrap */
.navbar-inner {
  flex-wrap: nowrap;
  gap: 1rem;
}

/* Mobile menu closed by default */
.navbar-mobile {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
}
.navbar-mobile.open {
  max-height: 600px;
  opacity: 1;
}

/* Mobile menu links */
.navbar-mobile nav {
  display: flex;
  flex-direction: column;
  padding: 1.25rem clamp(1rem, 4vw, 1.5rem);
  gap: 0;
}
.navbar-mobile nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: #94a3b8;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(27, 37, 53, 0.4);
  transition: color 0.2s;
  display: block;
}
.navbar-mobile nav a:last-child { border-bottom: none; }
.navbar-mobile nav a:hover,
.navbar-mobile nav a.active { color: #00f0ff; }

/* ================================================================
   2. FOOTER — responsive grid
   ================================================================ */
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ================================================================
   3. SHARED GRIDS — used across pages
   ================================================================ */

/* Two-column story/split layout */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

/* Three-column values/features */
.grid-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Four-column team/talent/stats */
.grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

/* ================================================================
   4. HERO SECTION (HOME) — mobile-first fixes
   ================================================================ */
.hero-section {
  min-height: 100svh; /* use svh for mobile browsers */
  min-height: 100vh;
}

.live-badge {
  /* Ensure it never clips on narrow screens */
  max-width: calc(100vw - 2rem);
  white-space: nowrap;
}

.hero-content {
  padding-bottom: clamp(4rem, 8vw, 6rem);
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.hero-title {
  font-size: clamp(2rem, 8vw, 6rem);
  max-width: min(800px, 90vw);
}

.hero-sub {
  max-width: min(420px, 90vw);
}

/* Scroll cue — hide on very short screens */
.scroll-cue { display: flex; }

/* ================================================================
   5. ABOUT PAGE — specific layout fixes
   ================================================================ */

/* Our Story two-column — needs class */
.about-story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

/* Vision values three-column — needs class */
.about-values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}

/* Est. badge — keep inside image, not absolute bleed */
.about-img-wrap {
  position: relative;
  overflow: visible; /* allow badge to show */
}

.about-est-badge {
  position: absolute;
  bottom: -1.5rem;
  left: -1.5rem;
  background: var(--card, #111823);
  border: 1px solid var(--border, #1b2535);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  z-index: 2;
}

/* ================================================================
   6. CONTACT PAGE — extra breakpoints
   ================================================================ */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 4rem;
  align-items: start;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

/* ================================================================
   7. BLOG LAYOUT — fluid sidebar
   ================================================================ */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr min(320px, 30vw);
  gap: 3rem;
  align-items: start;
}

/* ================================================================
   8. PAGE HERO (inner pages) — fluid padding
   ================================================================ */
.page-hero-section {
  padding-block: clamp(4.5rem, 10vw, 7rem) clamp(2rem, 5vw, 4rem);
  overflow: hidden;
}

/* ================================================================
   BREAKPOINT: ≤ 1280px — Large laptops
   ================================================================ */
@media (max-width: 1280px) {
  .navbar-nav { gap: 1.25rem; }
  .navbar-nav a { font-size: 0.82rem; }
}

/* ================================================================
   BREAKPOINT: ≤ 1024px — Tablets / iPad landscape
   ================================================================ */
@media (max-width: 1024px) {

  /* --- Navbar --- */
  .navbar-nav,
  .navbar-cta { display: none; }
  .navbar-hamburger { display: flex; }

  /* --- Footer --- */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }

  /* --- Shared grids --- */
  .grid-2col   { grid-template-columns: 1fr; gap: 2.5rem; }
  .grid-3col   { grid-template-columns: 1fr 1fr; }
  .grid-4col   { grid-template-columns: 1fr 1fr; }

  /* --- About --- */
  .about-story-grid   { grid-template-columns: 1fr; gap: 2.5rem; }
  .about-values-grid  { grid-template-columns: 1fr 1fr; }
  .about-est-badge    { position: static; margin-top: 1rem; }

  /* --- Contact --- */
  .contact-layout { grid-template-columns: 1fr; gap: 2.5rem; }
  .form-row       { grid-template-columns: 1fr; }

  /* --- Blog --- */
  .blog-layout { grid-template-columns: 1fr; }

  /* --- Hero (home) --- */
  .platform-sidebar { display: none !important; }

  /* --- Services --- */
  .service-detail-card,
  .service-detail-card.reverse {
    grid-template-columns: 1fr !important;
    direction: ltr !important;
  }

  /* --- Process steps --- */
  .process-grid  { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .process-line  { display: none; }
}

/* ================================================================
   BREAKPOINT: ≤ 768px — Tablets portrait / large phones
   ================================================================ */
@media (max-width: 768px) {

  /* --- Typography scale down --- */
  .section-title { font-size: clamp(1.6rem, 5vw, 2.25rem); }

  /* --- Footer --- */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  /* --- Shared grids --- */
  .grid-3col { grid-template-columns: 1fr; }
  .grid-4col { grid-template-columns: 1fr 1fr; }

  /* --- About values --- */
  .about-values-grid { grid-template-columns: 1fr; }

  /* --- Blog --- */
  .blog-main-grid    { grid-template-columns: 1fr !important; }
  .b-featured        { grid-template-columns: 1fr !important; }
  .b-featured-img    { height: 200px !important; }

  /* --- Blog detail --- */
  .post-layout       { grid-template-columns: 1fr !important; }
  .related-grid      { grid-template-columns: 1fr 1fr !important; }
  .post-hero-img     { height: 240px !important; object-fit: cover; }

  /* --- Contact --- */
  .social-grid       { grid-template-columns: repeat(3, 1fr); }
  .map-placeholder   { height: 180px; }

  /* --- Gallery --- */
  .gallery-grid      { columns: 2 !important; }
  .view-toggle       { display: none !important; }

  /* --- Process --- */
  .process-grid      { grid-template-columns: 1fr; }

  /* --- Stats bars --- */
  .stats-inner       { grid-template-columns: 1fr 1fr; }
  .stat-col:nth-child(2) { border-right: none; }
  .stat-col:nth-child(3),
  .stat-col:nth-child(4) {
    border-top: 1px solid rgba(27,37,53,0.6);
    padding-top: 1.5rem;
    margin-top:  0.5rem;
  }

  /* --- Hero home --- */
  .hero-section    { min-height: 100svh; min-height: 100vh; }
  .hero-content    { padding-bottom: 5rem; }
  .scroll-cue      { display: none; }
  .live-badge      { top: 1.25rem; }

  /* --- CTA box --- */
  .cta-box { padding: 2rem 1.5rem !important; }
  .cta-box .cta-btns { flex-direction: column; align-items: stretch; }
  .cta-box .cta-btns a,
  .cta-box .cta-btns button { text-align: center; justify-content: center; }

  /* --- Services hero decoration --- */
  .service-detail-card { gap: 1.5rem !important; }
  .service-img-wrap img { height: 260px !important; }

  /* --- Talent grid --- */
  .talent-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .join-form-wrap { padding-inline: 0; }

  /* --- Portfolio masonry --- */
  .portfolio-masonry { columns: 2 !important; }

  /* --- Portfolio bento (home) --- */
  .portfolio-grid .pf-card:nth-child(n) { grid-column: span 12 !important; }

  /* --- Services grid (home) --- */
  .services-grid { grid-template-columns: 1fr !important; }

  /* --- Blog grid (home) --- */
  .blog-grid { grid-template-columns: 1fr !important; }
}

/* ================================================================
   BREAKPOINT: ≤ 640px — Large phones
   ================================================================ */
@media (max-width: 640px) {

  /* --- General typography --- */
  .section-title { font-size: clamp(1.4rem, 6vw, 1.9rem); }
  .section-desc  { font-size: 0.85rem; }

  /* --- Container padding --- */
  .container { padding-inline: 1rem; }

  /* --- Navbar --- */
  .navbar-logo { font-size: 1rem; }
  .navbar-logo-mark { width: 27px; height: 27px; }
  .navbar-logo--image-only .navbar-logo-mark { max-width: min(160px, 42vw); height: 36px; }
  .navbar-inner { padding-inline: 1.5rem; height: 60px; }

  /* --- Hero home --- */
  .hero-title { font-size: clamp(1.8rem, 9vw, 3rem); }
  .hero-sub   { font-size: 0.875rem; }
  .hero-btns  { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .hero-btn-primary { width: 100%; max-width: 280px; justify-content: center; }
  .loader-bar-wrap { width: 160px; }

  /* --- Stats bar (home) --- */
  .stats-inner { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .stat-col    { padding-inline: 0.75rem; }
  .stat-col:nth-child(3),
  .stat-col:nth-child(4) { border-top: 1px solid rgba(27,37,53,0.6); }

  /* --- About --- */
  .about-story-grid  { gap: 2rem; }
  .about-values-grid { grid-template-columns: 1fr; }
  .stats-mini-grid   { grid-template-columns: 1fr 1fr; gap: 1rem; padding: 1.5rem; }
  .team-grid         { grid-template-columns: 1fr 1fr !important; }
  .why-grid          { grid-template-columns: 1fr !important; }
  .vm-grid           { grid-template-columns: 1fr !important; }

  /* --- Contact --- */
  .social-grid       { grid-template-columns: 1fr 1fr 1fr; }
  .form-wrap         { padding: 1.5rem; }
  .f-input, .f-select, .f-textarea { font-size: 16px; } /* prevent iOS zoom */

  /* --- Blog --- */
  .sidebar-card      { padding: 1rem; }
  .related-grid      { grid-template-columns: 1fr !important; }

  /* --- Gallery --- */
  .gallery-grid { columns: 1 !important; }
  .gallery-item { margin-bottom: 0.75rem; }

  /* --- Portfolio --- */
  .portfolio-masonry { columns: 1 !important; }
  .ps-item           { padding: 1rem; }

  /* --- Services --- */
  .service-detail-card .service-features li { font-size: 0.82rem; }
  .how-grid { grid-template-columns: 1fr !important; }

  /* --- Talent --- */
  .talent-grid { grid-template-columns: 1fr 1fr !important; }
  .talent-card-img { height: 200px; }

  /* --- Footer --- */
  .footer-brand-desc { font-size: 0.78rem; }
  .footer-col ul a   { font-size: 0.78rem; }
  .footer-bottom p   { font-size: 0.72rem; }
  .footer-bottom-links { gap: 1rem; }

  /* --- Buttons --- */
  .btn { padding: 0.75rem 1.4rem; font-size: 0.82rem; }
  .btn-sm { padding: 0.5rem 1rem; font-size: 0.75rem; }

  /* --- Cards general --- */
  .card, .srv-card, .bl-card,
  .b-card, .team-card, .why-item,
  .vm-card, .ps-item { border-radius: 0.875rem; }

  /* --- Modal (portfolio) --- */
  .modal-box { border-radius: 1rem; }
  .modal-img { height: 200px !important; }
  .modal-body { padding: 1.25rem; }
  .modal-metrics { gap: 0.75rem; flex-wrap: wrap; }
  .modal-metric-num { font-size: 1rem; }

  /* --- FAQ --- */
  .faq-q { font-size: 0.85rem; padding: 1rem; }

  /* --- CTA --- */
  .cta-box { gap: 1.5rem; }
  .cta-title { font-size: clamp(1.25rem, 5vw, 1.75rem) !important; }
}

/* ================================================================
   BREAKPOINT: ≤ 480px — Standard phones
   ================================================================ */
@media (max-width: 480px) {

  /* --- Process --- */
  .proc-num { width: 60px; height: 60px; font-size: 1rem; }

  /* --- Stats mini (about) --- */
  .stats-mini-num { font-size: 1.6rem; }

  /* --- Gallery --- */
  .gallery-grid { columns: 1 !important; }

  /* --- Portfolio masonry --- */
  .portfolio-masonry { columns: 1 !important; }

  /* --- Blog detail --- */
  .post-meta { flex-wrap: wrap; gap: 0.5rem; }
  .article h2 { font-size: 1.15rem; }
  .article h3 { font-size: 1rem; }
  .article p  { font-size: 0.85rem; }
  .strategy-card { flex-direction: column; }

  /* --- Contact social grid --- */
  .social-grid { grid-template-columns: 1fr 1fr; }
  .social-item { padding: 0.75rem; }

  /* --- Talent grid --- */
  .talent-grid { grid-template-columns: 1fr !important; }

  /* --- About team --- */
  .team-grid { grid-template-columns: 1fr !important; }

  /* --- Services detail cards --- */
  .service-img-badge { position: static !important; margin-top: 1rem; border-radius: 0.75rem; }
}

/* ================================================================
   BREAKPOINT: ≤ 375px — Small phones (iPhone SE etc.)
   ================================================================ */
@media (max-width: 375px) {
  .navbar-inner { padding-inline: 1rem; }

  /* --- Hero --- */
  .hero-title  { font-size: 1.75rem; }
  .hero-btns   { gap: 0.6rem; }
  .live-badge  { padding: 0.3rem 0.75rem; }
  .live-badge-count { display: none; } /* hide viewer count if no space */

  /* --- Navbar --- */
  .navbar-inner { height: 56px; }
  .navbar-logo  { font-size: 0.9rem; }
  .navbar-logo-mark { width: 25px; height: 25px; }

  /* --- Typography --- */
  .section-title { font-size: 1.35rem; }
  .section-label { font-size: 0.58rem; }

  /* --- Stats mini --- */
  .stats-mini-grid { grid-template-columns: 1fr 1fr; padding: 1rem; gap: 0.75rem; }
  .stats-mini-num  { font-size: 1.4rem; }

  /* --- Cards padding --- */
  .srv-card,
  .why-item,
  .vm-card { padding: 1.25rem; }
  .srv-num  { font-size: 2rem; }

  /* --- Footer brand logo --- */
  .footer-brand-logo { font-size: 1rem; }

  /* --- CTA box --- */
  .cta-box { padding: 1.5rem 1rem !important; }

  /* --- Form --- */
  .form-wrap    { padding: 1.25rem; }
  .form-title   { font-size: 1rem; }
  .f-input,
  .f-textarea,
  .f-select     { padding: 0.7rem 0.875rem; }

  /* --- Buttons --- */
  .btn         { padding: 0.7rem 1.2rem; font-size: 0.8rem; }
  .btn-primary { padding: 0.75rem 1.4rem; }
}

/* ================================================================
   BREAKPOINT: ≥ 1440px — Wide desktops
   ================================================================ */
@media (min-width: 1440px) {
  .container { max-width: 1360px; }
  .hero-content { max-width: 1360px; }
}

/* ================================================================
   TOUCH DEVICE OPTIMIZATIONS
   ================================================================ */
@media (hover: none) and (pointer: coarse) {

  /* Remove hover-only effects that don't work on touch */
  .srv-card:hover    { transform: none; }
  .bl-card:hover     { transform: none; }
  .team-card:hover   { transform: none; }
  .gallery-item:hover { transform: none; }
  .pf-card:hover     { transform: none; }

  /* Make overlays visible on touch */
  .gallery-overlay   { opacity: 1; }
  .pf-overlay        { opacity: 1; }

  /* Larger touch targets */
  .filter-tab,
  .filter-tab,
  .blog-ftab,
  .page-btn    { min-height: 44px; min-width: 44px; }

  .navbar-hamburger { padding: 8px; }

  /* Form inputs — prevent iOS zoom */
  .f-input,
  .f-select,
  .f-textarea,
  .sidebar-search input { font-size: 16px; }

  /* Prevent double-tap zoom on buttons */
  .btn, button { touch-action: manipulation; }
}

/* ================================================================
   PRINT STYLES
   ================================================================ */
@media print {
  .navbar, .footer, #page-loader,
  .scroll-cue, #scroll-progress,
  .hero-canvas, .live-badge,
  .platform-sidebar { display: none !important; }

  body { background: white; color: black; }
  a    { color: black; }
  .hero-section { min-height: auto; height: auto; padding: 2rem 0; }
}

/* ================================================================
   ACCESSIBILITY — reduced motion
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ================================================================
   LANDSCAPE PHONE — special case
   ================================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section { min-height: 100vw; }
  .hero-content { padding-bottom: 2rem; }
  .scroll-cue   { display: none; }
  .live-badge   { top: 0.75rem; }
  #page-loader  { padding: 1rem; gap: 0.75rem; }
}
