:root {
    --cream: #FFF4DC;
    --cream-deep: #F2DFB0;
    --white: #FFFCEF;
    --ink: #2A1F12;
    --ink-soft: #6B5638;
    --red: #FF5C4B;
    --yellow: #FFC233;
    --blue: #4FB4E8;
    --charcoal: #4A3F35;
    --lime: #7DC95E;
    --green: #5BC97F;
    --orange: #FF8B3D;
    --purple: #B470E8;
    --pink: #FF8FC2;
    --brown: #C87D4A;
    --pip: #8FB94E;
    --pip-dark: #5F8530;
    --pip-face: #FFE89A;
    --shadow-lg: 0 8px 0 var(--ink);
    --shadow-md: 0 6px 0 var(--ink);
    --shadow-sm: 0 4px 0 var(--ink);
    --border-lg: 3px solid var(--ink);
    --max: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--cream);
    color: var(--ink);
    font-family: "Fredoka", system-ui, sans-serif;
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

body {
    margin: 0;
    min-width: 320px;
    background:
        radial-gradient(circle at 12% 34%, rgba(255, 194, 51, 0.2) 0 3px, transparent 4px),
        radial-gradient(circle at 82% 18%, rgba(79, 180, 232, 0.18) 0 4px, transparent 5px),
        var(--cream);
    color: var(--ink);
    font-family: "Fredoka", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
}

/* ZCOOL KuaiLe is Simplified, Huninn (jf-OpenHuninn 粉圆) is Traditional; each leads
   for its own script and backs up the other so a glyph one face lacks (e.g. the 简
   switcher label, absent from Huninn) still renders in a rounded CJK font rather than
   a mismatched system serif. Both are self-hosted (see fonts.css). */
/* Both CJK display faces ship a single weight (400). Headings ask for 600/700,
   so the browser would synthesize bold — doubling strokes on an already-heavy
   rounded face. Disable synthesis so CJK renders at its true weight; Latin runs
   (Fredoka, a real 300–700 variable font) keep their genuine bold. */
:lang(zh-Hans) {
    font-family: "ZCOOL KuaiLe", "Huninn", "Fredoka", system-ui, sans-serif;
    font-synthesis: none;
}

:lang(zh-Hant) {
    font-family: "Huninn", "ZCOOL KuaiLe", "Fredoka", system-ui, sans-serif;
    font-synthesis: none;
}

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

button,
input,
select {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: min(100% - 32px, var(--max));
    min-height: 76px;
    margin: 0 auto;
    padding: 12px 0;
}

.site-header::before {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: -1;
    height: 76px;
    background: rgba(255, 244, 220, 0.92);
    border-bottom: 3px solid rgba(42, 31, 18, 0.12);
    content: "";
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
    color: var(--ink);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

.brand-mark {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    background: var(--white);
    border: var(--border-lg);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.brand-mark img,
.brand-mark svg {
    width: 42px;
    height: 42px;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 0.96rem;
    font-weight: 700;
}

.nav-links a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 2px solid transparent;
    border-radius: 999px;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a:focus-visible {
    background: var(--white);
    border-color: var(--ink);
    outline: 0;
}

.nav-cta {
    background: var(--yellow);
    border-color: var(--ink) !important;
    box-shadow: 0 3px 0 var(--ink);
}

.portal-root {
    overflow: hidden;
}

.hero {
    position: relative;
    isolation: isolate;
    min-height: 68svh;
    margin-top: -76px;
    padding: 126px 0 34px;
    display: grid;
    align-items: center;
    border-bottom: var(--border-lg);
    overflow: hidden;
}

.hero-bg,
.hero-bg::after {
    position: absolute;
    inset: 0;
    content: "";
}

.hero-bg {
    z-index: -2;
    background-image: url("../img/portal-hero.36728e028830.png");
    background-position: center right;
    background-size: cover;
}

.hero-bg::after {
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(255, 244, 220, 0.99) 0%, rgba(255, 244, 220, 0.95) 34%, rgba(255, 244, 220, 0.5) 58%, rgba(255, 244, 220, 0.12) 100%),
        linear-gradient(0deg, rgba(255, 244, 220, 0.96) 0%, rgba(255, 244, 220, 0.2) 22%, rgba(255, 244, 220, 0) 62%);
}

.hero-content {
    width: min(100% - 32px, var(--max));
    margin: 0 auto;
    padding-top: 12px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin: 0 0 14px;
    padding: 5px 12px;
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 3px 0 var(--ink);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero h1,
.section h2 {
    max-width: 760px;
    margin: 0;
    color: var(--ink);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: 0;
}

.hero h1 {
    max-width: 660px;
    font-size: 3.65rem;
}

.hero-copy {
    max-width: 610px;
    margin: 18px 0 0;
    color: var(--ink-soft);
    font-size: 1.24rem;
    font-weight: 600;
    line-height: 1.45;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 24px;
}

.button {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 26px;
    border: var(--border-lg);
    border-radius: 999px;
    box-shadow: var(--shadow-md);
    color: var(--ink);
    cursor: pointer;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(2px);
    box-shadow: 0 4px 0 var(--ink);
    outline: 0;
}

.button:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--ink);
}

.button-primary {
    background: var(--red);
}

.button-secondary {
    background: var(--white);
}

.trust-line {
    display: inline-flex;
    max-width: 610px;
    margin: 24px 0 0;
    padding: 14px 18px;
    background: rgba(255, 252, 239, 0.82);
    border: 2px solid var(--ink);
    border-radius: 22px;
    color: var(--ink);
    font-weight: 700;
    box-shadow: 0 4px 0 var(--ink);
}

.trust-strip,
.section,
.site-footer {
    width: min(100% - 32px, var(--max));
    margin-inline: auto;
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 34px 0 30px;
}

.trust-item {
    min-height: 154px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 20px;
    background: var(--white);
    border: var(--border-lg);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

.trust-item strong {
    font-size: 1.1rem;
    line-height: 1.15;
}

.trust-item span:last-child {
    color: var(--ink-soft);
    font-weight: 600;
}

.mini-icon {
    position: relative;
    width: 42px;
    height: 42px;
    display: inline-block;
    background: var(--yellow);
    border: 2.5px solid var(--ink);
    border-radius: 15px;
    box-shadow: 0 3px 0 var(--ink);
}

.mini-ear {
    background: var(--pink);
}

.mini-ear::before {
    position: absolute;
    inset: 8px 10px;
    border: 3px solid var(--ink);
    border-left-width: 5px;
    border-radius: 45% 55% 55% 45%;
    content: "";
}

.mini-check {
    background: var(--green);
}

.mini-check::before {
    position: absolute;
    left: 12px;
    top: 9px;
    width: 11px;
    height: 18px;
    border: solid var(--ink);
    border-width: 0 4px 4px 0;
    content: "";
    transform: rotate(45deg);
}

.mini-clock {
    background: var(--blue);
    border-radius: 50%;
}

.mini-clock::before,
.mini-clock::after {
    position: absolute;
    left: 19px;
    top: 10px;
    width: 4px;
    height: 14px;
    background: var(--ink);
    border-radius: 999px;
    content: "";
    transform-origin: bottom center;
}

.mini-clock::after {
    height: 11px;
    transform: rotate(90deg);
}

.section {
    padding: 72px 0;
}

.section-band {
    width: 100%;
    max-width: none;
    padding-inline: max(16px, calc((100% - var(--max)) / 2));
    background: var(--white);
    border-top: var(--border-lg);
    border-bottom: var(--border-lg);
}

.section-heading {
    max-width: 740px;
    margin-bottom: 34px;
}

.section-heading.center {
    margin-inline: auto;
    text-align: center;
}

.section h2 {
    font-size: 3rem;
}

.section-heading p:not(.eyebrow),
.section-copy p {
    color: var(--ink-soft);
    font-size: 1.12rem;
    font-weight: 600;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.feature-card,
.step-card,
.research-card,
.today-plan,
.routine-track,
.benefit-list,
.signup-form,
.faq-list details {
    background: var(--white);
    border: var(--border-lg);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

.feature-card {
    min-height: 282px;
    padding: 20px;
}

.feature-card h3,
.step-card h3,
.research-card h3,
.today-plan h3 {
    margin: 16px 0 8px;
    font-size: 1.28rem;
    line-height: 1.1;
}

.feature-card p,
.step-card p,
.research-card p,
.today-plan p {
    margin: 0;
    color: var(--ink-soft);
    font-weight: 600;
}

.card-red {
    background: #FFE4DF;
}

.card-yellow {
    background: #FFF1B8;
}

.card-blue {
    background: #DFF5FF;
}

.card-purple {
    background: #F0DFFF;
}

.feature-icon {
    position: relative;
    width: 58px;
    height: 58px;
    display: block;
}

.swatch-stack::before,
.swatch-stack::after {
    position: absolute;
    width: 28px;
    height: 38px;
    border: 2.5px solid var(--ink);
    border-radius: 10px;
    box-shadow: 0 3px 0 var(--ink);
    content: "";
}

.swatch-stack::before {
    left: 7px;
    top: 8px;
    background: var(--red);
    transform: rotate(-7deg);
}

.swatch-stack::after {
    left: 25px;
    top: 13px;
    background: var(--yellow);
    transform: rotate(7deg);
}

.sound-ring {
    border: 3px solid var(--ink);
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 4px 0 var(--ink);
}

.sound-ring::before,
.sound-ring::after {
    position: absolute;
    inset: 13px;
    border: 3px solid var(--white);
    border-radius: 50%;
    content: "";
}

.sound-ring::after {
    inset: 22px;
    background: var(--white);
}

.habit-dots {
    display: grid;
    grid-template-columns: repeat(3, 14px);
    grid-auto-rows: 14px;
    gap: 6px;
    align-content: center;
    justify-content: center;
    background: var(--yellow);
    border: 3px solid var(--ink);
    border-radius: 18px;
    box-shadow: 0 4px 0 var(--ink);
}

.habit-dots::before,
.habit-dots::after {
    content: "";
}

.habit-dots,
.habit-dots::before,
.habit-dots::after {
    color: var(--ink);
}

.habit-dots::before,
.habit-dots::after {
    width: 14px;
    height: 14px;
    background: currentColor;
    border-radius: 50%;
    box-shadow: 20px 0 0 currentColor, 40px 0 0 currentColor, 0 20px 0 currentColor, 20px 20px 0 currentColor, 40px 20px 0 currentColor;
}

.steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    width: min(100%, var(--max));
    margin-inline: auto;
}

.step-card {
    position: relative;
    min-height: 240px;
    padding: 20px;
}

.step-number {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    background: var(--yellow);
    border: var(--border-lg);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    font-size: 1.3rem;
    font-weight: 700;
}

.step-card:nth-child(2) .step-number {
    background: var(--red);
}

.step-card:nth-child(3) .step-number {
    background: var(--blue);
}

.step-card:nth-child(4) .step-number {
    background: var(--lime);
}

.step-card:nth-child(5) .step-number {
    background: var(--purple);
}

.split-section {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1fr);
    gap: 48px;
    align-items: center;
}

.section-copy p {
    max-width: 610px;
}

.color-story {
    position: relative;
    min-height: 340px;
    display: grid;
    align-content: center;
    gap: 28px;
    padding: 30px;
    background: var(--cream-deep);
    border: var(--border-lg);
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.color-story::before {
    position: absolute;
    right: -44px;
    top: -34px;
    width: 160px;
    height: 130px;
    background: var(--pip);
    border: var(--border-lg);
    border-radius: 58% 42% 52% 48%;
    content: "";
    transform: rotate(-10deg);
}

.wave-line {
    height: 42px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 8% 50%, var(--red) 0 7px, transparent 8px),
        radial-gradient(circle at 24% 50%, var(--yellow) 0 7px, transparent 8px),
        radial-gradient(circle at 40% 50%, var(--blue) 0 7px, transparent 8px),
        radial-gradient(circle at 56% 50%, var(--lime) 0 7px, transparent 8px),
        radial-gradient(circle at 72% 50%, var(--purple) 0 7px, transparent 8px),
        radial-gradient(circle at 88% 50%, var(--orange) 0 7px, transparent 8px);
    border: 3px dashed rgba(42, 31, 18, 0.55);
}

.chord-row,
.plan-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.chord-swatch,
.tiny-swatch {
    display: inline-block;
    background: var(--cream-deep);
    border: 2.5px solid var(--ink);
    box-shadow: 0 3px 0 var(--ink);
}

.chord-swatch {
    width: 46px;
    height: 52px;
    border-radius: 12px;
}

.tiny-swatch {
    width: 34px;
    height: 38px;
    border-radius: 10px;
}

.red {
    background: var(--red);
}

.yellow,
.sun {
    background: var(--yellow);
}

.blue {
    background: var(--blue);
}

.charcoal {
    background: var(--charcoal);
}

.lime {
    background: var(--lime);
}

.green {
    background: var(--green);
}

.orange {
    background: var(--orange);
}

.purple {
    background: var(--purple);
}

.pink {
    background: var(--pink);
}

.brown {
    background: var(--brown);
}

.planner-section {
    padding-top: 30px;
}

.planner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.75fr);
    gap: 22px;
    align-items: stretch;
}

.routine-track {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 20px;
    background: var(--white);
}

.routine-step {
    position: relative;
    min-height: 172px;
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 18px;
    background: var(--cream);
    border: 2.5px solid var(--ink);
    border-radius: 20px;
}

.routine-step strong {
    font-size: 1.1rem;
    line-height: 1.1;
}

.routine-step span:last-child {
    color: var(--ink-soft);
    font-weight: 600;
}

.routine-dot {
    width: 40px;
    height: 40px;
    display: block;
    border: 2.5px solid var(--ink);
    border-radius: 50%;
    box-shadow: 0 3px 0 var(--ink);
}

.moon {
    background: var(--purple);
}

.today-plan {
    padding: 22px;
    background: var(--white);
}

.today-plan h3 {
    margin-top: 0;
}

.plan-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    padding-bottom: 8px;
    border-bottom: 2px dashed rgba(42, 31, 18, 0.3);
    font-weight: 700;
}

.plan-time {
    color: var(--ink);
}

.plan-duration {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    background: var(--yellow);
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 2px 0 var(--ink);
}

.plan-colors {
    margin-top: 12px;
}

.parents-section {
    padding-top: 56px;
}

.benefit-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 20px;
    background: #E6F8D8;
}

.benefit-list span {
    min-height: 92px;
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--white);
    border: 2.5px solid var(--ink);
    border-radius: 18px;
    color: var(--ink);
    font-weight: 700;
}

.research-section {
    width: 100%;
    max-width: none;
    padding-inline: max(16px, calc((100% - var(--max)) / 2));
    background: #DFF5FF;
    border-top: var(--border-lg);
    border-bottom: var(--border-lg);
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    width: min(100%, var(--max));
}

.research-card {
    min-height: 224px;
    padding: 22px;
}

.early-section {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(320px, 0.82fr);
    gap: 36px;
    align-items: center;
    padding-top: 82px;
}

.early-copy p:not(.eyebrow) {
    max-width: 600px;
    color: var(--ink-soft);
    font-size: 1.12rem;
    font-weight: 600;
}

.signup-form {
    display: grid;
    gap: 14px;
    padding: 22px;
    background: var(--white);
}

.download-card {
    gap: 20px;
}

.download-card h3 {
    margin: 0;
    font-size: 1.55rem;
    line-height: 1.1;
}

.store-download-grid {
    display: grid;
    grid-template-columns: minmax(176px, 1fr) minmax(172px, 1fr);
    gap: 28px;
    align-items: center;
}

.store-badges {
    display: grid;
    gap: 16px;
    align-content: center;
    justify-items: center;
}

.store-badge-link {
    display: inline-flex;
    width: min(100%, 215px);
    justify-content: center;
}

.store-badge {
    display: block;
    max-width: 100%;
    height: auto;
}

.app-store-badge {
    width: 180px;
}

.google-play-badge {
    width: 215px;
}

.qr-slot {
    display: grid;
    min-width: 0;
    place-items: center;
}

.download-qr {
    display: block;
    width: 160px;
    max-width: min(100%, 180px);
    height: auto;
    background: var(--white);
    border: 3px solid var(--ink);
    border-radius: 18px;
    box-shadow: 0 5px 0 var(--ink);
}

.download-note {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 700;
}

.signup-form label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 700;
}

.signup-form input,
.signup-form select {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    background: var(--cream);
    border: var(--border-lg);
    border-radius: 18px;
    color: var(--ink);
    outline: 0;
}

.signup-form input:focus,
.signup-form select:focus {
    box-shadow: 0 0 0 4px rgba(79, 180, 232, 0.28);
}

.signup-form .button {
    width: 100%;
    margin-top: 6px;
}

.faq-section {
    padding-top: 36px;
}

.faq-list {
    display: grid;
    gap: 14px;
}

.faq-list details {
    padding: 0;
    overflow: hidden;
}

.faq-list summary {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    cursor: pointer;
    font-size: 1.18rem;
    font-weight: 700;
    list-style: none;
}

.faq-list summary::-webkit-details-marker {
    display: none;
}

.faq-list summary::after {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    background: var(--yellow);
    border: 2px solid var(--ink);
    border-radius: 50%;
    box-shadow: 0 2px 0 var(--ink);
    content: "+";
}

.faq-list details[open] summary::after {
    content: "-";
}

.faq-list details p {
    margin: 0;
    padding: 0 22px 22px;
    color: var(--ink-soft);
    font-weight: 600;
}

.legal-root {
    overflow: visible;
}

.legal-hero {
    width: 100%;
    padding: 64px 16px 44px;
    background: var(--white);
    border-bottom: var(--border-lg);
}

.legal-hero-inner {
    width: min(100% - 32px, 900px);
    margin-inline: auto;
}

.legal-hero h1 {
    max-width: 780px;
    margin: 0;
    color: var(--ink);
    font-size: 3.25rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
}

.legal-date {
    margin: 14px 0 0;
    color: var(--ink-soft);
    font-size: 1.02rem;
    font-weight: 700;
}

.legal-document {
    width: min(100% - 32px, 900px);
    margin-inline: auto;
    padding: 42px 0 76px;
}

.legal-summary {
    margin-bottom: 38px;
    padding: 24px;
    background: var(--white);
    border: var(--border-lg);
    border-radius: 24px;
    box-shadow: var(--shadow-md);
}

.legal-summary p {
    margin: 0;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 700;
}

.legal-section-list {
    display: grid;
    gap: 34px;
}

/* Legal body — rendered from markdown, so every rule keys off the element, not a class */
.legal-body h2 {
    margin: 34px 0 10px;
    color: var(--ink);
    font-size: 1.58rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
}

.legal-body h2:first-child {
    margin-top: 0;
}

.legal-body p {
    margin: 0 0 12px;
    color: var(--ink-soft);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.62;
}

.legal-body p:last-child,
.legal-body li:last-child {
    margin-bottom: 0;
}

.legal-body ul,
.legal-body ol {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
}

.legal-body ul {
    padding: 0;
    list-style: none;
}

.legal-body ol {
    padding-left: 22px;
}

.legal-body li {
    margin: 0;
    color: var(--ink-soft);
    font-weight: 600;
    line-height: 1.58;
}

.legal-body ul > li {
    position: relative;
    padding-left: 28px;
}

.legal-body ul > li::before {
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 9px;
    height: 9px;
    background: var(--red);
    border: 2px solid var(--ink);
    border-radius: 50%;
    content: "";
}

/* --blue is too light for body prose; ink text on a red underline stays legible */
.legal-body a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--red);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.legal-body a:hover,
.legal-body a:focus-visible {
    color: var(--red);
    outline: 0;
}

/* Research page — single-line closing disclaimer */
.research-disclaimer {
    margin: 40px 0 0;
    padding-top: 18px;
    border-top: 2px dashed rgba(42, 31, 18, 0.22);
    color: var(--ink-soft);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Research page — confident lead + evidence highlights */
.research-lead {
    margin: 0 0 26px;
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.5;
}

.evidence-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat-card {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 22px;
    background: var(--white);
    border: var(--border-lg);
    border-radius: 22px;
    box-shadow: var(--shadow-md);
}

.stat-number {
    color: var(--red);
    font-size: 2.9rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card:nth-child(2) .stat-number {
    color: var(--blue);
}

.stat-card:nth-child(3) .stat-number {
    color: var(--green);
}

.stat-label {
    margin: 0;
    color: var(--ink-soft);
    font-weight: 600;
    line-height: 1.45;
}

.stat-cite {
    margin-top: 2px;
    font-size: 0.85rem;
}

.stats-caption {
    margin: 0 0 34px;
    color: var(--ink-soft);
    font-size: 0.95rem;
    font-weight: 600;
}

/* Research page — grouped reference list */
.reference-group h2 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 1.58rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
}

.reference-group-note {
    margin: 0 0 18px;
    color: var(--ink-soft);
    font-size: 1rem;
    font-weight: 600;
}

.reference-list {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: ref;
}

.reference-item {
    position: relative;
    counter-increment: ref;
    padding: 18px 20px 18px 58px;
    background: var(--white);
    border: var(--border-lg);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.reference-item::before {
    position: absolute;
    left: 16px;
    top: 17px;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    background: var(--blue);
    border: 2px solid var(--ink);
    border-radius: 50%;
    box-shadow: 0 2px 0 var(--ink);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 700;
    content: counter(ref);
}

.reference-cite {
    margin: 0;
    color: var(--ink-soft);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.55;
}

.reference-authors,
.reference-title {
    color: var(--ink);
    font-weight: 700;
}

.reference-doi {
    display: inline-block;
    margin-top: 8px;
    color: var(--blue);
    font-size: 0.92rem;
    font-weight: 700;
    word-break: break-word;
    border-bottom: 2px solid transparent;
}

.reference-doi:hover,
.reference-doi:focus-visible {
    border-bottom-color: var(--blue);
    outline: 0;
}

/* Evidence note — shared by the home research section and the research page */
.evidence-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 14px 18px;
    background: rgba(255, 252, 239, 0.9);
    border: 2px solid var(--ink);
    border-radius: 20px;
    box-shadow: 0 4px 0 var(--ink);
    color: var(--ink);
    font-weight: 700;
    line-height: 1.5;
}

.evidence-note p {
    margin: 0;
}

.evidence-note-block {
    margin-top: 38px;
    background: var(--white);
}

.evidence-note-icon {
    flex: 0 0 auto;
    width: 28px;
    height: 30px;
}

/* Home research section footer — boundary note + link to the full page */
.research-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(100%, var(--max));
    margin-top: 26px;
}

.research-footer .evidence-note {
    flex: 1 1 360px;
}

.research-cta {
    flex: 0 0 auto;
}

.research-cta-arrow {
    font-size: 1.1em;
    line-height: 1;
}

.site-footer {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 36px 0 48px;
    border-top: 3px dashed rgba(42, 31, 18, 0.32);
}

.footer-identity {
    display: grid;
    gap: 14px;
}

.footer-identity p {
    margin: 0;
    color: var(--ink-soft);
    font-weight: 700;
}

.footer-tagline {
    max-width: 720px;
}

.footer-copyright {
    font-size: 0.94rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    font-weight: 700;
}

.footer-links a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background: var(--white);
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: 0 3px 0 var(--ink);
    white-space: nowrap;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    background: var(--yellow);
    outline: 0;
}

@media (max-width: 1040px) {
    .nav-links a:not(.nav-cta) {
        display: none;
    }

    .hero h1 {
        max-width: 600px;
        font-size: 3.35rem;
    }

    .feature-grid,
    .steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .steps .step-card:last-child {
        grid-column: 1 / -1;
    }

    .split-section,
    .planner-layout,
    .early-section {
        grid-template-columns: 1fr;
    }

    .routine-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body {
        font-size: 15px;
    }

    .site-header {
        width: min(100% - 24px, var(--max));
        min-height: 68px;
    }

    .site-header::before {
        height: 68px;
    }

    .brand {
        font-size: 1.08rem;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
        border-radius: 16px;
    }

    .brand-mark img,
    .brand-mark svg {
        width: 36px;
        height: 36px;
    }

    .nav-cta {
        min-height: 40px;
        padding-inline: 12px;
        font-size: 0.92rem;
    }

    .hero {
        min-height: 82svh;
        margin-top: -68px;
        padding: 118px 0 44px;
    }

    .hero-bg {
        background-position: 70% center;
    }

    .hero-bg::after {
        background:
            linear-gradient(90deg, rgba(255, 244, 220, 0.98) 0%, rgba(255, 244, 220, 0.92) 46%, rgba(255, 244, 220, 0.54) 72%, rgba(255, 244, 220, 0.22) 100%),
            linear-gradient(0deg, rgba(255, 244, 220, 0.98) 0%, rgba(255, 244, 220, 0.38) 35%, rgba(255, 244, 220, 0) 72%);
    }

    .hero h1 {
        max-width: 460px;
        font-size: 2.65rem;
        line-height: 1;
    }

    .hero-copy {
        max-width: 460px;
        font-size: 1.05rem;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        max-width: 340px;
    }

    .button {
        width: 100%;
        min-height: 54px;
        padding-inline: 18px;
    }

    .trust-line {
        max-width: 460px;
        font-size: 0.95rem;
    }

    .trust-strip,
    .feature-grid,
    .steps,
    .research-grid,
    .routine-track,
    .benefit-list {
        grid-template-columns: 1fr;
    }

    .trust-strip,
    .section,
    .site-footer {
        width: min(100% - 24px, var(--max));
    }

    .section,
    .section-band,
    .research-section {
        padding-top: 54px;
        padding-bottom: 54px;
    }

    .section h2 {
        font-size: 2.25rem;
        line-height: 1.02;
    }

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

    .legal-hero-inner,
    .legal-document {
        width: min(100% - 24px, 900px);
    }

    .legal-hero h1 {
        font-size: 2.45rem;
    }

    .legal-document {
        padding-top: 34px;
        padding-bottom: 58px;
    }

    .legal-summary {
        padding: 20px;
        border-radius: 22px;
    }

    .legal-body h2 {
        font-size: 1.34rem;
    }

    .section-heading p:not(.eyebrow),
    .section-copy p,
    .early-copy p:not(.eyebrow) {
        font-size: 1rem;
    }

    .feature-card,
    .step-card,
    .research-card {
        min-height: auto;
    }

    .research-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .evidence-stats {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .reference-item {
        padding: 16px 16px 16px 50px;
    }

    .reference-item::before {
        left: 12px;
        top: 15px;
    }

    .steps .step-card:last-child {
        grid-column: auto;
    }

    .color-story {
        min-height: 280px;
        padding: 22px;
    }

    .chord-row {
        gap: 10px;
    }

    .routine-step {
        min-height: 132px;
    }

    .early-section {
        padding-top: 58px;
    }

    .store-download-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .download-note {
        text-align: center;
    }

    .faq-list summary {
        min-height: 66px;
        padding: 16px 18px;
        font-size: 1.04rem;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        justify-content: flex-start;
        padding-top: 0;
    }

    .footer-tagline {
        max-width: 100%;
    }
}

@media (max-width: 420px) {
    .hero h1 {
        font-size: 2.25rem;
    }

    .eyebrow {
        font-size: 0.74rem;
    }

    .site-header {
        gap: 10px;
    }

    .brand span:last-child {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Pricing/trial line under the download card */
.download-trial {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 800;
}

/* Language switcher (segmented pill in the navbar).
   Standalone component: templates/web/common/_lang_switcher.html */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 2px;
    margin-left: 6px;
    padding: 3px;
    border: 2px solid var(--ink);
    border-radius: 999px;
    background: var(--cream);
}

.lang-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 30px;
    padding: 5px 9px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.lang-option:hover {
    color: var(--red);
}

.lang-option:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
}

.lang-option.is-active {
    background: var(--white);
    color: var(--ink);
    box-shadow: 0 2px 0 var(--ink);
    cursor: default;
}

/* Roomier tap targets where the navbar collapses to brand + CTA + switcher. */
@media (max-width: 720px) {
    .lang-switcher {
        margin-left: 2px;
    }

    .lang-option {
        min-width: 40px;
        min-height: 36px;
        font-size: 0.9rem;
    }
}
