/* Comparison pages (/notchnook-alternative, /alcove-alternative, /boring-notch-alternative,
   /dynamic-island-for-macbook). Built from the site's own pieces: the night sky (stars.js),
   the Luni stage and tiles (luni.css, luni.js) and the install steps (styles.css). The one
   loud thing on the page is Luni; the rest stays quiet. Lunille's column carries the moon's
   warm accent, the other app's column stays neutral. */

.cmp {
  max-width: 72rem; margin: 0 auto; padding: 0 var(--sc-gutter) 2.5rem;
  display: grid; gap: clamp(4.5rem, 9vw, 7.5rem);
}
.cmp .section-title { text-wrap: balance; }
.cmp-lede { margin: 0; max-width: 52ch; font-size: var(--sc-t-base); line-height: 1.6; color: var(--sc-ink-soft); }

/* ---------------------------------------------------------------- hero */
.cmp-hero {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; gap: var(--sc-6);
  padding-top: calc(var(--menubar-h, 48px) + clamp(1.5rem, 5vw, 3.5rem));
}
/* An opaque night behind the hero: Luni's clips are black and screened over it (as on the
   homepage), so the group needs a real backdrop to blend with. */
.cmp-hero::before {
  content: ""; position: absolute; z-index: -2; top: 0; left: 50%; width: 100vw; height: calc(100% + 4rem); margin-left: -50vw;
  background: var(--sc-canvas);
}
.cmp-hero__sky {
  position: absolute; z-index: -1; top: 0; left: 50%; width: 100vw; height: calc(100% + 4rem); margin-left: -50vw;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent);
}
.cmp-hero__copy { display: grid; gap: var(--sc-4); align-content: center; }
.cmp-hero__vs { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.cmp-hero__vs img { width: 26px; height: 26px; }
.cmp-hero__vs b { color: var(--sc-ink); font-weight: 600; }
.cmp-hero .section-title { font-size: var(--sc-t-3xl); }
.cmp-hero__cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: var(--sc-2, 0.5rem); }
.cmp-hero__price { margin: 0; max-width: 28ch; font-size: var(--sc-t-sm); line-height: 1.5; color: var(--sc-ink-soft); }
.cmp-hero__price b { color: var(--sc-ink); font-weight: 600; }
.cmp-hero .luni__stage { grid-area: auto; align-self: stretch; height: clamp(360px, 36vw, 470px); --disc: 140px; --cy: 46%; }
/* The hint sits under Luni, on the hero's own night (no ground here). */
.cmp-hero .luni__hint { position: absolute; left: 0; right: 0; top: calc(var(--cy) + var(--disc) * 0.787 + 30px); margin: 0; max-width: none; }

/* ------------------------------------------------- which one is for you */
.cmp-pick { display: grid; gap: var(--sc-5); }
.cmp-pick__cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cmp-card {
  display: grid; align-content: start; gap: var(--sc-4);
  padding: clamp(22px, 3vw, 30px); border-radius: 16px;
  background: var(--sc-surface);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06), inset 0 1px 0 rgb(255 255 255 / 0.04);
}
.cmp-card h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-family: var(--sc-font-display); font-weight: 500; font-size: var(--sc-t-lg); letter-spacing: -0.01em; }
.cmp-card h3 img { width: 26px; height: 26px; }
.cmp-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cmp-card li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; font-size: var(--sc-t-base); line-height: 1.5; color: #B7BED2; }
.cmp-card li i { font-size: 17px; line-height: 1.55; color: var(--sc-ink-soft); }
.cmp-card li b { color: var(--sc-ink); font-weight: 600; }
.cmp-card--us {
  background: radial-gradient(110% 130% at 100% 0%, rgb(255 211 161 / 0.11), transparent 58%), var(--sc-surface);
  box-shadow: inset 0 0 0 1px rgb(255 211 161 / 0.26), 0 18px 40px -24px rgb(255 211 161 / 0.25);
}
.cmp-card--us li i { color: var(--sc-accent); }

/* ------------------------------------------------------- side by side */
.cmp-sheet { display: grid; gap: var(--sc-5); }
.cmp-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--sc-t-sm); line-height: 1.5; table-layout: fixed; }
.cmp-table th, .cmp-table td { padding: 13px 18px; text-align: left; vertical-align: top; }
.cmp-table thead th { padding: 22px 18px 16px; font-size: var(--sc-t-base); font-weight: 600; color: var(--sc-ink); vertical-align: bottom; }
.cmp-table thead th:first-child { width: 30%; }
.cmp-app { display: inline-flex; align-items: center; gap: 10px; }
.cmp-app img { width: 28px; height: 28px; }
.cmp-app__mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: rgb(255 255 255 / 0.06); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.08);
  font: 600 13px/1 var(--sc-font-display); color: var(--sc-ink-soft);
}
.cmp-table tbody th { font-weight: 500; color: var(--sc-ink); border-top: 1px solid var(--sc-hairline); }
.cmp-table tbody td { color: var(--sc-ink-soft); border-top: 1px solid var(--sc-hairline); }
.cmp-table .cmp-group th {
  padding-top: 30px; padding-bottom: 10px; border-top: 0;
  font-family: var(--sc-font-display); font-weight: 500; font-size: var(--sc-t-base); letter-spacing: -0.005em; color: var(--sc-accent);
}
.cmp-table .cmp-group td { border-top: 0; }
/* Lunille's column: one raised strip of moonlight from the header to the last row. */
.cmp-table .is-us { background: rgb(255 211 161 / 0.055); color: var(--sc-ink); box-shadow: inset 1px 0 0 rgb(255 211 161 / 0.2), inset -1px 0 0 rgb(255 211 161 / 0.2); }
.cmp-table thead .is-us { border-radius: 16px 16px 0 0; box-shadow: inset 1px 0 0 rgb(255 211 161 / 0.2), inset -1px 0 0 rgb(255 211 161 / 0.2), inset 0 1px 0 rgb(255 211 161 / 0.3); }
.cmp-table tbody:last-child tr:last-child .is-us { border-radius: 0 0 16px 16px; box-shadow: inset 1px 0 0 rgb(255 211 161 / 0.2), inset -1px 0 0 rgb(255 211 161 / 0.2), inset 0 -1px 0 rgb(255 211 161 / 0.2); }
.cmp-v { display: inline-grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; align-items: start; }
.cmp-v i { font-size: 15px; line-height: 1.5; }
.is-us .cmp-v--yes i { color: var(--sc-accent); }
.cmp-v--yes i { color: #C9CFDD; }
.cmp-v--no { color: rgb(163 171 194 / 0.62); }
.cmp-v--no i { color: rgb(163 171 194 / 0.45); }
.cmp-note { margin: 0; max-width: 70ch; font-size: 13px; line-height: 1.55; color: rgb(163 171 194 / 0.8); }
.cmp-note a { color: var(--sc-ink-soft); text-underline-offset: 3px; }

/* The overview page: one row per app, Lunille's row lit instead of a column. */
.cmp-table--apps thead th:first-child { width: 17%; }
.cmp-table--apps tbody tr.is-us-row th, .cmp-table--apps tbody tr.is-us-row td { background: rgb(255 211 161 / 0.055); color: var(--sc-ink); border-top-color: rgb(255 211 161 / 0.22); }
.cmp-table--apps tbody tr.is-us-row + tr th, .cmp-table--apps tbody tr.is-us-row + tr td { border-top-color: rgb(255 211 161 / 0.22); }
.cmp-table--apps tbody tr.is-us-row th:first-child { border-radius: 14px 0 0 14px; }
.cmp-table--apps tbody tr.is-us-row td:last-child { border-radius: 0 14px 14px 0; }

/* -------------------------------------------------------------- Luni */
.cmp-luni { display: grid; gap: var(--sc-5); }
.cmp-luni__head { display: grid; gap: var(--sc-3); }
.cmp-luni .luni__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ----------------------------------------------------------- switching */
.cmp-switch { display: grid; gap: var(--sc-5); }

/* ----------------------------------------------------------------- FAQ */
.cmp-faq { display: grid; gap: var(--sc-4); max-width: 46rem; }
.cmp-faq .faq { max-width: none; }
.cmp-faq .faq a { color: var(--sc-accent); text-underline-offset: 3px; }

/* ------------------------------------------------------------- the end */
.cmp-end {
  display: grid; justify-items: center; gap: var(--sc-4); text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem) var(--sc-gutter);
  border-radius: 24px;
  background: radial-gradient(70% 120% at 50% 0%, rgb(255 211 161 / 0.09), transparent 62%), var(--sc-surface);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.06);
}
.cmp-end img { width: 96px; height: 96px; filter: drop-shadow(0 16px 30px rgb(0 0 0 / 0.5)); }
.cmp-end .body { max-width: 36ch; }
.cmp-end__price { margin: 0; font-size: var(--sc-t-sm); color: var(--sc-ink-soft); }
.cmp-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: var(--sc-3, 0.75rem) 0 0; padding: 0; list-style: none; }
.cmp-more a {
  display: inline-flex; padding: 8px 14px; border-radius: 999px; text-decoration: none;
  font-size: var(--sc-t-sm); color: var(--sc-ink);
  box-shadow: inset 0 0 0 1px var(--sc-hairline-strong, rgb(255 255 255 / 0.16));
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.cmp-more a:hover { background: rgb(255 255 255 / 0.05); box-shadow: inset 0 0 0 1px rgb(255 211 161 / 0.4); }
.cmp-more a:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; }
.cmp > .foot { margin-top: calc(clamp(4.5rem, 9vw, 7.5rem) * -0.5); }

/* -------------------------------------------------------------- narrow */
@media (max-width: 900px) {
  .cmp-hero { grid-template-columns: 1fr; gap: 0; }
  .cmp-hero .luni__stage { height: 340px; --disc: 118px; --cy: 48%; }
  .cmp-pick__cards { grid-template-columns: 1fr; }
  .cmp-luni .luni__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-luni .luni__tiles > :nth-child(3) { display: none; }
}
@media (max-width: 680px) {
  .cmp-table, .cmp-table tbody, .cmp-table tr, .cmp-table th, .cmp-table td { display: block; width: auto; }
  .cmp-table { table-layout: auto; }
  .cmp-table thead { display: none; }
  .cmp-table tbody tr:not(.cmp-group) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 14px 0; border-top: 1px solid var(--sc-hairline); }
  .cmp-table tbody tr:not(.cmp-group) th { grid-column: 1 / -1; padding: 0; border: 0; }
  .cmp-table tbody td { padding: 10px 12px; border: 0; border-radius: 12px; background: rgb(255 255 255 / 0.03); }
  .cmp-table tbody td::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--sc-ink-soft); }
  .cmp-table tbody .is-us, .cmp-table tbody:last-child tr:last-child .is-us { border-radius: 12px; box-shadow: inset 0 0 0 1px rgb(255 211 161 / 0.24); }
  .cmp-table tbody .is-us::before { color: var(--sc-accent); }
  .cmp-table .cmp-group td { display: none; }
  .cmp-table .cmp-group th { padding: 22px 0 4px; }
  .cmp-table--apps tbody tr:not(.cmp-group) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-table--apps tbody tr td:last-child { grid-column: 1 / -1; }
  .cmp-table--apps tbody tr.is-us-row { padding: 14px 12px; border-radius: 16px; background: rgb(255 211 161 / 0.055); box-shadow: inset 0 0 0 1px rgb(255 211 161 / 0.22); }
  .cmp-table--apps tbody tr.is-us-row th, .cmp-table--apps tbody tr.is-us-row td { background: none; border-radius: 12px; }
  .cmp-table--apps tbody tr.is-us-row td { background: rgb(255 211 161 / 0.06); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .cmp-luni .luni__tiles { grid-template-columns: 1fr; }
  .cmp-luni .luni__tiles > :nth-child(3) { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  .cmp-more a { transition: none; }
}

/* The Luni tiles use h3 here (they sit under the section's h2); same look as the homepage's h4. */
.cmp .luni-tile h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--sc-ink); }
@media (max-width: 860px) { .cmp .luni-tile h3 { font-size: 14px; } }
