/*
 * Landing page: screenshots, questions and the closing call to action. The hero
 * copy, the store buttons and the word packs are styled in default.css, which the
 * rest of the site shares; the walkthrough video is in walkthrough.css, which
 * /extension/about shares.
 *
 * Pixels matter here. The screenshots are cut at the recording's own size and shown
 * at that size. The browser only ever shrinks them on screens too narrow to hold them.
 */

/* Features ---------------------------------------------------------------- */

.landing-feature,
.landing-faq {
  padding-block: clamp(3rem, 7vw, 4.5rem);
  border-bottom: 1px solid var(--line);
}

.landing-feature {
  display: grid;
  align-items: center;
  gap: 2rem 3rem;
}

.landing-feature > * {
  min-width: 0;
}

.landing-feature h2,
.landing-faq h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.landing-feature__list {
  margin: 1rem 0 0;
  padding-left: 1.1em;
  color: var(--dim);
}

.landing-feature__list li {
  margin: 0.375rem 0;
}

.landing-feature__list b {
  color: var(--ink);
}

.landing-feature__list--inline {
  display: flex;
  padding: 0;
  flex-wrap: wrap;
  gap: 0.375rem 1.75rem;
  list-style: none;
}

.landing-feature__list--inline li::before {
  color: var(--accent);
  font-family: var(--font-mono);
  content: "→ ";
}

.landing-feature--stacked .landing-feature__copy {
  max-width: 40rem;
}

.landing-feature--stacked .landing-shot {
  justify-self: center;
}

/* Screenshot left, copy right on a wide screen; the copy stays first in the DOM. */
@media (min-width: 980px) {
  .landing-feature:not(.landing-feature--stacked) {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .landing-feature:not(.landing-feature--stacked) .landing-feature__copy {
    order: 2;
  }
}

.landing-shot {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  background: #202124;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.landing-shot img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

/* Phones ------------------------------------------------------------------ */

/* A phone (ws-os-*) is shown phone recordings: the hero clip in place of the desktop
   install walkthrough, and the word card on its own device's browser. Hidden ones are
   never fetched: the clip has no preload and the stills load lazily. */
.landing-phone-clip,
.landing-shot--phone {
  display: none;
}

:is(.ws-os-ios, .ws-os-android) .landing-walkthrough,
:is(.ws-os-ios, .ws-os-android) .landing-shot--desktop {
  display: none;
}

:is(.ws-os-ios, .ws-os-android) .landing-phone-clip {
  display: block;
  width: min(17.5rem, 100%);
  margin: clamp(1.5rem, 5vw, 2rem) auto 0;
}

.ws-os-ios .landing-shot--ios,
.ws-os-android .landing-shot--android {
  display: block;
  max-width: min(17.5rem, 100%);
  justify-self: center;
}

.landing-phone-clip__frame {
  position: relative;
  overflow: hidden;
  background: #202124;
  border: 6px solid #111;
  border-radius: 1.75rem;
  box-shadow: var(--shadow-md);
}

.landing-phone-clip video {
  display: block;
  width: 100%;
  height: auto;
}

.landing-phone-clip figcaption {
  margin-top: 0.6rem;
  color: var(--dim);
  font-size: 0.8125rem;
  text-align: center;
}

.landing-phone-clip__toggle {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  place-items: center;
  background: oklch(0 0 0 / 0.55);
  border: 0;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
}

.landing-phone-clip__toggle:hover,
.landing-phone-clip__toggle:focus-visible {
  background: oklch(0 0 0 / 0.75);
}

.landing-phone-clip__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Questions --------------------------------------------------------------- */

.landing-faq h2 {
  text-align: center;
}

.landing-faq__list {
  max-width: 47.5rem;
  margin: 2rem auto 0;
}

.landing-faq__list details {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.landing-faq__list summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

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

.landing-faq__list summary::after {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1;
  content: "+";
}

.landing-faq__list details[open] summary::after {
  content: "–";
}

.landing-faq__list p {
  margin: 0.625rem 0 0;
  color: var(--dim);
}

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

/* Word packs and the closing call to action ------------------------------- */

.landing-collections__more {
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
}

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

.landing-cta {
  margin-block: clamp(2.5rem, 6vw, 4rem) clamp(1rem, 3vw, 2rem);
  padding: clamp(1.75rem, 5vw, 3.5rem);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.landing-cta h2 {
  max-width: none;
}

.landing-cta__fallback {
  display: none;
}

/* "Add WordySpot to your browser" can't be done in a browser that cannot run it, such
   as desktop Safari (ws-store-both + ws-cannot-install). The hero keeps both stores
   there and says why; this closing section offers the account and the browser list.
   A phone (ws-store-none) gets the same setup and send buttons as its hero instead. */
.ws-cannot-install .landing-cta .landing-install {
  display: none;
}

.ws-os-desktop.ws-cannot-install .landing-cta__fallback {
  display: flex;
}

.landing-cta .landing-cta__note a {
  color: var(--accent);
}

/* A phone that cannot run WordySpot in this browser (ws-store-none) starts with something
   to tap (landing/phone_reader): a marked paragraph, then reading a book here or making
   the account. Elsewhere none of it shows. */
.landing-reader,
.landing-hero__elsewhere {
  display: none;
}

.ws-store-none .landing-reader {
  display: block;
  margin-top: 1rem;
  text-align: left;
}

.landing-reader__lead {
  margin: 0 0 0.5rem;
  color: var(--dim);
  font-size: 0.9375rem;
  text-align: center;
}

.landing-reader .ext-try__page {
  padding: 0.9rem 1.1rem 1rem;
}

.ext-page.landing-reader .ext-try__bar {
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
}

.ext-page.landing-reader .ext-try__text {
  margin-top: 0.5rem;
  font-size: 1.0625rem;
  line-height: 1.7;
}

.landing-reader__actions {
  display: flex;
  margin-top: 1rem;
  flex-direction: column;
  gap: 0.6rem;
}

/* Two classes deep: components.css, loaded later, gives every .btn a display. */
.landing-reader__actions .btn {
  display: inline-flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.0625rem;
}

.landing-reader__note {
  margin: 0.6rem 0 0;
  color: var(--dim);
  font-size: 0.875rem;
  text-align: center;
}

/* Under it, setting up a browser that can run the extension is the quieter way, and the
   links the reader block already makes into buttons are not repeated. */
.ws-store-none .landing-hero__elsewhere {
  display: block;
  margin: 2.25rem 0 0;
  color: var(--ink);
  font-weight: 600;
  text-align: center;
}

.ws-store-none .landing-hero--reader .landing-install__alt {
  margin-top: 0.4rem;
}

.ws-store-none .landing-hero--reader .landing-phone .btn {
  min-height: 2.75rem;
  font-size: 0.9375rem;
}

.ws-store-none .landing-hero--reader .landing-phone .landing-phone__setup {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.ws-store-none .landing-hero--reader :is(.landing-install__try, .landing-install__classics, .landing-install__more) {
  display: none;
}

.landing-classics {
  padding-block: clamp(2.5rem, 6vw, 3.5rem);
  border-bottom: 1px solid var(--line);
}
