/*
  Extra styles for iosapps.mohinisharma.xyz and androidapps.mohinisharma.xyz.
  Loaded after the main site's styles.css (copied in by platform/build.mjs),
  so it reuses its tokens, buttons, cards and sections.
*/

/* ---------- Shared ---------- */

.brand-platform {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent, var(--text));
  font-weight: 600;
}

.text-link:hover .arrow {
  transform: translate(2px, -2px);
}

/* Tint colours for an app page, from its hue (--h), as on the app cards. */
.app-page {
  --tint: hsl(var(--h) var(--tint-s) var(--tint-l));
  --tint-2: hsl(var(--h) var(--tint-s) var(--tint-l2));
  --accent: hsl(var(--h) 60% var(--accent-l));
  --app-a: hsl(var(--h) 95% 72% / 0.42);
  --app-b: hsl(calc(var(--h) + 50) 95% 76% / 0.32);
}

@media (prefers-color-scheme: dark) {
  .app-page {
    --app-a: hsl(var(--h) 85% 55% / 0.26);
    --app-b: hsl(calc(var(--h) + 50) 85% 58% / 0.18);
  }
}

/* ---------- App hero ---------- */

.app-hero {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 7vw, 96px);
}

.app-aurora {
  background:
    radial-gradient(40% 50% at 18% 30%, var(--app-a), transparent 70%),
    radial-gradient(36% 46% at 80% 30%, var(--app-b), transparent 70%),
    radial-gradient(30% 34% at 60% 85%, var(--aurora-c), transparent 70%);
}

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

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.crumbs a:hover {
  color: var(--text);
}

.crumbs [aria-current] {
  color: var(--text);
}

.app-icon {
  width: 112px;
  height: 112px;
  border-radius: 22.5%;
  box-shadow: 0 18px 36px -16px hsl(var(--h) 50% 25% / 0.55);
}

.app-hero h1 {
  margin-top: 28px;
  font-size: clamp(48px, 7vw, 88px);
  font-weight: 750;
  letter-spacing: -0.05em;
}

.app-tagline {
  margin-top: 16px;
  color: var(--accent);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

.app-intro {
  max-width: 52ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.6;
}

.app-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.app-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.app-meta li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.app-meta li:has(.star) {
  color: var(--text);
  font-weight: 600;
}

.app-meta li span:not(.star) {
  color: var(--muted);
  font-weight: 500;
}

/* Three screenshots fanned out, like the wide app cards. */
.app-stage {
  --shot: clamp(170px, 19vw, 240px);
  min-height: calc(var(--shot) * 2.25);
}

.app-stage .shot {
  top: 0;
}

.app-stage .shot:nth-child(1) {
  transform: translateX(-50%) translate(-58%, 28px) rotate(-7deg);
}

.app-stage .shot:nth-child(2) {
  transform: translateX(-50%) translate(58%, 28px) rotate(7deg);
}

/* ---------- Sections ---------- */

.app-section {
  padding: clamp(48px, 7vw, 96px) 0;
  border-top: 1px solid var(--line);
}

.app-section-head {
  margin-bottom: clamp(28px, 4vw, 44px);
}

.app-section-head h2 {
  font-size: clamp(32px, 4.4vw, 52px);
}

/* Screenshot gallery: scrolls sideways, snapping to each screenshot. */
.gallery {
  display: flex;
  gap: 18px;
  padding: 4px 4px 20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.gallery li {
  flex: none;
  width: clamp(170px, 21vw, 240px);
  scroll-snap-align: start;
}

.gallery img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 36px -24px var(--shadow);
}

/* Feature tiles and fact panels share the principle-card look. */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-grid li,
.fact {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--gradient);
}

.feature-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-grid h3,
.fact h3 {
  margin: 18px 0 6px;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.feature-grid p,
.fact p {
  color: var(--muted);
  font-size: 15px;
}

.fact .text-link {
  margin-top: 14px;
  font-size: 15px;
}

/* How it works */
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  list-style: none;
}

.steps li {
  padding: 28px;
  border: 1px solid hsl(var(--h) 50% 50% / 0.1);
  border-radius: 22px;
  background: linear-gradient(170deg, var(--tint) 30%, var(--tint-2));
}

.step-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  font-size: 15px;
  font-weight: 700;
}

.steps p {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
}

/* Privacy, price and details */
.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.facts-2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
}

.facts-1 {
  grid-template-columns: minmax(0, 1fr);
  max-width: 560px;
}

.details {
  font-size: 14px;
}

.details div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.details div:last-child {
  border-bottom: 0;
}

.details dt {
  color: var(--muted);
}

.details dd {
  font-weight: 500;
  text-align: right;
}

.details a {
  color: var(--accent);
}

/* FAQ */
.faq {
  max-width: 820px;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat;
  color: var(--muted);
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details p {
  max-width: 68ch;
  padding-bottom: 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

/* More apps */
.more-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.more-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 22px;
  border: 1px solid hsl(var(--h) 50% 50% / 0.1);
  border-radius: 22px;
  background: linear-gradient(170deg, hsl(var(--h) var(--tint-s) var(--tint-l)) 30%, hsl(var(--h) var(--tint-s) var(--tint-l2)));
  transition:
    transform 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}

.more-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 50px -30px hsl(var(--h) 50% 25% / 0.45);
}

.more-card img {
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border-radius: 22.5%;
  box-shadow: 0 10px 22px -10px hsl(var(--h) 50% 25% / 0.55);
}

.more-name {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.more-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
  .app-hero-inner {
    grid-template-columns: 1fr;
  }

  .app-stage {
    --shot: clamp(150px, 30vw, 220px);
  }

  .feature-grid,
  .more-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .steps,
  .facts,
  .facts-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .brand-platform {
    display: none;
  }

  .app-icon {
    width: 88px;
    height: 88px;
  }

  .app-actions {
    flex-direction: column;
    align-items: stretch;
  }

  /* Narrow enough that the fanned screenshots stay on screen. */
  .app-stage {
    --shot: 36vw;
  }

  .feature-grid,
  .more-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid li,
  .fact,
  .steps li {
    padding: 22px;
  }

  .faq summary {
    font-size: 17px;
  }
}
