/* ============================================
   Kartina.TV — App Landing
   ============================================ */

/* --- Fonts --- */
@font-face {
    font-family: 'Gilroy';
    src: url('/assets/fonts/Gilroy-Regular.woff2') format('woff2'),
         url('/assets/fonts/Gilroy-Regular.woff')  format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Gilroy';
    src: url('/assets/fonts/Gilroy-Medium.woff2') format('woff2'),
         url('/assets/fonts/Gilroy-Medium.woff')  format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Gilroy';
    src: url('/assets/fonts/Gilroy-Semibold.woff2') format('woff2'),
         url('/assets/fonts/Gilroy-Semibold.woff')  format('woff');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Gilroy';
    src: url('/assets/fonts/Gilroy-Bold.woff2') format('woff2'),
         url('/assets/fonts/Gilroy-Bold.woff')  format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* --- Tokens --- */
:root {
    /* Colors */
    --color-bg:        #000;
    --color-surface:   #1F1A1A;
    --color-surface-2: #2B2525;
    --color-text:      #FFFFFF;
    --color-muted:     #9B9D9F;
    --color-mute-2:    #BDBDBD;
    --color-orange:    #FF6600;
    --color-orange-2:  #FF8a3d;

    /* Typography */
    --font-sans: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Layout */
    --max-width:  90rem;   /* 1440px */
    --gutter:     clamp(1rem, 4vw, 2.5rem);
    --header-h:   5.25rem; /* 84px */
    --radius-sm:  0.5rem;
    --radius-md:  0.75rem;
    --radius-lg:  1.5rem;
    --radius-xl:  2.5rem;

    /* Easing */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--color-bg);
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    background:
        url('/assets/images/bg.jpg') center top / contain no-repeat,
        var(--color-bg);
}

img, svg, video { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.site-header,
main,
.site-footer { position: relative; z-index: 1; }

/* ============================================
   Header
   ============================================ */
.site-header {
    position: relative;
    z-index: 10;
    height: var(--header-h);
    display: flex;
    align-items: center;
}

.site-header__inner {
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.site-header__logo {
    grid-column: 2;
    display: inline-flex;
    transition: opacity 0.2s var(--ease-out);
}
.site-header__logo:hover { opacity: 0.85; }
.site-header__logo img { width: 160px; height: 48px; }

.site-header__support {
    grid-column: 3;
    justify-self: end;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    transition: color 0.2s var(--ease-out);
}
.site-header__support:hover { color: var(--color-orange); }

/* ============================================
   Hero
   ============================================ */
.hero {
    position: relative;
    padding-block: 1.5rem 0;
    overflow: hidden;
}

.hero__inner {
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "content device";
    gap: 2.5rem;
    align-items: start;
}

.hero__content {
    grid-area: content;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title    qr"
        "subtitle qr"
        "stores   qr"
        "rating   rating";
    column-gap: 2rem;
    row-gap: 1.5rem;
    align-items: start;
    max-width: 50rem;
    padding-block: 1.5rem;
}

.hero__title {
    grid-area: title;
    max-width: 27rem;
    font-size: clamp(2rem, 4.5vw, 3rem);     /* 32–48px */
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
}

.hero__subtitle {
    grid-area: subtitle;
    max-width: 28rem;
    font-size: clamp(1rem, 1.5vw, 1.125rem);
    line-height: 1.4;
    color: var(--color-mute-2);
}

.hero__stores {
    grid-area: stores;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.store-btn {
    display: inline-flex;
    transition: transform 0.2s var(--ease-out), opacity 0.2s var(--ease-out);
}
.store-btn:hover { transform: translateY(-2px); opacity: 0.92; }
.store-btn img { height: 3.75rem; width: auto; }

.hero__qr {
    grid-area: qr;
}
.hero__qr-frame {
    width: 13.75rem;
    height: 13.75rem;
    padding: 0.625rem;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 0.5rem 1.5rem rgba(0,0,0,0.4);
}
#qr-code,
#qr-code img,
#qr-code canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    border-radius: 0.25rem;
}

.hero__device {
    grid-area: device;
    align-self: start;
    width: 20.5rem;            /* 328px */
    margin-right: 3rem;
    margin-bottom: -8rem;       /* allow iPhone bottom to bleed below hero */
    pointer-events: none;
    position: relative;
    z-index: 1;
}
.hero__device img {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 1.5rem 3rem rgba(0,0,0,0.6));
}

/* Rating card */
.rating-card {
    grid-area: rating;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem;
    max-width: 26rem;
}
.rating-card__icon {
    width: 4.625rem;
    height: 4.625rem;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}
.rating-card__body { min-width: 0; }
.rating-card__name {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}
.rating-card__meta {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--color-muted);
    display: flex;
    gap: 0.375rem;
    align-items: center;
}
.rating-card__rating {
    margin-top: 0.375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-muted);
}
.rating-card__stars { display: inline-flex; gap: 0.1875rem; }
.rating-card__star {
    width: 0.875rem;
    height: 0.875rem;
    background: var(--color-muted);
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/></svg>") center/contain no-repeat;
}
.rating-card__star.is-on   { background: var(--color-orange); }
.rating-card__star.is-half { background: linear-gradient(90deg, var(--color-orange) 50%, var(--color-muted) 50%); }
.rating-card__score { font-weight: 600; color: var(--color-text); }

/* ============================================
   Features
   ============================================ */
.features {
    position: relative;
    padding-block: 0 2rem;
    padding-inline: var(--gutter);
    max-width: var(--max-width);
    margin-inline: auto;
}

.features__panel {
    position: relative;
    background: #1F1A1A;
    border-radius: 2.5rem;
    padding: 4.5rem 3rem 5rem;
    overflow: visible;
}

.features__head {
    text-align: center;
    margin-bottom: 2.5rem;
}
.features__title {
    font-size: clamp(1.75rem, 3vw, 2rem);
    font-weight: 600;
    line-height: 1.3;
}
.features__subtitle {
    margin-top: 0.5rem;
    font-size: 1.125rem;
    color: var(--color-muted);
}

.feature {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    /*gap: 3rem;*/
    padding-block: 0;
}
.feature + .feature { margin-top: -10rem; }

.feature__text { position: relative; z-index: 2; }

.feature__title {
    font-size: clamp(1.5rem, 2.4vw, 1.875rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.feature__desc {
    font-size: 1.125rem;
    line-height: 1.45;
    color: var(--color-mute-2);
    max-width: 32rem;
}
.feature__media {
    position: relative;
    z-index: 1;
}
.feature__media img {
    width: 100%;
    height: auto;
    /*max-width: 34rem;*/
    margin-inline: auto;
}

/* Let the last feature's image spill below the panel onto the CTA area */
.feature:last-of-type .feature__media {
    margin-bottom: -5rem;
}

/* ============================================
   FAQ
   ============================================ */
.faq {
    max-width: var(--max-width);
    margin-inline: auto;
    padding: 5rem var(--gutter) 4rem;
}
.faq__title {
    text-align: center;
    font-size: clamp(1.75rem, 3vw, 2rem);
    font-weight: 600;
    margin-bottom: 2.5rem;
}
.faq__list {
    max-width: 70.5rem;
    margin-inline: auto;
    display: grid;
    gap: 0.0625rem;
    background: var(--color-surface-2);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.faq-item {
    background: var(--color-surface);
}
.faq-item__q {
    list-style: none;
    cursor: pointer;
    padding: 1.5rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 1.125rem;
    font-weight: 500;
    transition: color 0.2s var(--ease-out);
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q:hover { color: var(--color-orange); }

.faq-item__icon {
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M6 9l6 6 6-6' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
    transition: transform 0.25s var(--ease-out);
}
.faq-item[open] .faq-item__icon { transform: rotate(180deg); }

.faq-item__a {
    padding: 0 2.5rem 1.75rem;
    color: var(--color-mute-2);
    font-size: 1rem;
    line-height: 1.55;
}
.faq-item__a p + p { margin-top: 0.75rem; }

/* ============================================
   CTA
   ============================================ */
.cta {
    position: relative;
    padding-block: 7.5rem 6rem;
    background: radial-gradient(ellipse 70% 90% at 50% 100%,
        rgba(255,102,0,1)   0%,
        rgba(255,102,0,0.75) 35%,
        rgba(255,102,0,0.25) 60%,
        rgba(255,102,0,0)   80%);
    text-align: center;
}
.cta__inner {
    max-width: 64rem;
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.cta__title {
    font-size: clamp(1.75rem, 3.5vw, 3rem);
    font-weight: 600;
    line-height: 1;
    color: var(--color-text);
}
.cta__title-accent {
    color: var(--color-orange);
    display: inline-block;
    margin-top: 0.5rem;
}
.cta__subtitle {
    margin-top: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text);
}
.cta__button {
    display: inline-block;
    margin-top: 2rem;
    padding: 1.25rem 2.5rem;
    background: var(--color-orange);
    color: var(--color-text);
    font-weight: 600;
    font-size: 1.125rem;
    border-radius: 0.5rem;
    box-shadow:
        0 0 1.25rem rgba(255,102,0,0.5),
        0 0 5rem   rgba(255,102,0,0.5);
    transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.cta__button:hover {
    transform: translateY(-2px);
    box-shadow:
        0 0 1.5rem rgba(255,102,0,0.65),
        0 0 6rem   rgba(255,102,0,0.55);
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: transparent;
    padding-block: 2.5rem 2.5rem;
}
.site-footer__inner {
    max-width: var(--max-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    font-size: 1.125rem;
    color: var(--color-text);
}
.site-footer__nav { gap: 3.25rem; }
.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.site-footer__nav a {
    opacity: 0.95;
    transition: opacity 0.2s var(--ease-out);
}
.site-footer__nav a:hover { opacity: 1; text-decoration: underline; }

/* ============================================
   Animation hooks (motion.dev sets initial state via JS)
   ============================================ */
.js [data-anim="hero-content"],
.js [data-anim="qr"],
.js [data-anim="device"],
.js [data-anim="rating"],
.js .feature[data-anim] { opacity: 0; }

/* ============================================
   Responsive — Tablet
   ============================================ */
@media (max-width: 63.9375rem) { /* < 1024px */
    .hero { padding-block: 1.5rem 3.5rem; }
    .hero__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "content"
            "device";
        gap: 2rem;
        justify-items: center;
        text-align: center;
    }
    .hero__content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "subtitle"
            "qr"
            "stores"
            "rating";
        justify-items: center;
        text-align: start;
        max-width: 36rem;
    }
    .hero__subtitle { margin-inline: auto; }
    .hero__stores { justify-content: center; }
    .rating-card { margin-inline: auto; }
    .hero__device { width: 17rem; }

    .features__panel { padding: 3rem 1.75rem 3.5rem; border-radius: 2rem; }
    .feature {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    .feature + .feature { margin-top: 1.5rem; }
    .feature:last-of-type .feature__media { margin-bottom: 0; }
    /* Always image first on small screens regardless of order */
    .feature__media { order: -1; }
    .feature__media img { max-width: 26rem; }
    .feature__desc { margin-inline: auto; }

    .faq-item__q { padding: 1.25rem 1.5rem; font-size: 1rem; }
    .faq-item__a { padding: 0 1.5rem 1.5rem; }
}

/* ============================================
   Responsive — Mobile
   ============================================ */
@media (max-width: 47.9375rem) { /* < 768px */
    :root { --header-h: 4rem; }

    .site-header__support { font-size: 0.875rem; }

    .hero { padding-block: 1.25rem 2.5rem; }
    .hero__title { font-size: clamp(1.625rem, 7vw, 2.25rem); }
    .hero__subtitle { font-size: 0.9375rem; }
    .hero__qr-frame { width: 11.5rem; height: 11.5rem; }
    .hero__stores { flex-direction: column; align-items: stretch; width: 100%; max-width: 18rem; }
    .store-btn { justify-content: center; }
    .store-btn img { height: 3.25rem; }
    .hero__device { display: none; }

    .features { padding-block: 1.5rem 0; }
    .features__panel { padding: 2.5rem 1.25rem 3rem; border-radius: 1.5rem; }
    .features__head { margin-bottom: 1.5rem; }
    .feature { padding-block: 0; }
    .feature + .feature { margin-top: 1rem; }
    .feature__title { font-size: 1.375rem; }
    .feature__desc { font-size: 1rem; }
    .feature__media img { max-width: 20rem; }

    .faq { padding-block: 3rem 2.5rem; }
    .faq__title { margin-bottom: 1.5rem; }
    .faq-item__q { padding: 1rem 1.25rem; gap: 0.75rem; }
    .faq-item__a { padding: 0 1.25rem 1.25rem; font-size: 0.9375rem; }

    .cta { padding-block: 3.5rem 3rem; }
    .cta__button { padding: 1rem 2.5rem; }

    .site-footer__inner { justify-content: center; text-align: center; }
}

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .js [data-anim] { opacity: 1 !important; transform: none !important; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
