html[data-theme-page="home"][data-theme][data-design-direction] {
  --home-paper: #fafaf7; --home-surface: #f0f2ec; --home-ink: #20231f;
  --home-muted: #686e65; --home-line: #dee2da; --home-accent: #304a3c;
  --home-font: "Avenir Next", "PingFang SC", sans-serif;
  body { font-family: var(--home-font); }

  body:has(#homePanel:not([hidden])) {
    header { max-width: 1440px; min-height: 100px; padding-block: 20px; gap: 24px; }
    header h1 { width: 150px; height: 58px; }
    .brand-typeset { display: none; }
    .brand-wordmark[data-theme-logo="light"] { display: block !important; object-fit: contain; }
    .brand-wordmark[data-theme-logo="dark"] { display: none !important; }
    .header-builder-link { font-size: 14px; }
    .theme-toggle, #guideBtn { border: 0; background: transparent; min-height: 44px; min-width: 44px; font-size: 13px; }
  }
  .home-panel { max-width: 1240px; }
  .home-edition-bar { min-height: 36px; border: 0; justify-content: flex-end; }
  .home-preferences > summary { font-size: 12px; min-height: 36px; }
  .home-hero { gap: 80px; grid-template-columns: minmax(0,1fr) minmax(0,.96fr); padding: 46px 0 68px; align-items: center; }
  .home-hero-copy { justify-content: flex-start; }
  .home-eyebrow { display: none; }
  .home-title { font-family: var(--home-font); font-size: clamp(40px,4.2vw,60px); line-height: 1.16; font-weight: 500; letter-spacing: -.04em; }
  &[data-display-language*="chinese"] .home-title { font-size: clamp(36px,3.7vw,54px); line-height: 1.28; letter-spacing: -.025em; }
  .home-intro { font-size: 16px; line-height: 1.85; max-width: 450px; margin-top: 22px; }
  .home-search {
    margin-top: 34px; background: white; border: 1px solid #b6c2b5; border-radius: 14px; padding: 7px 7px 7px 16px;
    grid-template-columns: 24px minmax(0,1fr) auto; min-height: 72px;
    button { grid-column: 3; background: #304a3c; color: white; border-radius: 9px; min-height: 54px; padding-inline: 20px; font-size: 14px; }
    textarea { font-size: 15px; min-height: 54px; }
  }
  .home-primary-actions { gap: 14px 24px; margin-top: 16px; }
  .home-primary:not(.listening) {
    display: inline-flex; align-items: center; gap: 10px; justify-content: center;
    min-height: 54px; padding: 12px 24px; border: 1px solid #b6c2b5;
    border-radius: 12px; color: #304a3c; background: #eef2eb; font-size: 15px;
    &:hover { background: #e2eadf; text-decoration: none; }
  }
  .home-primary::before {
    content: ""; width: 18px; height: 23px; margin: 0; border-radius: 0; background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='9' y='2' width='6' height='13' rx='3'/%3E%3Cpath d='M5 11v1a7 7 0 0014 0v-1M12 19v3M8 22h8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  }
  .home-secondary:not(.listening) { min-height: 54px; font-size: 14px; color: var(--home-muted); }
  .home-builder-entry { display: none; }
  .home-privacy-note { font-size: 12px; margin-top: 17px; max-width: 450px; line-height: 1.75; }
  .home-hero-figure { width: 100%; margin: 0; position: relative; }
  .home-hero-figure picture { display: block; }
  .home-hero-figure img { border-radius: 3px; }
  .home-mascot-note { margin: 15px auto 0; font-size: 12px; line-height: 1.65; text-align: center; max-width: 430px; }
  .home-samples { border: 0; padding: 24px 28px; border-radius: 16px; background: var(--home-surface); gap: 16px 44px; }
  .home-sample { padding: 0; }
  .home-sample-label { font-size: 12px; text-transform: none; letter-spacing: 0; margin-bottom: 2px; }
  .home-sample strong { font-family: var(--home-font); font-size: 24px; font-weight: 500; }
  .home-sample-action { font-size: 12px; }
  .home-sample-meta { font-size: 13px; }
  .home-doorway-invite { display: none; }

}
@media (max-width:760px) {
  html[data-theme-page="home"][data-theme][data-design-direction] {
    body:has(#homePanel:not([hidden])) header { padding: 14px 22px 0; min-height: 84px; gap: 14px; }
    body:has(#homePanel:not([hidden])) header h1 { width: 130px; height: 50px; }
    body:has(#homePanel:not([hidden])) .header-builder-link { display: inline-flex; font-size: 12px; }
    body:has(#homePanel:not([hidden])) #guideBtn { display: inline-flex; }
    .home-edition-bar { margin-top: 3px; }
    .home-hero { padding: 28px 0 32px; grid-template-columns: minmax(0,1fr); gap: 30px; }
    .home-title, &[data-display-language*="chinese"] .home-title { font-size: calc(35px * var(--app-font-scale)); }
    .home-intro { font-size: 15px; line-height: 1.8; margin-top: 18px; }
    .home-search { margin-top: 26px; button { padding-inline: 14px; } textarea { font-size: 16px; } }
    .home-primary-actions { gap: 12px; }
    .home-primary:not(.listening) { flex: 1; padding-inline: 14px; }
    .home-secondary:not(.listening) { font-size: 13px; }
    .home-privacy-note { font-size: 11px; }
    .home-samples { padding: 24px; gap: 22px; }
    .home-sample + .home-sample { padding-top: 22px; }
    .home-mascot-note { font-size: 11px; }
  }
}
html[data-theme-page="home"][data-theme="dark"][data-design-direction] {
  --home-paper: #151c17; --home-surface: #202a22; --home-ink: #f1f4ed; --home-muted: #b1bcae; --home-line: #374637; --home-accent: #a6b998;
  .home-search { background: #202a22; button { background: #d6e3cb; color: #203426; } }
  .home-primary:not(.listening) { background: #26392b; color: #e5eadf; }
}



/* Owner-selected direction: preserve the existing artwork and logo;
   simplify the surrounding controls without introducing a new green identity. */
html[data-theme-page="home"][data-theme][data-design-direction="c"] {
 --home-paper: #faf9f6; --home-surface: #f1eeea; --home-ink: #30292e;
 --home-muted: #6b625d; --home-line: #ded8d0; --home-accent: #795112;
 .home-title { font-family: var(--home-font); font-weight: 500; letter-spacing: -.025em; }
 .home-search { border-color: #cabca6; background: #fffefb; }
 .home-search button { background: #795112; color: #fffdf8; }
 .home-primary:not(.listening) { background: #f3eadb; border-color: #d1bea0; color: #67471b; }
 .home-primary:not(.listening):hover { background: #eadcc4; }
 .home-samples { background: transparent; border-radius: 0; border-top: 1px solid #ded8d0; padding-inline: 0; }
 .home-sample strong { font-family: var(--home-font); }
 .home-hero-figure img { border-radius: 3px; }
}
html[data-theme-page="home"][data-theme="dark"][data-design-direction="c"] {
 --home-paper: #171417; --home-surface: #211c22; --home-ink: #eee8e0;
 --home-muted: #b2a89d; --home-line: #493e41; --home-accent: #d2ad75;
 .home-search { background: #211c22; border-color: #6c5945; }
 .home-search button { background: #d2ad75; color: #211b16; }
 .home-primary:not(.listening) { background: #30261d; color: #e0c39b; border-color: #6c5945; }
 body:has(#homePanel:not([hidden])) .brand-wordmark[data-theme-logo="dark"] { display: block !important; }
 body:has(#homePanel:not([hidden])) .brand-wordmark[data-theme-logo="light"] { display: none !important; }
}

html[data-theme-page="home"][data-theme][data-design-direction="c"] {
 .home-hero { grid-template-columns: minmax(0, 760px); justify-content: center; padding-top: 24px; }
 .home-hero-copy { max-width: 760px; }
 .home-intro { max-width: 640px; }
 .home-builder-entry { display: grid; flex: 1 0 100%; margin-top: 12px; }
 .home-doorway-invite { display: grid; }
 .home-closing-art { display: block; width: min(100%,640px); margin: 64px auto 0; }
 .home-closing-art picture { height: auto; }
 .home-closing-art img { height: auto; object-fit: contain; }
 .home-sample { grid-template-columns: 52px minmax(0,1fr) auto; column-gap: 16px; }
 .sample-entry-symbol { grid-column: 1; grid-row: 1 / 4; width: 44px; height: 44px; align-self: center; position: relative; border: 1.5px solid currentColor; border-radius: 50%; color: var(--home-accent); }
 #homeSampleBtn .sample-entry-symbol { background: repeating-radial-gradient(circle,transparent 0 5px,currentColor 5px 6px,transparent 6px 9px); }
 #homeCollaborationSampleBtn .sample-entry-symbol { border: 0; border-radius: 0; background: linear-gradient(currentColor,currentColor) center/25px 1px no-repeat; }
 #homeCollaborationSampleBtn .sample-entry-symbol::before, #homeCollaborationSampleBtn .sample-entry-symbol::after { content: ""; position: absolute; width: 17px; height: 17px; border: 1.5px solid currentColor; border-radius: 50%; top: 12px; background: var(--home-paper); }
 #homeCollaborationSampleBtn .sample-entry-symbol::before { left: 0; }
 #homeCollaborationSampleBtn .sample-entry-symbol::after { right: 0; }
 .home-sample-label { grid-column: 2 / -1; }
 .home-sample strong { grid-column: 2; }
 .home-sample-meta { grid-column: 2 / -1; }
 .home-sample-action { grid-column: 3; }
 .home-playlist-platform { display: inline-flex; align-items: center; gap: 8px; }
 .home-playlist-platform::before { content: ""; width: 22px; height: 22px; display: inline-block; background: currentColor; }
 .home-playlist-platform.spotify::before { border-radius: 50%; }
 .home-playlist-platform.youtube::before { clip-path: polygon(20% 10%,90% 50%,20% 90%); }
 .home-playlist-platform.live::before { border-radius: 50%; width: 12px; height: 12px; }
}
@media(max-width:760px) {
 html[data-theme-page="home"][data-theme][data-design-direction="c"] {
  .home-sample { grid-template-columns: 40px minmax(0,1fr); }
  .sample-entry-symbol { width: 34px; height: 34px; }
  .home-sample-action { grid-column: 2; grid-row: 4; }
  .home-closing-art { margin-top: 40px; }
 }
}

/* Tanda Builder belongs with the other illustrated home features. */
html[data-theme-page="home"][data-theme][data-design-direction="c"] body:has(#homePanel:not([hidden])) #headerTandaBuilderLink,
html[data-theme-page="home"][data-theme][data-design-direction="c"] #homeTandaBuilderLink { display: none; }

html[data-theme-page="home"][data-theme][data-design-direction="c"] #homeTandaMateBtn {
 grid-column: 1 / -1; display: grid; grid-template-columns: 88px minmax(0,1fr) minmax(0,1fr); grid-template-rows: auto auto 1fr; gap: 10px 28px; align-items: start; padding: 30px 0;
 .tanda-builder-mark { grid-column: 1; grid-row: 1 / 4; color: var(--home-accent); align-self: center; }
 .tanda-builder-mark svg { display: block; width: 88px; height: 88px; }
 .home-journey-kicker { grid-column: 2; grid-row: 1; margin: 0; }
 .home-journey-title { grid-column: 2; grid-row: 2; font-size: 20px; }
 .home-journey-copy { grid-column: 2; grid-row: 3; margin: 0; }
 .home-journey-visual { grid-column: 3; grid-row: 1 / 4; width: 100%; align-self: center; }
}
@media(max-width:760px) {
 html[data-theme-page="home"][data-theme][data-design-direction="c"] #homeTandaMateBtn {
  grid-template-columns: 58px minmax(0,1fr); gap: 12px 18px;
  .tanda-builder-mark { grid-row: 1 / 3; }
  .tanda-builder-mark svg { width: 58px; height: 58px; }
  .home-journey-copy { grid-column: 1 / -1; }
  .home-journey-visual { grid-column: 1 / -1; grid-row: 4; }
 }
}

/* Keep the paired desktop previews level even when their content heights differ. */
@media (min-width: 761px) {
 html[data-theme-page="home"][data-theme][data-design-direction="c"] {
  #homeLibraryBtn .home-journey-visual,
  #homeLyricsBtn .home-journey-visual { flex: 1; margin-top: 0; }
  #homeLyricsBtn .home-reading-preview { grid-template-rows: 1fr auto; }
 }
}
