/* The third landing design loads after landing.css and landing-next.css.
   It keeps the shared fonts and supports both themes. */

/* A soft daylight fade reduces scene detail behind the copy on wide screens.
   Plain dark text stays readable without a dark panel or text outlines.
   The loop overlaps the hero so its title appears in the first screen. */
@media (min-width: 721px) {
  .lv3-page { --lnx-loop-overlap: 92px; }
  .lv3-hero { align-items: flex-end; }
  .landing-page .lv3-hero .lnx-hero-scene img { object-position: 50% 0%; }
  .lv3-hero::before { background: linear-gradient(90deg, #edf7ffa6 0%, #edf7ff8c 38%, #edf7ff59 51%, #edf7ff00 70%); mask-image: linear-gradient(180deg, #000 80%, transparent 84%); }
  .lv3-hero::after { content: ''; position: absolute; inset: 0; z-index: -2; pointer-events: none; background: linear-gradient(0deg, var(--night) 0%, var(--night) 7%, transparent 22%); }
  .lv3-hero .lnx-hero-copy::before { content: none; }
  .lv3-hero .lnx-hero-copy :is(h1, h1 span, h1 em, .landing-lede, .landing-secondary) { color: #100d27; text-shadow: none; }
  .lv3-hero .lnx-hero-copy h1 { font-size: clamp(2.25rem, 3.5vw, 3.25rem); }
  .lv3-hero .landing-lede { font-weight: 600; line-height: 1.55; }
  .lv3-hero .landing-secondary { font-weight: 700; }
  .lv3-page .lv3-loop-title { width: fit-content; background: var(--night); box-shadow: 0 0 12px 8px var(--night); }
  .lv3-hero .landing-waitlist { background: #f5f3ffe6; border-color: #100d2733; }
  .lv3-hero .landing-waitlist input { color: #100d27; }
  .lv3-hero .landing-waitlist input::placeholder { color: #514b6b; }
  .lv3-hero .landing-waitlist-status { color: #403096; }
}
/* The eyebrow has a solid background to keep its label readable over the scene. */
.lv3-hero .landing-eyebrow { background: color-mix(in srgb, var(--lnx-veil) 78%, #6b4fd1); }
/* Short landscape screens: the copy stays in the middle, and the loop does not cover the tutorial link. */
@media (min-width: 721px) and (max-height: 500px) {
  .lv3-hero { align-items: center; padding-bottom: calc(40px + var(--lnx-loop-overlap)); }
}

/* Show loop: a visible title above the steps. */
.landing-page .lv3-loop-title { margin: 0 0 14px; font-size: 1.3rem; line-height: 1.2; }
/* The Grow thumbnail: a white copy of the hero pet with a gold glow is the future form. */
.landing-page .lv3-loop .lnx-loop-thumb-grow img.lv3-loop-glow { left: auto; right: 9%; bottom: 8%; width: 36%; filter: brightness(0) invert(1) drop-shadow(0 0 6px #ffd23f) drop-shadow(0 0 14px #ffd23f); }

/* Part 1, Watch: one large frame, like a screen. The head and the frame are centred.
   The frame keeps its full height in the viewport: its width is at most 16:9 of the viewport height minus the header and actions. */
.lv3-watch .landing-section-head { max-width: 1040px; margin-inline: auto; text-align: center; }
.lnx-page .lv3-watch .landing-section-head > p:not(.landing-kicker) { margin-inline: auto; }
.lv3-watch .landing-kicker { justify-content: center; }
.lv3-story { max-width: min(1100px, calc((100svh - 190px) * 16 / 9)); margin-inline: auto; }
.lv3-story-frame { position: relative; margin: 0; }
.lv3-story-scene { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: 0 30px 80px var(--shadow), 0 0 0 6px var(--hover); transition: border-color .2s ease, box-shadow .2s ease; }
.landing-page .lv3-story-scene :is(img, video) { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lv3-story-loop { z-index: 1; opacity: 0; transition: opacity .6s ease; }
.lv3-story-scene.has-playing-loop .lv3-story-loop { opacity: 1; }
.lv3-story-clip { z-index: 2; }
.landing-page .lv3-story-clip[hidden], .landing-page .lv3-story-control[hidden] { display: none; }
.lv3-story-scene .adv-episode, .lv3-story-scene .lnx-scene-control { z-index: 4; }
/* While a clip plays, the frame has a gold edge. */
.lv3-story.is-moving .lv3-story-scene { border-color: #ffd23f99; box-shadow: 0 0 0 4px #ffd23f33, 0 30px 80px var(--shadow); }
/* The control belongs to the fork loop, so it shows at the fork only. */
.lv3-story:not([data-step="fork"]) .lv3-story-control { display: none; }
/* Path markers on the fork, at the start of each path. They repeat the path buttons for a pointer. Screen readers skip them. */
.lv3-story-marker { position: absolute; z-index: 3; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 3px solid #fff; border-radius: 50%; background: #ffd23f4d; box-shadow: 0 2px 8px #0008; cursor: pointer; transition: transform .2s ease, background .2s ease; }
.lv3-story-marker:hover { background: var(--gold); transform: scale(1.2); }
.lv3-story:not([data-step="fork"]) .lv3-story-marker { display: none; }
.lv3-story-marker-grass { left: 17%; top: 55%; }
.lv3-story-marker-river { left: 48%; top: 44%; }
.lv3-story-marker-burned { left: 67%; top: 64%; }
/* Caption: a line of text under the frame. Wide screens show it as a subtitle box over the bottom of the frame. */
.lv3-story-caption { min-height: 2.9em; margin: 14px 0 0; color: var(--lede); font-size: 1.1rem; font-weight: 600; line-height: 1.45; text-align: center; }
/* Actions under the frame. The forward action has a gold edge. */
.lv3-story-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.landing-page .lv3-story-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border: 1px solid var(--border-strong); border-radius: 99px; background: var(--hover); color: var(--ink); font: 600 1rem/1.25 'DM Sans', sans-serif; text-align: center; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.landing-page .lv3-story-button:hover { border-color: var(--gold-text); }
.landing-page .lv3-story-button.is-forward { padding: 0 19px; border: 2px solid var(--gold-text); background: #ffd23f1f; }
.lv3-story-button span { color: var(--gold-text); }
@media (min-width: 961px) {
  .lv3-story-caption { position: absolute; z-index: 5; left: 50%; bottom: 22px; width: max-content; max-width: min(760px, calc(100% - 48px)); min-height: 0; margin: 0; padding: 10px 20px; border: 1px solid #ffffff2e; border-radius: 14px; background: #0e0b1fd9; color: var(--on-art); transform: translateX(-50%); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  .lv3-story-actions { margin-top: 20px; }
}

/* Part 3, Battle. Wide screens: the heading and the comparison sit left of the footage.
   The opponents and the Later line use the full width below. */
.lv3-battle { grid-template-areas: 'head stage' 'compare stage' 'stakes stakes'; }
.lv3-battle .lnx-stakes { margin-top: 40px; }
.lv3-battle .lnx-opponents { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* The example moves sit inside the bottom of the frame, like a command bar, so the play control moves to the top center.
   A dark band under the moves keeps them readable over the footage. */
@media (min-width: 721px) {
  .lv3-battle .lnx-battle-scene::after { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(0deg, #0e0b1fcc 0%, #0e0b1f00 38%); }
  .lv3-battle .lnx-scene-control { top: 16px; bottom: auto; right: auto; left: 50%; transform: translateX(-50%); }
}

/* Part 4, Grow. The teaser has no link row, so its grid has one row. The explorer opens below its summary. */
.lv3-grow .lnx-grow-demo { grid-template-areas: 'start paths future'; }
.lv3-evolve-head { max-width: 680px; margin: 56px auto 20px; text-align: center; }
.lv3-evolve-head h3 { font-size: clamp(1.5rem, 2.4vw, 1.9rem); margin-bottom: 6px; }
.lv3-evolve-head p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.lv3-evolve { scroll-margin-top: 72px; }
.landing-page .lv3-evolve > summary { display: flex; width: fit-content; margin-inline: auto; list-style: none; cursor: pointer; }
.lv3-evolve > summary::-webkit-details-marker { display: none; }
.lv3-evolve > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.lv3-evolve[open] .lv3-evolve-open, .lv3-evolve:not([open]) .lv3-evolve-close { display: none; }
/* The label keeps the text color of the other page links. Only the arrow is gold. */
.lv3-evolve .lv3-evolve-open, .lv3-evolve .lv3-evolve-close { color: var(--ink); }
.lv3-evolve-arrow { transition: transform .2s ease; }
.lv3-evolve[open] .lv3-evolve-arrow { transform: rotate(-90deg); }
.lv3-evolve .lnx-evolve { margin-top: 28px; }

/* CSS images load only near the viewport. landing-v3.js adds lv3-is-near 1250 pixels before a part enters the viewport.
   Until then, the glow of the Grow teaser and the closing backdrop are not in the layout, so the browser does not request their images. */
.lv3-grow .lnx-grow-demo:not(.lv3-is-near) .lnx-grow-glow, .lv3-page .lnx-final:not(.lv3-is-near)::before { display: none; }

/* Tablets */
@media (max-width: 960px) {
  .lv3-battle .landing-battle-stage { margin-top: 24px; }
  .lv3-grow .lnx-grow-demo { grid-template-areas: 'start future' 'paths paths'; }
}
/* Narrow tablets keep the Roadmap header link. Smaller link padding makes room for it from 721 pixels. */
@media (min-width: 721px) and (max-width: 780px) {
  .lv3-page .landing-header nav a { padding-inline: 5px; }
  .lv3-page .landing-header nav a[data-nav-section="roadmap"] { display: inline; }
}

/* Phones: the story frame uses the full screen width. The actions share one row. The battle moves sit below the frame. */
@media (max-width: 720px) {
  .lv3-story-scene { margin: 0 calc(-1 * var(--gutter)); border-inline: 0; border-radius: 0; box-shadow: none; }
  .lv3-story.is-moving .lv3-story-scene { box-shadow: none; }
  .lv3-story-caption { font-size: 1rem; }
  .lv3-story-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
  .landing-page .lv3-story-button { padding: 6px 10px; font-size: .92rem; }
  .landing-page .lv3-story-button.is-forward { padding: 5px 9px; }
  .lv3-story-marker { width: 24px; height: 24px; margin: -12px 0 0 -12px; }
  .lv3-battle .lnx-opponents { grid-template-columns: 1fr; }
  /* The frame has a 6-pixel ring, so the moves need more space than the shared 12 pixels. */
  .lv3-battle .landing-moves { margin-top: 18px; }
  .lv3-evolve-head { margin-top: 40px; }
  /* Roadmap teaser: each phase is one compact card. The label and the title share a row, and the items wrap in one block.
     The content does not change. The full list stays on the Roadmap page. */
  .lv3-page .roadmap-column { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; padding: 18px; }
  .lv3-page .roadmap-column .roadmap-label { margin: 0; }
  .lv3-page .roadmap-column h3 { margin: 0; font-size: 1.15rem; }
  .landing-page.lv3-page .roadmap-column ul { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; }
}
/* Small phones stack the actions, so each label stays on one or two lines. */
@media (max-width: 360px) {
  .lv3-story-actions { grid-auto-flow: row; grid-auto-columns: auto; }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .lv3-story-marker { animation: lnx-pulse 2s ease-in-out infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .lv3-evolve-arrow, .lv3-story-loop, .lv3-story-scene { transition: none; }
}
