:root {
  --bg-page: #F7F9FC;
  --bg-tinted: #EEF2F9;
  --bg-elevated: #FFFFFF;

  --ink-primary: #141C2E;
  --ink-muted: #4A556E;

  --accent: #3B5CCC;
  --accent-hover: #2E4CB5;

  --hairline: rgba(20, 28, 46, 0.1);
  --hairline-strong: rgba(20, 28, 46, 0.16);
  --hairline-dark: rgba(243, 246, 255, 0.14);

  /* Strictly 2 font families & 3 body font-size steps */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  --text-wordmark: 1.3125rem;
  --text-hero: clamp(2.35rem, 5vw, 4.25rem);
  --text-heading: clamp(1.65rem, 2.6vw, 2.25rem);
  --text-body: 1.0625rem;
  --text-sm: 0.875rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --container-max: 1120px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--bg-page);
  color: var(--ink-primary);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

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

button {
  font-family: inherit;
  font-size: var(--text-sm);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.container {
  width: min(92vw, var(--container-max));
  margin-inline: auto;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: background-color 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.site-header.is-scrolled {
  background-color: rgba(247, 249, 252, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--hairline);
}

.header-inner {
  width: min(92vw, var(--container-max));
  height: 64px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
}

.brand-wordmark {
  font-size: var(--text-wordmark);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.segmented-control {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 2px;
  background-color: rgba(20, 28, 46, 0.06);
  border: 1px solid rgba(20, 28, 46, 0.08);
  border-radius: 7px;
}

.segmented-control::before {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 2px;
  width: calc(50% - 2px);
  border-radius: 5px;
  background-color: var(--bg-elevated);
  box-shadow: 0 1px 3px rgba(20, 28, 46, 0.1);
  transform: translate3d(0, 0, 0);
  transition: transform 280ms var(--ease-out);
  pointer-events: none;
}

.segmented-control.is-second::before {
  transform: translate3d(100%, 0, 0);
}

.seg-option {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.25;
  padding: 5px 14px;
  border-radius: 5px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: color 200ms var(--ease-out);
}

.seg-option:hover {
  color: var(--ink-primary);
}

.seg-option.is-active {
  color: var(--ink-primary);
  font-weight: 600;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 9px;
  background-color: var(--accent);
  color: #FFFFFF;
  font-size: var(--text-body);
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 4px 14px rgba(59, 92, 204, 0.2);
  transition: background-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* ==========================================================================
   Hero + Pinned Scroll-Linked Focus-to-Full-Window Stages
   ========================================================================== */
.hero {
  padding-top: 116px;
  padding-bottom: 72px;
  background: linear-gradient(180deg, #E2EBFF 0%, #EFF3FB 34%, var(--bg-page) 100%);
}

.hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
}

.hero-title {
  margin: 0;
  max-width: 1040px;
  text-wrap: balance;
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.022em;
}

html[data-lang="en"] .hero-title {
  letter-spacing: -0.034em;
  line-height: 1.02;
}

.hero-copy {
  margin: 16px 0 0;
  max-width: 58ch;
  text-wrap: balance;
  font-size: var(--text-body);
  color: var(--ink-muted);
}

.hero-action {
  margin-top: 26px;
}

.hero-stage {
  width: min(94vw, var(--container-max));
  margin-inline: auto;
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.stage-caption {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* Scroll-Linked Sticky Camera Track */
.zoom-track {
  position: relative;
  min-height: 170vh;
}

.zoom-sticky {
  position: sticky;
  top: 76px;
  padding-bottom: 24px;
}

.stage-fit {
  width: min(92vw, var(--container-max), calc((100dvh - 210px) * 1.606));
  margin-inline: auto;
}

.stage-fit-sheet {
  width: min(92vw, 900px, calc((100dvh - 210px) * 1.5));
}

/* Native macOS Window Frame + GPU Zoom Layer */
.window-frame {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 22px 56px rgba(20, 28, 46, 0.13), 0 2px 8px rgba(20, 28, 46, 0.05);
  background-color: var(--bg-elevated);
}

.hero-window-frame {
  position: relative;
  background-color: transparent;
  transition: border-color 420ms var(--ease-out), box-shadow 420ms var(--ease-out);
}

.hero-window-frame.is-dark {
  border-color: rgba(20, 28, 46, 0.34);
  box-shadow: 0 26px 64px rgba(12, 18, 32, 0.24), 0 4px 12px rgba(12, 18, 32, 0.1);
}

.hero-img-light {
  width: 100%;
  height: auto;
  opacity: 1;
  will-change: opacity;
  transition: opacity 420ms var(--ease-out);
}

.hero-window-frame.is-dark .hero-img-light {
  opacity: 0;
}

.hero-img-dark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
  transition: opacity 420ms var(--ease-out);
}

.hero-window-frame.is-dark .hero-img-dark {
  opacity: 1;
}

.zoom-canvas {
  position: relative;
  width: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.window-frame > img,
.zoom-canvas img {
  width: 100%;
  height: auto;
}

/* ==========================================================================
   Feature Sections
   ========================================================================== */
.feature-section {
  padding: 64px 0 72px;
  border-top: 1px solid var(--hairline);
}

.surface-tinted {
  background-color: var(--bg-tinted);
}

.section-head {
  margin-bottom: 20px;
}

h2 {
  margin: 0;
  font-size: var(--text-heading);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.section-head p {
  margin: 8px 0 0;
  max-width: 60ch;
  text-wrap: pretty;
  font-size: var(--text-body);
  color: var(--ink-muted);
}

/* ==========================================================================
   Download CTA
   ========================================================================== */
.download-section {
  min-height: calc(100dvh - 76px);
  display: flex;
  align-items: center;
  padding: 120px 0 76px;
  border-top: 1px solid var(--hairline);
}

.download-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.download-copy {
  margin: 12px 0 0;
  max-width: 52ch;
  text-wrap: balance;
  font-size: var(--text-body);
  color: var(--ink-muted);
}

.download-cta {
  margin-top: 28px;
}

.download-note {
  margin: 14px 0 0;
  text-wrap: balance;
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  padding: 18px 0;
  border-top: 1px solid var(--hairline);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-meta {
  font-size: var(--text-sm);
  color: var(--ink-muted);
}

/* ==========================================================================
   Responsive Layout
   ========================================================================== */
@media (max-width: 900px) {
  .hero-stage,
  .stage-fit,
  .stage-fit-sheet {
    width: 92vw;
  }
}

@media (max-width: 600px) {
  :root {
    --text-body: 1rem;
  }

  .hero {
    padding-top: 94px;
    padding-bottom: 48px;
  }

  .zoom-track {
    min-height: 138vh;
  }

  .zoom-sticky {
    top: 72px;
  }

  .feature-section {
    padding: 52px 0;
  }

  .download-section {
    padding: 96px 0 64px;
  }

  .window-frame {
    border-radius: 8px;
  }
}

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

  .zoom-track {
    min-height: auto;
  }

  .zoom-sticky {
    position: static;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
