/* ========================================================================
   FiveFlavours Quick Scan — landing page styles
   ======================================================================== */

.ff-quickscan,
.ff-quickscan * { box-sizing: border-box; }

.ff-quickscan {
    /* Brand flavour colours (used on result page headline) */
    --sweet:  #f15973;
    --sour:   #75b934;
    --salt:   #f5d600;
    --bitter: #7a4723;
    --umami:  #302050;

    /* Tile base colours — adjust here to change the question-tile look.
       Each tile uses a soft pastel base with a darker shade for the gradient,
       computed automatically with color-mix. */
    --tile-sweet:  #fddce0;
    --tile-sour:   #fffedb;
    --tile-salt:   #e1e8f8;
    --tile-bitter: #ebe5f5;
    --tile-umami:  #f7ebe2;

    /* Strength of the gradient darkening (0–100). Higher = more contrast. */
    --tile-darken: 25%;

    --orange: #ff6900;
    --ink:    #0a0a0a;
    --paper:  #f6f1ea;

    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--ink);
    color: #fff;
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.ff-quickscan button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}
.ff-quickscan button:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 4px;
}

/* Screens */
.ffq-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;     /* iOS Safari momentum scrolling */
    overscroll-behavior: contain;          /* don't bubble up to page scroll */
}
.ffq-screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Intro */
.ffq-intro {
    background:
        radial-gradient(circle at 30% 20%, rgba(255,105,0,0.15), transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(241,89,115,0.12), transparent 50%),
        var(--ink);
    text-align: center;
}
.ffq-intro .ffq-eyebrow {
    font-size: 12px;
    letter-spacing: 0.3em;
    color: var(--orange);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 24px;
}
.ff-quickscan .ffq-intro h1,
.ff-quickscan h1.ffq-title {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-weight: 900 !important;
    font-style: italic !important;
    font-size: clamp(56px, 13vw, 160px) !important;
    line-height: 0.9 !important;
    max-width: 12ch !important;
    margin: 0 auto 32px !important;
    padding: 0 !important;
    text-align: center !important;
    background: linear-gradient(180deg, #fff 0%, #999 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
}
.ffq-intro p {
    font-size: 16px;
    color: #ccc;
    max-width: 36ch;
    line-height: 1.5;
    margin: 0 auto 48px;
}
.ffq-cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--orange);
    color: #000;
    padding: 18px 36px;
    border-radius: 100px;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ffq-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255,105,0,0.4);
}
.ffq-cta::after { content: '→'; transition: transform 0.2s ease; }
.ffq-cta:hover::after { transform: translateX(4px); }
.ffq-intro .ffq-small {
    margin-top: 24px;
    font-size: 12px;
    color: #666;
}
.ffq-skip {
    display: inline-block;
    margin-top: 20px;
    color: #999;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 2px;
    transition: color 0.2s ease, border-color 0.2s ease;
}
.ffq-skip:hover {
    color: #fff;
    border-bottom-color: var(--orange);
}

/* Question */
.ffq-question .ffq-progress {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}
.ffq-progress .ffq-dot {
    width: 28px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    transition: background 0.3s ease;
}
.ffq-progress .ffq-dot.done    { background: var(--orange); }
.ffq-progress .ffq-dot.current { background: #fff; }

.ffq-prompt {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(28px, 5vw, 48px);
    text-align: center;
    margin: 56px auto 32px;
    max-width: 18ch;
    line-height: 1.1;
    color: #fff;
}

.ffq-tiles {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 920px;
    grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 720px) {
    .ffq-tiles { grid-template-columns: repeat(3, 1fr); }
}

.ffq-tile {
    aspect-ratio: 4 / 5;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    color: #fff;
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.06);
    padding: 0;
    width: 100%;
    text-align: left;
}
.ffq-tile:hover,
.ffq-tile:focus-visible {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    outline: none;
}
.ffq-tile::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--tile-bg, radial-gradient(circle at 30% 30%, #444, #111));
    background-size: cover;
    background-position: center;
    z-index: 0;
}
/* Dark overlay only on image tiles — keeps text legible on photos.
   Pastel tiles keep their soft look without darkening. */
.ffq-tile.has-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}
.ffq-tile-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}
.ffq-tile .ffq-word {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 28px;
    line-height: 1;
    font-weight: 400;
}
.ffq-tile .ffq-label {
    font-size: 11px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.85;
    font-weight: 600;
}

/* Per-flavour pastel gradient (used when no image is uploaded).
   Gradient = base colour (top-left) → automatically darkened (bottom-right). */
.ffq-tile:not(.has-image) {
    color: #1a1a1a;
}
.ffq-tile:not(.has-image) .ffq-word  { color: #1a1a1a; }
.ffq-tile:not(.has-image) .ffq-label { color: #1a1a1a; opacity: 0.6; }

.ffq-tile[data-flavour="sweet"]:not(.has-image) {
    --tile-bg: radial-gradient(circle at 30% 30%,
        var(--tile-sweet),
        color-mix(in srgb, var(--tile-sweet), #000 var(--tile-darken)) 90%);
}
.ffq-tile[data-flavour="sour"]:not(.has-image) {
    --tile-bg: radial-gradient(circle at 30% 30%,
        var(--tile-sour),
        color-mix(in srgb, var(--tile-sour), #000 var(--tile-darken)) 90%);
}
.ffq-tile[data-flavour="salt"]:not(.has-image) {
    --tile-bg: radial-gradient(circle at 30% 30%,
        var(--tile-salt),
        color-mix(in srgb, var(--tile-salt), #000 var(--tile-darken)) 90%);
}
.ffq-tile[data-flavour="bitter"]:not(.has-image) {
    --tile-bg: radial-gradient(circle at 30% 30%,
        var(--tile-bitter),
        color-mix(in srgb, var(--tile-bitter), #000 var(--tile-darken)) 90%);
}
.ffq-tile[data-flavour="umami"]:not(.has-image) {
    --tile-bg: radial-gradient(circle at 30% 30%,
        var(--tile-umami),
        color-mix(in srgb, var(--tile-umami), #000 var(--tile-darken)) 90%);
}

/* Interstitial */
.ffq-interstitial {
    background: var(--ink);
    text-align: center;
}
.ffq-pulse {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--orange);
    margin-bottom: 32px;
    animation: ffq-pulse 1.4s infinite;
}
@keyframes ffq-pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50%      { transform: scale(1.2); opacity: 1; }
}
.ffq-interstitial-msg {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(28px, 5vw, 48px);
    max-width: 16ch;
}

/* Result (the A4) */
.ffq-result {
    background: var(--paper);
    color: var(--ink);
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;                      /* always scrollable, not just .active */
    -webkit-overflow-scrolling: touch;
}

.ffq-cover {
    position: relative;
    /* 100dvh = dynamic viewport, respects mobile browser bars; 100vh as fallback */
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    overflow: visible;                     /* never clip cover content */
}
.ffq-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--flavour-bg);
    opacity: 0.08;
    pointer-events: none;
}

.ffq-masthead {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ink);
    margin-bottom: 18px;
    position: relative;
    z-index: 2;
}
.ffq-masthead .ffq-brand {
    font-weight: 900;
    letter-spacing: 0.2em;
    font-size: 13px;
    text-transform: uppercase;
}
.ffq-masthead .ffq-issue {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.7;
}

.ff-quickscan .ffq-headline,
.ff-quickscan h2.ffq-headline {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-style: italic !important;
    font-weight: 900 !important;
    font-size: clamp(56px, 11vw, 130px) !important;
    line-height: 0.85 !important;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
    color: var(--flavour-bg) !important;
    text-transform: uppercase !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    position: relative;
    z-index: 2;
}
.ffq-subhead {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(18px, 2.6vw, 26px);
    line-height: 1.2;
    max-width: 28ch;
    margin-bottom: 20px;
    position: relative;
    z-index: 2;
}
.ffq-subhead em {
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
    text-decoration-color: var(--flavour-bg);
    font-style: italic;
}

.ffq-spreads {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 16px;
    position: relative;
    z-index: 2;
}
/* Tablet+: keep all 4 side-by-side so the page fits in one viewport. */
@media (min-width: 720px) {
    .ffq-spreads { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 20px; }
}

.ffq-spread {
    border-top: 1px solid var(--ink);
    padding-top: 12px;
}
.ffq-spread .ffq-eyebrow {
    font-size: 9px;
    letter-spacing: 0.2em;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--flavour-bg);
}
.ffq-spread h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 17px;
    line-height: 1.15;
    margin: 0 0 8px;
}
.ffq-spread p {
    font-size: 12.5px;
    line-height: 1.45;
    color: #2a2a2a;
    margin: 0 0 6px;
}

.ffq-philo-long {
    display: none;
}
.ffq-philo-long.open { display: block; }

.ffq-readmore {
    background: none;
    border: none;
    padding: 0;
    color: var(--flavour-bg);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
    margin-top: 6px;
}
.ffq-readmore:hover { text-decoration: underline; }

.ffq-cocktail .ffq-glass {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--flavour-bg);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}
.ffq-cocktail .ffq-glass::after {
    content: '';
    position: absolute;
    inset: 12px;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
}
.ffq-cocktail ul {
    list-style: none;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}
.ffq-cocktail ul li::before { content: '— '; opacity: 0.5; }

.ffq-playlist ol {
    list-style: none;
    counter-reset: ffq-track;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}
.ffq-playlist li {
    counter-increment: ffq-track;
    padding-left: 24px;
    position: relative;
    padding-bottom: 4px;
}
.ffq-playlist li::before {
    content: counter(ffq-track, decimal-leading-zero);
    position: absolute;
    left: 0;
    font-weight: 800;
    color: var(--flavour-bg);
    font-size: 10px;
}

/* Conversion block (after the 4 spreads on the result page) */
.ffq-conversion {
    border-top: 1px solid var(--ink);
    padding: 16px 0 4px;
    margin-top: auto;            /* push to bottom of cover so it sits within viewport */
    position: relative;
    z-index: 2;
    text-align: center;
}
.ffq-conv-headline {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-style: italic !important;
    font-weight: 900 !important;
    font-size: clamp(22px, 3vw, 32px) !important;
    line-height: 1.1 !important;
    margin: 0 0 6px !important;
    color: var(--flavour-bg) !important;
    text-align: center !important;
}
.ffq-conv-text {
    font-size: 13px !important;
    line-height: 1.4 !important;
    max-width: 52ch;
    margin: 0 auto 12px !important;
    color: #2a2a2a !important;
}

.ffq-actions {
    padding: 6px 0 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}
.ffq-btn {
    padding: 11px 20px;
    border-radius: 100px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 0.2s ease;
    text-decoration: none;
    display: inline-block;
}
.ffq-btn.primary { background: var(--ink); color: var(--paper); }
.ffq-btn.ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--ink);
}
.ffq-btn:hover { transform: translateY(-2px); }

/* =============================================================
   Upsell screen — magazine-cover continuation of the result A4
   ============================================================= */
.ffq-upsell {
    background: var(--paper);
    color: var(--ink);
    padding: 0;
    align-items: stretch;
    justify-content: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ffq-upsell-cover {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}
.ffq-upsell-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--flavour-bg);
    opacity: 0.08;
    pointer-events: none;
}

.ffq-upsell-headline {
    color: var(--flavour-bg) !important;
    /* Override the giant result-page headline scale — upsell has more content
       below, so the headline must be smaller. */
    font-size: clamp(40px, 7vw, 80px) !important;
    line-height: 0.9 !important;
    margin-bottom: 4px !important;
}
.ffq-upsell .ffq-subhead {
    font-size: clamp(15px, 2vw, 20px);
    margin-bottom: 10px;
}

.ffq-upsell-intro {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(13px, 1.5vw, 15px);
    line-height: 1.35;
    max-width: 70ch;
    margin: 4px 0 12px;
    color: #2a2a2a;
    position: relative;
    z-index: 2;
}

.ffq-upsell-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 8px;
    position: relative;
    z-index: 2;
}
@media (min-width: 720px) {
    .ffq-upsell-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}

/* Discover checklist — 2-column layout to halve vertical space */
.ffq-discover-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.25;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 2px;
}
.ffq-discover-list li {
    padding: 3px 0 3px 22px;
    position: relative;
}
.ffq-discover-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 3px;
    width: 15px;
    height: 15px;
    background: var(--flavour-bg);
    color: var(--paper);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 800;
}

/* Locked preview cards — 3–4 col grid keeps it short vertically */
.ffq-locked-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}
@media (min-width: 480px) {
    .ffq-locked-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
    .ffq-locked-cards { grid-template-columns: repeat(4, 1fr); }
}
.ffq-locked-cards li {
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(4px);
    border: 1px dashed rgba(0,0,0,0.25);
    border-radius: 6px;
    padding: 6px 6px 6px 26px;
    position: relative;
    font-size: 10.5px;
    font-weight: 600;
    color: #555;
    line-height: 1.2;
    overflow: hidden;
    min-height: 32px;
    display: flex;
    align-items: center;
}
.ffq-locked-cards li::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(246,241,234,0.6) 100%);
    pointer-events: none;
}
.ffq-lock {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    z-index: 1;
}
.ffq-locked-title {
    position: relative;
    z-index: 1;
}

/* Promise block */
.ffq-upsell-promise {
    border-top: 1px solid var(--ink);
    padding-top: 10px;
    margin-top: auto;
    margin-bottom: 8px;
    max-width: 64ch;
    position: relative;
    z-index: 2;
}
.ffq-upsell-promise p {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(13px, 1.5vw, 15px);
    line-height: 1.3;
    color: #2a2a2a;
    margin: 0;
}
.ffq-upsell-promise .ffq-eyebrow {
    color: var(--flavour-bg);
    margin-bottom: 4px;
}

.ffq-upsell .ffq-actions {
    border-top: 1px solid var(--ink);
    padding: 10px 0;
    justify-content: space-between;
}
