/* 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;
}

html {
    background-color: var(--white);
}

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(--white);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

.hero-content,
.video-section-content {
    width: 100%;
    height: 100%;
    border: 2px solid var(--border-grey);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-heading,
.video-section-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;
}

.videos-page .video-section-content {
    border: none;
}

.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-video-frame,
.video-frame {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
    z-index: 2;
    border: 2px solid var(--border-grey);
    background: transparent;
    pointer-events: none;
}

.hero-phone-wrap,
.video-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,
.video-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,
.video-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,
.video-phone-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.videos-page .hero-phone-screen,
.video-phone-screen {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
}

.hero-video-player,
.video-player {
    position: absolute;
}

.hero-video-controls,
.video-controls {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 16px 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.78) 100%);
}

.hero-video-audio,
.video-audio {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.hero-video-button,
.video-button {
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: var(--white);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    min-height: 40px;
    padding: 0 16px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.hero-video-button:hover,
.hero-video-button:focus-visible,
.video-button:hover,
.video-button:focus-visible {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.42);
    outline: none;
}

.hero-video-volume,
.video-volume {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--white);
}

.hero-video-volume-label,
.video-volume-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hero-video-volume-slider,
.video-volume-slider {
    width: clamp(96px, 18vw, 160px);
    accent-color: var(--white);
}

.hero-video-player-no-volume-slider .hero-video-volume,
.video-player-no-volume-slider .video-volume {
    display: none;
}

@media (max-width: 640px) {
    .hero-video-controls,
    .video-controls {
        gap: 10px;
        padding: 16px 12px 12px;
    }

    .hero-video-audio,
    .video-audio {
        gap: 8px;
    }

    .hero-video-button,
    .video-button {
        min-height: 36px;
        padding: 0 14px;
    }

    .hero-video-volume-slider,
    .video-volume-slider {
        width: 88px;
    }
}


/* Cards Section */
.cards-section {
    width: 100%;
    background-color: var(--light-grey);
    border-top: 1px solid var(--border-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,
    .video-section-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,
    .video-section-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,
    .video-section-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;
    }
}

/* Kids page hero: compact header without phone video */
.kids-hero {
    height: auto;
}

.kids-hero .hero-content {
    height: auto;
    border: none;
}

.kids-hero .hero-heading {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    transform: none;
    width: min(900px, 90%);
    margin: 0 auto;
    padding: var(--hero-top-padding) var(--card-edge-gap) var(--hero-bottom-padding);
}

@media (min-width: 600px) {
    .kids-hero .hero-heading {
        width: 100%;
        margin-top: var(--hero-top-padding);
        padding: var(--hero-cta-height) var(--card-edge-gap) var(--hero-bottom-padding);
    }
}

@media (min-width: 600px) and (max-width: 1023px) {
    .kids-hero .hero-heading {
        padding-top: calc(var(--hero-cta-height) + clamp(24px, 5vh, 48px));
    }
}

/* Video Grid (kids.html) */
.video-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 24px;
    box-sizing: border-box;
    background-color: var(--white);
}

.video-grid-item {
    height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--white);
}

@media (max-width: 1023px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 599px) {
    .video-grid {
        grid-template-columns: 1fr;
    }

    .video-grid-item {
        height: 100vh;
    }
}

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

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

/* QR Code Modal */
.qr-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.qr-modal-overlay.open {
    display: flex;
}

.qr-modal {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.qr-modal-caption {
    font-size: 14px;
    color: #333;
    margin: 0;
}
