/* ==========================================================================
   Clever AI Apps — components specific to the app studio site
   Loaded after main.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   PHONE FRAME — shared device mockup
-------------------------------------------------------------------------- */

.phone {
  position: relative;
  border-radius: 30px;
  padding: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.03));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 23px;
  background: #fff;
}


/* --------------------------------------------------------------------------
   HERO VISUAL
-------------------------------------------------------------------------- */

.hero-apps {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 560px;
  z-index: var(--z-raised);
}

.hero-phone {
  width: min(244px, 62vw);
  animation: heroFloat 7s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

.hero-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: rgba(22, 25, 39, 0.86);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  opacity: 0;
  animation: chipIn 0.7s ease forwards;
}

.hero-chip small {
  display: block;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
}

.hero-chip-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-glow);
  border: 1px solid var(--border-hover);
  color: var(--accent);
  flex-shrink: 0;
}

.hero-chip-1 { top: 1%;    left: -9%;  animation-delay: 0.5s; }
.hero-chip-2 { top: 46%;   right: -8%; animation-delay: 0.8s; }
.hero-chip-3 { bottom: 4%; left: -2%;  animation-delay: 1.1s; }

@keyframes chipIn {
  from { opacity: 0; transform: translateY(14px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  .hero-apps { min-height: 480px; }
  .hero-chip-1, .hero-chip-3 { left: 0; }
  .hero-chip-2 { right: 0; }
}

@media (max-width: 520px) {
  .hero-chip { font-size: var(--text-xs); padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .hero-chip-icon { width: 24px; height: 24px; }
}


/* --------------------------------------------------------------------------
   FLAGSHIP APP SECTION
-------------------------------------------------------------------------- */

.flagship-section {
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}

.flagship-head {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.flagship-icon {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.flagship-head h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.12;
  margin-bottom: var(--space-2);
}

.flagship-head .app-card-role {
  margin-top: 0;
}

.flagship-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-12);
  align-items: start;
}

/* Grid items default to min-width:auto, which lets the store badges blow out the track */
.flagship-grid > * {
  min-width: 0;
}

@media (min-width: 1000px) {
  .flagship-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: var(--space-16);
  }

  .flagship-showcase {
    position: sticky;
    top: 96px;
  }
}

.flagship-lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: var(--space-8);
}

.flagship-features {
  display: grid;
  gap: var(--space-5);
  margin-bottom: var(--space-8);
}

.flagship-feature {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}

.flagship-feature svg {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 3px;
}

.flagship-feature strong {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 2px;
}

.flagship-feature span {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.65;
}

.flagship-shots {
  display: flex;
  gap: var(--space-5);
  overflow-x: auto;
  padding: var(--space-2) var(--space-1) var(--space-4);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.flagship-shots figure {
  scroll-snap-align: center;
  flex-shrink: 0;
}

.flagship-shots .phone {
  width: 212px;
}

.flagship-shots::-webkit-scrollbar { height: 6px; }
.flagship-shots::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: var(--radius-full); }
.flagship-shots::-webkit-scrollbar-track { background: transparent; }

.shot-caption {
  display: block;
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-muted);
  margin-top: var(--space-4);
}

.shots-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}


/* --------------------------------------------------------------------------
   STORE BADGES
-------------------------------------------------------------------------- */

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-5);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  min-height: 56px;
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.store-badge:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.store-badge svg { flex-shrink: 0; }

.store-badge-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: left;
}

.store-badge-text small {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.store-badge-text strong {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: 700;
}


/* --------------------------------------------------------------------------
   APP PORTFOLIO CARDS
-------------------------------------------------------------------------- */

.apps-section { background: var(--bg-primary); }

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.app-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
}

.app-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.app-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.app-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--gradient-glow);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
}

.app-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

.app-tag-live {
  color: var(--accent);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.app-card h3 {
  font-size: var(--h3);
  font-weight: 700;
  margin-bottom: 4px;
}

.app-card-role {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--brand);
  line-height: 1.5;
}

.app-card .app-card-role {
  flex: 0 0 auto;
  margin-top: calc(var(--space-4) * -1 + 2px);
}

.app-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  flex: 1;
}

.app-stack {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.app-stack span {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.apps-note {
  margin-top: var(--space-10);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}


/* --------------------------------------------------------------------------
   PROCESS SECTION
-------------------------------------------------------------------------- */

.process-section { background: var(--bg-secondary); }

.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}

.process-step {
  position: relative;
  padding: var(--space-8) var(--space-6);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.process-step:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
}

.process-num {
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 800;
  letter-spacing: 0.1em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
  display: block;
}

.process-step h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.process-step p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.7;
}


/* --------------------------------------------------------------------------
   SERVICES GRID — four cards read better as 2x2 than as 3 + an orphan
-------------------------------------------------------------------------- */

@media (min-width: 760px) {
  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
