/*
 * ChordIQ landing page — /products/chordiq and /:lang/products/chordiq.
 * Standalone: no Bootstrap, no landing bundle, nothing shared with the Piano
 * Companion page. The palette is the App Store listing's own: electric violet
 * with a white diagonal cut, and the app's dark game screen with cyan answer
 * buttons and magenta highlights.
 */

/* Bravura (SIL OFL, licence in public/fonts/bravura-OFL.txt): the music font of
   the ChordIQ app, the same subset the free games load. Relative URL so the
   version prefix of the static path is kept (see apps/chordiq-games/src/games.css). */
@font-face {
    font-family: 'Bravura';
    src: url('../../public/fonts/bravura-subset.woff2') format('woff2'),
         url('../../public/fonts/bravura-subset.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: block;
}

:root {
    --violet: #3b2bf0;
    --violet-deep: #22169e;
    --ink: #140e4c;
    --ink-soft: #4a4577;
    --game: #221c33;
    --game-2: #2e2745;
    --cyan: #17b3e6;
    --magenta: #e6197f;
    --right: #13a874;
    --paper: #ffffff;
    --mist: #f4f3ff;
    --line: #dedbff;
    --star: #ffb21a;

    --display: 'Bricolage Grotesque', 'Arial Black', system-ui, sans-serif;
    --body: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 40px);
    --radius-s: 8px;
    --radius-l: 22px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body.cq {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 18px/1.6 var(--body);
    overflow-x: hidden;
}

.cq img { max-width: 100%; height: auto; }
.cq a { color: var(--violet); }
.cq a:hover { color: var(--violet-deep); }
.cq :focus-visible { outline: 3px solid var(--magenta); outline-offset: 3px; border-radius: 4px; }

.cq-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.cq-skip {
    position: absolute; inset-inline-start: 8px; top: -60px; z-index: 50;
    background: var(--ink); color: #fff !important; padding: 10px 16px; border-radius: var(--radius-s);
}
.cq-skip:focus { top: 8px; }

.cq-h2 {
    font: 800 clamp(30px, 4.2vw, 48px)/1.05 var(--display);
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    max-width: 22ch;
}
.cq-lead { font-size: 20px; color: var(--ink-soft); max-width: 60ch; margin: 0 0 32px; }

.cq-btn {
    display: inline-flex; align-items: center; justify-content: center;
    font: 700 16px/1 var(--body);
    background: var(--magenta); color: #fff !important; text-decoration: none;
    padding: 14px 22px; border-radius: 999px;
}
.cq-btn:hover { background: #c7106b; }
.cq-btn--small { padding: 10px 16px; font-size: 15px; }

/* ===== Header ===== */
.cq-top {
    position: sticky; top: 0; z-index: 20;
    background: var(--violet);
    color: #fff;
}
.cq-top__in { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.cq-brand {
    display: inline-flex; align-items: center; gap: 10px;
    color: #fff !important; text-decoration: none;
    font: 800 22px/1 var(--display); letter-spacing: -0.01em;
}
.cq-brand img { border-radius: 9px; }
.cq-nav { display: flex; gap: 22px; margin-inline-start: 16px; }
.cq-nav a { color: rgba(255, 255, 255, .86); text-decoration: none; font-weight: 700; font-size: 16px; }
.cq-nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
.cq-top__end { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

/* Language menu (includes/landing-lang.jade) */
.lang { position: relative; }
.lang__btn {
    list-style: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    height: 40px; padding: 0 12px; border-radius: 999px;
    color: #fff; border: 1.5px solid rgba(255, 255, 255, .45);
    font: 700 14px/1 var(--body);
}
.lang__btn::-webkit-details-marker { display: none; }
.lang__btn:hover, .lang[open] .lang__btn { border-color: #fff; background: rgba(255, 255, 255, .12); }
.lang__menu {
    position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
    margin: 0; padding: 8px; list-style: none;
    width: min(420px, calc(100vw - 32px));
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px;
    background: #fff; border-radius: 14px;
    box-shadow: 0 18px 50px rgba(20, 14, 76, .28);
    max-height: 70vh; overflow: auto;
}
.lang__item {
    display: block; padding: 8px 12px; border-radius: 8px;
    color: var(--ink) !important; text-decoration: none; font-size: 15px;
}
.lang__item:hover { background: var(--mist); }
.lang__item[aria-current="true"] { background: var(--violet); color: #fff !important; font-weight: 700; }

/* ===== Hero ===== */
.cq-hero {
    background: var(--violet);
    color: #fff;
    padding: clamp(40px, 6vw, 80px) 0 clamp(96px, 10vw, 140px);
    clip-path: polygon(0 0, 100% 0, 100% 84%, 0 100%);
}
.cq-hero__in {
    display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(32px, 6vw, 80px); align-items: center;
}
.cq-hero__title {
    font: 800 clamp(40px, 6.4vw, 78px)/0.98 var(--display);
    letter-spacing: -0.035em;
    margin: 0 0 22px;
}
.cq-hero__sub { font-size: clamp(18px, 2vw, 21px); color: rgba(255, 255, 255, .88); margin: 0 0 28px; max-width: 46ch; }
.cq-hero__facts { font-size: 15px; color: rgba(255, 255, 255, .72); margin: 18px 0 0; max-width: 46ch; }

/* Store badges (chordiq-apps.jade renders .app-list) */
.cq-stores .app-list { display: flex; flex-wrap: wrap; gap: 12px; }
.cq-stores .app-list a { display: block; width: 156px; height: 52px; }
.cq-stores .app-list img { display: block; width: 100%; height: 100%; }
.cq-stores .visible-md { display: none; }
.cq-stores--center .app-list { justify-content: center; }
@media (min-width: 992px) {
    .cq-stores--center .visible-md { display: block; margin-top: 20px; }
    .cq-stores--center .visible-md img { width: 100px; margin: 0 auto; display: block; }
}

/* The playable round, drawn like the app's game screen */
.cq-round {
    background: var(--game);
    border-radius: 34px;
    padding: 20px 20px 22px;
    box-shadow: 0 30px 80px rgba(14, 8, 70, .45);
    max-width: 440px; justify-self: center; width: 100%;
    color: #fff;
}
.cq-round__bar { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 2px 4px 14px; }
.cq-round__title { font: 800 22px/1.1 var(--display); margin: 0; }
.cq-round__score { font-size: 14px; color: rgba(255, 255, 255, .7); white-space: nowrap; }
.cq-round__score strong { color: #fff; font: 800 22px/1 var(--display); margin-inline-start: 4px; }
.cq-round__staff {
    display: block; width: 100%; height: auto;
    background: #fff; border-radius: 6px;
    direction: ltr;
}
.cq-round__lines line { stroke: var(--ink); stroke-width: 1.6; }
.cq-round__clef { font-family: 'Bravura'; font-size: 60px; fill: var(--ink); }
/* Only when Bravura cannot load: the Unicode G clef in a system music font. */
.cq-round__clef.is-fallback { font-family: 'Noto Music', 'Apple Symbols', 'Segoe UI Symbol', serif; font-size: 96px; }
.cq-round__head { fill: var(--ink); }
.cq-round__stem, .cq-round__ledger { stroke: var(--ink); stroke-width: 2; }
.cq-round__staff.is-in [data-note] { animation: cq-drop .28s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes cq-drop { from { transform: translateY(-10px); opacity: 0; } }

.cq-round__keys {
    display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px;
    margin: 16px 0 12px;
    direction: ltr;
}
.cq-round__key {
    appearance: none; border: 0; cursor: pointer;
    min-height: 48px; padding: 0 2px; border-radius: 7px;
    background: var(--cyan); color: #fff;
    font: 700 16px/1 var(--body);
    transition: transform .08s, background-color .15s;
}
.cq-round__key:hover { background: #0e9fd0; }
.cq-round__key:active { transform: scale(.95); }
.cq-round__key.is-right { background: var(--right); }
.cq-round__key.is-wrong { background: var(--magenta); }
.cq-round__msg { min-height: 1.6em; margin: 0; font-size: 16px; color: rgba(255, 255, 255, .86); }
.cq-round__more { display: inline-block; margin-top: 8px; font-size: 15px; font-weight: 700; color: var(--cyan) !important; }

/* ===== Sections ===== */
.cq-section { padding: clamp(56px, 8vw, 104px) 0; }

/* Screenshots: the store set, scrollable sideways */
.cq-shots { padding-top: clamp(24px, 4vw, 48px); }
.cq-shots__strip {
    display: flex; gap: 18px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 8px max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))) 20px;
    scrollbar-width: thin; scrollbar-color: var(--violet) transparent;
}
.cq-shots__item {
    flex: 0 0 auto; margin: 0; scroll-snap-align: start;
    width: clamp(180px, 22vw, 240px);
}
.cq-shots__item img { display: block; width: 100%; border-radius: 18px; box-shadow: 0 10px 30px rgba(20, 14, 76, .16); }

/* Free games */
.cq-games { background: var(--mist); }
.cq-games__list {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.cq-games__card {
    display: flex; flex-direction: column; gap: 6px; height: 100%;
    padding: 20px 22px; border-radius: var(--radius-s);
    background: #fff; border: 2px solid var(--line);
    text-decoration: none; color: var(--ink) !important;
}
.cq-games__card:hover { border-color: var(--violet); }
.cq-games__name { font: 800 21px/1.15 var(--display); }
.cq-games__line { font-size: 16px; color: var(--ink-soft); }
.cq-games__all { margin: 24px 0 0; font-weight: 700; }

/* Why */
.cq-why__list { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.cq-why__list div { border-top: 4px solid var(--violet); padding-top: 18px; }
.cq-why__list div:nth-child(2) { border-color: var(--cyan); }
.cq-why__list div:nth-child(3) { border-color: var(--magenta); }
.cq-why__list dt { font: 800 24px/1.15 var(--display); margin-bottom: 10px; }
.cq-why__list dd { margin: 0; color: var(--ink-soft); }

/* Game modes: one column per skill; the colour marks the skill */
.cq-modes { background: var(--ink); color: #fff; }
.cq-modes .cq-h2 { color: #fff; }
.cq-modes__groups {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 36px 28px; margin-top: 40px;
}
.cq-modes__skill {
    display: inline-block;
    font: 800 15px/1 var(--body); letter-spacing: .01em;
    padding: 8px 12px; border-radius: 6px; margin: 0 0 18px;
    background: var(--cyan); color: #fff;
}
.cq-modes__group--rhythm .cq-modes__skill { background: var(--magenta); }
.cq-modes__group--ear .cq-modes__skill { background: #8a7dff; }
.cq-modes__group--theory .cq-modes__skill { background: var(--right); }
.cq-modes__group--chart .cq-modes__skill { background: var(--star); color: var(--ink); }
.cq-modes__group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
.cq-modes__group h4 { font: 700 19px/1.25 var(--display); margin: 0 0 4px; }
.cq-modes__group p { margin: 0; font-size: 16px; color: rgba(255, 255, 255, .72); }

/* Video */
.cq-video__frame { position: relative; aspect-ratio: 16 / 9; max-width: 900px; border-radius: var(--radius-l); overflow: hidden; background: var(--game); }
.cq-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* FAQ */
.cq-faq { background: var(--mist); }
.cq-faq__list { max-width: 860px; border-top: 2px solid var(--line); }
.cq-faq__item { border-bottom: 2px solid var(--line); }
.cq-faq__item summary {
    cursor: pointer; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 20px 0; font: 700 21px/1.3 var(--display);
}
.cq-faq__item summary::-webkit-details-marker { display: none; }
.cq-faq__item summary::after {
    content: '+'; flex: 0 0 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center; background: var(--violet); color: #fff;
    font: 700 22px/1 var(--body);
}
.cq-faq__item[open] summary::after { content: '−'; background: var(--magenta); }
.cq-faq__item p { margin: 0 0 24px; color: var(--ink-soft); max-width: 72ch; }

/* Download */
.cq-download {
    background: var(--violet); color: #fff; text-align: center;
    padding: clamp(110px, 12vw, 160px) 0 clamp(64px, 8vw, 96px);
    clip-path: polygon(0 22%, 100% 0, 100% 100%, 0 100%);
}
.cq-download__in { display: flex; flex-direction: column; align-items: center; }
.cq-download__icon { border-radius: 22px; margin-bottom: 20px; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); }
.cq-download .cq-h2 { margin-inline: auto; }
.cq-download .cq-lead { color: rgba(255, 255, 255, .85); margin-inline: auto; }

/* Footer */
.cq-foot { background: var(--ink); color: rgba(255, 255, 255, .7); padding: 28px 0 36px; font-size: 15px; }
.cq-foot__links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0; }
.cq-foot a { color: #fff !important; text-decoration: none; }
.cq-foot a:hover { text-decoration: underline; }

/* ===== Reviews (includes/app-reviews.jade) ===== */
.rv { padding: clamp(56px, 8vw, 104px) 0; overflow: hidden; }
.rv__head {
    max-width: var(--wrap); margin: 0 auto 44px; padding: 0 var(--gutter);
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end;
}
.rv__title { font: 800 clamp(30px, 4.2vw, 48px)/1.05 var(--display); letter-spacing: -0.02em; margin: 0; max-width: 16ch; }
.rv__summary {
    display: flex; gap: 28px; align-items: center;
    padding: 22px 26px; border-radius: var(--radius-l);
    background: var(--mist); border: 2px solid var(--line);
}
.rv__score { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 190px; }
.rv__avg { font: 800 60px/0.9 var(--display); letter-spacing: -0.04em; }
.rv__stars { color: var(--star); letter-spacing: 2px; font-size: 17px; line-height: 1; }
.rv__stars--big {
    font-size: 22px;
    background: linear-gradient(90deg, var(--star) var(--rv-fill), var(--line) var(--rv-fill));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
[dir="rtl"] .rv__stars--big { background: linear-gradient(270deg, var(--star) var(--rv-fill), var(--line) var(--rv-fill)); -webkit-background-clip: text; background-clip: text; }
.rv__count { font-size: 14px; color: var(--ink-soft); line-height: 1.35; }
.rv__bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 220px; }
.rv__bars li { display: grid; grid-template-columns: 30px 1fr 38px; gap: 10px; align-items: center; font-size: 14px; color: var(--ink-soft); }
.rv__bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rv__bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--violet); }
.rv__bar-pct { text-align: end; }

.rv__rows { display: grid; gap: 18px; }
.rv__row {
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.rv__track {
    display: flex; gap: 18px; width: max-content;
    direction: ltr;
    animation: rv-scroll 190s linear infinite;
}
.rv__row--reverse .rv__track { animation-direction: reverse; animation-duration: 210s; }
.rv__row:hover .rv__track, .rv__row:focus-within .rv__track { animation-play-state: paused; }
@keyframes rv-scroll { to { transform: translateX(-50%); } }

.rv__card {
    width: 340px; flex: 0 0 auto;
    padding: 20px 22px; border-radius: var(--radius-s);
    background: #fff; border: 2px solid var(--line);
    display: flex; flex-direction: column; gap: 10px;
}
[dir="rtl"] .rv__card { direction: rtl; }
.rv__who { display: flex; align-items: center; gap: 12px; }
.rv__avatar {
    position: relative; flex: 0 0 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center;
    background: hsl(var(--rv-hue) 72% 46%); color: #fff;
    font: 800 17px/1 var(--display);
}
.rv__flag {
    position: absolute; inset-inline-end: -4px; bottom: -4px;
    width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center;
    background: #fff; box-shadow: 0 0 0 2px #fff;
    font-size: 15px; line-height: 1;
}
.rv__flag--play { background: var(--right); color: #fff; }
.rv__id { display: flex; flex-direction: column; min-width: 0; }
.rv__name { font-weight: 700; font-size: 16px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv__where { font-size: 13px; color: var(--ink-soft); }
.rv__quote { margin: 0; }
.rv__quote p {
    margin: 0; font-size: 16px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.rv__note { margin: auto 0 0; font-size: 12px; color: var(--ink-soft); font-style: italic; }

@media (prefers-reduced-motion: reduce) {
    .rv__track { animation: none; }
    .rv__row { overflow-x: auto; -webkit-mask-image: none; mask-image: none; padding: 0 var(--gutter) 8px; }
    .rv__card[aria-hidden="true"] { display: none; }
    .cq-round__staff.is-in [data-note] { animation: none; }
}

/* Phone menu (includes/landing-menu.jade): the header links once the nav is hidden. */
.lp-menu { display: none; }
.lp-menu .lang__menu { grid-template-columns: 1fr; width: min(240px, calc(100vw - 32px)); }
.lp-menu .lang__btn { padding: 0 11px; }
@media (max-width: 960px) { .lp-menu { display: block; } }

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .cq-nav { display: none; }
    .cq-hero__in { grid-template-columns: 1fr; }
    .cq-why__list { grid-template-columns: 1fr; }
    .rv__head { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    body.cq { font-size: 17px; }
    .cq-top__in { gap: 12px; }
    .cq-brand span { display: none; }
    .cq-btn--small { padding: 10px 13px; font-size: 14px; }
    .cq-hero { clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%); }
    .cq-round { border-radius: 26px; padding: 16px; }
    .cq-round__keys { gap: 5px; }
    .cq-round__key { min-height: 46px; font-size: 14px; }
    .rv__summary { flex-direction: column; align-items: stretch; }
    .rv__score { max-width: none; }
    .rv__card { width: 280px; }
    .lang__menu { grid-template-columns: 1fr; }
}

/* Social icons (includes/landing-social.jade) */
.social { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.social__link {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: rgba(255, 255, 255, .1); color: #fff !important;
}
.social__link:hover { background: var(--magenta); }

/* Captioned QR code (includes/store-qr.jade): desktop only. Replaces the small
   uncaptioned QR that chordiq-apps.jade prints under the bottom badges. */
.cq-stores .visible-md { display: none !important; }
.store-qr { display: none; margin: 0; }
.store-qr img { display: block; width: 104px; height: 104px; padding: 6px; background: #fff; border-radius: 12px; image-rendering: pixelated; }
.store-qr figcaption { font-size: 14px; line-height: 1.4; max-width: 200px; }
@media (min-width: 992px) and (hover: hover), (min-width: 992px) and (pointer: fine) {
    .store-qr { display: flex; align-items: center; gap: 14px; }
    .store-qr--hero { margin-top: 20px; }
    .store-qr--hero figcaption { color: rgba(255, 255, 255, .88); font-weight: 700; }
    .store-qr--bottom { flex-direction: column; margin: 26px auto 0; text-align: center; }
    .store-qr--bottom img { width: 128px; height: 128px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
    .store-qr--bottom figcaption { color: inherit; }
}
