:root {
    --brand: #634473;
    --bg: #f9f6f1;
    --features-bg: #e8e2e5;
    --text: #333;
    --ink: #111;
    --cream: #fcfcf9;
    --content-primary: #0b0b0b;
    --content-tertiary: #666166;
    --yellow-50: #f9e5c6;
    --purple-50: #ede8e0;
    --blue-50: #e9ece3;
    --orange-50: #f9d8c2;
    --glass-border: rgba(255, 255, 255, 0.48);

    --font-serif: "Erode", Georgia, serif;
    --font-sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
    --tracking-tight: -0.04em;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 24px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
p,
ul {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

img {
    display: block;
    max-width: 100%;
}

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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.heading-1 {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 40px;
    line-height: 44px;
    letter-spacing: var(--tracking-tight);
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 40px;
    background: var(--ink);
    color: var(--cream);
    font-weight: 600;
    font-size: 16px;
    line-height: 24px;
    white-space: nowrap;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.button:hover {
    background: #000;
}

.button:active {
    transform: translateY(1px);
}

.button--hero {
    position: relative;
    padding: 16px 24px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.button--hero::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow:
        inset 0 -4px 4px rgba(0, 0, 0, 0.12),
        inset 0 4px 4px rgba(109, 91, 127, 0.25),
        inset 0 4px 12px rgba(255, 255, 255, 0.24);
}

.button--nav {
    flex-shrink: 0;
    height: 56px;
    padding: 0 24px 0 16px;
}

/* Navigation */

.site-nav {
    position: absolute;
    top: 32px;
    left: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(1175px, calc(100% - 48px));
    transform: translateX(-50%);
}

.site-nav__bar {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    gap: 24px;
    min-width: 0;
    height: 56px;
    padding: 0 32px 0 24px;
    border-radius: 40px;
    background: var(--brand);
}

.site-nav__logo {
    flex-shrink: 0;
}

.site-nav__links {
    display: flex;
    flex: 1;
    justify-content: flex-end;
    gap: 32px;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.site-nav__links a {
    transition: opacity 0.15s ease;
}

.site-nav__links a:hover {
    opacity: 0.72;
}

.site-nav__toggle {
    display: none;
}

/* Hero */

.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 40px;
    min-height: 960px;
    padding: 80px;
}

.hero__media {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 376px;
}

.hero__mockup {
    position: absolute;
    top: 0;
    left: calc(50% - 20px);
    width: 360px;
    height: 464px;
    max-width: none;
    object-fit: cover;
    transform: translateX(-50%);
    mask-image: url("../img/hero-mockup-mask.svg");
    mask-mode: luminance;
    mask-size: 100% 100%;
    mask-repeat: no-repeat;
}

.hero__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.hero__text {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero__title {
    color: var(--brand);
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 80px;
    line-height: 80px;
    letter-spacing: var(--tracking-tight);
    font-feature-settings: "zero" 1, "dlig" 1, "frac" 1;
}

.hero__subtitle {
    font-family: var(--font-serif);
    font-size: 24px;
    line-height: 28px;
    letter-spacing: var(--tracking-tight);
}

/* Statement sections */

.statement {
    display: flex;
    justify-content: center;
    padding: 160px 80px;
}

.statement__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    width: 100%;
    max-width: 480px;
}

.icon-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 64px;
    background: #fff;
}

.statement__text {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: center;
}

.statement__body {
    display: flex;
    flex-direction: column;
    gap: 28px;
    font-family: var(--font-serif);
    font-size: 24px;
    line-height: 28px;
    letter-spacing: var(--tracking-tight);
}

.statement__divider {
    width: 100%;
}

.statement__notes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.statement__notes-title {
    font-weight: 600;
}

/* Feature cards */

.features {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 80px;
    background: var(--features-bg);
}

.feature {
    display: flex;
    align-items: flex-start;
    width: 100%;
    max-width: 960px;
    overflow: hidden;
    border-radius: 40px;
    background: #fff;
}

.feature__text {
    display: flex;
    flex: 0 0 50%;
    flex-direction: column;
    gap: 160px;
    padding: 40px;
}

.feature__title {
    color: var(--brand);
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 40px;
    line-height: 44px;
    letter-spacing: var(--tracking-tight);
}

.feature__copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feature__lead {
    font-weight: 600;
}

.feature__visual {
    position: relative;
    display: flex;
    flex: 0 0 50%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    padding: 50px 60px;
    overflow: hidden;
    background: #fff url("../img/feature-bg.png") center / cover no-repeat;
    color: #fff;
}

.feature__visual--symptom-logging {
    gap: 8px;
    padding: 40px;
}

.feature__visual--insights {
    justify-content: flex-start;
    padding: 50px;
}

/* Symptom pills — sized from a 300px base via --s */

.symptom-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.symptom {
    display: flex;
    align-items: center;
    gap: calc(9px * var(--s));
    width: calc(300px * var(--s));
    max-width: 100%;
    padding: calc(12px * var(--s)) calc(18px * var(--s));
    border-radius: calc(12px * var(--s));
    background: #fff;
}

.symptom__category {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: calc(24px * var(--s));
    height: calc(24px * var(--s));
    border-radius: 24px;
}

.symptom__category--yellow { background: var(--yellow-50); }
.symptom__category--purple { background: var(--purple-50); }
.symptom__category--blue { background: var(--blue-50); }
.symptom__category--orange { background: var(--orange-50); }

.symptom__name {
    flex: 1;
    min-width: 0;
    color: var(--content-primary);
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: calc(18px * var(--s));
    line-height: calc(21px * var(--s));
    letter-spacing: var(--tracking-tight);
}

.symptom__rating {
    color: var(--content-tertiary);
    font-size: calc(12px * var(--s));
    line-height: calc(18px * var(--s));
    white-space: nowrap;
}

/* Notes */

.note {
    width: 360px;
    max-width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: #f5f5f5;
    color: var(--ink);
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 20px;
    line-height: 24px;
    letter-spacing: var(--tracking-tight);
}

.note--small {
    position: absolute;
    width: 320px;
    max-width: none;
    opacity: 0.8;
    font-size: 16px;
    line-height: 20px;
}

.note--top-left {
    top: 30px;
    left: -80px;
}

.note--bottom-right {
    top: 290px;
    left: 240px;
}

/* Good days */

.good-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 360px;
    max-width: 100%;
    padding: 40px;
    border-radius: 16px;
    background: #fff;
    color: #444;
    text-align: center;
}

.good-day__text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.good-day__title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 24px;
    line-height: 28px;
    letter-spacing: var(--tracking-tight);
}

.good-day__body {
    font-size: 14px;
    line-height: 20px;
}

/* Glass cards (insights, period, history) */

.glass-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.glass-card__label {
    margin-bottom: 4px;
    font-size: 14px;
    line-height: 20px;
}

.glass-card__value {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 28px;
    line-height: 32px;
    letter-spacing: var(--tracking-tight);
}

.glass-card__caption {
    font-size: 16px;
    line-height: 24px;
}

.insights {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.insights__title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 28px;
    line-height: 32px;
    letter-spacing: var(--tracking-tight);
}

.insights__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.glass-card--wide {
    grid-column: 1 / -1;
}

/* Period calendar */

.calendar {
    gap: 16px;
    width: 100%;
}

.calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
}

.calendar__title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 24px;
    line-height: 28px;
    letter-spacing: var(--tracking-tight);
}

.calendar__link {
    font-size: 14px;
    line-height: 20px;
}

.calendar__row {
    display: flex;
    justify-content: space-between;
}

.calendar__weekday {
    width: 24px;
    font-weight: 600;
    font-size: 14px;
    line-height: 24px;
    text-align: center;
}

.calendar__weeks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* History */

.history {
    position: absolute;
    top: 40px;
    right: 60px;
    left: 60px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    white-space: nowrap;
}

.history__stats {
    display: flex;
    gap: 16px;
}

.history__stats .glass-card {
    flex: 1;
}

.history__month {
    gap: 16px;
}

.history__day {
    display: flex;
    align-items: center;
    gap: 16px;
}

.history__date {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border: 1px solid #fff;
    border-radius: 16px;
}

.history__weekday {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 24px;
    line-height: 28px;
    letter-spacing: var(--tracking-tight);
}

/* Content pages */

.page-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 200px 80px 80px;
    text-align: center;
}

.page-header__title {
    max-width: 800px;
    color: var(--brand);
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 64px;
    line-height: 64px;
    letter-spacing: var(--tracking-tight);
}

.page-header__subtitle {
    max-width: 560px;
    font-family: var(--font-serif);
    font-size: 24px;
    line-height: 28px;
    letter-spacing: var(--tracking-tight);
}

.page-header__meta {
    color: var(--content-tertiary);
    font-size: 14px;
    line-height: 20px;
}

.page-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 0 80px 160px;
}

.page-content > .prose {
    width: 100%;
    max-width: 720px;
    padding: 40px;
    border-radius: 40px;
    background: #fff;
}

.prose h2 {
    margin: 40px 0 8px;
    color: var(--brand);
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 28px;
    line-height: 32px;
    letter-spacing: var(--tracking-tight);
}

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

.prose p + p {
    margin-top: 12px;
}

.prose ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 20px;
    list-style: disc;
}

.prose a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.faq {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 720px;
}

.faq__item {
    border-radius: 24px;
    background: #fff;
}

.faq__question {
    position: relative;
    padding: 24px 64px 24px 32px;
    color: var(--content-primary);
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 24px;
    line-height: 28px;
    letter-spacing: var(--tracking-tight);
    list-style: none;
    cursor: pointer;
}

.faq__question::-webkit-details-marker {
    display: none;
}

.faq__question::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 32px;
    color: var(--brand);
    font-family: var(--font-sans);
    font-size: 28px;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

.faq__item[open]:not(.is-closing) .faq__question::after {
    transform: translateY(-50%) rotate(45deg);
}

.faq__answer {
    padding: 0 32px 24px;
}

.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 720px;
    padding: 48px 40px;
    border-radius: 40px;
    background: #fff url("../img/feature-bg.png") center / cover no-repeat;
    color: #fff;
    text-align: center;
}

.contact-card p {
    max-width: 480px;
}

.contact-card .button {
    margin-top: 8px;
}

.contact-card__title {
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: 40px;
    line-height: 44px;
    letter-spacing: var(--tracking-tight);
}

/* Footer */

.site-footer {
    display: flex;
    justify-content: center;
    padding: 0 24px 32px;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(1175px, 100%);
    padding-top: 24px;
    border-top: 1px solid #d9d7d9;
    color: var(--content-tertiary);
    font-size: 14px;
    line-height: 20px;
}

.site-footer__links {
    display: flex;
    gap: 24px;
}

.site-footer__links a:hover {
    color: var(--brand);
}

/* Responsive */

@media (max-width: 960px) {
    .site-nav__bar {
        padding-right: 8px;
    }

    .site-nav__toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        margin-left: auto;
        padding: 0;
        border: 0;
        border-radius: 40px;
        background: transparent;
        color: #fff;
        cursor: pointer;
    }

    .site-nav__toggle-bars,
    .site-nav__toggle-bars::before,
    .site-nav__toggle-bars::after {
        display: block;
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .site-nav__toggle-bars {
        position: relative;
    }

    .site-nav__toggle-bars::before,
    .site-nav__toggle-bars::after {
        content: "";
        position: absolute;
        left: 0;
    }

    .site-nav__toggle-bars::before { top: -6px; }
    .site-nav__toggle-bars::after { top: 6px; }

    .site-nav.is-open .site-nav__toggle-bars { background: transparent; }
    .site-nav.is-open .site-nav__toggle-bars::before { transform: translateY(6px) rotate(45deg); }
    .site-nav.is-open .site-nav__toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

    .site-nav__links {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 8px;
        border-radius: 24px;
        background: var(--brand);
    }

    .site-nav.is-open .site-nav__links {
        display: flex;
    }

    .site-nav__links a {
        display: block;
        padding: 12px 16px;
    }

    .hero__title {
        font-size: 64px;
        line-height: 64px;
    }

    .features {
        padding: 40px 24px;
    }
}

@media (max-width: 760px) {
    .hero {
        min-height: 0;
        padding: 120px 24px 80px;
    }

    .hero__media {
        height: 300px;
    }

    .hero__mockup {
        width: 288px;
        height: 371px;
    }

    .hero__title {
        font-size: 44px;
        line-height: 48px;
    }

    .hero__subtitle,
    .statement__body {
        font-size: 20px;
        line-height: 24px;
    }

    .statement {
        padding: 96px 24px;
    }

    .heading-1,
    .feature__title {
        font-size: 32px;
        line-height: 36px;
    }

    .features {
        gap: 24px;
        padding: 24px 16px;
    }

    .feature {
        flex-direction: column;
        border-radius: 32px;
    }

    .feature__text {
        flex-basis: auto;
        gap: 48px;
        padding: 32px 24px;
    }

    .feature__visual {
        flex-basis: auto;
        width: 100%;
        min-height: 400px;
        padding: 40px 24px;
    }

    .feature__visual--insights {
        min-height: 0;
    }

    .feature__visual--history {
        height: 440px;
    }

    .history {
        right: 24px;
        left: 24px;
    }

    .page-header {
        padding: 136px 24px 48px;
    }

    .page-header__title {
        font-size: 44px;
        line-height: 48px;
    }

    .page-header__subtitle {
        font-size: 20px;
        line-height: 24px;
    }

    .page-content {
        gap: 24px;
        padding: 0 16px 96px;
    }

    .page-content > .prose,
    .contact-card {
        padding: 32px 24px;
        border-radius: 32px;
    }

    .faq__question {
        padding: 20px 56px 20px 24px;
        font-size: 20px;
        line-height: 24px;
    }

    .faq__question::after {
        right: 24px;
    }

    .faq__answer {
        padding: 0 24px 20px;
    }

    .contact-card__title {
        font-size: 32px;
        line-height: 36px;
    }

    .contact-card .button {
        white-space: normal;
    }
}

@media (max-width: 520px) {
    .site-nav {
        top: 16px;
        gap: 8px;
        width: calc(100% - 32px);
    }

    .site-nav__logo img {
        width: 130px;
        height: auto;
    }

    .button--nav {
        width: 56px;
        padding: 0;
        justify-content: center;
    }

    .button--nav .button__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Motion — opacity and transforms only, so everything stays on the compositor.
   Keyframes omit their end state so elements settle on their own styles
   (e.g. the inline opacity on symptom pills). */

@keyframes rise {
    from {
        opacity: 0;
        translate: 0 24px;
    }
}

@keyframes pop {
    from {
        opacity: 0;
        scale: 0.4;
    }
}

@keyframes drift {
    50% {
        transform: translateY(-10px);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .hero__mockup,
    .hero__title,
    .hero__subtitle,
    .button--hero {
        animation: rise 1s var(--ease-out) backwards;
    }

    .hero__mockup { animation-duration: 1.2s; }
    .hero__title { animation-delay: 0.15s; }
    .hero__subtitle { animation-delay: 0.25s; }
    .button--hero { animation-delay: 0.35s; }

    /* Scroll reveals: held on their first frame until JS marks the group visible. */
    .js .reveal {
        --reveal-delay: calc(var(--i, 0) * 70ms + var(--reveal-base, 0ms));
        animation: rise 0.8s var(--ease-out) var(--reveal-delay) backwards paused;
    }

    .js .reveal--pop {
        --reveal-delay: calc(var(--i, 0) * 40ms + var(--reveal-base, 0ms));
        animation-name: pop;
        animation-duration: 0.5s;
        animation-timing-function: var(--ease-spring);
    }

    .js .is-visible .reveal,
    .js .reveal.is-visible {
        animation-play-state: running;
    }

    .feature__visual {
        --reveal-base: 200ms;
    }

    .calendar__weeks {
        --reveal-base: 450ms;
    }

    .js .note--small.reveal {
        animation:
            rise 0.8s var(--ease-out) var(--reveal-delay) backwards,
            drift 8s ease-in-out var(--drift-delay, 0s) infinite;
        animation-play-state: paused;
    }

    .note--top-left {
        --drift-delay: -4s;
    }

    /* Only loop while the card is on screen. */
    .js .is-in-view .note--small.reveal {
        animation-play-state: running;
    }
}
