/**
 * appdev.css — page-specific styles for appDevelopment.html.
 *
 * Deliberately NOT part of design-system.css: this page uses a bespoke
 * layout (interactive device stage, platform switcher, scroll-driven
 * process timeline) that no other page shares. Keeping it here stops the
 * shared system from accumulating one-off rules.
 *
 * Everything below reuses the design system's tokens (--blue, --ink,
 * --border, ...) so the page still reads as the same brand.
 */

/* ================================================================
   HERO — device stage
   ================================================================ */
.ad-hero {
  position: relative;
  padding-top: calc(var(--header-h) + 64px);
  padding-bottom: 80px;
  overflow: hidden;
  background: var(--surface);
}

/* Fine dot grid — gives the hero texture without a background image. */
.ad-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, oklch(88% 0.012 255) 1px, transparent 0);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 40%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 35%, #000 40%, transparent 100%);
  pointer-events: none;
}

.ad-hero > * { position: relative; z-index: 1; }

.ad-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 56px;
  align-items: center;
}

.ad-hero h1 {
  font-size: clamp(32px, 4.4vw, 52px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.ad-hero-lede {
  font-size: 18px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 480px;
}

/* Capability chips — honest capability statements, not invented metrics. */
.ad-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ad-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 13px;
  border-radius: 100px;
}

.ad-chip svg { color: var(--blue); flex-shrink: 0; }

/* ================================================================
   DEVICE — an actual phone UI built in HTML, not a screenshot
   ================================================================ */
.ad-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.ad-device-wrap {
  position: relative;
  display: flex;
  justify-content: center;
}

/* Soft brand glow pooled under the device. */
.ad-device-wrap::after {
  content: "";
  position: absolute;
  bottom: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 76%;
  height: 46px;
  background: radial-gradient(ellipse at center, oklch(56% 0.17 258 / 0.28), transparent 70%);
  filter: blur(14px);
  z-index: -1;
}

.ad-device {
  width: 268px;
  height: 552px;
  border-radius: 42px;
  background: oklch(18% 0.02 262);
  padding: 9px;
  box-shadow:
    0 2px 3px rgba(15, 22, 40, 0.4),
    0 26px 50px -18px rgba(15, 22, 40, 0.45),
    inset 0 0 0 1.5px oklch(34% 0.02 262);
  animation: ad-float 7s ease-in-out infinite;
}

@keyframes ad-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

.ad-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 34px;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Camera pill — the only device chrome. No fake status bar: a painted
   one collides with the real OS bar in any screenshot and reads cheap. */
.ad-notch {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 74px;
  height: 20px;
  border-radius: 100px;
  background: oklch(18% 0.02 262);
  z-index: 5;
}

.ad-panels {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.ad-panel {
  position: absolute;
  inset: 0;
  padding: 40px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 380ms cubic-bezier(0.16, 1, 0.3, 1), transform 380ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  overflow: hidden;
}

.ad-panel.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* `display:flex` above outranks the hidden attribute's UA display:none,
   so hidden panels need this or they'd stay in the layout and the a11y
   tree while invisible. */
.ad-panel[hidden] { display: none; }

.ad-panel-head {
  font-family: "Sora", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.ad-panel-sub {
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

/* — in-screen widgets — */
.ad-w {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
}

.ad-w-big {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 21px;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.ad-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 54px;
  margin-top: 10px;
}

.ad-bars i {
  flex: 1;
  border-radius: 3px;
  background: var(--blue-soft);
  transform-origin: bottom;
  animation: ad-bar-rise 700ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.ad-bars i.on { background: linear-gradient(180deg, var(--blue), var(--cyan)); }

@keyframes ad-bar-rise {
  from { transform: scaleY(0.05); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}

.ad-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.ad-row-ic {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--blue-soft);
  flex-shrink: 0;
}

.ad-row-ic.c { background: var(--cyan-soft); }

.ad-row-t { font-size: 11.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.ad-row-s { font-size: 10px; color: var(--muted); margin-top: 1px; }

.ad-pill {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--blue-soft);
  color: var(--blue-ink);
  white-space: nowrap;
}

.ad-pill.warn { background: oklch(94% 0.05 85); color: oklch(45% 0.12 60); }

/* Membership card inside the phone */
.ad-memcard {
  border-radius: 14px;
  padding: 15px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #fff;
}

.ad-memcard .lbl { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.85; font-weight: 700; }
.ad-memcard .num { font-family: "Sora", sans-serif; font-weight: 700; font-size: 25px; margin-top: 3px; }
.ad-memcard .meta { display: flex; justify-content: space-between; margin-top: 14px; font-size: 10.5px; opacity: 0.92; }

/* Fake bottom tab bar (part of the app UI being demoed, not OS chrome) */
.ad-tabbar {
  display: flex;
  justify-content: space-around;
  padding: 11px 8px 15px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.ad-tabbar span {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: oklch(90% 0.008 255);
}

.ad-tabbar span.on { background: var(--blue); }

/* — screen switcher (real tabs, keyboard accessible) — */
.ad-switch {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  background: oklch(94.5% 0.008 255);
  border: 1px solid var(--border);
  border-radius: 100px;
}

.ad-switch button {
  border: none;
  background: transparent;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 17px;
  border-radius: 100px;
  cursor: pointer;
  transition: color 200ms, background 200ms, box-shadow 200ms;
  white-space: nowrap;
}

.ad-switch button:hover { color: var(--ink); }

.ad-switch button[aria-selected="true"] {
  background: var(--surface);
  color: var(--blue-ink);
  box-shadow: 0 1px 3px rgba(20, 30, 60, 0.12);
}

.ad-switch button:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ================================================================
   PLATFORMS — segmented selector + swapping detail panel
   ================================================================ */
.ad-plat {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

.ad-plat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ad-plat-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  transition: background 200ms, color 200ms, border-color 200ms;
}

.ad-plat-btn:hover { background: var(--surface); color: var(--ink); }

.ad-plat-btn[aria-selected="true"] {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}

.ad-plat-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.ad-plat-btn .ic {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: oklch(94.5% 0.008 255);
  color: var(--muted);
  flex-shrink: 0;
  transition: background 200ms, color 200ms;
}

.ad-plat-btn[aria-selected="true"] .ic { background: var(--blue-soft); color: var(--blue-ink); }

.ad-plat-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px;
  min-height: 268px;
}

.ad-plat-panel[hidden] { display: none; }

.ad-plat-panel h3 {
  font-family: "Sora", sans-serif;
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.ad-plat-panel > p {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 22px;
  max-width: 60ch;
}

.ad-deliver {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.ad-deliver div {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.ad-deliver svg { color: var(--blue); flex-shrink: 0; margin-top: 3px; }

/* Fade the panel in when it swaps */
.ad-plat-panel.swapping { animation: ad-fade-in 320ms cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes ad-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ================================================================
   PROCESS — scroll-driven timeline
   ================================================================ */
.ad-timeline {
  position: relative;
  padding-left: 46px;
}

/* The track and the progress line that fills as you scroll */
.ad-timeline::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
  border-radius: 2px;
}

.ad-progress {
  position: absolute;
  left: 15px;
  top: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--blue), var(--cyan));
  height: 0;
  transition: height 120ms linear;
}

.ad-step {
  position: relative;
  padding-bottom: 40px;
}

.ad-step:last-child { padding-bottom: 0; }

.ad-step .dot {
  position: absolute;
  left: -46px;
  top: 1px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Sora", sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  transition: background 400ms, border-color 400ms, color 400ms, transform 400ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.ad-step.is-live .dot {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  border-color: transparent;
  color: #fff;
  transform: scale(1.12);
}

.ad-step h3 {
  font-family: "Sora", sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
  transition: color 400ms;
  letter-spacing: -0.015em;
}

.ad-step.is-live h3 { color: var(--ink); }

.ad-step p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}

/* ================================================================
   SHIPPED WORK — links to the real apps this team already runs
   ================================================================ */
.ad-work {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.ad-work-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 260ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ad-work-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 340ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ad-work-card:hover,
.ad-work-card:focus-within {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
}

.ad-work-card:hover::before,
.ad-work-card:focus-within::before { transform: scaleX(1); }

.ad-work-card h3 { font-size: 16.5px; font-weight: 600; }
.ad-work-card p { font-size: 14px; line-height: 1.55; color: var(--muted); }

.ad-work-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--blue-ink);
}

.ad-work-card:hover .ad-work-link svg { transform: translateX(3px); }
.ad-work-link svg { transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1); }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 980px) {
  .ad-hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .ad-plat { grid-template-columns: 1fr; gap: 24px; }
  .ad-plat-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  /* The base rule sets width:100%, which in a row layout makes each button
     claim the full container width — you'd see only the first platform with
     no hint the others exist. Size to content instead. */
  .ad-plat-btn { flex: 0 0 auto; width: auto; padding: 12px 18px; }
  .ad-work { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .ad-hero { padding-top: calc(var(--header-h) + 36px); padding-bottom: 56px; }
  .ad-device { width: 240px; height: 496px; }
  .ad-plat-panel { padding: 24px; }
  .ad-deliver { grid-template-columns: 1fr; }
  .ad-plat-btn .ic { display: none; }
  .ad-timeline { padding-left: 38px; }
  .ad-timeline::before, .ad-progress { left: 13px; }
  .ad-step .dot { left: -38px; width: 27px; height: 27px; font-size: 11.5px; }
}

/* ================================================================
   MOTION PREFERENCES
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .ad-device { animation: none; }
  .ad-bars i { animation: none; }
  .ad-panel { transition: none; }
  .ad-plat-panel.swapping { animation: none; }
  .ad-step .dot,
  .ad-step h3 { transition: none; }
  .ad-progress { transition: none; }
  .ad-work-card,
  .ad-work-card::before,
  .ad-work-link svg { transition: none; }
}
