/* HabiFit native CSS. Redesign preserve; variance 6, motion 4, density 3.
   Existing grey/charcoal/green tokens; 12px controls, 24px screenshot surfaces. */
:root {
  color-scheme: light dark;
  --bg: #f7f8f5;
  --ink: #1c211e;
  --muted: #59635b;
  --green: #18794e;
  --line: #d8dfd6;
  --surface: #edf1eb;
  --focus: #126b43;
  --on-green: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151a17;
    --ink: #f2f5f0;
    --muted: #b5c0b5;
    --green: #75d6a5;
    --line: #3d4940;
    --surface: #222b25;
    --focus: #a0edbf;
    --on-green: #10291b;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}
button:disabled {
  cursor: default;
}
h1,
h2,
h3,
p,
figure {
  margin: 0;
}
h1,
h2 {
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.06;
}
.wrap {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
}
.header {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-size: 24px;
  font-weight: 650;
  letter-spacing: -1px;
  display: inline-flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--ink);
  color: var(--bg);
  font-size: 19px;
  display: grid;
  place-items: center;
}
.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}
.nav > a:not(.button) {
  text-decoration: none;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--green);
  color: var(--on-green);
  text-decoration: none;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}
.button:active {
  transform: translateY(1px);
}
.hero {
  padding-block: 48px 56px;
}
.hero h1 {
  font-size: clamp(42px, 5.2vw, 68px);
  text-wrap: balance;
}
.hero p {
  margin-top: 22px;
  max-width: 42ch;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.5;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 26px;
}

/* Keep Chinese glyphs relaxed within the same compact bilingual composition. */
:lang(zh-CN) body {
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    sans-serif;
}
:lang(zh-CN) h1,
:lang(zh-CN) h2,
:lang(zh-CN) .scene h3 {
  letter-spacing: -0.025em;
}
:lang(zh-CN) .hero p {
  max-width: 34em;
}
:lang(zh-CN) .hero h1 span {
  display: inline-block;
}
:lang(zh-CN) .scene h3 {
  line-height: 1.35;
  font-size: 30px;
}
:lang(zh-CN) .scene h3 span {
  display: block;
}
:lang(zh-CN) .download-content h2 {
  max-width: none;
}

/* Headline, controls and screenshots share one compact editorial composition. */
.overview {
  position: relative;
  padding-block: 36px 32px;
  border-top: 1px solid var(--line);
}
.panels {
  min-height: 620px;
}
.scene {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(0, 2.4fr);
  align-items: center;
  gap: 36px;
  min-height: 620px;
}
.scene[hidden] {
  display: none;
}
.scene h3 {
  margin: 0 0 48px;
  font-size: 38px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.collage {
  display: flex;
  align-items: start;
  justify-content: center;
  gap: 22px;
  padding-block: 12px 32px;
}
.collage figure {
  min-width: 0;
  flex: 0 1 246px;
}
.collage-log figure:nth-child(1) {
  margin-top: 54px;
}
.collage-log figure:nth-child(2) {
  margin-top: 0;
}
.collage-log figure:nth-child(3) {
  margin-top: 86px;
}
.collage-plan figure:nth-child(1) {
  margin-top: 32px;
}
.collage-plan figure:nth-child(2) {
  margin-top: 86px;
}
.collage-review figure:nth-child(1) {
  margin-top: 48px;
}
.collage-review figure:nth-child(3) {
  margin-top: 86px;
}
.screen-link {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 18px 38px rgb(41 66 47 / 0.09);
  background: var(--surface);
  transition:
    transform 240ms ease,
    box-shadow 240ms ease;
}
.screen-link img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 480 / 1044;
  object-fit: contain;
}
.screen-link:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 44px rgb(41 66 47 / 0.13);
}
.viewer-open {
  overflow: hidden;
  scrollbar-gutter: auto;
}
.viewer-open body {
  padding-right: var(--viewer-scrollbar, 0px);
}
.image-viewer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: calc(64px + env(safe-area-inset-top))
    max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom))
    max(20px, env(safe-area-inset-left));
  background: #101411;
  color: #fff;
  overscroll-behavior: contain;
}
.image-viewer[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.image-viewer::backdrop {
  background: #101411;
}
.image-viewer > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.viewer-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #56635a;
  border-radius: 12px;
  background: #26302a;
  color: #fff;
  font-size: 30px;
  line-height: 1;
}
.viewer-close:hover {
  background: #37453c;
}
.viewer-close:focus-visible {
  outline-color: #a0edbf;
}
.enhanced .scene {
  animation: scene-in 300ms ease both;
}
.enhanced .scene figure {
  animation: screen-in 450ms ease both;
  animation-delay: calc(var(--order) * 40ms);
}
@keyframes scene-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.tour-controls {
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 8px;
  position: absolute;
  left: 0;
  top: calc(50% + 64px);
}
.tour-controls[hidden] {
  display: none;
}
.scene-dots {
  display: flex;
  align-items: center;
}
.tour-controls button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  padding: 0;
  background: none;
  border-radius: 12px;
  color: var(--muted);
}
.scene-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0.42;
  transition:
    width 240ms,
    opacity 240ms;
}
.scene-dots [aria-current="true"] span {
  width: 18px;
  border-radius: 4px;
  background: var(--green);
  opacity: 1;
}
.tour-controls .playback {
  font-size: 15px;
}
.tour-controls button:hover {
  background: var(--surface);
}
.closing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 7vw, 100px);
  padding-block: 52px 42px;
  border-top: 1px solid var(--line);
}
.closing h2 {
  font-size: 38px;
}
.download-options {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-top: 24px;
}
.download-content h2 {
  max-width: 12ch;
}
.download-content > p {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
}
.store-badge {
  display: block;
  width: 164px;
  flex-shrink: 0;
}
.store-badge img {
  display: block;
  width: 100%;
  height: auto;
}
.qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  text-align: center;
}
.qr img {
  border: 1px solid var(--line);
  border-radius: 10px;
}
.faq h2 {
  font-size: 24px;
  letter-spacing: -0.025em;
  margin-bottom: 16px;
}
.faq details {
  padding-block: 11px;
}
.faq summary {
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  font-size: 18px;
  line-height: 1;
}
.faq details[open] summary::after {
  content: "−";
}
.faq details p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.footer {
  border-top: 1px solid var(--line);
  padding-block: 24px;
}
.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.footer-top .brand {
  font-size: 19px;
}
.footer nav {
  display: flex;
  gap: 24px;
  font-size: 12px;
}
.footer > p,
.credits {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 8px;
}
.credits summary {
  cursor: pointer;
}
.credits p {
  max-width: 850px;
  margin-top: 8px;
}
.skip-link,
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip-link:focus {
  clip-path: none;
  width: auto;
  height: auto;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 10px;
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  .screen-link {
    box-shadow: none;
  }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .panels,
  .scene {
    min-height: 560px;
  }
  .scene {
    gap: 28px;
    grid-template-columns: minmax(200px, 0.9fr) minmax(0, 2.4fr);
  }
  .scene h3 {
    font-size: 34px;
  }
  .collage {
    gap: 18px;
  }
}
@media (min-width: 768px) and (max-width: 999px) {
  .panels,
  .scene {
    min-height: 610px;
  }
  .scene {
    display: block;
  }
  .scene h3 {
    font-size: 32px;
    margin: 0 0 18px;
  }
  .collage {
    padding-block: 0 16px;
  }
  .collage figure {
    flex-basis: 210px;
  }
  .tour-controls {
    position: static;
    justify-content: center;
  }
}
@media (min-width: 1400px) {
  .hero {
    padding-block: 64px 66px;
  }
  .overview {
    padding-top: 36px;
  }
  .closing {
    padding-block: 60px 48px;
  }
}
@media (max-width: 767px) {
  .wrap {
    width: calc(100% - 40px);
  }
  .header {
    height: 68px;
  }
  .brand {
    font-size: 21px;
  }
  .nav {
    gap: 18px;
  }
  .nav > a:nth-child(1) {
    display: none;
  }
  .hero {
    padding-block: 36px 38px;
  }
  .hero h1 {
    font-size: 43px;
  }
  .hero p {
    font-size: 16px;
    margin-top: 18px;
    max-width: 330px;
  }
  .hero-actions {
    margin-top: 24px;
    gap: 22px;
  }
  .button {
    padding: 12px 20px;
  }
  .overview {
    padding-block: 26px 24px;
  }
  .panels {
    min-height: 620px;
  }
  .scene {
    display: block;
    min-height: 620px;
  }
  .scene h3 {
    font-size: 29px;
    max-width: 330px;
    min-height: 67px;
    margin: 0;
  }
  .collage {
    display: flex;
    justify-content: start;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 12px;
    gap: 22px;
    padding: 24px 12px 28px;
    margin-inline: -12px;
  }
  .collage figure {
    flex: 0 0 218px;
    scroll-snap-align: center;
  }
  .collage figure:nth-child(n) {
    margin-top: 0;
  }
  .screen-link {
    border-radius: 24px;
  }
  .tour-controls {
    position: static;
    justify-content: center;
  }
  .closing {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-block: 32px 28px;
  }
  .closing h2 {
    font-size: 32px;
  }
  .download-options {
    gap: 32px;
    margin-top: 18px;
  }
  .download-copy h2 {
    font-size: 29px;
  }
  .download-content > p {
    font-size: 13px;
    margin-top: 10px;
  }
  .store-badge {
    width: 144px;
  }
  .qr {
    font-size: 10px;
    gap: 8px;
  }
  .qr img {
    width: 96px;
    height: 96px;
    display: block;
    margin: 0;
  }
  .faq h2 {
    font-size: 23px;
  }
  .faq details {
    padding-block: 9px;
  }
  .faq summary {
    font-size: 13px;
  }
  .footer {
    padding-block: 20px;
  }
  .footer-top {
    gap: 16px;
  }
  .footer nav {
    gap: 16px;
    font-size: 11px;
  }
  .footer > p,
  .credits {
    font-size: 9px;
  }
}
@media (max-width: 359px) {
  .hero h1 {
    font-size: 37px;
  }
  .hero-actions {
    gap: 16px;
  }
  .scene h3 {
    font-size: 26px;
  }
  .download-options {
    gap: 20px;
  }
  .download-copy h2 {
    font-size: 25px;
  }
  .footer nav {
    gap: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
