/*
  App-showcase styling shared by the homepage (index.html) and the App page
  (app.html). Scoped to `ap-` classes plus a few homepage section overrides, so
  guides, tools and calculators (which carry their own styles) are unaffected.

  Design notes: pale app-like surfaces, dark ink text, serif display headings,
  subtle borders, restrained teal accents. Deep blue is used selectively behind
  app screens (hero panel, Guardian and download sections) as CSS only.
*/

:root {
  --teal: #0f766e;
  --teal-tint: #e3f3f0;
  --teal-bright: #5fd6c4;
  --deep-1: #06182f;
  --deep-2: #0b3a52;
  --deep-3: #0e5f73;
  --serif-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
}

.serif-display {
  font-family: var(--serif-display);
  font-weight: 500;
  letter-spacing: -0.012em;
}

/* Phone-shaped screenshot frame. The screenshot is shown whole and unaltered. */
.ap-phone {
  margin: 0;
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  border: 1px solid var(--line-strong, #c7d3e0);
  background: #fff;
  box-shadow: 0 18px 40px rgba(6, 24, 47, 0.22);
}

.ap-phone img {
  display: block;
  width: 100%;
  height: auto;
}

/* Deep-blue panel behind a screenshot (CSS only, no photo). */
.ap-deep {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 4vw, 40px);
  border-radius: var(--radius-lg, 22px);
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(95, 214, 196, 0.22), rgba(95, 214, 196, 0) 60%),
    linear-gradient(170deg, var(--deep-1), var(--deep-2) 60%, var(--deep-3));
  overflow: hidden;
}

.ap-deep .ap-phone {
  width: min(100%, 290px);
}

.ap-eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Two-up screenshot gallery with captions (homepage app section). */
.ap-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
}

.ap-shot {
  margin: 0;
}

.ap-shot .ap-phone {
  box-shadow: 0 10px 26px rgba(15, 32, 57, 0.14);
}

.ap-shot figcaption {
  margin-top: 14px;
  color: var(--muted, #5b6b80);
  font-size: 13.5px;
  line-height: 1.6;
}

.ap-shot figcaption strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text, #0f2039);
  font-size: 14.5px;
}

.ap-link {
  color: var(--teal);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.ap-link:hover {
  color: var(--deep-3);
}

/* ---- App page ---------------------------------------------------------- */

.ap-page-hero {
  padding-block: clamp(40px, 6vw, 76px) clamp(36px, 5vw, 60px);
  background: linear-gradient(180deg, var(--page-bg-soft, #f5f7fa), var(--page-bg, #eef2f7) 70%);
}

.ap-page-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: clamp(32px, 5vw, 64px);
}

.ap-page-title {
  margin: 0 0 20px;
  max-width: 600px;
  font-size: clamp(34px, 4.6vw, 52px);
  line-height: 1.1;
  color: var(--text, #0f2039);
}

.ap-page-lead {
  max-width: 520px;
  margin: 0 0 28px;
  color: var(--soft, #33445c);
  font-size: clamp(16px, 1.8vw, 19px);
  line-height: 1.65;
}

.ap-feature {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(28px, 4vw, 48px);
  border-top: 1px solid var(--line, #dde5ee);
}

.ap-feature:nth-of-type(even) {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.ap-feature:nth-of-type(even) .ap-feature-shot {
  order: 2;
}

.ap-feature-shot {
  display: flex;
  justify-content: center;
}

.ap-feature-shot .ap-phone {
  width: min(100%, 280px);
  box-shadow: 0 14px 32px rgba(15, 32, 57, 0.16);
}

.ap-feature h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.15;
  color: var(--text, #0f2039);
}

.ap-feature p {
  margin: 0 0 14px;
  max-width: 560px;
  color: var(--muted, #5b6b80);
  font-size: 16px;
  line-height: 1.7;
}

.ap-feature .ap-note {
  padding: 12px 16px;
  border-left: 3px solid var(--teal);
  background: var(--teal-tint);
  border-radius: 0 var(--radius-sm, 10px) var(--radius-sm, 10px) 0;
  color: var(--soft, #33445c);
  font-size: 14px;
}

.ap-plans {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 28px);
  margin-top: 28px;
}

.ap-plan {
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line, #dde5ee);
  border-radius: var(--radius-lg, 22px);
  background: var(--surface, #fff);
}

.ap-plan h3 {
  margin: 0 0 10px;
  font-size: 22px;
  color: var(--text, #0f2039);
}

.ap-plan p {
  margin: 0;
  color: var(--muted, #5b6b80);
  font-size: 15px;
  line-height: 1.65;
}

.ap-plan-premium {
  border-color: rgba(15, 118, 110, 0.4);
  background: linear-gradient(180deg, var(--teal-tint), #fff 70%);
}

.ap-deep-cta {
  padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px);
  border-radius: var(--radius-lg, 22px);
  background:
    radial-gradient(90% 90% at 85% 0%, rgba(95, 214, 196, 0.18), rgba(95, 214, 196, 0) 60%),
    linear-gradient(165deg, var(--deep-1), var(--deep-2) 70%, var(--deep-3));
  color: var(--navy-text, #eef3fa);
}

.ap-deep-cta h2 {
  margin: 0 0 14px;
  max-width: 560px;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.15;
  color: var(--navy-text, #eef3fa);
}

.ap-deep-cta p {
  max-width: 520px;
  margin: 0 0 28px;
  color: #b9c9de;
  font-size: 16px;
  line-height: 1.7;
}

/* ---- Homepage section refinements (deep blue / teal, serif headings) ----- */

.hero-title,
.section-title {
  font-family: var(--serif-display);
  font-weight: 500;
  letter-spacing: -0.012em;
}

.hero-title em {
  color: var(--teal);
}

.guardian-section {
  background:
    radial-gradient(80% 80% at 90% 0%, rgba(95, 214, 196, 0.14), rgba(95, 214, 196, 0) 60%),
    linear-gradient(165deg, var(--deep-1), var(--deep-2) 90%, var(--deep-3));
}

.cta-panel {
  background:
    radial-gradient(80% 80% at 90% 0%, rgba(95, 214, 196, 0.16), rgba(95, 214, 196, 0) 60%),
    linear-gradient(165deg, var(--deep-1), var(--deep-2) 90%, var(--deep-3));
}

.section-label.on-dark,
.guardian-card h3 {
  color: var(--teal-bright);
}

@media (max-width: 900px) {
  /* Keep the problem-solving heading and actions first on small screens. */
  .hero-visual {
    order: 0;
  }

  .hero-visual .ap-deep {
    padding: 24px;
  }

  .hero-visual .ap-phone {
    width: min(100%, 230px);
  }

  .ap-page-hero-inner,
  .ap-feature,
  .ap-feature:nth-of-type(even) {
    grid-template-columns: 1fr;
  }

  /* App page hero keeps text and store badges first on small screens. */
  .ap-feature-shot {
    order: -1;
  }

  .ap-feature:nth-of-type(even) .ap-feature-shot {
    order: -1;
  }
}

@media (max-width: 700px) {
  /* Homepage examples: one per row, caption directly beneath each. */
  .ap-shots {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .ap-shot {
    width: min(100%, 320px);
    margin-inline: auto;
  }

  .ap-shot figcaption {
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  .ap-plans {
    grid-template-columns: 1fr;
  }
}

/* Homepage app section: copy beside two captioned screens. */
#app .explain-layout {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
}

#app .explain-visual {
  display: block;
}

.ap-shot-note {
  margin: 18px 0 0;
  color: var(--muted, #5b6b80);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  #app .explain-layout {
    grid-template-columns: 1fr;
  }

  #app .explain-visual {
    order: 0;
  }
}

.ap-page-title,
.ap-feature h2,
.ap-section-head h2,
.section-title,
.hero-title {
  text-wrap: balance;
}

/* Slightly more compact desktop hero so the entry points appear sooner. */
.hero-visual .ap-deep {
  padding: clamp(22px, 3vw, 32px) clamp(20px, 3vw, 32px);
}

.hero-visual .ap-phone {
  width: min(100%, 250px);
}

.hero-inner {
  gap: clamp(28px, 4vw, 48px);
}

.needs-group-label {
  margin-top: 24px;
}
