/* HowToInvest — landing page. Visual language follows the app: sky-blue screens,
   slanted yellow/white labels, gold coins, the white arc from the lesson screen. */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --sky1: #2aa7e3;
    --sky2: #0c7fc6;
    --navy: #0f2d5c;
    --ink: #0b1b33;
    --yellow: #ffd21f;
    --gold: #ffb400;
    --green: #2fc15a;
    --red: #e5484d;
    --paper: #eef5f9;
    --cyan: #62d3f2;
    /* Exo 2 and Nunito cover Latin and Cyrillic; Cairo and Noto Sans Thai are
       picked per glyph for Arabic and Thai. */
    --display: 'Exo 2', 'Cairo', 'Noto Sans Thai', sans-serif;
    --body: 'Nunito', 'Cairo', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--body);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.5;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 28px; position: relative; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Letter-spacing breaks Arabic joining; Thai needs room for tone marks. */
html[lang="ar"] * { letter-spacing: 0 !important; }
html[lang="th"] .label span { line-height: 1.35; }

/* ---------- Navigation and language switcher ---------- */
.nav { display: flex; align-items: center; gap: 12px; padding: 18px 0; position: relative; z-index: 5; }
.nav-brand { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 19px; letter-spacing: -.01em; color: #fff; text-decoration: none; }
.nav-brand img { width: 40px; height: 40px; border-radius: 10px; }

.lang-switcher { position: relative; margin-inline-start: auto; }
.lang-current {
    display: flex; align-items: center; gap: 6px;
    font: 800 13px var(--body); color: #fff;
    background: transparent; border: 1.5px solid rgba(255, 255, 255, .85); border-radius: 999px;
    padding: 6px 12px; cursor: pointer;
}
.lang-current:hover { background: rgba(255, 255, 255, .15); }
.lang-arrow { transition: transform .2s; }
.lang-switcher.open .lang-arrow { transform: rotate(180deg); }
.lang-dropdown {
    display: none; position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 170px;
    background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 16px 40px rgba(4, 40, 80, .3);
}
.lang-switcher.open .lang-dropdown { display: block; }
.lang-option {
    display: block; width: 100%; text-align: start;
    font: 700 14px var(--body); color: var(--navy);
    background: none; border: 0; border-radius: 9px; padding: 9px 12px; cursor: pointer;
}
.lang-option:hover { background: var(--paper); }
.lang-option.active { background: var(--navy); color: #fff; }

/* ---------- Shared pieces ---------- */
.label {
    display: flex; flex-direction: column; align-items: flex-start;
    font-family: var(--display); text-transform: uppercase; line-height: 1;
    transform: rotate(-5deg); transform-origin: left center;
}
.label .l1 {
    background: var(--yellow); color: #10233f; font-weight: 600;
    font-size: clamp(19px, 2.9vw, 34px); padding: .3em .7em; margin-inline-start: .35em;
    position: relative; z-index: 1;
}
/* --fit shrinks the big word when a translation is longer than ~7 letters (set in site.js). */
.label .l2 {
    background: #fff; color: #0a0a0a; font-weight: 900;
    font-size: calc(clamp(54px, 9.3vw, 116px) * var(--fit, 1));
    padding: .04em .2em .08em; margin-top: -.05em; letter-spacing: -.01em;
    box-shadow: 12px 12px 0 var(--cyan);
}
.label .l3 { font-weight: 500; font-size: clamp(17px, 2.4vw, 27px); margin-top: 1.15em; letter-spacing: .05em; color: #fff; }
[dir="rtl"] .label { transform: rotate(5deg); transform-origin: right center; }
[dir="rtl"] .label .l2 { box-shadow: -12px 12px 0 var(--cyan); }

.tag {
    display: inline-block; background: var(--yellow); color: #10233f;
    font: 600 15px var(--display); text-transform: uppercase; letter-spacing: .05em;
    padding: .35em .8em; transform: rotate(-3deg);
}
[dir="rtl"] .tag { transform: rotate(3deg); }

.h2 { font-weight: 900; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.12; color: var(--navy); letter-spacing: -.015em; max-width: 16em; }

.stores { display: flex; gap: 12px; flex-wrap: wrap; }
.store {
    display: inline-flex; align-items: center; gap: 10px;
    background: #0a0a0a; color: #fff; text-decoration: none;
    border-radius: 12px; padding: 9px 18px 9px 14px; min-width: 168px; transition: transform .15s;
}
.store:hover { transform: translateY(-2px); }
.store svg { width: 28px; height: 28px; fill: #fff; flex: none; }
.store-text { display: flex; flex-direction: column; line-height: 1.15; }
.store-small { font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.store-name { font-size: 17px; font-weight: 800; }

.stars { color: var(--gold); letter-spacing: 1px; }

/* ---------- Hero ---------- */
.hero { position: relative; background: linear-gradient(165deg, var(--sky1), var(--sky2)); color: #fff; overflow: hidden; padding-bottom: 130px; }
.hero::before, .cta::before, .legal-top::before {
    content: ""; position: absolute; inset: -30%; pointer-events: none;
    background: repeating-conic-gradient(from 8deg at 66% 50%, rgba(255, 255, 255, .075) 0 5deg, transparent 5deg 10deg);
    -webkit-mask-image: radial-gradient(circle at 66% 50%, #000 0, transparent 58%);
    mask-image: radial-gradient(circle at 66% 50%, #000 0, transparent 58%);
}
.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 16px; align-items: center; padding-top: 26px; }
.hero .label { margin: 26px 0 44px; }
.hero-sub { font-size: clamp(17px, 1.6vw, 20px); font-weight: 600; max-width: 27em; margin-bottom: 26px; color: #eaf6ff; }

.trust { list-style: none; display: flex; gap: 14px 22px; flex-wrap: wrap; margin-top: 24px; font-weight: 800; font-size: 15px; }
.trust span { display: block; font-weight: 600; font-size: 12.5px; opacity: .85; }
.trust .stars { display: inline; font-size: 15px; opacity: 1; }

.stage { position: relative; min-height: 520px; }
.phone { position: relative; width: min(292px, 74%); margin-inline: auto 6%; transform: rotate(5deg); filter: drop-shadow(0 30px 36px rgba(4, 40, 80, .4)); }
.phone-frame { width: 100%; aspect-ratio: 1 / 2; }
.phone-scene { position: absolute; left: 9%; width: 82%; top: 17%; }
.mascot { position: absolute; inset-inline-start: -15%; bottom: -6%; width: min(280px, 64%); }
.sticker {
    position: absolute; inset-inline-end: -6px; top: 5%; width: 104px; height: 104px; border-radius: 50%;
    background: var(--yellow); color: #10233f; display: grid; place-items: center; text-align: center;
    font: 900 15px/1.1 var(--display); text-transform: uppercase;
    transform: rotate(12deg); box-shadow: 0 6px 0 #d9a900;
}
[dir="rtl"] .phone { transform: rotate(-5deg); }
[dir="rtl"] .sticker { transform: rotate(-12deg); }
.hill { position: absolute; left: 0; bottom: -1px; width: 100%; height: 96px; }

/* ---------- Lessons ---------- */
.lessons { padding: 26px 0 80px; }
.lessons .h2 { margin: 14px 0 16px; }
.exam { display: flex; gap: 12px; align-items: flex-start; max-width: 36em; font-weight: 700; font-size: 17px; color: #33507a; margin-bottom: 40px; }
.exam::before {
    content: ""; flex: none; width: 26px; height: 26px; border-radius: 50%;
    background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 15px no-repeat;
}

/* The course as a snake of 11 coins: lessons 1-4 run forward, 5-8 back, 9-11 forward again.
   Each li draws the dashes to its neighbours: ::after is the horizontal one towards the inline end,
   ::before the vertical one down to the next row (lessons 4 and 8). */
.path { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 54px 0; counter-reset: n; }
.path li { position: relative; counter-increment: n; padding-inline-end: 18px; }
.coin {
    position: relative; z-index: 1; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; margin-bottom: 14px;
    background: radial-gradient(circle at 35% 30%, #ffe27a, var(--gold) 62%);
    box-shadow: inset 0 0 0 5px #ffc933, 0 5px 0 #c98600;
    font: 900 22px var(--display); color: #7a4b00;
}
.coin::before { content: counter(n); }
/* Arabic: coins are numbered with Arabic-Indic digits (١ ٢ ٣), drawn by the Cairo font. */
html[lang="ar"] .coin::before { content: counter(n, arabic-indic); }
.path b { display: block; font-weight: 800; font-size: 17px; line-height: 1.25; color: var(--navy); }
.path small { display: block; font-weight: 700; font-size: 13px; color: #6f8399; padding-bottom: 6px; }
/* The text sits on a paper background so the vertical dashes pass behind it. */
.path b, .path small { position: relative; z-index: 1; background: var(--paper); }
.path em {
    font-style: normal; display: inline-block; background: var(--green); color: #fff;
    font: 800 11px var(--display); text-transform: uppercase; letter-spacing: .06em;
    border-radius: 6px; padding: 3px 7px; margin-inline-start: 6px; vertical-align: 2px;
}
.path li:last-child em { background: var(--navy); }
.path li:nth-child(n+5):nth-child(-n+8) { grid-row: 2; }
.path li:nth-child(5) { grid-column: 4; }
.path li:nth-child(6) { grid-column: 3; }
.path li:nth-child(7) { grid-column: 2; }
.path li:nth-child(8) { grid-column: 1; }
.path li:nth-child(n+9) { grid-row: 3; }
.path li::after { content: ""; position: absolute; top: 27px; inset-inline: 58px 0; border-top: 4px dashed #9fd0ea; }
.path li:nth-child(4)::after, .path li:nth-child(5)::after, .path li:nth-child(11)::after { display: none; }
.path li:nth-child(4)::before, .path li:nth-child(8)::before {
    content: ""; position: absolute; top: 58px; inset-inline-start: 27px; height: calc(100% - 4px);
    border-inline-start: 4px dashed #9fd0ea;
}

/* ---------- Quiz ---------- */
.quiz-section { padding: 0 0 90px; }
.quiz { background: var(--navy); color: #fff; border-radius: 28px; padding: 40px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 36px; align-items: center; }
.quiz .h2 { color: #fff; margin: 14px 0 10px; font-size: clamp(26px, 3vw, 36px); }
.quiz-desc { color: #b9cde6; font-weight: 600; }
.quiz-q { font-weight: 800; font-size: 19px; margin-bottom: 14px; }
.quiz-options { list-style: none; display: grid; gap: 10px; }
.quiz-options button {
    width: 100%; text-align: start; font: 700 16px var(--body); color: var(--navy);
    background: #fff; border: 0; border-radius: 12px; padding: 14px 16px; cursor: pointer;
    display: flex; gap: 12px; transition: transform .12s, background-color .12s;
}
.quiz-options button:hover { transform: translateX(4px); }
[dir="rtl"] .quiz-options button:hover { transform: translateX(-4px); }
.quiz-options button b { font-weight: 900; color: var(--sky2); }
.quiz-options button.ok { background: var(--green); color: #fff; }
.quiz-options button.no { background: var(--red); color: #fff; }
.quiz-options button.ok b, .quiz-options button.no b { color: #fff; }
.quiz-res { min-height: 26px; margin-top: 14px; font-weight: 800; color: var(--yellow); }
.quiz-res.bad { color: #ff9a94; }

/* ---------- Reviews ---------- */
.reviews { padding: 0 0 96px; }
.reviews .h2 { margin: 14px 0 36px; }
.revs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.rev { background: #fff; border-radius: 20px; padding: 26px 24px; box-shadow: 0 6px 0 #d5e4ee; display: flex; flex-direction: column; gap: 14px; }
.rev:nth-child(1) { transform: rotate(-1.2deg); }
.rev:nth-child(3) { transform: rotate(1.2deg); }
.rev-text { font-weight: 600; font-size: 16px; color: #24406b; flex: 1; }
.rev-author { font-weight: 800; color: var(--navy); }
/* Opens this exact review on Google Play. */
.rev-source { display: block; width: fit-content; margin-top: 2px; font-weight: 700; font-size: 12.5px; color: #0c6fb0; text-decoration: underline; text-decoration-color: #9fd0ea; text-underline-offset: 3px; }
.rev-source::after { content: "\2197"; display: inline-block; margin-inline-start: 4px; }
[dir="rtl"] .rev-source::after { content: "\2196"; }
.rev-source:hover { text-decoration-color: currentColor; }

/* ---------- Final call to action ---------- */
.cta { position: relative; overflow: hidden; background: linear-gradient(165deg, var(--sky1), var(--sky2)); color: #fff; padding: 70px 0; }
.cta .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.cta .label { margin: 0 0 40px; }
.cta .label .l2 { font-size: calc(clamp(44px, 7vw, 88px) * var(--fit, 1)); }
.cta-sub { font-weight: 600; font-size: 18px; color: #eaf6ff; max-width: 24em; margin-bottom: 24px; }
[dir="rtl"] .cta-art { transform: scaleX(-1); }

/* ---------- Legal pages: privacy_policy.html and terms.html ---------- */
.legal-top { position: relative; background: linear-gradient(165deg, var(--sky1), var(--sky2)); color: #fff; overflow: hidden; padding-bottom: 132px; }
.legal-top .label { margin: 38px 0 0; transform: rotate(-3deg); }
.legal-top .label .l1 { font-size: clamp(15px, 2vw, 22px); }
.legal-top .label .l2 { font-size: clamp(22px, 5.4vw, 60px); padding: .12em .3em .16em; box-shadow: 8px 8px 0 var(--cyan); }
/* "Back to home": a pill in the header and a filled button under the text. */
.back {
    display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto;
    font: 800 14px var(--body); color: #fff; text-decoration: none; white-space: nowrap;
    border: 1.5px solid rgba(255, 255, 255, .85); border-radius: 999px; padding: 8px 16px;
}
.back:hover { background: rgba(255, 255, 255, .15); }
.back svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.back-dark { margin: 0; font-size: 15px; padding: 12px 24px; background: var(--navy); border-color: var(--navy); }
.back-dark:hover { background: #17407f; }
.legal { padding-bottom: 80px; }
.legal-card {
    position: relative; z-index: 2; max-width: 820px; margin: -44px auto 0;
    background: #fff; border-radius: 24px; padding: clamp(24px, 5vw, 56px); box-shadow: 0 6px 0 #d5e4ee;
    color: #33507a; font-weight: 600; font-size: 17px; line-height: 1.7;
}
.legal-card h2 { font-weight: 900; font-size: clamp(20px, 2.4vw, 25px); line-height: 1.2; color: var(--navy); margin: 1.9em 0 .6em; }
.legal-card p { margin-bottom: 1em; }
.legal-card p:last-child { margin-bottom: 0; }
.legal-card ul { list-style: none; margin-bottom: 1.1em; display: grid; gap: .45em; }
.legal-card li { position: relative; padding-inline-start: 28px; }
.legal-card li::before {
    content: ""; position: absolute; inset-inline-start: 5px; top: .62em; width: 10px; height: 10px; border-radius: 50%;
    background: var(--gold); box-shadow: 0 0 0 3px #ffe9a8;
}
.legal-card a { color: #0c6fb0; font-weight: 700; text-decoration-color: #9fd0ea; text-underline-offset: 3px; overflow-wrap: anywhere; }
.legal-card a:hover { text-decoration-color: currentColor; }
.legal-back { display: flex; justify-content: center; margin-top: 34px; }
.footer-links a[aria-current] { text-decoration: none; opacity: .7; }

/* ---------- Footer ---------- */
.footer { background: var(--navy); color: #b9cde6; padding: 30px 0; font-weight: 600; font-size: 14.5px; }
.footer .wrap { display: flex; gap: 16px 28px; flex-wrap: wrap; align-items: center; }
.footer-links { margin-inline-start: auto; display: flex; gap: 12px 26px; flex-wrap: wrap; }
.footer-links a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .4); }
.footer-links a:hover { text-decoration-color: #fff; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
    .wrap { padding: 0 20px; }
    .hero-grid, .quiz, .revs, .cta .wrap { grid-template-columns: 1fr; }
    .hero { padding-bottom: 110px; }
    .stage { min-height: 0; margin-top: 28px; }
    .phone { margin-inline: auto; width: min(260px, 70%); }
    .mascot { inset-inline-start: -4%; width: min(210px, 50%); }
    .sticker { inset-inline-end: 2%; width: 88px; height: 88px; font-size: 13px; }
    .store { flex: 1; }
    /* The snake becomes one column: coin on the side, a vertical dash between coins. */
    .path { grid-template-columns: 1fr; gap: 22px; }
    .path li { grid-column: auto !important; grid-row: auto !important; display: grid; grid-template-columns: 50px 1fr; column-gap: 14px; padding-inline-end: 0; }
    .coin { grid-row: span 2; width: 50px; height: 50px; margin: 0; font-size: 19px; }
    .path b { align-self: end; }
    .path li::after { display: none !important; }
    .path li:not(:last-child)::before {
        content: ""; position: absolute; top: 50px; inset-inline-start: 23px; height: calc(100% - 28px);
        border-inline-start: 4px dashed #9fd0ea;
    }
    .quiz { padding: 28px 20px; border-radius: 22px; }
    .rev { transform: none !important; }
    .footer-links { margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .store, .quiz-options button, .lang-arrow { transition: none; }
}
