/* 众乐乐 Jamhaus — public product site
   Brand colors from the official 1024 app icon:
   navy #0d1222, speaker blue #4fc3f7, host gold #ffc857, cream #f7f3ea
   Display face: self-hosted subset of Noto Serif CJK Bold (SIL OFL 1.1).
*/
@font-face {
  font-family: "Jamhaus Serif";
  src: url("/fonts/NotoSerifCJK-Bold-subset.woff2?v=20261126d") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy: #0d1222;
  --navy-2: #12182b;
  --ink: #070a14;
  --blue: #4fc3f7;
  --blue-deep: #2aa4e0;
  --gold: #ffc857;
  --gold-2: #ffe09a;
  --cream: #f7f3ea;
  --text: #eef1f8;
  --muted: #9aa3b8;
  --faint: #6d768c;
  --hairline: rgba(247, 243, 234, 0.14);
  --stroke: rgba(247, 243, 234, 0.14);
  --stroke-strong: rgba(255, 200, 87, 0.35);
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.45);
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Noto Sans JP",
    "Noto Sans CJK SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-display: "Jamhaus Serif", "Songti SC", "STSong", "Songti TC", "PMingLiU",
    "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif CJK SC", Georgia, serif;
  --max: 1180px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--navy);
  color: var(--text);
}

html[lang="ja"] { --font-sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "PingFang SC", system-ui, sans-serif; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(13, 18, 34, 0), rgba(0, 0, 0, 0.35) 70%),
    radial-gradient(800px 520px at 85% 0%, rgba(79, 195, 247, 0.08), transparent 58%),
    radial-gradient(640px 480px at 0% 30%, rgba(255, 200, 87, 0.06), transparent 55%),
    var(--navy);
  min-height: 100%;
}

body::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 8;
  opacity: 0.045;
  background-image: url("/assets/grain.png");
  background-size: 128px 128px;
  mix-blend-mode: overlay;
}

img { max-width: 100%; height: auto; border: 0; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--gold-2); }
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

h1, h2, h3,
.brand span,
.step-num,
.page-hero h1,
.not-found h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-synthesis: none;
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  background: var(--gold);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 4px;
  z-index: 100;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip:focus, .skip:focus-visible {
  clip: auto;
  clip-path: none;
  width: auto;
  height: auto;
  overflow: visible;
}

/* Language visibility: all locales live in the DOM; html[lang] reveals one. */
[data-l] { display: none !important; }
html[lang="zh-Hans"] [data-l~="zh-Hans"],
html[lang="zh-Hant"] [data-l~="zh-Hant"],
html[lang="en"] [data-l~="en"],
html[lang="ja"] [data-l~="ja"] { display: inline !important; }

p[data-l],
h1[data-l],
h2[data-l],
h3[data-l],
li[data-l],
div[data-l],
section[data-l],
figcaption[data-l],
ul[data-l],
header[data-l],
footer[data-l],
article[data-l] { display: none !important; }

html[lang="zh-Hans"] p[data-l~="zh-Hans"],
html[lang="zh-Hans"] h1[data-l~="zh-Hans"],
html[lang="zh-Hans"] h2[data-l~="zh-Hans"],
html[lang="zh-Hans"] h3[data-l~="zh-Hans"],
html[lang="zh-Hans"] li[data-l~="zh-Hans"],
html[lang="zh-Hans"] div[data-l~="zh-Hans"],
html[lang="zh-Hans"] section[data-l~="zh-Hans"],
html[lang="zh-Hans"] figcaption[data-l~="zh-Hans"],
html[lang="zh-Hans"] ul[data-l~="zh-Hans"],
html[lang="zh-Hans"] article[data-l~="zh-Hans"],
html[lang="zh-Hant"] p[data-l~="zh-Hant"],
html[lang="zh-Hant"] h1[data-l~="zh-Hant"],
html[lang="zh-Hant"] h2[data-l~="zh-Hant"],
html[lang="zh-Hant"] h3[data-l~="zh-Hant"],
html[lang="zh-Hant"] li[data-l~="zh-Hant"],
html[lang="zh-Hant"] div[data-l~="zh-Hant"],
html[lang="zh-Hant"] section[data-l~="zh-Hant"],
html[lang="zh-Hant"] figcaption[data-l~="zh-Hant"],
html[lang="zh-Hant"] ul[data-l~="zh-Hant"],
html[lang="zh-Hant"] article[data-l~="zh-Hant"],
html[lang="en"] p[data-l~="en"],
html[lang="en"] h1[data-l~="en"],
html[lang="en"] h2[data-l~="en"],
html[lang="en"] h3[data-l~="en"],
html[lang="en"] li[data-l~="en"],
html[lang="en"] div[data-l~="en"],
html[lang="en"] section[data-l~="en"],
html[lang="en"] figcaption[data-l~="en"],
html[lang="en"] ul[data-l~="en"],
html[lang="en"] article[data-l~="en"],
html[lang="ja"] p[data-l~="ja"],
html[lang="ja"] h1[data-l~="ja"],
html[lang="ja"] h2[data-l~="ja"],
html[lang="ja"] h3[data-l~="ja"],
html[lang="ja"] li[data-l~="ja"],
html[lang="ja"] div[data-l~="ja"],
html[lang="ja"] section[data-l~="ja"],
html[lang="ja"] figcaption[data-l~="ja"],
html[lang="ja"] ul[data-l~="ja"],
html[lang="ja"] article[data-l~="ja"] { display: block !important; }

html[lang="zh-Hans"] li[data-l~="zh-Hans"],
html[lang="zh-Hant"] li[data-l~="zh-Hant"],
html[lang="en"] li[data-l~="en"],
html[lang="ja"] li[data-l~="ja"] { display: list-item !important; }

img[data-l],
picture[data-l],
source[data-l],
a.badge[data-l] { display: none !important; }

html[lang="zh-Hans"] img[data-l~="zh-Hans"],
html[lang="zh-Hant"] img[data-l~="zh-Hant"],
html[lang="en"] img[data-l~="en"],
html[lang="ja"] img[data-l~="ja"] { display: block !important; }

html[lang="zh-Hans"] a.badge[data-l~="zh-Hans"],
html[lang="zh-Hant"] a.badge[data-l~="zh-Hant"],
html[lang="en"] a.badge[data-l~="en"],
html[lang="ja"] a.badge[data-l~="ja"] { display: inline-flex !important; }

html[lang="zh-Hans"] picture[data-l~="zh-Hans"],
html[lang="zh-Hant"] picture[data-l~="zh-Hant"],
html[lang="en"] picture[data-l~="en"],
html[lang="ja"] picture[data-l~="ja"] { display: block !important; }

html[lang="zh-Hans"] div.gallery[data-l~="zh-Hans"],
html[lang="zh-Hant"] div.gallery[data-l~="zh-Hant"],
html[lang="en"] div.gallery[data-l~="en"],
html[lang="ja"] div.gallery[data-l~="ja"] { display: grid !important; }

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(18px) saturate(1.15);
  background: rgba(13, 18, 34, 0.82);
  border-bottom: 1px solid var(--hairline);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  width: min(var(--max), calc(100% - 40px));
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
  min-width: 0;
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
}
.brand span {
  font-size: 17px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px 20px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.nav a:hover { color: var(--cream); }

.lang-switch {
  display: flex;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--faint);
  font: inherit;
  font-size: 12px;
  padding: 6px 7px;
  cursor: pointer;
  line-height: 1.2;
  border-bottom: 1px solid transparent;
}
.lang-switch button:hover { color: var(--cream); }
html[lang="zh-Hans"] .lang-switch button[data-set-lang="zh-Hans"],
html[lang="zh-Hant"] .lang-switch button[data-set-lang="zh-Hant"],
html[lang="en"] .lang-switch button[data-set-lang="en"],
html[lang="ja"] .lang-switch button[data-set-lang="ja"] {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: 650;
  background: transparent;
}

/* Hero — typography-led, one composed frame */
.hero {
  position: relative;
  overflow: hidden;
  padding: 88px 0 96px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 {
  font-size: clamp(34px, 5.6vw, 72px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  margin: 0 0 28px;
  color: var(--cream);
  max-width: 8.2em;
}
html[lang="en"] .hero h1 { max-width: 10em; }
html[lang="ja"] .hero h1 { max-width: 11em; font-size: clamp(30px, 4.8vw, 62px); }
.hero .lede {
  font-size: 18px;
  color: var(--muted);
  max-width: 34em;
  margin: 0 0 36px;
  line-height: 1.8;
}
.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
a.badge img {
  height: 52px;
  width: auto;
  display: block;
}
.mac-note {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}
.mac-note strong { color: var(--gold-2); font-weight: 650; }

.hero-art {
  position: relative;
  min-height: 0;
}
.constellation {
  position: absolute;
  inset: -12% -18% auto -18%;
  width: 130%;
  height: 130%;
  pointer-events: none;
  opacity: 0.28;
}
.shots {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.shot {
  position: relative;
  width: 62%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,0.06);
  background: #111;
}
.shot img { display: block; width: 100%; }
.shot-a { z-index: 2; }
/* Hide the classic three-device stack; one still is enough in the hero. */
html[lang="zh-Hans"] div.shot-b[data-l],
html[lang="zh-Hans"] div.shot-c[data-l],
html[lang="zh-Hant"] div.shot-b[data-l],
html[lang="zh-Hant"] div.shot-c[data-l],
html[lang="en"] div.shot-b[data-l],
html[lang="en"] div.shot-c[data-l],
html[lang="ja"] div.shot-b[data-l],
html[lang="ja"] div.shot-c[data-l] { display: none !important; }

/* Sections */
section.block {
  padding: 88px 0;
  scroll-margin-top: calc(var(--header-h) + 16px);
}
#scenes { scroll-margin-top: calc(var(--header-h) + 16px); }
section.block + section.block {
  border-top: 1px solid var(--hairline);
}
.section-label {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.04em;
  font-weight: 500;
  margin: 0 0 14px;
  text-transform: none;
}
h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.2;
  margin: 0 0 16px;
  color: var(--cream);
  letter-spacing: -0.035em;
}
.section-intro {
  color: var(--muted);
  max-width: 38em;
  margin: 0 0 48px;
  font-size: 17px;
}

/* Scenes — magazine photo essay */
.scenes-list {
  display: flex;
  flex-direction: column;
  gap: 88px;
}
.scene {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr;
  gap: 28px 56px;
  align-items: center;
}
.scene:nth-child(even) { grid-template-columns: 0.7fr 1.4fr; }
.scene:nth-child(even) .scene-photo { order: 2; }
.scene:nth-child(even) .scene-copy { order: 1; }
.scene-photo picture,
.scene-photo img {
  display: block;
  width: 100%;
  height: auto;
}
.scene-photo img {
  border-radius: 2px;
  box-shadow: var(--shadow);
  object-fit: cover;
  background: #111;
}
.scene-copy h3 {
  margin: 0 0 16px;
  font-size: clamp(26px, 2.8vw, 36px);
  line-height: 1.2;
  color: var(--cream);
  letter-spacing: -0.03em;
}
.scene-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 16.5px;
  line-height: 1.85;
}

/* How it works — typographic numbers, hairlines */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 48px;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}
.steps li {
  background: none;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  padding: 24px 0 0;
  min-height: 0;
}
.step-num {
  display: block;
  width: auto;
  height: auto;
  border: 0;
  background: none;
  border-radius: 0;
  color: var(--gold);
  font-size: clamp(36px, 4vw, 52px);
  line-height: 1;
  letter-spacing: -0.05em;
  margin: 0 0 18px;
  box-shadow: none;
}
.steps h3 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--cream);
}
.steps p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.75; }

/* Features — two-column editorial list */
.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--hairline);
}
.feature {
  background: none;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--hairline);
  padding: 28px 36px 32px 0;
}
.feature:nth-child(even) { padding-left: 36px; padding-right: 0; }
.feature h3 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -0.03em;
  color: var(--cream);
}
.feature p { margin: 0; color: var(--muted); font-size: 15.5px; line-height: 1.75; }

/* Look — one featured frame + a quieter strip */
.gallery {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 16px 18px;
  align-items: start;
}
.gallery figure {
  margin: 0;
  background: none;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}
.gallery figure:first-child { grid-row: span 2; }
.gallery img {
  display: block;
  width: 100%;
  border-radius: 2px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.gallery figcaption {
  padding: 10px 2px 0;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--faint);
}

/* Mac — screenshot sits on the dark page, no light bezel */
.mac-panel {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 48px;
  align-items: center;
}
.mac-frame {
  background: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
.mac-frame img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
}
.mac-status {
  display: inline-block;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: none;
}

/* Pricing — typographic comparison */
.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 64px;
  border-top: 1px solid var(--hairline);
}
.price-card,
.price-card.full {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 28px 0 0;
}
.price-card.full {
  box-shadow: none;
  padding-left: 0;
}
.price-card h3 {
  margin: 0 0 10px;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
  color: var(--cream);
}
.price-card.full h3 { color: var(--gold-2); }
.price-card p { color: var(--muted); margin: 0 0 18px; }
.price-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--text);
}
.price-card li {
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--hairline);
}
.fine {
  font-size: 13px;
  color: var(--faint);
  margin-top: 28px;
  max-width: 46em;
}

/* Requirements — ruled list */
.req-list {
  display: block;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--hairline);
}
.req-list li {
  padding: 16px 0;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: none;
  color: var(--text);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 48px 0 56px;
  color: var(--muted);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}
.site-footer .brand { margin-bottom: 12px; }
.site-footer h2 {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--faint);
  margin: 0 0 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 6px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { color: var(--gold-2); }
.legal { margin-top: 36px; color: var(--faint); font-size: 13px; }

/* Inner pages */
.page-hero { padding: 56px 0 24px; }
.page-hero h1 {
  font-size: clamp(32px, 4.4vw, 56px);
  letter-spacing: -0.04em;
  color: var(--cream);
  margin: 0 0 12px;
}
.page-hero .lede { color: var(--muted); max-width: 46em; margin: 8px 0 0; }
.prose {
  max-width: 760px;
  padding: 10px 0 80px;
}
.prose h2 {
  font-size: 24px;
  letter-spacing: -0.03em;
  margin: 36px 0 10px;
}
.prose p, .prose li { color: var(--text); }
.prose .meta { color: var(--faint); font-size: 14px; }
.prose a { overflow-wrap: anywhere; }
.card-page {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  padding: 28px 0 8px;
  margin: 0 0 12px;
}

/* 404 */
.not-found { padding: 120px 0 160px; text-align: left; }
.not-found h1 {
  font-size: clamp(36px, 5vw, 64px);
  letter-spacing: -0.04em;
  color: var(--cream);
}

@keyframes orb-pulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; }
}
.constellation .spoke {
  fill: none;
  stroke: rgba(79, 195, 247, 0.28);
  stroke-width: 1;
}
.constellation .dot-blue {
  fill: #4fc3f7;
  opacity: 0.5;
  animation: orb-pulse 7s ease-in-out infinite;
}
.constellation .dot-blue:nth-child(odd) { animation-delay: -2s; }
.constellation .dot-gold { fill: #ffc857; opacity: 0.85; }

@media (max-width: 960px) {
  .hero-grid, .mac-panel, .footer-grid { grid-template-columns: 1fr; }
  .hero-art { min-height: 0; }
  .shots { max-width: 320px; margin: 0 auto; }
  .shot, .shot-a { width: 72%; }
  .steps { gap: 0 28px; }
}

@media (max-width: 860px) {
  .scenes-list { gap: 56px; }
  .scene,
  .scene:nth-child(even) { grid-template-columns: 1fr; }
  .scene .scene-photo,
  .scene:nth-child(even) .scene-photo { order: 0; }
  .scene .scene-copy,
  .scene:nth-child(even) .scene-copy { order: 1; }
  .features { grid-template-columns: 1fr; }
  .feature,
  .feature:nth-child(even) { padding: 24px 0; }
  html[lang="zh-Hans"] div.gallery[data-l~="zh-Hans"],
  html[lang="zh-Hant"] div.gallery[data-l~="zh-Hant"],
  html[lang="en"] div.gallery[data-l~="en"],
  html[lang="ja"] div.gallery[data-l~="ja"] {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px;
    grid-template-columns: none;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .gallery figure {
    flex: 0 0 58%;
    scroll-snap-align: start;
  }
  .gallery figure:first-child {
    grid-row: auto;
    flex-basis: 68%;
  }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .wrap { width: min(var(--max), calc(100% - 32px)); }
  .hero { padding: 44px 0 56px; }
  .hero h1 { max-width: none; }
  section.block { padding: 56px 0; }
  .steps, .price-grid { grid-template-columns: 1fr; }
  .steps li + li { margin-top: 8px; }
  .price-card.full { padding-top: 32px; }
  .shots { max-width: none; }
  .shot, .shot-a { width: 68%; }
  .nav .hide-sm { display: none; }
  .constellation { opacity: 0.2; }
  .site-header { height: auto; padding: 10px 0; }
  .site-header .wrap { flex-wrap: wrap; }
  .lang-switch { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .orb-pulse, .constellation circle { animation: none !important; }
}
