@font-face {
  font-family: Inter;
  src: url("/assets/inter.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: optional;
}

:root {
  color-scheme: light;
  --paper: #f7f4ef;
  --ink: #211e1a;
  --muted: #514b43;
  --line: #dbd4ca;
  --gutter: clamp(1.25rem, 5.556vw, 5rem);
  --shell: min(calc(100vw - var(--gutter) * 2), 80rem);
  --header-height: clamp(4rem, 6.25vw, 5.625rem);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  scroll-padding-top: var(--header-height);
}

* { box-sizing: border-box; }

body { margin: 0; }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

a:focus-visible {
  outline: 2px solid #8456d7;
  outline-offset: 4px;
}

h1, h2, h3, p, figure { margin: 0; }

.wrap {
  width: calc(100% - var(--gutter) * 2);
  max-width: 80rem;
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 2;
  top: 0;
  background: var(--paper);
}

.header-inner, .header-nav {
  display: flex;
  align-items: center;
}

.header-inner {
  min-height: var(--header-height);
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand img {
  width: clamp(5rem, 8vw, 7.1875rem);
  height: auto;
}

.header-nav {
  gap: clamp(1rem, 3.2vw, 2.875rem);
  font-size: 0.9375rem;
}

.header-nav a { white-space: nowrap; }

.nav-current { font-weight: 600; }

.header-nav a:not(.language):hover { text-decoration: underline; text-underline-offset: 0.2em; }

.language {
  display: grid;
  min-width: 4rem;
  min-height: 2.75rem;
  padding-inline: 0.75rem;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.language:hover, .chapter-link:hover, .all-apps:hover { border-color: var(--ink); }

.arrow {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

.hero {
  display: flow-root;
  min-height: calc(100svh - var(--header-height));
}

.hero-paper {
  position: relative;
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 25rem;
  max-width: 72.71rem;
  aspect-ratio: 1164 / 633;
  margin: clamp(1.5rem, 3vw, 2.6875rem) auto 0;
  background: url("/assets/lavender-paper.svg") center / 100% 100% no-repeat;
}

.hero-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: translateY(clamp(0.25rem, 0.7vw, 0.625rem));
}

.hero h1 {
  font-size: min(12.08vw, 10.875rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.075em;
  white-space: nowrap;
}

:lang(zh-Hans) .hero h1 {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: min(9.65vw, 8.6875rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero-ink { position: relative; }

.ink-line {
  position: absolute;
  top: 86%;
  left: -5%;
  max-width: none;
  width: 110%;
  pointer-events: none;
}

:lang(zh-Hans) .hero-ink { display: inline-block; }

:lang(zh-Hans) .ink-line {
  top: calc(100% + 0.015em);
  left: -24%;
  width: 116%;
}

@media (prefers-reduced-motion: no-preference) {
  .ink-line { animation: draw-ink 520ms 120ms cubic-bezier(.23, .68, .4, 1) both; }

  @keyframes draw-ink {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0); }
  }
}

.hero-content p {
  margin-top: clamp(1.125rem, 2vw, 1.75rem);
  color: var(--muted);
  font-size: clamp(1.125rem, 1.9vw, 1.75rem);
  line-height: 1.4;
}

.hero-cta, .hero-apps {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
}

.hero-cta {
  min-height: clamp(2.75rem, 3.61vw, 3.25rem);
  margin-top: clamp(1.5rem, 2.6vw, 2.375rem);
  padding-inline: 1.1875rem 0.9375rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 550;
}

.hero-cta:hover { background: #413a34; }

.hero-apps {
  margin-top: clamp(0.625rem, 1.65vw, 1.5rem);
  padding-inline: 0.5rem;
  color: var(--muted);
}

.hero-apps:hover { text-decoration: underline; text-underline-offset: 0.2em; }

.story {
  --scene-gap: clamp(1.5rem, 3.333vw, 3rem);
  --stage-height: min(34.375rem, calc(var(--shell) * 0.4297), calc(100svh - var(--header-height) - var(--scene-gap) - 8rem));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 57.03%);
}

.story-steps { grid-area: 1 / 1; }

.story-step { padding-block: 1.5rem; }

.story h2, .story-title {
  font-size: clamp(2.75rem, 7.36vw, 6.625rem);
  font-weight: 600;
  letter-spacing: -0.075em;
  line-height: 1;
}

.story-title { display: none; }

.story-visual {
  grid-area: 1 / 2;
  width: 100%;
  align-self: start;
  justify-self: end;
}

.story-nav {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(0.4rem, 0.83vw, 0.75rem);
  z-index: 1;
}

.chapter-link {
  display: inline-grid;
  min-height: 2.875rem;
  padding-inline: clamp(0.6rem, 1.45vw, 1.3rem);
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.9375rem;
  font-weight: 550;
}

.chapter-link[aria-current="step"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.chapter-next {
  width: 2.875rem;
  padding-inline: 0;
}

.chapter-next[hidden] { display: none; }

.story-art {
  position: relative;
  width: 100%;
  aspect-ratio: 730 / 550;
  overflow: hidden;
  container-type: inline-size;
  border: 1px solid #ded7cc;
  border-radius: clamp(0.75rem, 1.4vw, 1.25rem);
  background: #ebe6de;
}

.poster {
  position: absolute;
  top: 6.18%;
  left: 22.055%;
  width: 56.16%;
  height: 87.45%;
  border-radius: 0.375cqw;
  background: #fffbf1;
  box-shadow: 0 0 0 1px #eae1cd, 0 1.1cqw 2.65cqw #33271b21;
  transition: opacity 220ms ease;
}

.poster-placeholder, .poster-title {
  position: absolute;
  inset-inline-start: 5.85%;
  transition: opacity 220ms ease;
}

.poster-placeholder {
  top: 8.55%;
  width: 60%;
  display: grid;
  gap: 2.63cqw;
}

.poster-placeholder span,
.poster-date-placeholder {
  display: block;
  width: 77%;
  height: 3cqw;
  border-radius: 0.55cqw;
  background: #d5caba;
}

.poster-placeholder span + span { width: 98%; }

.poster-title {
  top: 5.2%;
  transform: translate(-3cqw, 1.4cqw);
  opacity: 0;
  font-size: 7.95cqw;
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.075em;
  transition: opacity 220ms ease 120ms, transform 460ms cubic-bezier(.2, .7, .25, 1) 120ms;
}

:lang(zh-Hans) .poster-title {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 7.12cqw;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.poster-landscape {
  position: absolute;
  top: 31.18%;
  inset-inline: 5.85%;
}

.poster-landscape img {
  width: 100%;
  height: auto;
}

.poster-landscape .sunset, .poster-landscape .selection {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 250ms ease;
}

.story-art[data-scene="click"] .selection { opacity: 1; transition-delay: 640ms; }
.story-art[data-scene="chat"] .selection { opacity: 1; }
.story-art[data-scene="chat"] .sunset { opacity: 1; transition: opacity 540ms ease 640ms; }
.story-art[data-scene="compose"] .sunset { opacity: 1; }

.poster-divider {
  position: absolute;
  top: 85.25%;
  inset-inline: 5.85%;
  border-top: 1px solid #685e53;
}

.poster-date-placeholder {
  position: absolute;
  top: 90.5%;
  inset-inline-start: 5.85%;
  width: 23.4%;
  height: 1.64cqw;
}

.poster-date {
  position: absolute;
  top: 89.25%;
  inset-inline-start: 5.85%;
  transform: translateX(2cqw);
  opacity: 0;
  font-size: 2.74cqw;
  font-weight: 650;
  letter-spacing: 0.06em;
  line-height: 1.15;
  transition: opacity 240ms ease 360ms, transform 460ms ease 360ms;
}

:lang(zh-Hans) .poster-date { letter-spacing: 0; }

.story-art[data-scene="compose"] :is(.poster-title, .poster-date) {
  opacity: 1;
  transform: translate(0);
}

.story-art[data-scene="compose"] :is(.poster-placeholder, .poster-date-placeholder) { opacity: 0; }

.draft-bubble, .chat-bubble {
  position: absolute;
  border: 1px solid #e8dfcb;
  border-radius: 1.8cqw;
  background: #fffbf1;
  box-shadow: 0 0.7cqw 1.3cqw #33271b20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.draft-bubble {
  top: 50%;
  left: 50%;
  width: min(88%, 32ch);
  min-height: 3.2em;
  padding: 2.3cqw 2.8cqw;
  transform: translate(-50%, -50%);
  font-size: clamp(0.875rem, 2.4cqw, 1.125rem);
  line-height: 1.5;
}

.draft-bubble.is-generating { color: var(--muted); }

.story-art.is-drafting .draft-bubble { opacity: 1; }
.story-art.is-drafting .poster { opacity: 0; }

.chat-bubble {
  top: 21.8%;
  left: 53.15%;
  min-width: 36.8cqw;
  max-width: 45%;
  padding: 1.9cqw 2.05cqw;
  font-size: clamp(0.775rem, 2.1cqw, 1rem);
  line-height: 1.25;
}

:lang(zh-Hans) .chat-bubble { min-width: 34cqw; }

.story-art[data-scene="chat"] .chat-bubble { opacity: 1; }

.story-cursor, .click-ripple {
  position: absolute;
  z-index: 1;
  top: 38.63%;
  left: 53.6%;
  width: 3.86%;
  opacity: 0;
  pointer-events: none;
}

.story-art[data-scene="click"] .story-cursor {
  opacity: 1;
  animation: move-to-sky 600ms cubic-bezier(.25, .7, .56, 1) both;
}

.click-ripple {
  top: 38.63%;
  left: 54.45%;
  aspect-ratio: 1;
  border: 1px solid #8555db;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.3);
}

.story-art[data-scene="click"] .click-ripple { animation: click-ripple 560ms 560ms ease-out both; }

.story-art[data-scene="compose"] .story-cursor {
  top: 15.9%;
  left: 46.2%;
  animation: move-title 920ms ease both;
}

@keyframes move-to-sky {
  from { top: 53%; left: 29.4%; }
  to { top: 37.5%; left: 53.6%; }
}

@keyframes click-ripple {
  0% { opacity: 0; }
  17% { opacity: 0.72; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); }
}

@keyframes move-title {
  0% { transform: translate(-60%, 50%); opacity: 0; }
  17% { opacity: 1; }
  63% { transform: translate(0, 0); opacity: 1; }
  100% { opacity: 0; }
}

.story-art--mobile { display: none; }

.product-strip {
  display: grid;
  grid-template-columns: minmax(max-content, 1.48fr) repeat(3, minmax(0, 1fr)) minmax(max-content, 0.87fr);
  align-items: center;
  gap: clamp(0.65rem, 1.1vw, 1rem);
  padding-block: 1.875rem clamp(2rem, 5vw, 4rem);
  margin-top: clamp(1.5rem, 3vw, 2.75rem);
  border-top: 1px solid var(--line);
}

.product-strip h2 {
  padding-inline-end: 1.1rem;
  font-size: clamp(1.15rem, 1.71vw, 1.625rem);
  font-weight: 600;
}

.product-shortcut, .all-apps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.product-shortcut {
  min-height: 3.875rem;
  padding: 0.875rem 1.125rem;
  border-radius: 0.625rem;
  background: var(--product-color);
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: 600;
}

.product-shortcut:hover { box-shadow: inset 0 0 0 1px currentColor; }
.product-shortcut.canvas { --product-color: #e4d6fa; }
.product-shortcut.frame { --product-color: #d5e7f2; }
.product-shortcut.deck { --product-color: #fae9a7; }

.all-apps {
  min-height: 3.5rem;
  margin-inline-start: 0.625rem;
  padding: 0.875rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 550;
}

@media (min-width: 53rem) and (min-height: 33rem) {
  .story--active .story-step {
    min-height: calc(100svh - var(--header-height));
    padding: 0;
  }

  .story--active .story-step h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .story--active .story-title {
    display: block;
    grid-area: 1 / 1;
    position: sticky;
    top: calc(var(--header-height) + var(--scene-gap) + var(--stage-height) * 0.26);
    align-self: start;
    margin-top: calc(var(--scene-gap) + var(--stage-height) * 0.26);
  }

  .story--active .story-step:last-child {
    min-height: calc(var(--scene-gap) + var(--stage-height));
  }

  .story--active .story-visual {
    position: sticky;
    top: calc(var(--header-height) + var(--scene-gap));
    width: min(100%, calc(var(--stage-height) * 730 / 550));
    margin-top: var(--scene-gap);
  }

  .story--active .story-nav {
    grid-area: 1 / 1;
    position: sticky;
    top: calc(var(--header-height) + var(--scene-gap) + var(--stage-height) - 5rem);
    align-self: start;
    width: max-content;
    max-width: 100%;
    margin-top: calc(var(--scene-gap) + var(--stage-height) - 5rem);
  }
}

@media (max-width: 52.999rem), (max-height: 32.999rem) {
  .hero { min-height: auto; padding-bottom: clamp(3rem, 8vw, 5.5rem); }
  .hero-paper { min-height: clamp(21rem, 68vw, 28rem); aspect-ratio: auto; }

  .story { grid-template-columns: minmax(0, 1fr); }
  .story-steps { grid-area: 2 / 1; }
  .story-visual { grid-area: 3 / 1; }
  .story-nav { grid-area: 1 / 1; }

  .story--active .story-visual { display: none; }

  .story--active .story-step {
    padding-top: clamp(2rem, 5vw, 3rem);
    padding-bottom: clamp(1.75rem, 5vw, 3rem);
    scroll-margin-top: 3.75rem;
  }

  .story--active .story-nav {
    position: sticky;
    top: var(--header-height);
    padding-block: 0.4rem;
    background: var(--paper);
  }

  .story-art--mobile {
    display: block;
    margin-top: 1.35rem;
  }

  .product-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-strip h2, .all-apps { grid-column: 1 / -1; }
  .all-apps { margin: 0; }
}

@media (max-width: 30rem) {
  .hero { width: calc(100% - 1.75rem); }
  .hero h1 { font-size: clamp(1.75rem, 12.2vw, 3.65rem); }
  :lang(zh-Hans) .hero h1 { font-size: clamp(1.75rem, 11vw, 3.35rem); }
  .chapter-link { padding-inline: 0.68rem; font-size: 0.85rem; }
  .chapter-next { padding-inline: 0; }
  .product-shortcut { padding-inline: 0.65rem; font-size: 0.9rem; }
  .product-shortcut .arrow { width: 1rem; height: 1rem; }
  .chat-bubble { left: 47%; max-width: 51%; }
}

@media (prefers-reduced-motion: reduce) {
  .story-art *, .story-art *::after { transition: none !important; animation: none !important; }
}

.apps-page {
  --paper: #f7f5f2;
  --ink: #121212;
  --muted: #625b55;
  --line: #e2dcd4;
  --gutter: clamp(1.25rem, 6.67vw, 6.25rem);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

.apps-page .header-inner { min-height: calc(var(--header-height) - 0.375rem); }

.apps-page .language {
  min-width: 5rem;
  margin-inline-start: clamp(0rem, 2.75vw, 2.5rem);
  background: #fff;
}

.apps-intro {
  padding-top: clamp(2rem, 3.6vw, 3.375rem);
  padding-bottom: clamp(2rem, 3.3vw, 3rem);
}

.apps-intro h1 {
  font-size: clamp(2.5rem, 6vw, 5.375rem);
  font-weight: 625;
  letter-spacing: -0.06em;
  line-height: 1.1;
}

:lang(zh-Hans) .apps-intro h1 { letter-spacing: -0.04em; }

.apps-intro p {
  margin: 1rem 0 0 0.1em;
  color: var(--muted);
  font-size: clamp(1rem, 1.56vw, 1.4375rem);
  line-height: 1.45;
}

.featured-products, .other-products {
  display: grid;
  gap: clamp(0.75rem, 1.67vw, 1.5rem);
}

.featured-products { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.other-products { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.product-card {
  padding: clamp(0.625rem, 0.9vw, 0.8125rem);
  scroll-margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: #fff;
}

.product-card:target { border-color: #8456d7; }

.product-logo {
  display: grid;
  height: clamp(5.75rem, 7.85vw, 7.25rem);
  place-items: center;
  border-radius: 0.8125rem;
  background: var(--product-color);
}

.product-logo img { width: clamp(4rem, 6.1vw, 5.5rem); height: auto; }
.product-logo.canvas { --product-color: #eee7fa; }
.product-logo.frame { --product-color: #deeff9; }
.product-logo.deck { --product-color: #fff0c7; }

.product-info { padding: 1rem 0.5rem clamp(0.8rem, 1.15vw, 1.1rem); }

.product-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.375rem 0.75rem;
}

.product-card h2 {
  font-size: 1.6875rem;
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.status {
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  white-space: nowrap;
}

.product-info p {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.more-tools {
  margin-top: clamp(2rem, 4.3vw, 3.75rem);
  padding-block: clamp(1.5rem, 2.5vw, 2.375rem) clamp(2rem, 3.5vw, 3.25rem);
  border-top: 1px solid var(--line);
}

.more-tools > h2 {
  margin-bottom: clamp(1.25rem, 2.6vw, 2.375rem);
  font-size: clamp(1.75rem, 3.1vw, 2.75rem);
  font-weight: 625;
  letter-spacing: -0.055em;
  line-height: 1.2;
}

.other-products .product-card { border-radius: 1.125rem; }
.other-products .product-info { padding: 0.1875rem 0.25rem 0.625rem; }
.other-products .product-card h3 { font-size: 1.1875rem; font-weight: 650; letter-spacing: -0.03em; }
.other-products .product-info p { margin-top: 1.4rem; font-size: 0.9rem; }

.site-footer {
  display: grid;
  justify-items: center;
  gap: 1.125rem;
  margin-top: auto;
  padding: 3rem 1.25rem 3.5rem;
  border-top: 1px solid var(--line);
  background: #eeeae5;
  color: #211e1a;
}

.site-footer a {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.site-footer small {
  color: var(--muted);
  font-size: 0.875rem;
}

@media (max-width: 53rem) {
  .other-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 38rem) {
  .featured-products { grid-template-columns: minmax(0, 1fr); }
  .apps-page .header-nav { gap: 0.75rem; font-size: 0.8125rem; }
  .apps-page .language { min-width: 2.75rem; margin-inline-start: 0; }
}

@media (max-width: 23rem) {
  .other-products { grid-template-columns: minmax(0, 1fr); }
  .header-inner { gap: 0.5rem; }
  .story-nav { gap: 0.25rem; }
  .chapter-link { padding-inline: 0.48rem; }
  .chapter-next { width: 2.5rem; padding: 0; }
  .product-shortcut { padding-inline: 0.5rem; }
}

.error-page { padding-block: 4rem; }
.error-page a { display: inline-block; margin-top: 1rem; text-decoration: underline; }
