/* EasyInput landing: centered editorial narrative + full-chapter desktop snapping. */
:root {
  /* JS replaces this fallback with the masthead's real rendered height. */
  --landing-header-height: 69px;
  --landing-reading-width: 760px;
  --landing-demo-width: 920px;
}

html {
  scroll-padding-top: var(--landing-header-height);
}

.screen {
  width: 100%;
  min-height: calc(100vh - var(--landing-header-height));
  min-height: calc(100svh - var(--landing-header-height));
  display: flex;
  align-items: center;
  align-items: safe center;
  padding-block: clamp(54px, 7vh, 86px);
}

/*
 * A roomy desktop only becomes a mandatory snap document after JS verifies
 * that every rendered chapter fits below the real masthead. This prevents a
 * tall chapter, browser zoom or larger text from hiding its bottom edge.
 */
@media (min-width: 1200px) and (min-height: 761px) {
  /* Keep the sticky masthead's geometry stable while chapters are snapping. */
  header.scrolled .mast {
    padding-top: 18px;
  }

  header.scrolled .mast-rule {
    margin-top: 16px;
  }

  html.landing-snap-ready {
    scroll-snap-type: y mandatory;
  }

  html.landing-snap-ready .screen {
    /* The global anchor margin is useful for document flow, but would offset snap alignment. */
    scroll-margin-top: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  /* The legal footer sits after chapter 10 and needs an explicit reachable end position. */
  html.landing-snap-ready footer {
    scroll-snap-align: end;
  }
}

.screen > .wrap,
.screen-rewrite > .wrap,
.screen-scenes > .wrap {
  width: 100%;
}

.screen > .wrap > .label,
.screen .hero-copy > .label,
.screen-final .label {
  justify-content: center;
}

.screen-why > .wrap > .h-serif,
.screen-why > .wrap > p,
.screen-scenes > .wrap > .h-serif,
.screen-scenes > .wrap > .scene-lead {
  text-align: center;
  margin-inline: auto;
}

/* Hero: one centered claim, then one product proof. */
.screen-hero {
  padding-block: clamp(52px, 7vh, 82px);
}

.screen-hero .hero-top {
  display: block;
  text-align: center;
}

.screen-hero .hero-copy {
  width: min(100%, var(--landing-reading-width));
  max-width: none;
  margin-inline: auto;
}

.screen-hero h1 {
  font-size: clamp(3rem, 6.6vw, 5.8rem);
  letter-spacing: -.035em;
  text-wrap: balance;
}

.screen-hero .sub {
  max-width: 35ch;
  margin-inline: auto;
  text-wrap: pretty;
}

.screen-hero .cta {
  justify-content: center;
}

.screen-hero .hero-key {
  width: min(100%, 620px);
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(22px, 4vw, 42px);
  margin: 30px auto 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--line);
  border-left: 0;
  text-align: left;
}

.screen-hero .hero-key .big em {
  font-size: clamp(3.8rem, 5.6vw, 5.2rem);
}

.screen-hero .hero-key .big span {
  font-size: clamp(1.45rem, 2vw, 2rem);
}

.screen-hero .hero-key-copy {
  margin-top: 0;
}

.screen-hero .hero-vp {
  width: min(100%, var(--landing-demo-width));
  margin: clamp(30px, 5vh, 48px) auto 0;
}

/* The comparison remains local because both methods must be seen together. */
.screen-why .cmp {
  width: min(100%, var(--landing-demo-width));
  margin-inline: auto;
}

.screen-why .cmp-note {
  text-align: center;
}

/* Each product capability is now its own centered screen. */
.feature-screen .feature-flow {
  width: min(100%, var(--landing-demo-width));
  display: block;
  margin-inline: auto;
  padding: 0;
  border-top: 0;
  text-align: center;
}

.feature-screen .flow-copy {
  width: min(100%, var(--landing-reading-width));
  margin-inline: auto;
}

.feature-screen .flow-copy .eyebrow {
  margin-bottom: 12px;
}

.feature-screen .flow-copy h3 {
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  line-height: 1.18;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.feature-screen .flow-copy p {
  max-width: 46ch;
  margin-inline: auto;
  font-size: clamp(15px, 1.4vw, 17px);
  text-wrap: pretty;
}

.feature-screen .flow-tags {
  justify-content: center;
}

.feature-screen .flow-demo {
  margin-top: clamp(30px, 4vh, 42px);
  text-align: left;
}

/* Chapters 03-05 mirror the App's real Voice Mode / Edit Mode state chain. */
.input-flow-demo .demo-bar span:last-child,
.input-flow-demo .demo-foot span,
.edit-flow-demo .demo-bar span:last-child,
.edit-flow-demo .demo-foot span,
.cleanup-flow-demo .demo-bar span:last-child,
.cleanup-flow-demo .demo-foot span,
.input-app-surface,
.edit-app-surface,
.cleanup-app-surface,
.input-app-copy,
.edit-app-copy,
.cleanup-app-copy,
.input-app-overlay,
.edit-app-overlay,
.cleanup-app-overlay,
.cleanup-rule {
  transition: color .22s, border-color .22s, background-color .22s, opacity .24s, transform .24s;
}

.input-app-surface,
.edit-app-surface,
.cleanup-app-surface {
  position: relative;
  min-height: 164px;
  display: flex;
  align-items: flex-start;
  padding: 22px 24px 72px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
}

.input-app-copy,
.edit-app-copy,
.cleanup-app-copy {
  max-width: 46ch;
  margin: 0;
  color: var(--ink);
  font: 15px/1.75 var(--sans);
}

.input-app-copy .ph,
.cleanup-app-copy .ph {
  color: var(--ink3);
}

.edit-demo-selection {
  padding: 2px 4px;
  border-radius: 3px;
  background: rgba(181, 86, 58, .16);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Product-operation context: values follow the current App overlay theme. */
.input-app-overlay,
.edit-app-overlay,
.cleanup-app-overlay {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 1;
  width: max-content;
  max-width: calc(100% - 32px);
  min-width: min(360px, calc(100% - 32px));
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background-color: rgba(16, 18, 22, .94);
  background-image:
    radial-gradient(140px 80px at 10% 15%, rgba(62, 78, 138, .16), transparent 60%),
    radial-gradient(180px 90px at 90% 85%, rgba(53, 88, 112, .08), transparent 65%);
  background-blend-mode: screen;
  box-shadow:
    inset 0 0 0 1px rgba(62, 78, 138, .08),
    inset 0 1px 0 rgba(255, 255, 255, .03);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
}

.edit-app-overlay {
  box-shadow:
    inset 0 0 0 1px rgba(255, 193, 7, .3),
    inset 0 0 0 1px rgba(62, 78, 138, .08),
    inset 0 1px 0 rgba(255, 255, 255, .03);
}

.input-app-overlay.is-visible,
.edit-app-overlay.is-visible,
.cleanup-app-overlay.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.app-overlay-siri {
  width: 56px;
  height: 32px;
  flex: 0 0 56px;
}

.app-overlay-status-slot {
  width: 14px;
  height: 14px;
  display: inline-flex;
  flex: 0 0 14px;
  align-items: center;
  justify-content: center;
}

.app-overlay-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(184, 192, 206, .28);
}

.app-overlay-status.is-recording {
  background: rgba(216, 94, 94, .84);
  box-shadow: 0 0 6px rgba(216, 94, 94, .34);
  animation: edit-overlay-dot-pulse 1.2s ease-in-out infinite;
}

.app-overlay-status.is-recording.has-live-text {
  background: rgba(104, 170, 198, .92);
  box-shadow: 0 0 8px rgba(104, 170, 198, .28);
}

.app-overlay-status.is-processing {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(208, 214, 226, .68);
  border-top-color: transparent;
  background: transparent;
  animation: edit-overlay-spin .9s linear infinite;
}

.app-overlay-live {
  min-width: 0;
  max-width: min(46vw, 330px);
  overflow: hidden;
  color: rgba(212, 218, 230, .86);
  font: 12px/1.35 var(--sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-overlay-live.is-processing {
  animation: edit-overlay-breathe 1.6s ease-in-out infinite;
}

.app-overlay-live.is-processing::after {
  content: "";
  display: inline-block;
  width: 1.2em;
  text-align: left;
  animation: edit-overlay-dots 1.5s steps(4, end) infinite;
}

.input-flow-demo.is-recording .demo-bar span:last-child,
.input-flow-demo.is-processing .demo-bar span:last-child,
.input-flow-demo.is-complete .demo-foot span:last-child,
.edit-flow-demo.is-recording .demo-bar span:last-child,
.edit-flow-demo.is-processing .demo-bar span:last-child,
.edit-flow-demo.is-complete .demo-foot span:last-child,
.cleanup-flow-demo.is-recording .demo-bar span:last-child,
.cleanup-flow-demo.is-processing .demo-bar span:last-child,
.cleanup-flow-demo.is-complete .demo-foot span:last-child {
  color: var(--accent);
}

/* Chapter 05: regular Voice Mode preview, processing, then dictionary commit. */
.cleanup-corrected {
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(181, 86, 58, .14);
  color: var(--accent);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.cleanup-rule {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--ink3);
  font: 11.5px/1.45 var(--mono);
  opacity: .56;
}

.cleanup-rule code,
.cleanup-rule strong {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
  color: var(--ink2);
  font: inherit;
  font-weight: 500;
}

.cleanup-flow-demo.is-processing .cleanup-rule {
  opacity: .78;
}

.cleanup-flow-demo.is-complete .cleanup-rule {
  color: var(--ink2);
  opacity: 1;
}

.cleanup-flow-demo.is-complete .cleanup-rule strong {
  border-color: rgba(181, 86, 58, .3);
  background: rgba(181, 86, 58, .08);
  color: var(--accent);
}

@keyframes edit-overlay-dot-pulse {
  0%, 100% { opacity: .8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.25); }
}

@keyframes edit-overlay-spin {
  to { transform: rotate(360deg); }
}

@keyframes edit-overlay-breathe {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@keyframes edit-overlay-dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75% { content: "..."; }
}

/* AI keeps its dark chapter, but the narrative no longer splits left and right. */
.screen-ai .grid {
  width: min(100%, var(--landing-demo-width));
  display: block;
  margin-inline: auto;
  text-align: center;
}

.screen-ai .grid > div:first-child {
  width: min(100%, var(--landing-reading-width));
  margin-inline: auto;
}

.screen-ai h2 {
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  letter-spacing: -.018em;
  text-wrap: balance;
}

.screen-ai .lead {
  max-width: 46ch;
  margin-inline: auto;
  text-wrap: pretty;
}

.screen-ai ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 28px;
  border-block: 1px solid var(--d-line);
  text-align: left;
}

.screen-ai li,
.screen-ai li:first-child {
  padding: 18px;
  border-top: 0;
  align-items: flex-start;
}

.screen-ai li + li {
  border-left: 1px solid var(--d-line);
}

.screen-ai .grid > .reveal:last-child {
  width: min(100%, 760px);
  margin: 34px auto 0;
  text-align: left;
}

/* Input destinations and voice editing are two separate scroll chapters. */
.screen-scenes > .wrap > .scene-lead {
  max-width: 58ch;
  margin-top: 0;
  margin-bottom: 34px;
}

.screen-scenes .scene-input {
  width: min(100%, 1120px);
  margin-inline: auto;
}

.screen-scenes .scene-case {
  min-height: 300px;
}

.screen-rewrite .rewrite-feature {
  width: min(100%, var(--landing-demo-width));
  display: block;
  margin: 0 auto;
}

.screen-rewrite .rewrite-intro {
  padding: 30px clamp(20px, 4vw, 44px);
  border-right: 0;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.screen-rewrite .rewrite-feature h3 {
  max-width: none;
  font-size: clamp(2rem, 4.4vw, 3.35rem);
  line-height: 1.18;
  letter-spacing: -.018em;
  text-wrap: balance;
}

.screen-rewrite .rewrite-intro > p {
  max-width: 42ch;
  margin-inline: auto;
  font-size: 15px;
  text-wrap: pretty;
}

.screen-rewrite .rewrite-footer {
  width: min(100%, 560px);
  margin: 24px auto 0;
}

/* The keyboard demo is one action; its modes and three steps remain supporting proof. */
.screen-how {
  padding-block: clamp(42px, 5vh, 64px);
}

.screen-how .kb-modes,
.screen-how .steps {
  width: min(100%, 1080px);
  margin-inline: auto;
}

.screen-how .steps {
  margin-top: 36px !important;
}

.screen-final .label {
  margin-bottom: 22px;
}

.screen-final .reveal {
  width: min(100%, var(--landing-reading-width));
  margin-inline: auto;
}

/* Final CTA, footer and download feedback live with the new layout layer. */
.final {
  text-align: center;
  border-bottom: 0;
}

.final h2 {
  margin-bottom: 16px;
  color: var(--ink);
  font: 700 clamp(2rem, 4.6vw, 3rem)/1.18 var(--serif);
}

.final h2 em {
  color: var(--accent);
  font-style: normal;
}

.final p {
  max-width: 34ch;
  margin: 0 auto 28px;
  color: var(--ink2);
  font: clamp(1rem, 2vw, 1.15rem)/1.65 var(--sans);
}

.final .cta {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.final .meta {
  margin-top: 20px;
  color: var(--ink3);
  font: 12px/1.5 var(--mono);
}

.final .vp {
  max-width: 720px;
  margin: 40px auto 0;
}

footer {
  padding: 30px 0 40px;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--ink3);
  font: 12px/1.5 var(--mono);
}

.foot .l {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.foot-logo {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 4px;
}

.foot .l b {
  color: var(--ink2);
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: .04em;
}

.beian {
  margin-top: 10px;
  color: var(--ink3);
  font: 12px/1.5 var(--mono);
  text-align: center;
}

.beian a {
  transition: color .16s;
}

.beian a:hover {
  color: var(--accent);
}

.dl-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(43, 39, 34, .22);
  color: var(--bg);
  font: 13.5px/1.5 var(--sans);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity .22s, transform .22s;
}

.dl-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/*
 * The compact tier preserves the editorial hierarchy on ordinary laptop
 * heights while keeping the complete chapter inside the masthead-adjusted
 * snapport. Larger viewports retain the more generous spacing above.
 */
@media (min-width: 1200px) and (min-height: 761px) and (max-height: 1180px) {
  .screen {
    padding-block: clamp(28px, 3.6svh, 42px);
  }

  .screen > .wrap > .label,
  .screen .hero-copy > .label,
  .screen-final .label {
    margin-bottom: 14px;
  }

  .screen-hero {
    padding-block: clamp(22px, 2.8svh, 34px);
  }

  .screen-hero h1 {
    margin-bottom: 14px;
    font-size: clamp(3rem, min(5.4vw, 8.6svh), 5rem);
  }

  .screen-hero .sub {
    margin-bottom: 18px;
    font-size: clamp(.98rem, 1.55vw, 1.1rem);
    line-height: 1.6;
  }

  .screen-hero .cta {
    margin-bottom: 10px;
  }

  .screen-hero .hero-key {
    gap: clamp(18px, 3vw, 32px);
    margin-top: 18px;
    padding-top: 14px;
  }

  .screen-hero .hero-key .big em {
    font-size: clamp(3.4rem, 7svh, 4.4rem);
  }

  .screen-hero .hero-vp {
    margin-top: 18px;
  }

  .screen-hero #vpHero {
    height: clamp(68px, 9svh, 96px) !important;
  }

  .screen-hero .hero-vp .axis {
    margin-top: 6px;
  }

  .screen-why > .wrap > p,
  .screen-scenes > .wrap > .scene-lead,
  .screen-how > .wrap > p {
    margin-bottom: 20px !important;
  }

  .feature-screen .flow-demo {
    margin-top: clamp(18px, 2.5svh, 28px);
  }

  .input-app-surface,
  .edit-app-surface,
  .cleanup-app-surface {
    min-height: 148px;
    padding-block: 18px 66px;
  }

  .screen-ai ul {
    margin-top: 18px;
  }

  .screen-ai li,
  .screen-ai li:first-child {
    padding: 13px 15px;
  }

  .screen-ai .grid > .reveal:last-child {
    margin-top: 22px;
  }

  .screen-scenes .scene-case {
    min-height: 270px;
  }

  .screen-rewrite .rewrite-intro {
    padding-block: 22px;
  }

  .screen-how {
    padding-block: clamp(24px, 3svh, 36px);
  }

  .screen-how .kbdemo .scr2 {
    min-height: 92px;
    margin-bottom: 16px;
    padding-block: 12px;
  }

  .screen-how .kb-note {
    margin-top: 10px;
  }

  .screen-how .kb-modes {
    margin-top: 16px;
    padding-top: 14px;
  }

  .screen-how .steps {
    margin-top: 20px !important;
  }

  .screen-how .step .n {
    margin-bottom: 8px;
    font-size: clamp(2rem, 4svh, 2.65rem);
  }

  .screen-how .step h4 {
    margin-bottom: 4px;
    font-size: 16px;
  }

  .screen-how .step p {
    line-height: 1.5;
  }
}

/* Short viewports and reading-oriented modes return to a normal document flow. */
@media (max-width: 1199px), (max-height: 760px) {
  html {
    scroll-snap-type: none;
  }

  .screen {
    min-height: 0;
    display: block;
    padding-block: clamp(58px, 10vw, 84px);
  }

  .screen-hero .hero-key {
    display: flex;
    width: min(100%, 620px);
    justify-content: center;
    padding-top: 18px;
  }

  .screen-ai ul {
    grid-template-columns: 1fr;
  }

  .screen-ai li + li {
    border-left: 0;
    border-top: 1px solid var(--d-line);
  }
}

@media (max-width: 680px) {
  .screen-hero h1 {
    font-size: clamp(2.8rem, 13vw, 4.5rem);
  }

  .screen-hero .hero-key {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 14px 20px;
    justify-content: stretch;
  }

  .screen-rewrite .rewrite-intro {
    padding-inline: 0;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: none;
    scroll-behavior: auto;
  }

  .screen {
    min-height: 0;
  }

  .input-flow-demo .demo-bar span:last-child,
  .input-flow-demo .demo-foot span,
  .edit-flow-demo .demo-bar span:last-child,
  .edit-flow-demo .demo-foot span,
  .cleanup-flow-demo .demo-bar span:last-child,
  .cleanup-flow-demo .demo-foot span,
  .input-app-surface,
  .edit-app-surface,
  .cleanup-app-surface,
  .input-app-copy,
  .edit-app-copy,
  .cleanup-app-copy,
  .input-app-overlay,
  .edit-app-overlay,
  .cleanup-app-overlay,
  .cleanup-rule {
    transition: none;
  }

  .app-overlay-status,
  .app-overlay-live {
    animation: none !important;
  }
}
