:root {
  --yellow: #ffd702;
  --ink: #17191d;
  --muted: #6b7280;
  --line: rgba(23, 25, 29, 0.1);
  --surface: rgba(255, 255, 255, 0.72);
  --shadow: 0 42px 120px rgba(15, 23, 42, 0.18);
  color: var(--ink);
  background: #f4f2ea;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 215, 2, 0.35), transparent 34rem),
    radial-gradient(circle at 82% 14%, rgba(255, 215, 2, 0.18), transparent 30rem),
    linear-gradient(180deg, #f7f5ed 0%, #efeee8 100%);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* ── Scroll progress indicator ── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 2px;
  pointer-events: none;
}

.scroll-progress i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--yellow);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 980ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-progress.is-demo i {
  transform: scaleX(1);
}

.landing {
  position: relative;
  height: 200vh;
  transform: translateY(0);
  transition: transform 980ms cubic-bezier(0.22, 1, 0.36, 1);
}

.landing[data-stage="demo"] {
  transform: translateY(-100vh);
}

.hero-section,
.demo-section {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.site-header {
  position: absolute;
  left: clamp(1.2rem, 4vw, 4rem);
  right: clamp(1.2rem, 4vw, 4rem);
  top: clamp(1rem, 3vw, 2.25rem);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: 0.85rem;
  background: var(--ink);
  color: var(--yellow);
  font-size: 1.08rem;
  font-weight: 850;
  box-shadow: 0 10px 30px rgba(23, 25, 29, 0.16);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(18px);
}

.top-nav a,
.top-nav button {
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  background: transparent;
  color: rgba(23, 25, 29, 0.72);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav button:hover {
  background: rgba(23, 25, 29, 0.06);
  color: var(--ink);
}

.hero-copy {
  position: absolute;
  top: 16vh;
  left: 50%;
  z-index: 5;
  width: min(92vw, 78rem);
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  text-align: center;
  transition:
    transform 980ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.landing[data-stage="demo"] .hero-copy {
  transform: translateX(-50%) translateY(-40px) scale(0.94);
  opacity: 0;
}

.eyebrow {
  margin: 0 0 1.2rem;
  color: rgba(23, 25, 29, 0.52);
  font-size: clamp(0.76rem, 1.4vw, 1rem);
  font-weight: 760;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(5.7rem, 18vw, 18rem);
  font-weight: 920;
  letter-spacing: -0.12em;
  line-height: 0.78;
  text-shadow:
    0 0 60px rgba(255, 215, 2, 0.18),
    0 0 120px rgba(255, 215, 2, 0.08);
}

.slogan {
  margin: 2rem 0 0;
  font-size: clamp(1.35rem, 3.1vw, 3.8rem);
  font-weight: 780;
  letter-spacing: -0.05em;
}

.download-panel {
  position: absolute;
  left: 50%;
  bottom: 26vh;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  transition:
    transform 980ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 580ms cubic-bezier(0.22, 1, 0.36, 1);
}

.landing[data-stage="demo"] .download-panel {
  transform: translateX(-50%) translateY(-30px);
  opacity: 0;
}

.download-button {
  display: flex;
  min-width: min(84vw, 22rem);
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid rgba(23, 25, 29, 0.88);
  border-radius: 999px;
  padding: 1rem 2rem;
  background: var(--ink);
  color: white;
  box-shadow: 0 18px 54px rgba(23, 25, 29, 0.23);
  text-decoration: none;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.download-button:hover {
  transform: translateY(-2px);
  background: #000;
  box-shadow:
    0 22px 68px rgba(23, 25, 29, 0.22),
    0 0 32px rgba(255, 215, 2, 0.25),
    0 0 64px rgba(255, 215, 2, 0.12);
}

.download-button span {
  font-size: 1rem;
  font-weight: 760;
}

.download-button small {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
}

.download-note {
  margin: 0.78rem 0 0;
  color: rgba(23, 25, 29, 0.5);
  font-size: 0.82rem;
}

.scroll-hint,
.back-hint {
  border: 0;
  background: transparent;
  color: rgba(23, 25, 29, 0.46);
  cursor: pointer;
  font: inherit;
  transition:
    opacity 680ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 680ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 2.2vh;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  transform: translateX(-50%);
  font-size: 0.78rem;
}

.landing[data-stage="demo"] .scroll-hint {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
}

.scroll-hint i {
  width: 1px;
  height: 2.8rem;
  background: linear-gradient(to bottom, rgba(23, 25, 29, 0.04), rgba(23, 25, 29, 0.42));
}

.back-hint {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  z-index: 8;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(12px);
  font-size: 0.8rem;
  color: rgba(23, 25, 29, 0.46);
  border: 1px solid rgba(23, 25, 29, 0.08);
  transition:
    background 200ms ease,
    color 200ms ease;
}

.back-hint:hover {
  background: rgba(255, 255, 255, 0.62);
  color: rgba(23, 25, 29, 0.72);
}

.demo-shell {
  position: absolute;
  left: 50%;
  bottom: -54vh;
  z-index: 4;
  width: min(92vw, 76rem);
  transform: translateX(-50%) translateY(80px);
  opacity: 0;
  transition:
    bottom 980ms cubic-bezier(0.22, 1, 0.36, 1),
    width 980ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 980ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 720ms cubic-bezier(0.22, 1, 0.36, 1) 180ms,
    filter 980ms cubic-bezier(0.22, 1, 0.36, 1);
  filter: saturate(0.92);
}

.landing[data-stage="demo"] .demo-shell {
  bottom: 7vh;
  width: min(94vw, 82rem);
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  filter: saturate(1);
}

.app-window {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 2rem;
  background: rgba(249, 250, 251, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.title-bar {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  align-items: center;
  gap: 1rem;
  height: 3.7rem;
  border-bottom: 1px solid rgba(23, 25, 29, 0.08);
  padding: 0 1.15rem;
  background: rgba(255, 255, 255, 0.58);
}

.window-dots {
  display: flex;
  gap: 0.45rem;
}

.window-dots span {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: rgba(23, 25, 29, 0.18);
}

.window-dots span:first-child {
  background: #ff6961;
}

.window-dots span:nth-child(2) {
  background: #ffbd2e;
}

.window-dots span:nth-child(3) {
  background: #28c840;
}

.title-text {
  color: rgba(23, 25, 29, 0.52);
  font-size: 0.82rem;
  font-weight: 680;
  text-align: center;
}

.status-pill {
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  background: rgba(255, 215, 2, 0.34);
  color: rgba(23, 25, 29, 0.76);
  font-size: 0.74rem;
  font-weight: 760;
}

.app-body {
  display: grid;
  grid-template-columns: 15rem 1fr;
  min-height: min(66vh, 42rem);
}

.sidebar {
  border-right: 1px solid rgba(23, 25, 29, 0.08);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.48);
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
}

.avatar {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--yellow);
  font-weight: 850;
}

.profile-chip strong,
.profile-chip small {
  display: block;
}

.profile-chip small {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.nav-item {
  display: block;
  width: 100%;
  margin: 0.22rem 0;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0.72rem;
  padding: 0.72rem 0.8rem;
  background: transparent;
  color: rgba(23, 25, 29, 0.62);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  transition:
    background 220ms ease,
    color 220ms ease,
    border-color 220ms ease;
}

.nav-item:hover {
  background: rgba(255, 215, 2, 0.18);
  color: var(--ink);
}

.nav-item.active {
  background: rgba(255, 215, 2, 0.28);
  border-left-color: var(--yellow);
  color: var(--ink);
  font-weight: 760;
}

.workspace {
  position: relative;
  min-height: 0;
  padding: clamp(1.2rem, 2.4vw, 2rem);
}

.view {
  display: none;
  animation: viewIn 360ms cubic-bezier(0.22, 1, 0.36, 1);
}

.view.active {
  display: block;
}

@keyframes viewIn {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}

/* Stagger entrance for view children — only when demo stage is visible */
.landing.is-demo .view.active .stagger-item {
  animation: staggerIn 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.view.active .stagger-item:nth-child(1) { animation-delay: 60ms; }
.view.active .stagger-item:nth-child(2) { animation-delay: 120ms; }
.view.active .stagger-item:nth-child(3) { animation-delay: 180ms; }
.view.active .stagger-item:nth-child(4) { animation-delay: 240ms; }
.view.active .stagger-item:nth-child(5) { animation-delay: 300ms; }
.view.active .stagger-item:nth-child(6) { animation-delay: 360ms; }

@keyframes staggerIn {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.view-header p {
  margin: 0 0 0.55rem;
  color: rgba(23, 25, 29, 0.48);
  font-size: 0.82rem;
  font-weight: 820;
  letter-spacing: 0.14em;
}

.view-header h2 {
  width: min(100%, 48rem);
  margin: 0 0 1.35rem;
  font-size: clamp(1.35rem, 2.4vw, 2.45rem);
  line-height: 1.12;
  letter-spacing: -0.06em;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric-grid article,
.record-list article,
.report-card,
.api-card {
  border: 1px solid rgba(23, 25, 29, 0.08);
  border-radius: 1.05rem;
  background: rgba(255, 255, 255, 0.64);
}

.metric-grid article {
  padding: 1rem;
}

.metric-grid small,
.metric-grid span,
.record-list small,
.api-card p {
  color: var(--muted);
}

.metric-grid strong {
  display: block;
  margin: 0.55rem 0 0.15rem;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.timeline-strip {
  display: flex;
  gap: 0.28rem;
  height: 3.1rem;
  margin: 1rem 0;
}

.timeline-strip span {
  width: var(--w);
  border-radius: 0.65rem;
  background: var(--c);
}

.record-list {
  display: grid;
  gap: 0.72rem;
}

.record-list.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.record-list article {
  display: grid;
  gap: 0.38rem;
  padding: 0.95rem;
}

.record-list time {
  color: rgba(23, 25, 29, 0.46);
  font-size: 0.78rem;
  font-weight: 760;
}

.report-card,
.api-card {
  max-width: 48rem;
  padding: 1.4rem;
}

.report-card h3 {
  margin: 0 0 0.8rem;
  font-size: 1.4rem;
}

.report-card p,
.report-card li,
.api-card p {
  line-height: 1.8;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.55rem;
  width: min(100%, 35rem);
}

.heatmap-grid span {
  aspect-ratio: 1;
  border-radius: 0.5rem;
  background: rgba(23, 25, 29, 0.06);
}

.heatmap-grid .l1 {
  background: rgba(255, 215, 2, 0.24);
}

.heatmap-grid .l2 {
  background: rgba(255, 215, 2, 0.48);
}

.heatmap-grid .l3 {
  background: rgba(255, 215, 2, 0.72);
}

.heatmap-grid .l4 {
  background: rgba(255, 215, 2, 1);
}

.usage-bars {
  display: grid;
  gap: 1rem;
  max-width: 48rem;
}

.usage-bars div {
  display: grid;
  grid-template-columns: 7rem 1fr 5rem;
  align-items: center;
  gap: 0.9rem;
}

.usage-bars i {
  height: 0.82rem;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--yellow) var(--w), rgba(23, 25, 29, 0.08) var(--w));
}

.usage-bars b {
  text-align: right;
}

.api-card code {
  display: block;
  margin: 0.6rem 0;
  border-radius: 0.7rem;
  padding: 0.85rem;
  background: rgba(23, 25, 29, 0.88);
  color: rgba(255, 255, 255, 0.86);
}

/* back-hint: styles now merged above with scroll-hint */

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .landing,
  .landing[data-stage="demo"] {
    height: auto;
    transform: none;
  }

  .hero-section,
  .demo-section {
    min-height: 100vh;
    height: auto;
  }

  .hero-copy {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    transform: none;
    padding: 8rem 1.25rem 2rem;
  }

  .download-panel {
    position: relative;
    left: auto;
    bottom: auto;
    transform: none;
    margin: 1.4rem auto 4rem;
  }

  .demo-shell,
  .landing[data-stage="demo"] .demo-shell {
    position: relative;
    left: auto;
    bottom: auto;
    width: calc(100% - 1.5rem);
    margin: 0.75rem auto 4rem;
    transform: none;
    opacity: 1;
    filter: saturate(1);
  }

  .app-body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: flex;
    overflow-x: auto;
    gap: 0.4rem;
    border-right: 0;
    border-bottom: 1px solid rgba(23, 25, 29, 0.08);
  }

  .profile-chip {
    min-width: 9rem;
    margin: 0;
  }

  .nav-item {
    white-space: nowrap;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 0.55rem 0.8rem;
  }

  .nav-item.active {
    border-bottom-color: var(--yellow);
  }

  .metric-grid,
  .record-list.compact {
    grid-template-columns: 1fr;
  }

  .scroll-hint,
  .back-hint {
    display: none;
  }

  .scroll-progress {
    display: none;
  }

  /* Reset hero / panel transitions on mobile (normal flow) */
  .hero-copy,
  .landing[data-stage="demo"] .hero-copy {
    transform: none;
    opacity: 1;
  }

  .download-panel,
  .landing[data-stage="demo"] .download-panel {
    transform: none;
    opacity: 1;
  }
}
