/* CSS Variables */
:root {
    --white: #ffffff;
    --light-grey: #f5f5f7;
    --border-grey: #d2d2d7;
    --text-dark: #1d1d1f;
    --footer-text: #6e6e73;
    --card-gap: 16px;
    --card-edge-gap: 32px;
    --border-radius: 12px;
    --hero-top-padding: 36px;
    --hero-bottom-padding: 20px;
    --hero-stack-gap: 16px;
    --hero-cta-height: clamp(40px, 6vw, 48px);
    --hero-cta-padding-y: clamp(10px, 2vw, 14px);
    --hero-cta-padding-x: clamp(22px, 4vw, 32px);
    --hero-cta-font-size: clamp(14px, 2vw, 16px);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--light-grey);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero {
    width: 100%;
    height: 100vh;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    width: 100%;
    height: 100%;
    border: 2px solid var(--border-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0;
    animation: fadeIn 0.8s ease-out 0.2s forwards;
}

.hero-heading {
    position: absolute;
    top: var(--hero-top-padding);
    bottom: var(--hero-bottom-padding);
    left: 50%;
    transform: translateX(-50%);
    width: min(900px, 90%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hero-stack-gap);
    text-align: center;
}

.hero-title {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: clamp(32px, 4.6vw, 64px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-dark);
}

.hero-title-line {
    display: block;
    white-space: nowrap;
}

.hero-icon {
    width: clamp(120px, 18vw, 200px);
    height: auto;
}

.hero-cta {
    background-color: var(--text-dark);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    padding: var(--hero-cta-padding-y) var(--hero-cta-padding-x);
    font-family: inherit;
    font-size: var(--hero-cta-font-size);
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    align-self: center;
    min-height: var(--hero-cta-height);
    text-decoration: none;
}

.hero-cta-ios {
    display: none;
    align-self: center;
    line-height: 0;
}

.hero-cta-ios img {
    height: calc(var(--hero-cta-height) * 1.331);
    width: auto;
    display: block;
}

.hero-phone {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 2;
}

.hero-phone-wrap {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 0;
}

.hero-phone-media {
    position: relative;
    height: 100%;
    width: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1350 / 2760;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-phone-screen {
    position: absolute;
    top: 2.5%;
    bottom: 2.5%;
    left: 5.35%;
    right: 5.35%;
    overflow: hidden;
    border-radius: 6%;
    background: #000;
    z-index: 1;
}

.hero-phone-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Cards Section */
.cards-section {
    width: 100%;
    background-color: var(--light-grey);
    padding: var(--card-edge-gap);
    flex: 1;
}

.cards-container {
    display: grid;
    gap: var(--card-gap);
    max-width: 1400px;
    margin: 0 auto;
}

.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    border: 2px solid var(--border-grey);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    min-height: 336px;
    position: relative;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    padding: 51px 24px 32px;
    text-align: center;
}

.card-icon {
    width: 64px;
    height: 64px;
    margin-top: 0;
    margin-bottom: 24px;
    object-fit: contain;
}

.card-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.2;
}

.card-text {
    font-size: 16px;
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.5;
    opacity: 0.8;
    margin-top: 24px;
    margin-bottom: 0;
}

/* Footer */
.footer {
    background-color: var(--white);
    padding: 32px 24px;
    border-top: 1px solid var(--border-grey);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--footer-text);
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--text-dark);
}

.divider {
    color: var(--border-grey);
    font-size: 14px;
}

/* Animations */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Tablet + Desktop hero layout */
@media (min-width: 600px) {
    .hero-title {
        transform: translateY(-10%);
    }

    .hero-heading {
        width: 100%;
        left: 0;
        right: 0;
        transform: none;
        padding: var(--hero-cta-height) var(--card-edge-gap) 0;
    }

    .hero-icon,
    .hero-cta,
    .hero-cta-ios {
        position: absolute;
        top: 0;
    }

    .hero-icon {
        left: var(--card-edge-gap);
    }

    .hero-cta,
    .hero-cta-ios {
        right: var(--card-edge-gap);
    }

    .hero-cta {
        min-height: var(--hero-cta-height);
        line-height: 1.2;
    }
}

/* Desktop: 4 cards per row (3 rows) */
@media (min-width: 1024px) {
    .cards-container {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(3, 1fr);
    }
}

/* Wide screens: let cards expand while keeping edge gap consistent */
@media (min-width: 1400px) {
    .cards-container {
        max-width: none;
        width: 100%;
    }
}

/* Tablet: 3 cards per row (4 rows) */
@media (min-width: 600px) and (max-width: 1023px) {
    .hero-heading {
        padding-top: calc(var(--hero-cta-height) + clamp(24px, 5vh, 48px));
    }

    .cards-container {
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(4, 1fr);
    }

    .card {
        min-height: 288px;
        padding-top: 27px;
    }
}

/* Mobile: 2 cards per row (6 rows) */
@media (max-width: 599px) {
    :root {
        --hero-cta-height: clamp(36px, 9vw, 44px);
        --hero-cta-padding-y: clamp(8px, 3.2vw, 12px);
        --hero-cta-padding-x: clamp(18px, 6vw, 28px);
        --hero-cta-font-size: clamp(13px, 3.4vw, 15px);
    }
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(6, 1fr);
    }

    .card {
        min-height: 240px;
        padding: 16px 16px 24px;
        min-width: 0;
    }

    .card-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 24px;
        object-fit: contain;
    }

    .card-title {
        font-size: 20px;
    }

    .card-text {
        font-size: 14px;
    }

    .hero-title {
        font-size: clamp(24px, 7vw, 40px);
    }

    .hero-heading {
        top: 24px;
        bottom: 16px;
        width: 92%;
        gap: 28px;
    }

    .hero-icon {
        width: clamp(110px, 36vw, 160px);
    }


    .footer-links {
        gap: 12px;
    }

    .footer-link,
    .divider {
        font-size: 12px;
    }
}

/* Extra small mobile: enforce equal card widths */
@media (max-width: 399px) {
    .cards-container {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .card {
        min-width: 0;
        overflow: hidden;
    }

    .card-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Policy Pages */
.page-header {
    background-color: var(--white);
    padding: var(--hero-top-padding) var(--card-edge-gap);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(var(--hero-top-padding) + 60px);
}

.page-header-icon-link {
    position: absolute;
    left: var(--card-edge-gap);
    top: var(--hero-top-padding);
    display: flex;
    align-items: center;
}

@media (min-width: 600px) {
    .page-header .hero-icon {
        position: static;
        left: auto;
        top: auto;
    }
}

.page-title {
    font-size: clamp(32px, 4.6vw, 64px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    text-align: center;
}

.policy-content {
    flex: 1;
    background-color: var(--white);
    padding: var(--card-edge-gap);
}

.policy-body {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 40px;
}

.policy-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 32px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.policy-body h3:first-child {
    margin-top: 0;
}

.policy-body p {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 12px;
    opacity: 0.85;
}

.policy-body ul {
    list-style: disc;
    padding-left: 24px;
    margin-bottom: 12px;
}

.policy-body li {
    font-size: 15px;
    font-weight: 400;
    color: var(--text-dark);
    line-height: 1.7;
    margin-bottom: 6px;
    opacity: 0.85;
}

.policy-content + .footer {
    border-top: none;
}

.footer-link a,
a.footer-link {
    text-decoration: none;
    color: var(--footer-text);
}

a.footer-link:hover {
    color: var(--text-dark);
}

@media (max-width: 599px) {
    .page-header {
        flex-direction: column;
        gap: 16px;
        padding-top: 24px;
        padding-bottom: 24px;
        min-height: unset;
    }

    .page-header-icon-link {
        position: static;
        transform: none;
    }

    .page-title {
        font-size: clamp(24px, 7vw, 40px);
    }

    .policy-body {
        padding: 28px 20px;
    }

    .policy-body h3 {
        font-size: 16px;
    }

    .policy-body p,
    .policy-body li {
        font-size: 14px;
    }
}

/* Card animation on scroll */
.card.visible {
    animation: cardFadeIn 0.5s ease-out forwards;
}

@keyframes cardFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
