/* Folio — product site. Colours come from the app icon: warm paper, navy folder, orange bookmark. */

:root {
  --bg: #fbfaf7;
  --bg-alt: #f3f0e9;
  --ink: #1d1d1f;
  --sub: #6e6e73;
  --line: rgba(0, 0, 0, 0.08);
  --navy: #2b3245;
  --orange: #ee6a3c;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --night: #000;
  --night-ink: #f5f5f7;
  --night-sub: #86868b;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Helvetica Neue", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, monospace;

  --gutter: max(22px, env(safe-area-inset-left));
  --content: 1120px;
  --nav-h: 52px;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  transition: opacity 0.5s ease;
}

html.preload body {
  opacity: 0;
}

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

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.skip:focus {
  left: 8px;
}

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(251, 250, 247, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.5s ease, background-color 0.5s ease;
}

.nav.is-scrolled {
  border-bottom-color: var(--line);
}

.nav.is-dark {
  background: rgba(22, 22, 23, 0.72);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.nav.is-dark .nav-brand,
.nav.is-dark .nav-links a,
.nav.is-dark .nav-github,
.nav.is-dark .lang-toggle {
  color: rgba(245, 245, 247, 0.85);
}

.nav.is-dark .nav-links a:hover,
.nav.is-dark .nav-github:hover {
  color: #fff;
}

.nav.is-dark .lang-toggle {
  border-color: rgba(255, 255, 255, 0.24);
}

.nav-inner {
  max-width: calc(var(--content) + 2 * var(--gutter));
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
}

.nav-links a {
  color: rgba(29, 29, 31, 0.8);
  font-size: 13px;
  letter-spacing: -0.005em;
  transition: color 0.5s ease;
}

.nav-links a:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.lang-toggle {
  font-size: 12px;
  font-weight: 500;
  color: rgba(29, 29, 31, 0.8);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-toggle:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink);
}

.nav-github {
  color: rgba(29, 29, 31, 0.8);
  display: grid;
  place-items: center;
}

.nav-github svg {
  width: 18px;
  height: 18px;
}

.nav-github:hover {
  color: var(--ink);
}

.nav-cta {
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: var(--blue);
  padding: 4px 12px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out), background-color 0.2s ease;
}

.nav.show-cta .nav-cta {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav-cta:hover {
  background: var(--blue-hover);
  text-decoration: none;
}

@media (max-width: 734px) {
  .nav-links {
    display: none;
  }
  .nav-actions {
    margin-left: auto;
  }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.015em;
  border-radius: 999px;
  transition: background-color 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease, color 0.2s ease;
}

.btn:hover {
  text-decoration: none;
}

.btn-icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  color: #fff;
  background: var(--blue);
  padding: 12px 24px;
  box-shadow: 0 6px 20px rgba(0, 113, 227, 0.22);
}

.btn-primary:hover {
  background: var(--blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 113, 227, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.06);
  padding: 12px 24px;
}

.btn-secondary:hover {
  background: rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.btn-link {
  color: var(--blue);
  padding: 12px 6px;
}

.btn-link .chev {
  width: 7px;
  height: 12px;
  transition: transform 0.3s var(--ease-out);
}

.btn-link:hover span {
  text-decoration: underline;
}

.btn-link:hover .chev {
  transform: translateX(3px);
}

.btn-large {
  font-size: 18px;
  padding: 15px 30px;
}

/* ---------- Shared type ---------- */

section {
  position: relative;
}

.section-head {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--orange);
}

.headline {
  margin: 0;
  font-size: clamp(34px, 6.2vw, 72px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: -0.028em;
}

html[data-lang="zh"] .headline {
  letter-spacing: -0.01em;
  line-height: 1.12;
}

.lede {
  margin: 24px auto 0;
  max-width: 720px;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--sub);
  letter-spacing: -0.01em;
}

/* Screenshot windows: the PNGs carry their own rounded, transparent corners. */
.win {
  position: relative;
  border-radius: 1.3% / 2.16%;
  box-shadow: 0 2px 6px rgba(15, 20, 30, 0.05), 0 22px 50px -10px rgba(15, 20, 30, 0.22),
    0 60px 120px -30px rgba(15, 20, 30, 0.22);
  background: transparent;
}

.win img {
  width: 100%;
  height: auto;
}

.win-stack {
  display: grid;
}

.win-stack > img {
  grid-area: 1 / 1;
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translate3d(0, 34px, 0);
  filter: blur(6px);
  transition: opacity 1.1s var(--ease-out), transform 1.3s var(--ease-out), filter 1.1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  filter: none;
}

.reveal-scale {
  opacity: 0;
  transform: translate3d(0, 60px, 0) scale(0.94);
  transition: opacity 1.2s var(--ease-out), transform 1.6s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}

.reveal-scale.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- Hero ---------- */

.hero {
  padding: calc(var(--nav-h) + clamp(48px, 9vh, 96px)) 0 0;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero-glow {
  position: absolute;
  inset: 0 0 30%;
  z-index: -1;
  pointer-events: none;
}

.hero-glow span {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 22s var(--ease-inout) infinite alternate;
}

.hero-glow span:nth-child(1) {
  width: 46vw;
  height: 46vw;
  left: -10vw;
  top: -6vw;
  background: radial-gradient(circle, rgba(246, 176, 132, 0.75), transparent 68%);
}

.hero-glow span:nth-child(2) {
  width: 44vw;
  height: 44vw;
  right: -12vw;
  top: 0;
  background: radial-gradient(circle, rgba(170, 190, 245, 0.7), transparent 68%);
  animation-delay: -8s;
  animation-duration: 26s;
}

.hero-glow span:nth-child(3) {
  width: 36vw;
  height: 36vw;
  left: 32vw;
  top: 22vw;
  background: radial-gradient(circle, rgba(250, 220, 170, 0.55), transparent 68%);
  animation-delay: -14s;
  animation-duration: 30s;
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(4vw, 3vw, 0) scale(1.08);
  }
  100% {
    transform: translate3d(-3vw, 5vw, 0) scale(0.96);
  }
}

.hero-copy {
  padding: 0 var(--gutter);
}

.hero-icon {
  position: relative;
  width: clamp(104px, 13vw, 148px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  opacity: 0;
  transform: translate3d(0, 30px, 0) scale(0.78);
  filter: blur(14px);
}

.hero-icon img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 30px rgba(43, 50, 69, 0.2));
}

.hero-icon-shine {
  position: absolute;
  inset: 0;
  -webkit-mask: url("../img/icon.webp") center / 100% 100% no-repeat;
  mask: url("../img/icon.webp") center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.65) 50%, transparent 65%) no-repeat;
  background-size: 300% 100%;
  background-position: 120% 0;
  opacity: 0;
}

.hero-eyebrow {
  margin: 0;
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 600;
  color: var(--orange);
}

.hero-title {
  margin: 4px 0 0;
  font-size: clamp(64px, 10vw, 120px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.hero-headline {
  margin: 16px 0 0;
  font-size: clamp(28px, 3.8vw, 48px);
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--navy) 10%, #4a5372 45%, var(--orange) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  max-width: 660px;
  margin: 22px auto 0;
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
  color: var(--sub);
}

.hero-cta {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px 22px;
}

.hero-meta {
  margin: 18px 0 0;
  font-size: 14px;
  color: var(--sub);
}

/* Intro sequence: everything is staged, then html.is-ready plays it once. */
.intro {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
  filter: blur(8px);
}

.is-ready .intro {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 1.2s var(--ease-out), transform 1.4s var(--ease-out), filter 1.2s var(--ease-out);
  transition-delay: calc(0.25s + var(--i, 0) * 0.11s);
}

.is-ready .hero-title {
  animation: title-in 1.8s var(--ease-out) both;
  animation-delay: 0.42s;
}

@keyframes title-in {
  from {
    letter-spacing: 0.18em;
  }
  to {
    letter-spacing: -0.035em;
  }
}

.is-ready .hero-icon {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 1.3s var(--ease-out), transform 1.6s var(--ease-out), filter 1.3s var(--ease-out);
  transition-delay: 0.1s;
}

.is-ready .hero-icon-shine {
  animation: shine 1.4s var(--ease-inout) 1.15s both;
}

@keyframes shine {
  0% {
    opacity: 1;
    background-position: 120% 0;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    background-position: -20% 0;
  }
}

.hero-stage {
  margin-top: clamp(48px, 8vh, 80px);
  padding: 0 var(--gutter);
  perspective: 2200px;
  perspective-origin: 50% 0%;
}

.is-ready .hero-stage {
  transition-duration: 1.6s, 1.8s, 1.4s;
}

.hero-window {
  max-width: 1080px;
  margin: 0 auto;
  transform-origin: 50% 0%;
  transform: rotateX(var(--tilt, 16deg)) scale(var(--scale, 0.92));
  will-change: transform;
}

.hero::after {
  /* Fade the bottom of the hero window into the next section. */
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 18%;
  background: linear-gradient(to bottom, rgba(251, 250, 247, 0), var(--bg));
  pointer-events: none;
}

/* ---------- Film ---------- */

.film {
  padding: clamp(100px, 14vh, 160px) 0 clamp(100px, 14vh, 160px);
}

.film-frame {
  position: relative;
  max-width: 1120px;
  margin: 56px auto 0;
  margin-inline: max(var(--gutter), calc((100% - 1120px) / 2));
  aspect-ratio: 16 / 9;
  border-radius: clamp(14px, 2.2vw, 28px);
  overflow: hidden;
  background: #efe9df;
  box-shadow: 0 30px 80px -20px rgba(24, 28, 42, 0.28), 0 4px 14px rgba(24, 28, 42, 0.06);
  transform: scale(var(--scale, 0.9));
  transform-origin: 50% 30%;
  will-change: transform;
}

.film-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.film-play {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding-bottom: clamp(18px, 6%, 56px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 55%, rgba(20, 22, 30, 0.18));
  transition: opacity 0.6s var(--ease-out), visibility 0.6s;
}

.film-play-disc {
  width: clamp(56px, 6vw, 76px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: transform 0.5s var(--ease-out), background-color 0.3s ease;
}

.film-play-disc svg {
  width: 40%;
  margin-left: 6%;
}

.film-play:hover .film-play-disc {
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.86);
}

.film-play-label {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.25);
}

.film-play-label small {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
}

.film.is-playing .film-play {
  opacity: 0;
  visibility: hidden;
}

/* ---------- Import (pinned) ---------- */

.import {
  padding-top: clamp(60px, 8vh, 100px);
  background: linear-gradient(to bottom, var(--bg), var(--bg-alt) 30%, var(--bg-alt) 85%, var(--bg));
}

.import-track {
  height: 460vh;
  margin-top: 40px;
}

.import-stage {
  position: sticky;
  top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  height: calc(100svh - var(--nav-h));
  max-width: calc(1280px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
}

.import-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 26px;
  counter-reset: step;
}

.import-steps li {
  position: relative;
  padding-left: 22px;
  color: rgba(29, 29, 31, 0.28);
  transition: color 0.6s var(--ease-out);
}

.import-steps li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.2em;
  width: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.35;
  transition: background-color 0.6s var(--ease-out), opacity 0.6s var(--ease-out);
}

.import-steps li.is-active {
  color: var(--ink);
}

.import-steps li.is-active::before {
  background: var(--orange);
  opacity: 1;
}

.import-steps b {
  display: block;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.import-steps span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.45;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  color: var(--sub);
  transition: max-height 0.7s var(--ease-out), opacity 0.6s var(--ease-out);
}

.import-steps li.is-active span {
  max-height: 5em;
  opacity: 1;
}

.import-visual {
  position: relative;
}

.import-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: -28px;
  height: 3px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.import-progress span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #f39a6e);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

#importStack > img {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out);
}

#importStack > img.is-on {
  opacity: 1;
}

.drag-file {
  position: absolute;
  left: 0;
  top: 0;
  width: 8%;
  min-width: 46px;
  pointer-events: none;
  transform: translate3d(var(--fx, -120%), var(--fy, 60%), 0) scale(var(--fs, 1));
  opacity: var(--fo, 0);
  will-change: transform, opacity;
}

.drag-file .pdf {
  width: 100%;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.22));
}

.drag-name {
  position: absolute;
  top: 104%;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  font-size: clamp(9px, 0.9vw, 12px);
  white-space: nowrap;
}

.drag-file .cursor {
  position: absolute;
  width: 46%;
  right: -26%;
  bottom: 6%;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

@media (max-width: 833px) {
  .import-track {
    height: 420vh;
  }
  .import-stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    gap: 36px;
  }
  .import-visual {
    order: -1;
  }
  .import-steps {
    display: grid;
    min-height: 6.5em;
  }
  .import-steps li {
    grid-area: 1 / 1;
    align-self: start;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s var(--ease-out), transform 0.6s var(--ease-out);
  }
  .import-steps li.is-active {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Organize ---------- */

.organize {
  padding: clamp(110px, 16vh, 180px) 0 clamp(60px, 10vh, 120px);
}

.duo {
  max-width: calc(1240px + 2 * var(--gutter));
  margin: 64px auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
}

.duo-item {
  margin: 0;
}

.duo-item:nth-child(2) {
  margin-top: clamp(40px, 7vw, 100px);
}

.duo-item figcaption {
  margin-top: 26px;
  padding: 0 4px;
  font-size: 17px;
  color: var(--sub);
}

.duo-item figcaption b {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 19px;
  margin-bottom: 2px;
}

@media (max-width: 734px) {
  .duo {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .duo-item:nth-child(2) {
    margin-top: 0;
  }
}

/* ---------- Reader ---------- */

.reader {
  padding: clamp(80px, 12vh, 140px) 0;
}

.reader-stage {
  position: relative;
  max-width: 1120px;
  margin: 64px auto 0;
  margin-inline: max(var(--gutter), calc((100% - 1120px) / 2));
}

.callout {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -135%) scale(0.85);
  transform-origin: 50% 100%;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(29, 29, 31, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: clamp(11px, 1.1vw, 14px);
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: calc(0.7s + var(--k) * 0.35s);
  pointer-events: none;
}

.callout::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 10px;
  height: 10px;
  margin: 6px 0 0 -5px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 4px rgba(238, 106, 60, 0.25);
  animation: pulse 2.4s ease-out infinite;
}

.reader-stage.is-in .callout {
  opacity: 1;
  transform: translate(-50%, -150%) scale(1);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(238, 106, 60, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(238, 106, 60, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(238, 106, 60, 0);
  }
}

@media (max-width: 600px) {
  .callout {
    padding: 4px 9px;
  }
  .callout::after {
    width: 7px;
    height: 7px;
    margin: 4px 0 0 -3.5px;
  }
}

/* ---------- Translate ---------- */

.translate {
  padding: clamp(80px, 12vh, 140px) 0 clamp(120px, 16vh, 180px);
}

.translate-stage {
  position: relative;
  max-width: 1120px;
  margin: 64px auto 0;
  margin-inline: max(var(--gutter), calc((100% - 1120px) / 2));
}

.win-parallel {
  border-radius: 1.2% / 2%;
}

.translate-chip {
  position: absolute;
  left: -2%;
  bottom: -7%;
  width: min(42%, 440px);
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 24px 60px -12px rgba(15, 20, 30, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.translate-chip-img {
  display: block;
  aspect-ratio: 560 / 56;
  border-radius: 12px;
  background: #fff url("../img/translating.webp") no-repeat;
  /* The list row with the translation progress, cropped out of the full window. */
  background-size: 357% auto;
  background-position: 23.6% 59.1%;
}

@media (max-width: 734px) {
  .translate-chip {
    position: relative;
    left: auto;
    bottom: auto;
    width: 100%;
    margin-top: 20px;
  }
}

/* ---------- Cite ---------- */

.cite {
  padding: clamp(100px, 14vh, 160px) 0;
  background: var(--bg-alt);
}

.cite-box {
  max-width: 900px;
  margin: 56px auto 0;
  padding: 0 var(--gutter);
}

.cite-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  width: fit-content;
  margin: 0 auto 26px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  position: relative;
}

.cite-tab {
  position: relative;
  z-index: 1;
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(29, 29, 31, 0.7);
  transition: color 0.3s ease;
}

.cite-tab[aria-selected="true"] {
  color: var(--ink);
}

.cite-tab-pill {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform 0.55s var(--ease-out), width 0.55s var(--ease-out);
}

.cite-card {
  position: relative;
  display: grid;
  min-height: 250px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 30px 80px -24px rgba(24, 28, 42, 0.2), 0 4px 14px rgba(24, 28, 42, 0.05);
  overflow: hidden;
}

.cite-entry {
  grid-area: 1 / 1;
  padding: clamp(28px, 5vw, 52px) clamp(24px, 6vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  filter: blur(6px);
  transition: opacity 0.6s var(--ease-out), transform 0.8s var(--ease-out), filter 0.6s var(--ease-out);
}

.cite-entry.is-on {
  opacity: 1;
  transform: none;
  filter: none;
  transition-delay: 0.12s;
}

.cite-entry.is-out {
  transform: translate3d(0, -24px, 0);
}

.cite-entry .style {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  color: var(--orange);
  background: rgba(238, 106, 60, 0.1);
  padding: 4px 12px;
  border-radius: 999px;
}

.cite-entry .text {
  margin: 0;
  font-family: "Times New Roman", "Songti SC", "STSong", serif;
  font-size: clamp(17px, 2vw, 23px);
  line-height: 1.5;
  color: var(--ink);
  letter-spacing: 0;
}

.cite-entry .text.mono {
  font-family: var(--mono);
  font-size: clamp(12px, 1.35vw, 15px);
  line-height: 1.6;
  white-space: pre;
  overflow-x: auto;
}

.cite-more {
  margin: 22px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--sub);
}

/* ---------- AI (dark) ---------- */

.ai {
  padding: clamp(110px, 16vh, 180px) 0;
  background: var(--night);
  color: var(--night-ink);
}

.ai .lede {
  color: var(--night-sub);
}

.eyebrow-ai {
  background: linear-gradient(90deg, #ff9a6b, #c58bff 60%, #6fa8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ai-stage {
  max-width: calc(1180px + 2 * var(--gutter));
  margin: 72px auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}

.win-settings {
  border-radius: 2% / 2.6%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 40px 100px -20px rgba(120, 140, 255, 0.18);
}

.terminal {
  border-radius: 16px;
  background: #0d1117;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.09), 0 40px 100px -20px rgba(0, 0, 0, 0.8),
    0 0 120px -40px rgba(238, 106, 60, 0.25);
  overflow: hidden;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  background: #161b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-bar i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5f57;
}

.terminal-bar i:nth-child(2) {
  background: #febc2e;
}

.terminal-bar i:nth-child(3) {
  background: #28c840;
}

.terminal-bar span {
  flex: 1;
  text-align: center;
  margin-right: 52px;
  font-size: 12px;
  color: #8b949e;
}

.terminal-body {
  margin: 0;
  height: clamp(320px, 34vw, 420px);
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: clamp(11px, 1.05vw, 13.5px);
  line-height: 1.6;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  letter-spacing: 0;
}

.terminal-body .p {
  color: #7ee787;
}

.terminal-body .d {
  color: #79c0ff;
}

.terminal-body .c {
  color: #f0f3f6;
}

.terminal-body .dim {
  color: #6e7681;
}

.terminal-body .caret {
  display: inline-block;
  width: 0.6em;
  height: 1.15em;
  margin-bottom: -0.2em;
  background: #f0f3f6;
  animation: blink 1.06s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.ai-facts {
  max-width: 980px;
  margin: 88px auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: center;
}

.ai-facts b {
  display: block;
  font-size: clamp(44px, 5.5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  background: linear-gradient(180deg, #fff, #a1a1a6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ai-facts span {
  display: block;
  margin-top: 8px;
  font-size: 15px;
  color: var(--night-sub);
}

@media (max-width: 833px) {
  .ai-stage {
    grid-template-columns: 1fr;
  }
  .win-settings {
    max-width: 560px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  .ai-facts {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

/* ---------- Dark-mode wipe (pinned) ---------- */

.theme {
  height: 280vh;
}

.theme-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  padding: calc(var(--nav-h) + 4vh) var(--gutter) 4vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: clamp(28px, 5vh, 56px);
  overflow: hidden;
  background: var(--stage-bg, var(--bg-alt));
  color: var(--stage-ink, var(--ink));
}

.theme-copy {
  text-align: center;
  max-width: 820px;
}

.theme-copy .lede {
  color: var(--stage-sub, var(--sub));
  margin-top: 16px;
}

.theme-window {
  width: min(1080px, 100%, calc((100svh - 330px) * 1.66));
  min-width: min(100%, 300px);
}

.theme-dark {
  clip-path: inset(0 calc(100% - var(--wipe, 0%)) 0 0);
}

.theme-line {
  grid-area: 1 / 1;
  justify-self: start;
  width: 2px;
  height: 100%;
  transform: translateX(var(--line-x, 0px));
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.95) 20%, rgba(255, 255, 255, 0.95) 80%, transparent);
  box-shadow: 0 0 24px 4px rgba(255, 200, 160, 0.55);
  opacity: var(--line-o, 0);
  pointer-events: none;
}

/* ---------- Stats ---------- */

.stats {
  padding: clamp(110px, 16vh, 180px) 0;
}

.stats-grid {
  max-width: calc(1080px + 2 * var(--gutter));
  margin: 72px auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat {
  padding: 34px 24px 30px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 20px 50px -24px rgba(24, 28, 42, 0.18);
  text-align: center;
}

.stat b {
  display: block;
  font-size: clamp(40px, 4.6vw, 58px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--navy), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.stat b small {
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-left: 4px;
}

.stat > span {
  display: block;
  margin-top: 10px;
  font-size: 15px;
  color: var(--sub);
}

@media (max-width: 960px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- More ---------- */

.more {
  padding: clamp(40px, 6vh, 80px) 0 clamp(110px, 16vh, 180px);
}

.bento {
  max-width: calc(1080px + 2 * var(--gutter));
  margin: 56px auto 0;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  padding: 34px 30px 32px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 20px 50px -28px rgba(24, 28, 42, 0.18);
  transition: opacity 1.1s var(--ease-out), transform 0.6s var(--ease-out), filter 1.1s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
}

.card.is-in:hover {
  transform: translateY(-4px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 30px 60px -24px rgba(24, 28, 42, 0.26);
  transition-delay: 0s;
}

.card svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card h3 {
  margin: 22px 0 8px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--sub);
}

@media (max-width: 960px) {
  .bento {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr;
  }
}

/* ---------- Download ---------- */

.download {
  padding: clamp(100px, 14vh, 160px) 0 clamp(100px, 14vh, 160px);
  background: radial-gradient(60% 50% at 50% 0%, rgba(246, 176, 132, 0.22), transparent 70%),
    radial-gradient(50% 40% at 80% 20%, rgba(170, 190, 245, 0.22), transparent 70%), var(--bg-alt);
  text-align: center;
}

.download-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.download-icon {
  width: clamp(110px, 12vw, 140px);
  height: auto;
  margin: 0 auto 26px;
  filter: drop-shadow(0 18px 30px rgba(43, 50, 69, 0.2));
}

.download-cta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.download-meta {
  margin: 16px 0 0;
  font-size: 14px;
  color: var(--sub);
  min-height: 1.4em;
}

.first-run {
  margin: 56px auto 0;
  max-width: 640px;
  padding: 26px 28px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  text-align: left;
}

.first-run h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}

.first-run p {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--sub);
}

.first-run .first-run-note {
  margin-top: 12px;
  font-size: 13px;
}

.code {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 10px 10px 16px;
  border-radius: 12px;
  background: #1d1d1f;
}

.code code {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  color: #f5f5f7;
  scrollbar-width: none;
}

.copy {
  flex: none;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  transition: background-color 0.2s ease;
}

.copy:hover {
  background: rgba(255, 255, 255, 0.22);
}

.copy.is-done {
  background: #28a745;
}

.download-links {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  font-size: 15px;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  color: var(--sub);
  font-size: 12px;
}

.footer-inner {
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 22px var(--gutter) 30px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.footer p {
  margin: 10px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.footer-links a {
  color: var(--sub);
}

.footer-links a:hover {
  color: var(--ink);
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .reveal,
  .reveal-scale,
  .intro,
  .hero-icon {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  .hero-window,
  .film-frame {
    transform: none !important;
  }
}

/* Platform-specific blocks (main.js shows the one for this computer). */
[hidden] { display: none !important; }
