/* ============================================
   Rally Landing Page — Aesthetic Sage Palette
   ============================================ */

:root {
    --bg: #f5f2ec;
    --surface: #ede9e1;
    --primary: #7d9b76;
    --primary-dark: #5c7a55;
    --accent: #a3b899;
    --text: #2c2c2c;
    --text-muted: #6b6b6b;
    --border: #d4cfc7;
    --card-bg: #ffffff;
    --cta-text: #f5f2ec;

    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'DM Serif Display', Georgia, serif;

    --radius: 12px;
    --radius-lg: 20px;
    --shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---- Fade-in Animation ---- */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Section 1: Hero
   ============================================ */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
    position: relative;
    background: linear-gradient(160deg, var(--bg) 0%, #e8ede5 50%, var(--bg) 100%);
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    z-index: 100;
    background: rgba(245, 242, 236, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--primary-dark);
    letter-spacing: -0.02em;
}

.nav-cta {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 8px 20px;
    background: var(--primary);
    color: var(--cta-text);
    border-radius: 100px;
    transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
    background: var(--primary-dark);
    color: var(--cta-text);
    transform: scale(1.03);
}

.hero-content {
    max-width: 640px;
}

.hero-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-dark);
    background: rgba(125, 155, 118, 0.12);
    border: 1px solid rgba(125, 155, 118, 0.25);
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero-headline {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 20px;
}

.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--text-muted);
    margin-bottom: 36px;
    line-height: 1.5;
}

.hero-form {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto 16px;
}

.phone-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: var(--font-body);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.phone-input:focus {
    border-color: var(--primary);
}

.phone-input::placeholder {
    color: #b0aa9f;
}

.btn-primary {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-body);
    background: var(--primary);
    color: var(--cta-text);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.03);
}

.btn-primary:active {
    transform: scale(0.98);
}

.hero-note {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.hero-scroll-hint {
    position: absolute;
    bottom: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    animation: float 2s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ============================================
   Section 2: Problem
   ============================================ */
.problem {
    padding: 120px 24px;
    text-align: center;
}

.section-headline {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 48px;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 720px;
    margin: 0 auto 48px;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    box-shadow: var(--shadow);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--primary-dark);
    line-height: 1;
}

.stat-suffix {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--primary-dark);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.4;
}

.problem-copy {
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

.problem-copy strong {
    color: var(--text);
}

/* ============================================
   Section 3: SMS Demo
   ============================================ */
.sms-demo {
    padding: 100px 24px 120px;
    text-align: center;
    background: var(--surface);
}

.phone-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.phone-frame {
    width: 340px;
    max-width: 100%;
    background: var(--card-bg);
    border-radius: 36px;
    border: 3px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

.phone-notch {
    width: 120px;
    height: 28px;
    background: var(--card-bg);
    border-radius: 0 0 16px 16px;
    margin: 0 auto;
    border-bottom: 1px solid var(--border);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

.phone-header {
    padding: 8px 20px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.phone-header-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.phone-messages {
    padding: 16px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.sms-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.85rem;
    line-height: 1.45;
    white-space: pre-line;
    word-break: break-word;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.sms-bubble.visible {
    opacity: 1;
    transform: translateY(0);
}

.sms-sent {
    align-self: flex-end;
    background: var(--primary);
    color: var(--cta-text);
    border-bottom-right-radius: 6px;
}

.sms-received {
    align-self: flex-start;
    background: var(--surface);
    color: var(--text);
    border-bottom-left-radius: 6px;
}

.sms-link {
    color: var(--cta-text);
    text-decoration: underline;
    text-decoration-color: rgba(245, 242, 236, 0.5);
    font-size: 0.78rem;
    word-break: break-all;
}

.sms-received .sms-link {
    color: var(--primary-dark);
    text-decoration-color: rgba(92, 122, 85, 0.4);
}

.sms-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    background: var(--surface);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sms-typing.visible {
    opacity: 1;
}

.sms-typing span {
    width: 7px;
    height: 7px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingDot 1.2s ease-in-out infinite;
}

.sms-typing span:nth-child(2) { animation-delay: 0.2s; }
.sms-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

.phone-input-bar {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
}

.phone-input-placeholder {
    font-size: 0.8rem;
    color: #b0aa9f;
}

/* ============================================
   Section 4: Three Steps
   ============================================ */
.steps {
    padding: 100px 24px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.step-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.step-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    background: rgba(125, 155, 118, 0.1);
    border-radius: 14px;
    color: var(--primary-dark);
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin-bottom: 8px;
}

.step-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================
   Section 5: Activities
   ============================================ */
.activities {
    padding: 100px 24px;
    background: var(--surface);
    text-align: center;
}

.activities-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
}

.activity-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.activity-card:hover {
    transform: translateY(-2px);
}

.activity-emoji {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.activity-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.activity-info p {
    font-size: 0.75rem;
    color: var(--primary-dark);
    font-weight: 500;
}

/* ============================================
   Section 6: Why SMS
   ============================================ */
.why-sms {
    padding: 100px 24px;
    text-align: center;
}

.sms-points {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sms-point {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
}

.sms-point-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(125, 155, 118, 0.1);
    border-radius: 12px;
    color: var(--primary-dark);
    flex-shrink: 0;
}

.sms-point h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.sms-point p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ============================================
   Section 7: Final CTA
   ============================================ */
.final-cta {
    padding: 120px 24px;
    text-align: center;
    background: linear-gradient(180deg, var(--bg) 0%, #e8ede5 100%);
}

.or-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 300px;
    margin: 24px auto;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.sms-number {
    margin-bottom: 16px;
}

.sms-number a {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--primary-dark);
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.sms-number a:hover {
    color: var(--primary);
}

.legal-links {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.legal-links a {
    color: var(--text-muted);
}

.legal-links a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Section 8: Footer
   ============================================ */
.footer {
    padding: 40px 24px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin-bottom: 6px;
}

.footer-tagline {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    font-size: 0.8rem;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--primary-dark);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .stats-row {
        grid-template-columns: 1fr;
        gap: 14px;
        max-width: 320px;
    }

    .stat-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 20px 24px;
        text-align: left;
    }

    .stat-label {
        margin-top: 0;
    }

    .stat-label br {
        display: none;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .activities-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-form {
        flex-direction: column;
    }

    .hero-form .phone-input,
    .hero-form .btn-primary {
        width: 100%;
    }

    .phone-frame {
        width: 300px;
    }

    .section-headline br {
        display: none;
    }
}

@media (max-width: 480px) {
    .activities-grid {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .hero-headline {
        font-size: 2.25rem;
    }
}
