/* ============================================================
   FLITZEN — App Development (service detail) page
   Extends styles.css + works.css + services.css + webdesign.css.
   New: phone-mockup hero cluster + in-app UI (strict monochrome),
   platform chips. Reuses wd-* grids for everything else.
   ============================================================ */

/* ---------- Hero: cycling app-type badge + screen swap ---------- */
.ad-kind {
  position: absolute;
  top: -14px; left: -6px;
  z-index: 5;
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--ink); color: #fff;
  border-radius: 100px;
  padding: 9px 15px;
  font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em;
  box-shadow: 0 16px 30px -14px rgba(14,14,14,0.5);
}
.ad-kind .d { width: 6px; height: 6px; border-radius: 50%; background: #fff; flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .ad-kind .d { animation: adKindPulse 1.5s ease-in-out infinite; }
}
@keyframes adKindPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.ad-kind .t { white-space: nowrap; min-width: 78px; }
.ad-kind-dots { display: inline-flex; gap: 5px; margin-left: 4px; }
.ad-kind-dots i { width: 14px; height: 3px; border-radius: 3px; background: rgba(255,255,255,0.28); display: block; transition: background 0.4s var(--ease); }
.ad-kind-dots i.on { background: #fff; }

/* the front screen content cross-fades when it swaps */
.ad-phone.front .ad-app { transition: opacity 0.34s var(--ease), transform 0.34s var(--ease); }
.ad-phone.front .ad-app.swap { opacity: 0; transform: translateY(8px); }

@media (max-width: 460px) {
  .ad-kind { top: -12px; left: 50%; transform: translateX(-50%); }
}

/* ---------- Hero layout: compact title/lead LEFT, phones as the star RIGHT ---------- */
.ad-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(34px, 4.4vw, 70px);
  align-items: center;
  margin-top: clamp(24px, 2.8vw, 44px);
}
.ad-h1 {
  font-size: clamp(36px, 3.9vw, 60px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin-top: clamp(16px, 1.6vw, 24px);
}
.ad-hero-lead .lead {
  max-width: 40ch;
  color: var(--gray-1);
  font-size: clamp(16px, 1.05vw, 18.5px);
  margin-top: clamp(18px, 1.7vw, 26px);
}
.ad-hero-lead .hero-cta { margin-top: clamp(26px, 2.8vw, 40px); }
.ad-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(26px, 2.6vw, 36px);
}
.ad-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  padding: 9px 15px;
  border-radius: 100px;
}
.ad-chip svg { width: 15px; height: 15px; }

/* ---------- Phone cluster ---------- */
/* ---------- Phone cluster: 3 upright phones side by side ---------- */
.ad-phones {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(8px, 1.1vw, 16px);
}
.ad-pcol { display: flex; flex-direction: column; align-items: center; gap: clamp(8px, 1vw, 13px); flex: 0 1 auto; }
/* centre phone sits a touch taller for hierarchy */
.ad-pcol.mid { margin-top: clamp(-14px, -1.6vw, -26px); }
.ad-phone {
  position: relative;
  width: clamp(110px, 15.4vw, 236px);
  aspect-ratio: 236 / 478;
  background: #0E0E0E;
  border-radius: clamp(22px, 2.5vw, 40px);
  padding: clamp(5px, 0.6vw, 10px);
  box-shadow: 0 38px 70px -28px rgba(14,14,14,0.42), 0 10px 24px -12px rgba(14,14,14,0.28);
}
.ad-pcol.mid .ad-phone { box-shadow: 0 46px 84px -28px rgba(14,14,14,0.5), 0 12px 28px -12px rgba(14,14,14,0.34); }
.ad-cap {
  font-size: clamp(10px, 0.85vw, 12.5px); font-weight: 600; letter-spacing: -0.01em;
  color: var(--gray-1); white-space: nowrap;
  transition: opacity 0.34s var(--ease);
}
.ad-cap.swap { opacity: 0; }

/* slide progress dots under the trio */
.ad-slidedots {
  position: absolute; bottom: clamp(-26px, -2.6vw, -34px); left: 50%; transform: translateX(-50%);
  display: flex; gap: 7px;
}
.ad-slidedots i { width: 20px; height: 3px; border-radius: 3px; background: var(--line-strong); display: block; transition: background 0.4s var(--ease); }
.ad-slidedots i.on { background: var(--ink); }

/* the screen content cross-fades when it swaps */
.ad-phone .ad-app { transition: opacity 0.34s var(--ease), transform 0.34s var(--ease); }
.ad-phone .ad-app.swap { opacity: 0; transform: translateY(8px); }

.ad-screen {
  position: relative;
  width: 100%; height: 100%;
  border-radius: clamp(15px, 1.8vw, 29px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
.ad-screen.dark { background: #141414; color: #fff; }
/* dynamic island */
.ad-screen::before {
  content: "";
  position: absolute;
  top: clamp(5px, 0.6vw, 9px); left: 50%;
  transform: translateX(-50%);
  width: clamp(34px, 4vw, 64px); height: clamp(11px, 1.2vw, 18px);
  background: #0E0E0E;
  border-radius: 12px;
  z-index: 6;
}

/* status bar */
.ad-sb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.ad-sb .dots { display: flex; gap: 3px; align-items: center; }
.ad-sb .dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; display: block; opacity: 0.85; }
.ad-sb .dots i.bar { width: 14px; height: 7px; border-radius: 2px; }

/* app body padding */
.ad-app { padding: 12px 16px 0; display: flex; flex-direction: column; gap: 11px; flex: 1; }

/* front: header row */
.ad-greet { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ad-greet small { display: block; font-size: 10.5px; color: var(--gray-2); font-weight: 600; letter-spacing: 0.02em; line-height: 1; white-space: nowrap; }
.ad-greet b { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.ad-head { display: flex; align-items: center; justify-content: space-between; }
.ad-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--paper-2); border: 1px solid var(--line); flex: none; }

/* search pill */
.ad-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper-2);
  border-radius: 100px;
  padding: 9px 14px;
  font-size: 11.5px; color: var(--gray-2); font-weight: 500;
}
.ad-search svg { width: 13px; height: 13px; color: var(--gray-1); }

/* chip row */
.ad-chips { display: flex; gap: 7px; }
.ad-chips span {
  font-size: 10.5px; font-weight: 600;
  padding: 6px 11px; border-radius: 100px;
  background: var(--paper-2); color: var(--gray-1);
  white-space: nowrap;
}
.ad-chips span.on { background: var(--ink); color: #fff; }

/* feature card (ink) */
.ad-feature {
  background: var(--ink); color: #fff;
  border-radius: 16px; padding: 14px;
  display: flex; flex-direction: column; gap: 9px;
}
.ad-feature .fl { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }
.ad-feature .ft { font-family: var(--serif); font-size: 16px; letter-spacing: -0.01em; }
.ad-feature .fb { display: flex; align-items: center; justify-content: space-between; }
.ad-feature .stack { display: flex; }
.ad-feature .stack i { width: 22px; height: 22px; border-radius: 50%; background: #2c2c2c; border: 1.5px solid #141414; margin-left: -7px; display: block; }
.ad-feature .stack i:first-child { margin-left: 0; }
.ad-feature .go { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 13px; }

/* list rows */
.ad-rows { display: flex; flex-direction: column; gap: 9px; }
.ad-row { display: flex; align-items: center; gap: 10px; }
.ad-row .ri { width: 32px; height: 32px; border-radius: 10px; background: var(--paper-2); border: 1px solid var(--line); flex: none; display: grid; place-items: center; }
.ad-row .ri svg { width: 15px; height: 15px; color: var(--ink); }
.ad-row .rt { flex: 1; min-width: 0; }
.ad-row .rt b { display: block; font-size: 12px; font-weight: 600; letter-spacing: -0.01em; }
.ad-row .rt small { display: block; font-size: 10px; color: var(--gray-2); }
.ad-row .rc { font-size: 12px; color: var(--gray-3); }

/* bottom tab bar */
.ad-tabs {
  margin-top: auto;
  display: flex; align-items: center; justify-content: space-around;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.ad-screen.dark .ad-tabs { background: #141414; border-top-color: #2a2a2a; }
.ad-tabs i { width: 19px; height: 19px; border-radius: 6px; background: var(--paper-3); display: block; }
.ad-tabs i.on { background: var(--ink); }
.ad-screen.dark .ad-tabs i { background: #2c2c2c; }
.ad-screen.dark .ad-tabs i.on { background: #fff; }

/* dark phone: analytics */
.ad-kpi { display: flex; flex-direction: column; gap: 3px; }
.ad-kpi small { font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; color: rgba(255,255,255,0.5); }
.ad-kpi b { font-family: var(--serif); font-size: 34px; letter-spacing: -0.02em; line-height: 1; }
.ad-kpi .up { font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,0.75); }
.ad-chart { display: flex; align-items: flex-end; gap: 7px; height: 92px; padding-top: 6px; }
.ad-chart span { flex: 1; background: #2c2c2c; border-radius: 5px 5px 0 0; }
.ad-chart span.hl { background: #fff; }
.ad-mini { display: flex; flex-direction: column; gap: 8px; }
.ad-mini .m { display: flex; align-items: center; justify-content: space-between; font-size: 11px; }
.ad-mini .m span:first-child { color: rgba(255,255,255,0.55); }
.ad-mini .m span:last-child { font-weight: 600; }

/* ---------- Selected apps: 2-up rich cards ---------- */
.ad-work-grid {
  margin-top: clamp(26px, 3vw, 46px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(18px, 1.8vw, 30px);
}
.ad-work-grid .work-card { grid-column: auto; display: flex; flex-direction: column; }
.ad-work-grid .work-card .media { aspect-ratio: 16 / 11; }
.ad-work-grid .work-card .wc-desc {
  margin-top: 14px;
  color: var(--gray-1);
  font-size: 15px;
  line-height: 1.55;
  max-width: 46ch;
}
.ad-work-grid .work-meta { margin-top: 16px; flex-direction: column; align-items: flex-start; gap: 6px; }
.ad-work-grid .tags .tag { white-space: nowrap; }
.ad-work-grid .badge { white-space: nowrap; }
.ad-work-grid .tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; justify-content: flex-start; }

@media (max-width: 1000px) {
  .ad-hero-row { grid-template-columns: 1fr; gap: clamp(30px, 6vw, 44px); align-items: start; }
  .ad-h1 { font-size: clamp(40px, 9vw, 66px); }
  .ad-hero-lead .lead { max-width: 50ch; }
  .ad-phones { margin-top: 8px; }
}
@media (max-width: 720px) {
  .ad-work-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .ad-phones { gap: 6px; }
  .ad-pcol.mid { margin-top: 0; }
  .ad-cap { font-size: 9px; }
}
