* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --paper: #f3efe7;
    --paper-deep: #ebe5da;
    --ink: #22251f;
    --ink-soft: #55594f;
    --muted: #7d7d70;
    --forest: #30433a;
    --forest-deep: #23342d;
    --bronze: #9d7a50;
    --line: rgba(48, 67, 58, 0.16);
    --white-soft: rgba(255, 255, 255, 0.5);
    --serif: "Songti SC", "STSong", "SimSun", "Noto Serif CJK SC", serif;
    --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
}

a {
    color: inherit;
}

.weekly-header {
    position: absolute;
    z-index: 10;
    top: 0;
    left: 0;
    display: grid;
    width: 100%;
    height: 92px;
    padding: 0 clamp(24px, 5vw, 76px);
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.weekly-brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 11px;
    color: var(--forest);
    text-decoration: none;
}

.brand-mark {
    display: inline-flex;
    width: 31px;
    height: 31px;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-size: 15px;
    line-height: 1;
}

.brand-name {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 17px;
    letter-spacing: 0.16em;
}

.space-label {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.2em;
}

.back-link {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    gap: 9px;
    color: var(--ink-soft);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.25s ease;
}

.back-link:hover {
    color: var(--forest);
}

.weekly-hero {
    position: relative;
    min-height: min(960px, 100svh);
    overflow: hidden;
    background:
        radial-gradient(circle at 78% 22%, rgba(184, 155, 113, 0.12), transparent 27%),
        linear-gradient(145deg, #f6f2eb 0%, var(--paper) 52%, #eee9df 100%);
}

.weekly-hero::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--line) 22%, var(--line) 78%, transparent);
    content: "";
}

.weekly-hero::after {
    position: absolute;
    right: -18vw;
    bottom: -44vw;
    width: 70vw;
    height: 70vw;
    border: 1px solid rgba(157, 122, 80, 0.12);
    border-radius: 50%;
    content: "";
}

.ambient-orbit {
    position: absolute;
    border: 1px solid rgba(48, 67, 58, 0.1);
    border-radius: 50%;
    pointer-events: none;
}

.ambient-orbit-one {
    top: 15%;
    left: -170px;
    width: 420px;
    height: 420px;
}

.ambient-orbit-two {
    top: 22%;
    left: -94px;
    width: 268px;
    height: 268px;
}

.hero-shell {
    position: relative;
    z-index: 2;
    display: grid;
    width: min(1120px, calc(100% - 48px));
    min-height: min(960px, 100svh);
    margin: 0 auto;
    padding: 146px 0 70px;
    grid-template-columns: minmax(0, 0.9fr) minmax(420px, 1.1fr);
    column-gap: clamp(70px, 9vw, 150px);
    align-items: center;
}

.hero-intro {
    align-self: center;
    padding-bottom: 42px;
}

.eyebrow {
    margin-bottom: 23px;
    color: var(--bronze);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 11px;
    letter-spacing: 0.3em;
}

.hero-intro h1 {
    max-width: 520px;
    margin-bottom: 34px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(56px, 5.8vw, 82px);
    font-weight: 400;
    line-height: 1.13;
    letter-spacing: -0.055em;
}

.hero-intro h1 span {
    margin: 0 0.04em;
    color: var(--bronze);
    font-family: Georgia, serif;
    font-size: 0.72em;
}

.hero-statement {
    max-width: 390px;
    color: var(--ink-soft);
    font-family: var(--serif);
    font-size: clamp(19px, 1.8vw, 25px);
    line-height: 1.85;
    letter-spacing: 0.03em;
}

.ritual-card {
    position: relative;
    max-width: 520px;
    padding: clamp(44px, 5vw, 70px);
    border: 1px solid rgba(48, 67, 58, 0.13);
    background: var(--white-soft);
    box-shadow: 0 28px 80px rgba(54, 48, 39, 0.07);
    backdrop-filter: blur(14px);
}

.ritual-card::before {
    position: absolute;
    top: -1px;
    left: 52px;
    width: 54px;
    height: 2px;
    background: var(--bronze);
    content: "";
}

.welcome {
    margin-bottom: 7px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 22px;
}

.alignment {
    color: var(--muted);
    font-size: 14px;
}

.quiet-line {
    width: 100%;
    height: 1px;
    margin: 39px 0 37px;
    background: var(--line);
}

.ritual-card h2 {
    max-width: 330px;
    margin-bottom: 37px;
    font-family: var(--serif);
    font-size: clamp(27px, 2.4vw, 35px);
    font-weight: 400;
    line-height: 1.55;
    letter-spacing: 0.02em;
}

.ritual-actions {
    display: grid;
    grid-template-columns: 1.25fr 0.95fr;
    gap: 12px;
}

.action-primary,
.action-secondary {
    min-height: 56px;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    letter-spacing: 0.06em;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.action-primary {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border: 1px solid var(--forest);
    background: var(--forest);
    color: #fff;
    box-shadow: 0 12px 28px rgba(48, 67, 58, 0.14);
}

.action-primary:hover {
    background: var(--forest-deep);
    box-shadow: 0 16px 32px rgba(48, 67, 58, 0.2);
    transform: translateY(-2px);
}

.action-secondary {
    border: 1px solid rgba(48, 67, 58, 0.28);
    background: transparent;
    color: var(--forest);
}

.action-secondary:hover {
    background: rgba(48, 67, 58, 0.06);
    transform: translateY(-2px);
}

.action-primary:disabled,
.action-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.46;
    transform: none;
}

.action-primary:focus-visible,
.action-secondary:focus-visible,
.back-link:focus-visible,
.weekly-brand:focus-visible,
.scroll-cue:focus-visible {
    outline: 2px solid var(--bronze);
    outline-offset: 4px;
}

.helper {
    margin-top: 22px;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: 0.03em;
}

.record-status {
    display: flex;
    margin-top: 17px;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.record-status::before {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--bronze);
    content: "";
    opacity: 0.7;
}

.record-status.is-connected {
    color: var(--forest);
}

.record-status.is-connected::before {
    background: #5f806f;
    box-shadow: 0 0 0 3px rgba(95, 128, 111, 0.12);
}

.record-status.is-error {
    color: #8a5e4d;
}

.record-status.is-error::before {
    background: #a66f58;
}

.data-note {
    max-width: 520px;
    margin: 9px 0 0 14px;
    color: rgba(95, 91, 82, 0.72);
    font-size: 10px;
    line-height: 1.7;
}

.scroll-cue {
    position: absolute;
    bottom: 34px;
    left: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-decoration: none;
}

.scroll-line {
    display: block;
    width: 54px;
    height: 1px;
    background: var(--bronze);
    transition: width 0.3s ease;
}

.scroll-cue:hover .scroll-line {
    width: 72px;
}

.growth-section {
    background: var(--forest-deep);
    color: #f3efe7;
}

.growth-shell {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
    padding: clamp(100px, 11vw, 160px) 0 72px;
}

.growth-heading {
    display: grid;
    margin-bottom: 66px;
    grid-template-columns: 1fr 1fr;
    align-items: end;
}

.growth-heading h2 {
    font-family: var(--serif);
    font-size: clamp(38px, 4.5vw, 58px);
    font-weight: 400;
    line-height: 1.25;
}

.growth-heading > p {
    justify-self: end;
    color: rgba(243, 239, 231, 0.56);
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.9;
    text-align: right;
}

.growth-list {
    border-top: 1px solid rgba(243, 239, 231, 0.18);
}

.growth-empty {
    padding: 68px 0;
    border-bottom: 1px solid rgba(243, 239, 231, 0.18);
    color: rgba(243, 239, 231, 0.54);
    font-family: var(--serif);
    font-size: 16px;
}

.growth-entry {
    position: relative;
    display: grid;
    min-height: 215px;
    padding: 45px 0;
    border-bottom: 1px solid rgba(243, 239, 231, 0.18);
    grid-template-columns: 150px 1fr 70px;
    gap: 34px;
    align-items: center;
}

.growth-date {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(243, 239, 231, 0.62);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 12px;
    letter-spacing: 0.08em;
}

.date-line {
    width: 18px;
    height: 1px;
    background: var(--bronze);
}

.growth-label {
    margin-bottom: 10px;
    color: #b89a72;
    font-size: 11px;
    letter-spacing: 0.18em;
}

.growth-copy h3 {
    max-width: 690px;
    margin-bottom: 17px;
    font-family: var(--serif);
    font-size: clamp(23px, 2.4vw, 31px);
    font-weight: 400;
    line-height: 1.55;
}

.growth-reflection {
    color: rgba(243, 239, 231, 0.54);
    font-family: var(--serif);
    font-size: 14px;
}

.growth-index {
    justify-self: end;
    color: rgba(243, 239, 231, 0.18);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 30px;
}

.growth-footer {
    display: flex;
    margin-top: 66px;
    align-items: center;
    justify-content: space-between;
    color: rgba(243, 239, 231, 0.42);
    font-family: var(--serif);
    font-size: 13px;
    letter-spacing: 0.06em;
}

.growth-footer span {
    font-family: Georgia, "Times New Roman", serif;
    letter-spacing: 0.24em;
}

/* Weekly ritual dialogs */
.ritual-dialog {
    width: min(680px, calc(100% - 40px));
    max-height: min(820px, calc(100dvh - 40px));
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 1px solid rgba(48, 67, 58, 0.18);
    background: #f6f2eb;
    color: var(--ink);
    box-shadow: 0 40px 110px rgba(24, 32, 27, 0.28);
}

.ritual-dialog::backdrop {
    background: rgba(28, 37, 32, 0.68);
}

.ritual-dialog[open] {
    animation: dialog-enter 0.32s ease-out both;
}

.dialog-form {
    min-height: 100%;
}

.dialog-header {
    display: flex;
    padding: 38px 42px 30px;
    border-bottom: 1px solid var(--line);
    align-items: flex-start;
    justify-content: space-between;
}

.dialog-step {
    margin-bottom: 10px;
    color: var(--bronze);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 10px;
    letter-spacing: 0.25em;
}

.dialog-header h2 {
    font-family: var(--serif);
    font-size: 33px;
    font-weight: 400;
}

.dialog-close {
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(48, 67, 58, 0.22);
    border-radius: 50%;
    background: transparent;
    color: var(--forest);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 25px;
    font-weight: 300;
    line-height: 1;
    transition: background 0.2s ease, color 0.2s ease;
}

.dialog-close:hover {
    background: var(--forest);
    color: white;
}

.dialog-body {
    padding: 34px 42px 40px;
}

.dialog-welcome {
    margin-bottom: 30px;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 15px;
}

.ritual-field {
    display: block;
}

.ritual-field + .ritual-field {
    margin-top: 28px;
}

.ritual-field > span {
    display: block;
    margin-bottom: 13px;
    color: var(--ink);
    font-family: var(--serif);
    font-size: 20px;
}

.ritual-field textarea {
    display: block;
    width: 100%;
    min-height: 112px;
    padding: 18px 19px;
    resize: vertical;
    border: 1px solid rgba(48, 67, 58, 0.2);
    border-radius: 0;
    outline: none;
    background: rgba(255, 255, 255, 0.4);
    color: var(--ink);
    font: 15px/1.8 var(--sans);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.ritual-field-secondary textarea {
    min-height: 88px;
}

.ritual-field textarea::placeholder {
    color: #99998d;
}

.ritual-field textarea:focus {
    border-color: var(--bronze);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 0 3px rgba(157, 122, 80, 0.09);
}

.review-focus {
    margin-bottom: 32px;
    padding: 20px 22px;
    border-left: 2px solid var(--bronze);
    background: rgba(157, 122, 80, 0.07);
}

.review-focus span {
    display: block;
    margin-bottom: 8px;
    color: var(--bronze);
    font-size: 10px;
    letter-spacing: 0.17em;
}

.review-focus p {
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.7;
}

.dialog-footer {
    display: flex;
    padding: 24px 42px 38px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.dialog-footer > p {
    max-width: 230px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.dialog-complete {
    display: inline-flex;
    min-width: 190px;
    min-height: 54px;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid var(--forest);
    background: var(--forest);
    color: white;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 0.05em;
    transition: transform 0.2s ease, background 0.2s ease;
}

.dialog-complete:hover {
    background: var(--forest-deep);
    transform: translateY(-2px);
}

.dialog-complete:disabled {
    cursor: wait;
    opacity: 0.68;
    transform: none;
}

.dialog-close:focus-visible,
.dialog-complete:focus-visible,
.ritual-field textarea:focus-visible {
    outline: 2px solid var(--bronze);
    outline-offset: 3px;
}

.ritual-toast {
    position: fixed;
    z-index: 30;
    right: 28px;
    bottom: 28px;
    max-width: calc(100% - 40px);
    padding: 15px 21px;
    background: var(--forest-deep);
    color: #f3efe7;
    box-shadow: 0 18px 42px rgba(24, 32, 27, 0.22);
    font-family: var(--serif);
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ritual-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes dialog-enter {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 900px) {
    .weekly-header {
        grid-template-columns: 1fr 1fr;
    }

    .space-label {
        display: none;
    }

    .hero-shell {
        min-height: auto;
        padding: 132px 0 90px;
        grid-template-columns: 1fr;
        gap: 60px;
    }

    .hero-intro {
        padding-bottom: 0;
    }

    .hero-intro h1 {
        max-width: none;
    }

    .ritual-card {
        width: min(100%, 620px);
        max-width: none;
        justify-self: end;
    }

    .scroll-cue {
        display: none;
    }
}

@media (max-width: 620px) {
    .weekly-header {
        height: 72px;
        padding: 0 20px;
    }

    .brand-mark {
        width: 29px;
        height: 29px;
    }

    .brand-name {
        font-size: 15px;
    }

    .back-link {
        font-size: 12px;
    }

    .weekly-hero::before {
        left: 24px;
    }

    .ambient-orbit-one {
        top: 8%;
        left: -230px;
    }

    .ambient-orbit-two {
        display: none;
    }

    .hero-shell {
        width: calc(100% - 40px);
        padding: 118px 0 72px;
        gap: 48px;
    }

    .eyebrow {
        margin-bottom: 17px;
        font-size: 10px;
    }

    .hero-intro h1 {
        margin-bottom: 25px;
        font-size: clamp(43px, 13vw, 55px);
        letter-spacing: -0.06em;
    }

    .hero-statement {
        max-width: 320px;
        font-size: 19px;
        line-height: 1.8;
    }

    .ritual-card {
        padding: 39px 24px 36px;
        justify-self: stretch;
    }

    .ritual-card::before {
        left: 24px;
        width: 45px;
    }

    .welcome {
        font-size: 20px;
    }

    .quiet-line {
        margin: 30px 0 29px;
    }

    .ritual-card h2 {
        margin-bottom: 28px;
        font-size: 27px;
        line-height: 1.5;
    }

    .ritual-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .action-primary,
    .action-secondary {
        min-height: 55px;
    }

    .helper {
        margin-top: 18px;
        font-size: 12px;
        line-height: 1.8;
    }

    .growth-shell {
        width: calc(100% - 40px);
        padding: 88px 0 54px;
    }

    .growth-heading {
        margin-bottom: 48px;
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .growth-heading > p {
        justify-self: start;
        font-size: 14px;
        text-align: left;
    }

    .growth-entry {
        min-height: 0;
        padding: 34px 0 38px;
        grid-template-columns: 1fr auto;
        gap: 20px;
    }

    .growth-date {
        grid-column: 1 / -1;
    }

    .growth-copy h3 {
        font-size: 23px;
    }

    .growth-index {
        align-self: start;
        font-size: 22px;
    }

    .growth-footer {
        margin-top: 48px;
        align-items: flex-end;
        gap: 24px;
    }

    .growth-footer p {
        max-width: 230px;
    }

    .ritual-dialog {
        width: calc(100% - 24px);
        max-height: calc(100dvh - 24px);
    }

    .dialog-header {
        padding: 27px 24px 23px;
    }

    .dialog-header h2 {
        font-size: 28px;
    }

    .dialog-body {
        padding: 27px 24px 20px;
    }

    .dialog-welcome {
        margin-bottom: 24px;
    }

    .ritual-field > span {
        font-size: 18px;
    }

    .ritual-field textarea {
        min-height: 96px;
        padding: 15px;
    }

    .ritual-field-secondary textarea {
        min-height: 78px;
    }

    .dialog-footer {
        padding: 20px 24px 27px;
        align-items: stretch;
        flex-direction: column-reverse;
        gap: 14px;
    }

    .dialog-footer > p {
        max-width: none;
    }

    .dialog-complete {
        width: 100%;
    }

    .ritual-toast {
        right: 20px;
        bottom: 20px;
        left: 20px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}
