/*
 * The home page (Task T3, site/docs/home-build-spec.md). App tokens only: no colour is written here, every one is a
 * tokens.css variable or a color-mix of one. Rows are flex-wrap with flex-basis, so they fall to one column on phones.
 * The shared patterns (container, sections, labels, headings, cards, the large and secondary buttons) are pages.css.
 */

/* Card body text on Home (list items); .card p, in pages.css, has the same values. */
.home li p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

/* ---------------------------------------------------------------------------------------------- buttons */

.button-plan {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  color: var(--primary);
  font-weight: 500;
  text-decoration: none;
}

.button-plan:hover {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* ---------------------------------------------------------------------------------------------- screenshot slots */

/* A frame with a strong outline; its <picture> fills it, cropped from the top (Task T6b). */
.shot {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--muted);
  overflow: hidden;
}

.shot picture {
  display: block;
  width: 100%;
  height: 100%;
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

/* Each screenshot links to its full-size image (Task T6d): the frame stays, the cursor says it opens larger, and the
   focus ring sits inside the frame (which clips anything outside it). No movement, so nothing for reduced motion. */
.shot-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.shot-link:hover img {
  opacity: 0.92;
}

.shot-link:focus-visible {
  outline-offset: -4px;
}

.shot-16x10 {
  aspect-ratio: 16 / 10;
}

.shot-4x3 {
  aspect-ratio: 4 / 3;
}

/* Slot 01: a window with a 28px top bar and three dots; the screenshot fills the rest. */
.shot-browser {
  padding-top: 28px;
}

.shot-bar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding-inline: 12px;
  border-bottom: 1px solid var(--rule);
  background: var(--card);
}

.shot-bar i {
  width: 8px;
  height: 8px;
  border: 1px solid var(--rule);
  border-radius: 50%;
}

/* ---------------------------------------------------------------------------------------------- 1. hero */

.hero {
  padding-block: 72px 80px;
  --grid-line: color-mix(in srgb, var(--foreground) 5%, transparent);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 24px 24px;
}

.hero-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 56px;
}

.hero-text {
  flex: 1 1 420px;
  min-width: 0;
}

.hero .section-label {
  margin-bottom: 16px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(36px, 4.6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 600;
}

.hero-lead {
  max-width: 34em;
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted-foreground);
}

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

.hero-note {
  margin: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 20px;
  color: var(--muted-foreground);
}

/* A phrase that never breaks inside: the hero note wraps only at its separators. */
.nowrap {
  white-space: nowrap;
}

/* The window, with the phone slot over its bottom-right corner, inside the visual's own padding. */
.hero-visual {
  position: relative;
  flex: 1 1 520px;
  min-width: 0;
  padding: 0 20px 48px 0;
}

.shot-phone {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26%;
  min-width: 96px;
  padding: 8px;
  border-radius: 18px;
  background: var(--muted);
  box-shadow: 0 0 0 6px var(--background);
}

/* The phone's height follows its screenshot (390 × 823): a fixed 9 / 19 box with an 8px bezel is narrower than the
   capture, and cover cut the share page's left edge at 390. */
.shot-phone picture,
.shot-phone img {
  height: auto;
}

.shot-phone img {
  border-radius: 10px;
}

.shot-phone .shot-link {
  height: auto;
  border-radius: 10px;
}

/* The screenshot viewer (scripts/shot-viewer.js, Task T6d). The page under it doesn't scroll while it's open. */
html.shot-viewer-open {
  overflow: hidden;
}

/* Each shape's width is the most that keeps its image within 90vh: 16:10 is 90vh × 1.6, 4:3 is 90vh × 4/3, the phone
   (780 × 1646) is 90vh × 0.474. So the image fills the dialog exactly and its border hugs it. */
.shot-viewer {
  width: min(calc(100vw - 32px), 2000px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  overflow: visible;
}

.shot-viewer.is-wide {
  width: min(calc(100vw - 32px), 2000px, 144vh);
}

.shot-viewer.is-standard {
  width: min(calc(100vw - 32px), 2000px, 120vh);
}

.shot-viewer.is-tall {
  width: min(calc(100vw - 32px), 780px, 42.6vh);
}

/* A dark scrim in both themes: the ink of the light theme, the paper of the dark one. */
.shot-viewer::backdrop {
  background: color-mix(in srgb, var(--foreground) 82%, transparent);
}

html.dark .shot-viewer::backdrop {
  background: color-mix(in srgb, var(--background) 90%, transparent);
}

@media (prefers-color-scheme: dark) {
  html:not(.light) .shot-viewer::backdrop {
    background: color-mix(in srgb, var(--background) 90%, transparent);
  }
}

.shot-viewer-frame {
  display: grid;
  gap: 12px;
}

.shot-viewer-close {
  justify-self: end;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--input);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--foreground);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.shot-viewer-close:hover {
  background: var(--accent);
}

/* The thumbnail and the full image share one cell, sized by the file's own width and height, so nothing moves when
   the full image arrives. */
.shot-viewer-stage {
  display: grid;
}

.shot-viewer-placeholder,
.shot-viewer-image {
  grid-area: 1 / 1;
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.shot-viewer-image.is-loading {
  opacity: 0;
}

/* ---------------------------------------------------------------------------------------------- 2. the problem */

.problem-list {
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--rule);
}

.problem-list li {
  flex: 1 1 240px;
  padding: 24px 24px 24px 0;
  border-bottom: 1px solid var(--border);
}

.item-number {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--primary);
}

/* ---------------------------------------------------------------------------------------------- 3. how it works */

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.steps .step {
  flex: 1 1 280px;
  background: var(--background);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 20px;
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 500;
}

/* ---------------------------------------------------------------------------------------------- 4. features */

.feature-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 48px;
  margin-bottom: 72px;
}

.feature-row .feature-text {
  flex: 1 1 380px;
  min-width: 0;
}

.feature-row .shot {
  flex: 1 1 520px;
  min-width: 0;
}

/* Row B: text first in the DOM and on phones; the slot moves left on desktop. */
@media (min-width: 760px) {
  .feature-row-b .shot {
    order: -1;
  }
}

.home h3.feature-title {
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.feature-text > p {
  margin: 16px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

.feature-points {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}

.feature-points li {
  padding-left: 20px;
  border-left: 2px solid var(--primary);
  font-weight: 500;
}

.feature-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.feature-card {
  flex: 1 1 250px;
  min-width: 0;
  padding: 0 0 24px;
  overflow: hidden;
}

.feature-card .shot {
  margin-bottom: 20px;
  border-width: 0 0 1px;
  border-radius: 0;
}

.feature-card h3,
.feature-card p {
  padding-inline: 24px;
}

.feature-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 32px;
  margin-top: 56px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted-foreground);
}

/* ---------------------------------------------------------------------------------------------- 5. who it's for */

.audience {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.audience .card {
  flex: 1 1 280px;
  background: var(--background);
}

/* ---------------------------------------------------------------------------------------------- 6. pricing */

.plans {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.plan {
  display: flex;
  flex: 1 1 300px;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
}

.plan-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
}

.home h3.plan-name {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* .home scoped: `.home li p` (card body text) would otherwise mute the price. */
.home .plan-price {
  margin: 12px 0 0;
  color: var(--foreground);
}

.plan-price .price {
  font-size: 40px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.plan-price .per {
  font-size: 14px;
  color: var(--muted-foreground);
}

.plan-facts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 24px 28px;
}

.plan-facts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
}

.plan-facts dt {
  color: var(--muted-foreground);
}

.plan-facts dd {
  margin: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.plan .button-plan {
  margin: auto 28px 28px;
}

.plans-note {
  margin: 24px 0 0;
  font-size: 14px;
  color: var(--muted-foreground);
}

/* ---------------------------------------------------------------------------------------------- 7. FAQ */

.faq {
  border-top: 1px solid var(--rule);
}

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

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding-block: 16px;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
}

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

.faq summary::marker {
  content: "";
}

.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--primary);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  max-width: 42em;
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-foreground);
}

/* ---------------------------------------------------------------------------------------------- 8. final CTA */

.cta-band {
  padding-block: 88px;
  border-bottom: 0;
  background: var(--foreground);
  color: var(--background);
  /* The focus ring must show on the inverted band. */
  --ring: var(--background);
}

.cta-band h2 {
  max-width: 18em;
  font-size: clamp(28px, 3.4vw, 44px);
}

.cta-band p {
  max-width: 36em;
  margin: 16px 0 32px;
  font-size: 17px;
  line-height: 1.55;
  opacity: 0.8;
}

.button-inverted {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding-inline: 24px;
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font-weight: 600;
  text-decoration: none;
}

.button-inverted:hover {
  background: color-mix(in srgb, var(--background) 88%, var(--foreground));
}

/* ---------------------------------------------------------------------------------------------- phones */

@media (max-width: 759px) {
  .cta-band {
    padding-block: 56px;
  }

  .hero {
    padding-block: 48px 56px;
  }

  .feature-row {
    gap: 32px;
    margin-bottom: 56px;
  }

  .problem-list li {
    padding-right: 0;
  }
}
