:root {
    --os-bg: #FFF8F2;
    --os-bg-alt: #FFFFFF;
    --os-cream: #E7F0E2;
    --os-beige: #DCE6D8;
    --os-disabled-bg: #E8E4DC;
    --os-sage-pale: #D6E6D3;
    --os-sage: #89A58D;
    --os-sage-dark: #5C7357;
    --os-sage-deeper: #47593F;
    --os-gradient-dark: #A9CBAE;
    --os-gradient-light: #E7F0E2;
    --os-coral: #D4776A;
    --os-coral-shadow: #A65B50;
    --os-rose: #D4607A;
    --os-text: #2B3328;
    --os-text-2: #5B6558;
    --os-text-3: #8B948A;
    --os-border: #E3EAE0;
    --os-border-strong: #C9D6C5;
    --os-dark: #2B3328;
    --os-dark-shadow: #15190F;

    --os-radius-button: 20px;
    --os-radius-card: 20px;
    --os-radius-pill: 999px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--os-text);
    background: var(--os-bg);
}

.font-display { font-family: 'Fraunces', Georgia, serif; font-weight: 600; }
.font-display-italic { font-family: 'Fraunces', Georgia, serif; font-style: italic; font-weight: 500; }
.font-body { font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; }
.eyebrow {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--os-sage-dark);
}

/* Claymorphic CTA buttons */
.cta-clay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
    color: #FFFFFF;
    background-color: var(--os-sage);
    box-shadow: 0 6px 0 0 var(--os-sage-dark);
    border-radius: var(--os-radius-button);
    padding: 1rem 1.75rem;
    min-height: 54px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 200ms ease;
    will-change: transform;
}
.cta-clay:hover { transform: translateY(-2px); box-shadow: 0 8px 0 0 var(--os-sage-dark); }
.cta-clay:active, .cta-clay.is-pressed { transform: translateY(6px); box-shadow: 0 0 0 0 var(--os-sage-dark); }

.cta-clay--dark { background-color: var(--os-dark); box-shadow: 0 6px 0 0 var(--os-dark-shadow); }
.cta-clay--dark:hover { box-shadow: 0 8px 0 0 var(--os-dark-shadow); }
.cta-clay--dark:active { box-shadow: 0 0 0 0 var(--os-dark-shadow); }

.cta-clay--coral { background-color: var(--os-coral); box-shadow: 0 6px 0 0 var(--os-coral-shadow); }
.cta-clay--coral:hover { box-shadow: 0 8px 0 0 var(--os-coral-shadow); }
.cta-clay--coral:active { box-shadow: 0 0 0 0 var(--os-coral-shadow); }

.cta-clay--lg { padding: 1.1rem 2.25rem; font-size: 1.05rem; min-height: 60px; }
.cta-clay[disabled], .cta-clay--soon {
    background-color: var(--os-disabled-bg);
    color: var(--os-text-3);
    box-shadow: none;
    cursor: default;
}
.cta-clay--soon:hover { transform: none; }

/* Soft chip / pill */
.os-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--os-radius-pill);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.7);
    color: var(--os-text);
    border: 1px solid var(--os-border-strong);
}

/* Card */
.os-card {
    background: var(--os-bg-alt);
    border-radius: var(--os-radius-card);
    padding: 1.75rem;
    border: 1px solid var(--os-border);
}

/* Category-flavoured challenge cards (showcase) */
.challenge-card {
    width: 240px;
    min-height: 200px;
    border-radius: 22px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 12px 32px -16px rgba(43, 51, 40, 0.25);
}
.challenge-card p {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.4;
}
.theme-sage    { background: linear-gradient(135deg, #A9CBAE 0%, #E7F0E2 100%); color: #2B3328; }
.theme-dark    { background: #2B3328; color: #F5ECE1; }
.theme-coral   { background: linear-gradient(135deg, #FFC9A8 0%, #FFB79D 100%); color: #2B3328; }
.theme-rose    { background: linear-gradient(135deg, #F0B9C4 0%, #D4607A 100%); color: #FFFFFF; }
.theme-cream   { background: #F5ECE1; color: #2B3328; }
.theme-blue    { background: linear-gradient(135deg, #B7CFE0 0%, #7AB1BC 100%); color: #2B3328; }

.challenge-card--draft {
    background: linear-gradient(135deg, #A9CBAE 0%, #E7F0E2 100%);
    border: 2px dashed rgba(43, 51, 40, 0.35);
    box-shadow: none;
}
.challenge-card--draft p { font-style: italic; color: #2B3328; }
.draft-cursor {
    display: inline-block;
    margin-left: 2px;
    color: #2B3328;
    animation: os-blink 1s step-end infinite;
}
@keyframes os-blink { 50% { opacity: 0; } }

.card-row {
    display: flex;
    gap: 1.1rem;
    overflow-x: auto;
    padding: 1rem 1.5rem 1.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.card-row::-webkit-scrollbar { display: none; }
.card-row > * { scroll-snap-align: center; flex-shrink: 0; }
@media (min-width: 768px) {
    .card-row { justify-content: center; flex-wrap: wrap; }
}

/* Step number badge */
.step-num {
    width: 42px; height: 42px;
    border-radius: 999px;
    background: var(--os-dark);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.1rem;
}

/* Phone mockup (no real screenshots yet — mirrors the actual app UI) */
.phone {
    width: 250px;
    height: 520px;
    border-radius: 42px;
    background: #10140D;
    padding: 10px;
    box-shadow: 0 24px 48px -16px rgba(43, 51, 40, 0.35), 0 6px 12px -4px rgba(43, 51, 40, 0.15);
    flex-shrink: 0;
}
.phone__screen {
    width: 100%;
    height: 100%;
    border-radius: 34px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(180deg, var(--os-gradient-dark) 0%, var(--os-gradient-light) 55%);
    display: flex;
    flex-direction: column;
    padding: 30px 14px 16px;
}
.phone__screen.photo { padding: 0; display: block; }
.phone__shot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}
.phone__notch {
    position: absolute;
    top: 10px; left: 50%; transform: translateX(-50%);
    width: 80px; height: 18px;
    background: #10140D;
    border-radius: 999px;
    z-index: 5;
}
.phone__title {
    text-align: center;
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--os-text);
    margin-bottom: 14px;
}
.phone__pills { display: flex; justify-content: space-between; margin-bottom: 14px; }
.phone__pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.55);
    border-radius: 999px;
    padding: 5px 12px 5px 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--os-sage-deeper);
}
.phone__pill-dot { width: 20px; height: 20px; border-radius: 999px; background: #fff; }
.phone__card {
    background: #fff;
    border-radius: 20px;
    padding: 22px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 10px 24px -12px rgba(43,51,40,0.25);
}
.phone__card-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--os-text-3);
    margin-bottom: 10px;
}
.phone__card-title {
    font-family: 'Fraunces', serif;
    font-size: 1.15rem;
    line-height: 1.35;
    color: var(--os-text);
    margin-bottom: 16px;
}
.phone__card-btns { display: flex; gap: 8px; width: 100%; margin-top: 6px; }
.phone__btn {
    flex: 1;
    border-radius: 12px;
    padding: 9px 0;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
}
.phone__btn--primary { background: var(--os-sage); color: #fff; }
.phone__btn--ghost { border: 1.5px solid var(--os-sage); color: var(--os-sage-deeper); }
.phone__nav {
    display: flex;
    justify-content: space-around;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(43,51,40,0.08);
}
.phone__nav-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--os-text-3); }
.phone__nav-dot--active { background: var(--os-sage-deeper); width: 18px; border-radius: 999px; }

/* Stats-flavoured screen */
.phone__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: 100%; }
.phone__grid span { display: block; aspect-ratio: 1; border-radius: 3px; background: rgba(43,51,40,0.08); }

.phone--sm { width: 250px; height: 521px; border-radius: 42px; padding: 9px; }
.phone--sm .phone__screen { border-radius: 34px; }
.phone--sm .phone__notch { width: 77px; height: 18px; top: 9px; }

.phone-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    width: 340px;
    padding: 1.75rem !important;
}
.phone-item__caption {
    width: 100%;
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.3;
    color: var(--os-text);
    text-align: center;
    margin-bottom: 12px;
    min-height: 80px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    word-wrap: break-word;
}

.phone-row-wrap { position: relative; }
.phone-row-arrow {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--os-coral);
    color: #FFFFFF;
    border: none;
    box-shadow: 0 8px 20px -8px rgba(166, 91, 80, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 150ms ease, transform 150ms ease;
}
.phone-row-arrow:hover { transform: translateY(-50%) scale(1.06); }
.phone-row-arrow--prev { left: 6px; }
.phone-row-arrow--next { right: 6px; }
.phone-row-arrow[disabled] { opacity: 0; pointer-events: none; }
@media (max-width: 640px) {
    .phone-row-arrow { width: 38px; height: 38px; }
}

.phone-row {
    display: flex;
    gap: 2.5rem;
    overflow-x: auto;
    padding: 1rem 1.5rem 2rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    justify-content: flex-start;
    justify-content: safe center;
}
.phone-row::-webkit-scrollbar { display: none; }
.phone-row > * { scroll-snap-align: center; }

/* Focus ring */
.cta-clay:focus-visible, button:focus-visible, a:focus-visible {
    outline: 3px solid rgba(137, 165, 141, 0.5);
    outline-offset: 2px;
}

.os-snap-x {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.os-snap-x::-webkit-scrollbar { display: none; }

@media (max-width: 640px) {
    .touch-target { min-height: 44px; min-width: 44px; }
}

/* Legal pages */
.legal-content h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.35rem;
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    color: var(--os-text);
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content p, .legal-content li { color: var(--os-text-2); line-height: 1.7; margin-bottom: 0.85rem; }
.legal-content ul { list-style: disc; padding-left: 1.4rem; }
.legal-content strong { color: var(--os-text); }
.legal-content a { color: var(--os-sage-deeper); text-decoration: underline; }
