/*
 * Landing page: walkthrough video, 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.
 *
 * Pixels matter here. The 1x video is 1024 wide and the frame adds a 1px border each
 * side, so on a wide screen it is drawn at exactly its own pixels; 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.
 */

/* Walkthrough ------------------------------------------------------------- */

.landing-walkthrough {
  width: min(100%, 1026px);
  margin: clamp(0.75rem, 2vw, 1.25rem) 0 0;
}

.landing-walkthrough__frame {
  overflow: hidden;
  background: #202124;
  border: 1px solid color-mix(in oklch, var(--line) 60%, #000);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-overlay);
}

.landing-walkthrough__video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #202124;
  cursor: pointer;
}

/* The caption and control bar are part of the video's dark frame in both themes. */
.landing-walkthrough__caption {
  display: flex;
  min-height: 3.4em;
  margin: 0;
  padding: 0.625rem 1.125rem;
  flex-direction: column;
  justify-content: center;
  background: #161616;
  border-top: 1px solid #000;
  color: #f1f1f1;
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
}

.landing-walkthrough__caption b {
  color: oklch(0.82 0.15 68);
  font-weight: 600;
}

.landing-walkthrough__step {
  margin-bottom: 0.2rem;
  color: #a8a8a8;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.landing-walkthrough__controls {
  display: flex;
  padding: 0.25rem 0.875rem 0.5rem 0.375rem;
  align-items: center;
  gap: 0.75rem;
  background: #161616;
  color: #d6d6d6;
}

.landing-walkthrough__controls[hidden] {
  display: none;
}

.landing-walkthrough__play {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: inherit;
  cursor: pointer;
}

.landing-walkthrough__play:hover,
.landing-walkthrough__play:focus-visible {
  background: #2a2a2a;
  color: #fff;
}

.landing-walkthrough__play svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.landing-walkthrough__icon-play,
.landing-walkthrough__play.is-paused .landing-walkthrough__icon-pause {
  display: none;
}

.landing-walkthrough__play.is-paused .landing-walkthrough__icon-play {
  display: block;
}

/* One segment per chapter; click or drag anywhere to seek. */
.landing-walkthrough__timeline {
  position: relative;
  min-width: 0;
  flex: 1;
  padding: 0.6875rem 0;
  cursor: pointer;
  outline: none;
  touch-action: none;
}

.landing-walkthrough__timeline:focus-visible {
  border-radius: 3px;
  box-shadow: 0 0 0 2px oklch(0.82 0.15 68);
}

.landing-walkthrough__segments {
  display: flex;
  height: 6px;
  gap: 3px;
  transition: height var(--transition-fast);
}

.landing-walkthrough__timeline.is-dragging .landing-walkthrough__segments,
.landing-walkthrough__timeline:focus-visible .landing-walkthrough__segments {
  height: 9px;
}

.landing-walkthrough__segment {
  position: relative;
  overflow: hidden;
  background: rgb(255 255 255 / 0.22);
  border-radius: 2px;
}

.landing-walkthrough__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: oklch(0.79 0.15 68);
}

.landing-walkthrough__tip {
  position: absolute;
  bottom: calc(100% + 2px);
  padding: 0.25rem 0.5rem;
  background: #000;
  border-radius: 4px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity var(--transition-fast);
}

.landing-walkthrough__timeline.is-dragging .landing-walkthrough__tip {
  opacity: 1;
}

/* On touch screens a tap would leave the hover state, and the tip, stuck on. */
@media (hover: hover) {
  .landing-walkthrough__timeline:hover .landing-walkthrough__segments {
    height: 9px;
  }

  .landing-walkthrough__timeline:hover .landing-walkthrough__tip {
    opacity: 1;
  }
}

.landing-walkthrough__time {
  flex: none;
  color: #a8a8a8;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.landing-walkthrough__chapters {
  display: grid;
  margin: 0.75rem 0 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  list-style: none;
}

.landing-walkthrough__chapters[hidden] {
  display: none;
}

.landing-walkthrough__chapters button {
  position: relative;
  width: 100%;
  padding: 0.625rem 0.75rem 0.75rem;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.875rem;
  line-height: 1.35;
  text-align: left;
}

.landing-walkthrough__chapters button b {
  display: block;
  margin-bottom: 0.125rem;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.landing-walkthrough__chapters button.is-current {
  border-color: var(--accent);
}

.landing-walkthrough__chapters button.is-current b {
  color: var(--accent);
}

.landing-walkthrough__chapter-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--accent);
}

@media (min-width: 760px) {
  .landing-walkthrough__chapters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 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;
}

/* 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. */
.ws-cannot-install .landing-cta .landing-install {
  display: none;
}

.ws-store-none .landing-cta__fallback,
.ws-cannot-install .landing-cta__fallback {
  display: flex;
}

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