/*
 * Scoped styles for the Apple-style Triple iPhone Hero section.
 * Component: #kulimo-ai-hero
 */

/* ====== SCOPE & THEME ====== */
#kulimo-ai-hero {
  position: relative;
  margin: 80px 0;
  padding: 0 var(--container-padding, 20px);
  
  /* Using design system colors */
  --bg: var(--bg, #F5F6F7);
  --text: var(--fg, #0B0E13);
  --muted: var(--accent, #0E2A47);
  --glass: rgba(245, 246, 247, 0.65);
  --ring: rgba(11, 14, 19, 0.06);
  --shadow: 0 12px 50px rgba(11, 14, 19, 0.12);
  /* Enhanced gradient using brand colors */
  --grad: conic-gradient(from 240deg at 50% 50%,
             var(--accent), var(--luxury-accent), var(--accent), var(--luxury-accent), var(--accent));
  --l1: var(--porcelain, #F5F6F7);
  --l2: var(--bone, #EDEEEC);
  --l3: var(--platinum, #DADDE1);
  --d1: var(--accent, #0E2A47);
}

/* ====== LAYOUT ====== */
#kulimo-ai-hero .kai-wrap {
  max-width: var(--container-max-width, 1280px); 
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px);
  display: grid; 
  gap: clamp(32px, 4vw, 48px);
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
  background: var(--bg);
  border-radius: 24px;
  box-shadow: var(--shadow);
  min-height: 600px;
}

/* Enhanced responsive breakpoints */
@media (max-width: 1068px) {
  #kulimo-ai-hero .kai-wrap { 
    grid-template-columns: 1fr; 
    text-align: center;
    padding: clamp(32px, 6vw, 64px);
    gap: clamp(24px, 3vw, 40px);
  }
}

@media (max-width: 735px) {
  #kulimo-ai-hero .kai-wrap {
    margin: 40px 0;
    padding: clamp(24px, 5vw, 48px);
    border-radius: 16px;
    min-height: auto;
  }
}

/* ====== TEXT ====== */
#kulimo-ai-hero .kai-copy {
  padding-right: clamp(20px, 4vw, 40px);
}

#kulimo-ai-hero .kai-eyebrow {
  font: var(--font-weight-semibold) 15px/1.2 var(--font-main);
  letter-spacing: 0.02em; 
  color: var(--muted);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

#kulimo-ai-hero .kai-title {
  font: var(--font-weight-semibold) clamp(32px, 6vw, 52px)/var(--line-height-h1) var(--font-main);
  color: var(--text); 
  margin: 0 0 1rem 0;
  max-width: 500px;
}

#kulimo-ai-hero .kai-title .grad {
  background: var(--grad); 
  -webkit-background-clip: text; 
  background-clip: text; 
  color: transparent;
  -webkit-text-fill-color: transparent;
}

#kulimo-ai-hero .kai-sub {
  font: var(--font-weight-regular) clamp(16px, 1.8vw, 22px)/var(--line-height-lead) var(--font-main);
  color: var(--text); 
  opacity: 0.75;
  max-width: 450px;
}

/* Responsive text adjustments */
@media (max-width: 1068px) {
  #kulimo-ai-hero .kai-copy {
    padding-right: 0;
    max-width: 600px;
    margin: 0 auto;
  }
  
  #kulimo-ai-hero .kai-title,
  #kulimo-ai-hero .kai-sub {
    max-width: none;
  }
}

@media (max-width: 735px) {
  #kulimo-ai-hero .kai-title {
    font-size: clamp(28px, 7vw, 40px);
  }
  
  #kulimo-ai-hero .kai-sub {
    font-size: clamp(14px, 4vw, 18px);
  }
}

/* ====== PHONE GRID ====== */
#kulimo-ai-hero .kai-phones {
  display: grid; 
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2.5vw, 24px); 
  justify-items: center;
}

/* Enhanced responsive grid */
@media (max-width: 1068px) {
  #kulimo-ai-hero .kai-phones { 
    grid-template-columns: repeat(2, 1fr); 
    gap: clamp(12px, 2vw, 20px);
    max-width: 500px;
    margin: 0 auto;
  }
}

@media (max-width: 735px) {
  #kulimo-ai-hero .kai-phones { 
    grid-template-columns: 1fr; 
    gap: 24px;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  #kulimo-ai-hero .kai-phones {
    gap: 20px;
    max-width: 240px;
  }
}

/* ====== iPhone component (enhanced responsive design) ====== */
#kulimo-ai-hero .iphone-x {
  aspect-ratio: 361/728; 
  width: clamp(200px, 22vw, 280px); 
  max-width: 300px;
  background: linear-gradient(145deg, #1a1d23 0%, #0a0c10 100%);
  border-radius: 50px; 
  position: relative;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 8px 16px rgba(0, 0, 0, 0.15),
    0 16px 32px rgba(0, 0, 0, 0.2),
    0 32px 64px rgba(0, 0, 0, 0.25),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    inset 0 1px 2px rgba(255, 255, 255, 0.1);
  isolation: isolate; 
  transform: translateZ(0);
  border: 1px solid rgba(0, 0, 0, 0.8);
}

#kulimo-ai-hero .iphone-x::after {
  content:""; 
  position:absolute; 
  inset:0; 
  border-radius:55px;
  box-shadow: 0 0 160px 0 var(--d1); 
  pointer-events:none; 
  z-index:0;
}

/* Enhanced responsive sizing */
@media (max-width: 1068px) {
  #kulimo-ai-hero .iphone-x {
    width: clamp(180px, 25vw, 260px);
  }
}

@media (max-width: 735px) {
  #kulimo-ai-hero .iphone-x {
    width: clamp(200px, 60vw, 280px);
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  #kulimo-ai-hero .iphone-x {
    width: clamp(180px, 70vw, 240px);
    max-width: 240px;
  }
}
#kulimo-ai-hero .iphone-x::after {
  content:""; 
  position:absolute; 
  inset:-10px; 
  border-radius:60px;
  background: radial-gradient(circle at 30% 30%, rgba(14, 42, 71, 0.3) 0%, transparent 70%);
  pointer-events:none; 
  z-index:0;
  opacity: 0.6;
}

/* Realistic frame/bezel with metallic appearance */
#kulimo-ai-hero .divider { 
  background: linear-gradient(90deg, #2a2d33 0%, #1a1d23 50%, #2a2d33 100%);
  height:4px; 
  width:100%; 
  position:absolute; 
  left:0;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.5);
}
#kulimo-ai-hero .iphone-x .divider:first-of-type { top:9%; }
#kulimo-ai-hero .iphone-x .divider:last-of-type { bottom:9%; }

/* Inner bezel with realistic metallic gradient */
#kulimo-ai-hero .bezel { 
  position:absolute; 
  inset:6px; 
  background: linear-gradient(145deg, #2a2d33 0%, #1a1d23 50%, #0f1115 100%);
  border-radius:48px; 
  border: 1px solid rgba(0, 0, 0, 0.9);
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.1),
    inset 0 -1px 2px rgba(0, 0, 0, 0.5),
    0 1px 3px rgba(0, 0, 0, 0.5);
  z-index:2;
}

#kulimo-ai-hero .bezel::after { 
  content:""; 
  position:absolute; 
  inset:5px; 
  background: linear-gradient(145deg, #1a1d23 0%, #0a0c10 100%);
  border-radius:43px;
  border: 1px solid rgba(0, 0, 0, 0.8);
}

/* Screen with realistic black border and glass reflection */
#kulimo-ai-hero .screen { 
  position:absolute; 
  inset:15px; 
  border-radius:40px; 
  overflow:hidden; 
  z-index:3;
  background: #000;
  box-shadow: 
    inset 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 10px rgba(0, 0, 0, 0.5);
}

/* Glass reflection overlay on screen */
#kulimo-ai-hero .screen::before {
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 30%,
    transparent 70%,
    rgba(255, 255, 255, 0.05) 100%
  );
  pointer-events: none;
  z-index: 10;
  mix-blend-mode: overlay;
}

/* Notch with realistic depth */
#kulimo-ai-hero .screen::after {
  content:""; 
  width:56%; 
  height:4%; 
  background: linear-gradient(180deg, #0a0c10 0%, #000 100%);
  position:absolute; 
  top:0; 
  left:0; 
  right:0; 
  margin:0 auto; 
  border-radius:0 0 20px 20px;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 -1px 1px rgba(0, 0, 0, 0.8);
  z-index: 9;
}
/* Screen corners with realistic depth */
#kulimo-ai-hero .corner { 
  position:absolute; 
  z-index:4; 
  top:15px; 
  width:10px; 
  height:10px; 
  background: linear-gradient(145deg, #1a1d23 0%, #0a0c10 100%);
}
#kulimo-ai-hero .corner.left { left:79px; }
#kulimo-ai-hero .corner.left::after { 
  content:""; 
  position:absolute; 
  width:10px; 
  height:10px; 
  background: #000;
  border-radius:0 6px 0 0;
  box-shadow: inset 1px -1px 2px rgba(0, 0, 0, 0.5);
}
#kulimo-ai-hero .corner.right { right:81px; }
#kulimo-ai-hero .corner.right::after { 
  content:""; 
  position:absolute; 
  width:10px; 
  height:10px; 
  background: #000;
  border-radius:6px 0 0 0;
  box-shadow: inset -1px -1px 2px rgba(0, 0, 0, 0.5);
}

/* Realistic speaker grille */
#kulimo-ai-hero .speaker { 
  width:48px; 
  height:6px; 
  background: linear-gradient(180deg, #0a0c10 0%, #1a1d23 100%);
  box-shadow: 
    inset 0 1px 2px rgba(0,0,0,.8),
    inset 0 -1px 1px rgba(255,255,255,.05);
  position:absolute; 
  top:3.75%; 
  left:0; 
  right:0; 
  margin:0 auto; 
  z-index:4; 
  border-radius:3px;
  border: 1px solid rgba(0, 0, 0, 0.9);
}

/* Realistic camera lens with reflections */
#kulimo-ai-hero .camera { 
  height:11px; 
  width:11px; 
  border-radius:50%; 
  background: linear-gradient(145deg, #0a0c10 0%, #000 100%);
  box-shadow: 
    inset 0 1px 3px rgba(0,0,0,.9),
    0 1px 2px rgba(0,0,0,.5);
  position:absolute; 
  z-index:4; 
  top:3.5%; 
  right:38%;
  border: 1px solid rgba(0, 0, 0, 0.9);
}

#kulimo-ai-hero .camera::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%, 
    rgba(100, 120, 180, 0.6) 0%, 
    rgba(40, 50, 80, 0.8) 30%, 
    rgba(10, 15, 30, 1) 60%,
    rgba(2, 5, 15, 1) 100%
  );
}

#kulimo-ai-hero .camera::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Realistic side buttons with metallic finish */
#kulimo-ai-hero .button { 
  width:3px; 
  position:absolute; 
  z-index:5; 
  background: linear-gradient(90deg, #2a2d33 0%, #1a1d23 50%, #2a2d33 100%);
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    inset 0 -1px 1px rgba(0, 0, 0, 0.5),
    1px 0 2px rgba(0, 0, 0, 0.5);
  border-radius: 1px;
}
#kulimo-ai-hero .button.mute { height:28px; top:13%; left:-3px; }
#kulimo-ai-hero .button.vol-up { height:53px; top:21%; left:-3px; }
#kulimo-ai-hero .button.vol-down { height:53px; top:30%; left:-3px; }
#kulimo-ai-hero .button.btnRight { 
  right:-3px; 
  height:84px; 
  top:23.5%; 
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.05),
    inset 0 -1px 1px rgba(0, 0, 0, 0.5),
    -1px 0 2px rgba(0, 0, 0, 0.5);
}

/* App surface placeholder (enhanced design system alignment) */
#kulimo-ai-hero .appWrap {
  position:relative; 
  width:100%; 
  height:100%; 
  background: linear-gradient(180deg, var(--bone), var(--muted));
  display:grid; 
  place-items:center;
}

#kulimo-ai-hero .ph {
  font: var(--font-weight-semibold) 12px/1.2 var(--font-main); 
  color: var(--text); 
  opacity: 0.7; 
  text-align:center; 
  padding:12px;
}

/* ====== ANIMATION STATES ====== */
/* initial (before in-view) - set to visible by default */
#kulimo-ai-hero .kai-title,
#kulimo-ai-hero .kai-sub,
#kulimo-ai-hero .kai-eyebrow { 
  opacity: 1;
  transform: translateY(0); 
}
#kulimo-ai-hero .iphone-x { 
  opacity: 1;
  transform: translateY(0) scale(1); 
}

/* in-view */
#kulimo-ai-hero.is-inview .kai-eyebrow { animation: fadeUp .7s cubic-bezier(.22,.61,.36,1) .05s forwards; }
#kulimo-ai-hero.is-inview .kai-title {   animation: fadeUp .8s cubic-bezier(.22,.61,.36,1) .12s forwards; }
#kulimo-ai-hero.is-inview .kai-sub {     animation: fadeUp .8s cubic-bezier(.22,.61,.36,1) .22s forwards; }

#kulimo-ai-hero.is-inview .iphone-x:nth-child(1) { animation: slideInL .9s cubic-bezier(.22,.61,.36,1) .10s forwards; }
#kulimo-ai-hero.is-inview .iphone-x:nth-child(2) { animation: slideInR .9s cubic-bezier(.22,.61,.36,1) .25s forwards; }

/* Keyframes */
@keyframes fadeUp { to { opacity:1; transform: translateY(0); } }
@keyframes slideInUp { from{ opacity:0; transform: translateY(26px) scale(.98);} to{ opacity:1; transform: translateY(0) scale(1);} }
@keyframes slideInL { from{ opacity:0; transform: translate(-26px, 16px) scale(.98);} to{ opacity:1; transform: translate(0,0) scale(1);} }
@keyframes slideInR { from{ opacity:0; transform: translate(26px, 16px) scale(.98);}  to{ opacity:1; transform: translate(0,0) scale(1);} }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #kulimo-ai-hero .kai-title,
  #kulimo-ai-hero .kai-sub,
  #kulimo-ai-hero .kai-eyebrow,
  #kulimo-ai-hero .iphone-x { 
    opacity:1; 
    transform:none; 
    animation:none !important; 
  }
}

/* ========================================
   ENHANCED MOBILE RESPONSIVE STYLES
   ======================================== */

/* Very Small Phones (320px - 375px) */
@media (max-width: 375px) {
  #kulimo-ai-hero {
    margin: 40px 0;
    padding: 0 12px;
  }

  #kulimo-ai-hero .kai-wrap {
    padding: 20px;
    gap: 20px;
    min-height: auto;
    border-radius: 12px;
  }

  #kulimo-ai-hero .kai-title {
    font-size: clamp(24px, 8vw, 32px);
    margin-bottom: 0.75rem;
  }

  #kulimo-ai-hero .kai-sub {
    font-size: clamp(13px, 4.5vw, 16px);
    line-height: 1.5;
  }

  #kulimo-ai-hero .kai-eyebrow {
    font-size: 13px;
    margin-bottom: 0.75rem;
  }

  #kulimo-ai-hero .kai-phones {
    gap: 16px;
    max-width: 200px;
  }

  #kulimo-ai-hero .iphone-x {
    width: clamp(160px, 75vw, 200px);
    max-width: 200px;
    border-radius: 40px;
  }

  #kulimo-ai-hero .bezel {
    inset: 5px;
    border-radius: 38px;
  }

  #kulimo-ai-hero .bezel::after {
    inset: 5px;
    border-radius: 32px;
  }

  #kulimo-ai-hero .screen {
    inset: 14px;
    border-radius: 32px;
  }

  #kulimo-ai-hero .corner.left {
    left: 65px;
  }

  #kulimo-ai-hero .corner.right {
    right: 67px;
  }

  #kulimo-ai-hero .ph {
    font-size: 10px;
    padding: 8px;
  }
}

/* Small Phones (376px - 480px) */
@media (min-width: 376px) and (max-width: 480px) {
  #kulimo-ai-hero {
    margin: 60px 0;
    padding: 0 16px;
  }

  #kulimo-ai-hero .kai-wrap {
    padding: 24px;
    gap: 24px;
    border-radius: 14px;
  }

  #kulimo-ai-hero .kai-title {
    font-size: clamp(26px, 7.5vw, 36px);
  }

  #kulimo-ai-hero .kai-sub {
    font-size: clamp(14px, 4.2vw, 17px);
  }

  #kulimo-ai-hero .kai-eyebrow {
    font-size: 14px;
  }

  #kulimo-ai-hero .kai-phones {
    gap: 18px;
    max-width: 220px;
  }

  #kulimo-ai-hero .iphone-x {
    width: clamp(170px, 68vw, 220px);
    max-width: 220px;
  }
}

/* Medium Phones (481px - 640px) */
@media (min-width: 481px) and (max-width: 640px) {
  #kulimo-ai-hero .kai-wrap {
    padding: 28px;
    gap: 28px;
  }

  #kulimo-ai-hero .kai-phones {
    max-width: 260px;
    gap: 20px;
  }

  #kulimo-ai-hero .iphone-x {
    width: clamp(190px, 60vw, 260px);
    max-width: 260px;
  }
}

/* Tablets (641px - 768px) */
@media (min-width: 641px) and (max-width: 768px) {
  #kulimo-ai-hero .kai-wrap {
    padding: 32px;
    gap: 32px;
  }

  #kulimo-ai-hero .kai-phones {
    max-width: 400px;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  #kulimo-ai-hero .iphone-x {
    width: clamp(180px, 30vw, 220px);
  }
}

/* Landscape Mobile (Max height 500px) */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
  #kulimo-ai-hero {
    margin: 20px 0;
  }

  #kulimo-ai-hero .kai-wrap {
    padding: 20px;
    gap: 20px;
    min-height: auto;
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  #kulimo-ai-hero .kai-title {
    font-size: clamp(20px, 5vw, 28px);
    margin-bottom: 0.5rem;
  }

  #kulimo-ai-hero .kai-sub {
    font-size: clamp(12px, 3.5vw, 15px);
    line-height: 1.4;
  }

  #kulimo-ai-hero .kai-eyebrow {
    font-size: 12px;
    margin-bottom: 0.5rem;
  }

  #kulimo-ai-hero .kai-phones {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 300px;
  }

  #kulimo-ai-hero .iphone-x {
    width: clamp(120px, 25vw, 160px);
  }

  #kulimo-ai-hero .screen {
    inset: 12px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  #kulimo-ai-hero .iphone-x {
    transform: translateZ(0);
    will-change: transform;
  }

  /* Prevent unwanted scaling on touch */
  #kulimo-ai-hero * {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
  }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  #kulimo-ai-hero .bezel,
  #kulimo-ai-hero .screen,
  #kulimo-ai-hero .speaker,
  #kulimo-ai-hero .camera {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Hide second iPhone on mobile devices */
@media (max-width: 768px) {
  #kulimo-ai-hero .iphone-x.hide-on-mobile {
    display: none;
  }
}
