/* ═══════════════════════════════════════════════════════
   BREATHSYNC WAITLIST — DESIGN SYSTEM & STYLES
   ═══════════════════════════════════════════════════════ */

/* ─── TOKENS ─── */
:root {
    /* Backgrounds */
    --sand-beige:    #FAF6EF;
    --warm-sand:     #EDE5D8;
    --paper-white:   #FFFCF7;
    --cream-white:   #F8F3EB;

    /* Brand Greens */
    --sage-green:    #8FA372;
    --olive-dark:    #6E8050;
    --sage-light:    rgba(143,163,114,0.10);
    --deep-forest:   #3D5A2B;

    /* Warm Accents */
    --warm-orange:   #E8944E;
    --burnt-orange:  #D07B3E;
    --sand-tan:      #D2C4A8;
    --muted-gold:    #C9A96E;

    /* Text */
    --cocoa-brown:   #3B3028;
    --heading-brown: #3B3028;
    --soft-mocha:    #9A8B7C;
    --off-white:     #FFF9F0;

    /* Semantic */
    --error-rose:    #D67166;
    --success-green: #8BAC8D;

    /* Surfaces */
    --glass-bg:      rgba(255,255,255,0.55);
    --glass-border:  rgba(45,38,33,0.10);
    --border-sand:   rgba(210,196,168,0.30);

    /* Typography */
    --font-serif:    'Playfair Display', Georgia, serif;
    --font-sans:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --max-width:     1080px;
    --section-pad:   clamp(24px, 5vw, 64px);
}


/* ─── RESET ─── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ─── BODY & BACKGROUND ─── */
body {
    font-family: var(--font-sans);
    color: var(--cocoa-brown);
    background: linear-gradient(170deg, var(--sand-beige) 0%, var(--warm-sand) 50%, var(--cream-white) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Ambient glow orbs */
.bg-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}
.bg-orb--green {
    width: 600px;
    height: 600px;
    background: var(--sage-green);
    top: -150px;
    right: -100px;
    opacity: 0.18;
}
.bg-orb--orange {
    width: 500px;
    height: 500px;
    background: var(--warm-orange);
    bottom: -120px;
    left: -120px;
    opacity: 0.12;
}


/* ─── HEADER ─── */
.header {
    position: relative;
    z-index: 10;
    padding: max(28px, env(safe-area-inset-top)) var(--section-pad) 0;
}
.header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
}
.wordmark {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 26px;
    color: var(--heading-brown);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: -0.02em;
}
.wordmark__leaf {
    font-size: 20px;
    display: inline-block;
    animation: leafSway 3s ease-in-out infinite;
}
@keyframes leafSway {
    0%, 100% { transform: rotate(0deg); }
    50%      { transform: rotate(12deg); }
}


/* ─── HERO ─── */
.hero {
    position: relative;
    z-index: 1;
    padding: 40px var(--section-pad) 20px;
}
.hero__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
}
.hero__content {
    flex: 1;
    min-width: 0;
}
.hero__phone {
    flex: 0 0 auto;
    width: 380px;
    display: flex;
    justify-content: center;
}

/* Headline */
.hero__headline {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: clamp(36px, 5vw, 54px);
    line-height: 1.15;
    color: var(--heading-brown);
    letter-spacing: -0.02em;
    margin-bottom: 20px;
}

/* Sub */
.hero__sub {
    font-size: clamp(15px, 1.8vw, 18px);
    line-height: 1.65;
    color: var(--soft-mocha);
    max-width: 480px;
    margin-bottom: 32px;
}
.hero__launching {
    display: inline-block;
    margin-top: 6px;
    font-weight: 500;
    color: var(--cocoa-brown);
}


/* ─── FORM ─── */
.form-wrapper {
    position: relative;
    margin-bottom: 16px;
}
.form-card {
    background: var(--paper-white);
    border: 1px solid var(--border-sand);
    border-radius: 28px;
    padding: 6px;
    box-shadow:
        0 4px 24px rgba(74,63,53,0.06),
        0 1px 3px rgba(74,63,53,0.04);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
    max-width: 500px;
}
.form-card:focus-within {
    border-color: var(--sage-green);
    box-shadow:
        0 4px 24px rgba(143,163,114,0.15),
        0 1px 3px rgba(74,63,53,0.04);
}
.form-card.shake {
    animation: shake 0.45s ease;
    border-color: var(--error-rose);
}
.form-card__inner {
    display: flex;
    align-items: center;
    gap: 6px;
}
.form-card__input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 16px;
}
.form-card__icon {
    color: var(--soft-mocha);
    opacity: 0.5;
    flex-shrink: 0;
}
#email-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--cocoa-brown);
    padding: 16px 0;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}
#email-input::placeholder {
    color: var(--soft-mocha);
    opacity: 0.55;
}

/* CTA Button */
.cta-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 24px;
    border: none;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--sage-green), #A5B583);
    color: white;
    font-family: var(--font-sans);
    font-size: 15px;
    -webkit-appearance: none;
    appearance: none;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}
.cta-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 24px rgba(143,163,114,0.35);
}
.cta-btn:active {
    transform: scale(0.97);
}
.cta-btn__arrow {
    transition: transform 0.2s ease;
}
.cta-btn:hover .cta-btn__arrow {
    transform: translateX(3px);
}
.cta-btn__spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.cta-btn.loading .cta-btn__text,
.cta-btn.loading .cta-btn__arrow {
    display: none;
}
.cta-btn.loading .cta-btn__spinner {
    display: block;
}
.cta-btn.loading {
    padding: 14px 28px;
    pointer-events: none;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Form error */
.form-error {
    font-size: 13px;
    color: var(--error-rose);
    padding: 6px 18px 0;
    min-height: 22px;
    transition: opacity 0.3s ease;
}
.form-error:empty {
    opacity: 0;
}

/* Form success */
.form-success {
    display: none;
    text-align: center;
    padding: 32px 24px;
    background: var(--paper-white);
    border: 1px solid var(--border-sand);
    border-radius: 28px;
    box-shadow: 0 4px 24px rgba(74,63,53,0.06);
    max-width: 500px;
    animation: successPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.form-success.show {
    display: block;
}
.form-success__check {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sage-green), #A5B583);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkBounce 0.6s 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}
.form-success__title {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 22px;
    color: var(--heading-brown);
    margin-bottom: 6px;
}
.form-success__sub {
    font-size: 14px;
    color: var(--soft-mocha);
}

@keyframes successPop {
    0%   { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes checkBounce {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}


/* ─── TRUST LINE ─── */
.trust-line {
    font-size: 13px;
    color: var(--soft-mocha);
    max-width: 500px;
}
.trust-line strong {
    color: var(--cocoa-brown);
    font-weight: 600;
}


/* ═══════════════════════════════════════════════════════
   PHONE MOCKUP
   ═══════════════════════════════════════════════════════ */

.phone-container {
    position: relative;
    display: inline-flex;
    justify-content: center;
    margin: 0 auto;
}

/* Phone Frame */
.phone-frame {
    position: relative;
    width: 280px;
    height: 580px;
    background: #1a1a1a;
    border-radius: 44px;
    padding: 12px;
    box-shadow:
        0 30px 80px rgba(0,0,0,0.18),
        0 10px 30px rgba(0,0,0,0.10),
        inset 0 0 0 1px rgba(255,255,255,0.08);
    animation: phoneFloat 6s ease-in-out infinite;
    transform: rotate(3deg);
}
.phone-frame__notch {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 26px;
    background: #1a1a1a;
    border-radius: 0 0 18px 18px;
    z-index: 3;
}
.phone-frame__screen {
    width: 100%;
    height: 100%;
    border-radius: 34px;
    overflow: hidden;
    background: var(--sand-beige);
    position: relative;
}
.phone-frame__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* If no image yet, show a gradient placeholder */
.phone-frame__img[src=""],
.phone-frame__img:not([src]) {
    display: none;
}
.phone-frame__screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--sage-green) 0%, #a8b88a 40%, var(--warm-sand) 100%);
    opacity: 0.4;
    pointer-events: none;
}

@keyframes phoneFloat {
    0%, 100% { transform: translateY(0px) rotate(3deg); }
    50%      { transform: translateY(-14px) rotate(3deg); }
}


/* ─── FLOATING GLASS PILLS ─── */
.float-pill {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.70);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-sand);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
    white-space: nowrap;
    z-index: 2;
}
.float-pill__emoji {
    font-size: 18px;
}
.float-pill__value {
    font-size: 13px;
    font-weight: 600;
    color: var(--cocoa-brown);
}

/* Positions */
.float-pill--streak {
    top: 40px;
    right: -50px;
    animation: floatPill1 5s ease-in-out infinite;
}
.float-pill--technique {
    bottom: 80px;
    left: -60px;
    animation: floatPill2 6s ease-in-out 0.5s infinite;
}
.float-pill--mood {
    top: 50%;
    left: -55px;
    transform: translateY(-50%);
    animation: floatPill3 5.5s ease-in-out 1s infinite;
}

@keyframes floatPill1 {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
@keyframes floatPill2 {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-10px); }
}
@keyframes floatPill3 {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50%      { transform: translateY(calc(-50% - 6px)) translateX(-4px); }
}


/* ═══════════════════════════════════════════════════════
   FEATURE PILLS SECTION
   ═══════════════════════════════════════════════════════ */

.features {
    position: relative;
    z-index: 1;
    padding: 32px var(--section-pad) 24px;
}
.features__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.feature-pill {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 12px;
    background: rgba(255,255,255,0.50);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-sand);
    border-radius: 20px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: default;
}
.feature-pill:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.07);
}
.feature-pill__emoji {
    font-size: 28px;
    margin-bottom: 8px;
}
.feature-pill__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--cocoa-brown);
    margin-bottom: 3px;
}
.feature-pill__desc {
    font-size: 11px;
    color: var(--soft-mocha);
    line-height: 1.4;
}


/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */

.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 32px var(--section-pad) max(40px, env(safe-area-inset-bottom));
    font-size: 13px;
    color: var(--soft-mocha);
}


/* ═══════════════════════════════════════════════════════
   ANIMATIONS — ENTRANCE
   ═══════════════════════════════════════════════════════ */

.anim-fade-down {
    opacity: 0;
    transform: translateY(-10px);
    animation: fadeDown 0.6s ease-out forwards;
}
@keyframes fadeDown {
    to { opacity: 1; transform: translateY(0); }
}

.anim-slide-up {
    opacity: 0;
    transform: translateY(24px);
    animation: slideUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--delay, 0s);
}
@keyframes slideUp {
    to { opacity: 1; transform: translateY(0); }
}

.anim-slide-up-phone {
    opacity: 0;
    transform: translateY(40px);
    animation: slideUpPhone 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--delay, 0s);
}
@keyframes slideUpPhone {
    to { opacity: 1; transform: translateY(0); }
}


/* ═══════════════════════════════════════════════════════
   SHAKE ANIMATION
   ═══════════════════════════════════════════════════════ */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%      { transform: translateX(-8px); }
    30%      { transform: translateX(8px); }
    45%      { transform: translateX(-6px); }
    60%      { transform: translateX(6px); }
    75%      { transform: translateX(-3px); }
    90%      { transform: translateX(3px); }
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════════════════════ */

@media (max-width: 860px) {
    .hero__inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 32px;
    }

    .hero__content {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero__sub {
        max-width: 420px;
    }

    .hero__phone {
        width: 100%;
        max-width: 340px;
    }

    .phone-frame {
        width: 240px;
        height: 500px;
        border-radius: 38px;
        margin: 0 auto;
    }
    .phone-frame__screen {
        border-radius: 28px;
    }

    /* Reposition floating pills for mobile */
    .float-pill--streak {
        right: -10px;
        top: 20px;
    }
    .float-pill--technique {
        left: -10px;
        bottom: 60px;
    }
    .float-pill--mood {
        left: -10px;
        top: 45%;
    }
    .float-pill {
        padding: 8px 12px;
        border-radius: 12px;
    }
    .float-pill__value {
        font-size: 11px;
    }
    .float-pill__emoji {
        font-size: 14px;
    }

    /* Form stacked on mobile */
    .form-card {
        max-width: 100%;
        padding: 0;
        overflow: hidden;
    }
    .form-card__inner {
        flex-direction: column;
        gap: 0;
    }
    .form-card__input-wrap {
        padding: 10px 16px;
        border-bottom: 1px solid var(--border-sand);
        width: 100%;
    }
    #email-input {
        text-align: center;
        padding: 12px 0;
    }
    .cta-btn {
        width: 100%;
        justify-content: center;
        border-radius: 0;
        padding: 18px 24px;
        font-size: 16px;
    }

    .trust-line {
        text-align: center;
    }

    .features__inner {
        gap: 12px;
    }
    .feature-pill {
        min-width: calc(50% - 6px);
        padding: 16px 8px;
    }
}

@media (max-width: 480px) {
    .hero__headline {
        font-size: 30px;
    }
    .phone-frame {
        width: 210px;
        height: 440px;
        border-radius: 34px;
    }
    .phone-frame__screen {
        border-radius: 24px;
    }
    .float-pill--mood {
        display: none;
    }
}
