/* ============================================================
   LinguaSearch.com — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700;900&family=Inter:wght@300;400;500;600&family=Courier+Prime:wght@400;700&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --navy:       #1A1A2E;
    --green:      #2A7A3B;
    --green-dark: #1e5a2a;
    --amber:      #C17A00;
    --red:        #B02020;
    --cream:      #F7F4EF;
    --white:      #FFFFFF;
    --grey-light: #E8E4DC;
    --grey-mid:   #9A9488;
    --grey-dark:  #4A4640;
    --gold:       #FFD700;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body:    'Inter', system-ui, sans-serif;
    --font-puzzle:  'Courier Prime', 'Courier New', monospace;

    --radius:    8px;
    --radius-lg: 16px;
    --shadow:    0 2px 16px rgba(26,26,46,0.10);
    --shadow-lg: 0 8px 40px rgba(26,26,46,0.18);

    --max-width: 1200px;
    --nav-height: 72px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--cream);
    color: var(--navy);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    line-height: 1.2;
    color: var(--navy);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 900; }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--grey-dark); }

.eyebrow {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green);
    margin-bottom: 0.5rem;
    display: block;
}

/* ── Layout helpers ────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}
.section { padding: 80px 0; }
.section--tight { padding: 48px 0; }
.section--dark {
    background: var(--navy);
    color: var(--white);
}
.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 { color: var(--white); }
.section--dark p { color: rgba(255,255,255,0.75); }
.section--dark .eyebrow { color: var(--gold); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.text-center { text-align: center; }

/* ── Navigation ────────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(26, 26, 46, 0.97);
    backdrop-filter: blur(8px);
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav__logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -0.01em;
}
.nav__logo span { color: var(--gold); }
.nav__links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}
.nav__links a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}
.nav__links a:hover { color: var(--white); text-decoration: none; }
.nav__cta {
    background: var(--green);
    color: var(--white) !important;
    padding: 8px 20px;
    border-radius: var(--radius);
    font-weight: 600 !important;
    transition: background 0.2s !important;
}
.nav__cta:hover { background: var(--green-dark) !important; }
.nav__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
}
.nav__hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    padding-top: var(--nav-height);
    background: var(--navy);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.hero__flag-bg {
    position: absolute;
    inset: 0;
    display: flex;
    opacity: 0.12;
    pointer-events: none;
}
.hero__flag-bg .flag-blue  { flex: 1; background: #002395; }
.hero__flag-bg .flag-white { flex: 1; background: #FFFFFF; }
.hero__flag-bg .flag-red   { flex: 1; background: #ED2939; }
.hero__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 80px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    position: relative;
    z-index: 1;
}
.hero__text .eyebrow { color: var(--gold); }
.hero__headline {
    color: var(--white);
    margin-bottom: 24px;
}
.hero__headline em {
    font-style: normal;
    color: var(--gold);
}
.hero__sub {
    color: rgba(255,255,255,0.75);
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 480px;
}
.hero__actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.hero__scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.4);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 1;
}
.hero__scroll::after {
    content: '';
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.4), transparent);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none !important;
}
.btn--primary {
    background: var(--green);
    color: var(--white);
}
.btn--primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255,255,255,0.3);
}
.btn--outline:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }
.btn--gold {
    background: var(--gold);
    color: var(--navy);
}
.btn--gold:hover { background: #e6c200; transform: translateY(-1px); }
.btn--sm { padding: 8px 18px; font-size: 0.85rem; }
.btn--lg { padding: 18px 36px; font-size: 1.05rem; }

/* ── Interactive puzzle (hero) ─────────────────────────────── */
.puzzle-widget {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-lg);
    position: relative;
}
.puzzle-widget__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-mid);
    margin-bottom: 4px;
}
.puzzle-widget__topic {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
}
.puzzle-grid {
    display: grid;
    gap: 2px;
    margin-bottom: 20px;
    user-select: none;
}
.puzzle-grid__cell {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-puzzle);
    font-size: clamp(0.65rem, 1.8vw, 0.9rem);
    font-weight: 700;
    color: var(--navy);
    background: var(--cream);
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: 1px solid var(--grey-light);
}
.puzzle-grid__cell:hover { background: #e8f5ec; }
.puzzle-grid__cell.selected { background: rgba(255, 215, 0, 0.4); }
.puzzle-grid__cell.found { background: var(--gold); color: var(--navy); }
.puzzle-widget__words {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.puzzle-word {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--cream);
    border-radius: var(--radius);
    border: 1px solid var(--grey-light);
    transition: all 0.3s;
}
.puzzle-word.found {
    background: #e8f5ec;
    border-color: var(--green);
}
.puzzle-word__french {
    font-family: var(--font-puzzle);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--navy);
}
.puzzle-word.found .puzzle-word__french { text-decoration: line-through; color: var(--green); }
.puzzle-word__english {
    font-size: 0.8rem;
    color: var(--grey-mid);
}
.puzzle-word__tick {
    color: var(--green);
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.3s;
}
.puzzle-word.found .puzzle-word__tick { opacity: 1; }
.puzzle-widget__success {
    display: none;
    text-align: center;
    padding: 16px;
    background: #e8f5ec;
    border-radius: var(--radius);
    margin-top: 16px;
    border: 1px solid var(--green);
}
.puzzle-widget__success.show { display: block; }
.puzzle-widget__success p {
    color: var(--green);
    font-weight: 600;
    margin-bottom: 8px;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card__body { padding: 28px; }
.card__tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}
.card__tag--beginner { background: #e8f5ec; color: var(--green); }
.card__tag--intermediate { background: #fff3e0; color: var(--amber); }
.card__tag--advanced { background: #fdecea; color: var(--red); }
.card__tag--free { background: #e8f5ec; color: var(--green); }

/* ── Book cards ────────────────────────────────────────────── */
.book-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.book-card__cover {
    height: 220px;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.book-card__cover--beginner     { background: linear-gradient(135deg, #002395 0%, #002395 33%, #fff 33%, #fff 66%, #ED2939 66%); }
.book-card__cover--intermediate { background: linear-gradient(135deg, #002395 0%, #002395 33%, #fff 33%, #fff 66%, #ED2939 66%); }
.book-card__cover--advanced     { background: linear-gradient(135deg, #002395 0%, #002395 33%, #fff 33%, #fff 66%, #ED2939 66%); }
.book-card__level-stripe {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
}
.book-card__level-stripe--beginner     { background: var(--green); }
.book-card__level-stripe--intermediate { background: var(--amber); }
.book-card__level-stripe--advanced     { background: var(--red); }
.book-card__mini-grid {
    background: rgba(255,255,255,0.9);
    border-radius: var(--radius);
    padding: 12px;
    display: grid;
    gap: 2px;
    box-shadow: var(--shadow);
}
.book-card__mini-cell {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-puzzle);
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--navy);
    background: var(--cream);
    border-radius: 2px;
}
.book-card__mini-cell.hl { background: var(--gold); }
.book-card__body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.book-card__level {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.book-card__level--beginner     { color: var(--green); }
.book-card__level--intermediate { color: var(--amber); }
.book-card__level--advanced     { color: var(--red); }
.book-card__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
}
.book-card__desc {
    font-size: 0.875rem;
    color: var(--grey-dark);
    flex: 1;
    margin-bottom: 20px;
}
.book-card__price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 12px;
}

/* ── Language grid ─────────────────────────────────────────── */
.language-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-align: center;
}
.language-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.language-card__flag {
    height: 80px;
    position: relative;
    overflow: hidden;
}
.language-card__flag--fr {
    background: linear-gradient(to right, #002395 33%, #fff 33%, #fff 66%, #ED2939 66%);
}
.language-card__flag--es {
    background: linear-gradient(to bottom, #AA151B 25%, #F1BF00 25%, #F1BF00 75%, #AA151B 75%);
}
.language-card__flag--de {
    background: linear-gradient(to bottom, #000 33%, #DD0000 33%, #DD0000 66%, #FFCE00 66%);
}
.language-card__flag--it {
    background: linear-gradient(to right, #009246 33%, #fff 33%, #fff 66%, #CE2B37 66%);
}
.language-card__flag--coming {
    background: var(--grey-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-mid);
    font-size: 1.5rem;
}
.language-card__body { padding: 16px; }
.language-card__name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}
.language-card__count { font-size: 0.8rem; color: var(--grey-mid); }
.language-card__badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 8px;
    background: var(--grey-light);
    color: var(--grey-mid);
    border-radius: 20px;
    margin-top: 4px;
}
.language-card__badge--available { background: #e8f5ec; color: var(--green); }

/* ── Fact banner ───────────────────────────────────────────── */
.fact-banner {
    background: var(--navy);
    padding: 48px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.fact-banner::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 15rem;
    color: rgba(255,255,255,0.03);
    line-height: 1;
    pointer-events: none;
}
.fact-banner__text {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--white);
    max-width: 800px;
    margin: 0 auto 16px;
    line-height: 1.4;
    position: relative;
}
.fact-banner__text em { font-style: normal; color: var(--gold); }
.fact-banner__source { font-size: 0.8rem; color: rgba(255,255,255,0.4); }

/* ── Daily puzzle section ──────────────────────────────────── */
.daily-puzzle {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
}
.daily-puzzle__date {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--grey-mid);
    margin-bottom: 8px;
}
.daily-puzzle__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 4px;
}
.daily-puzzle__topic {
    font-size: 0.9rem;
    color: var(--grey-mid);
    margin-bottom: 24px;
}

/* ── Download section ──────────────────────────────────────── */
.download-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.download-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.download-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.download-card__icon--beginner     { background: #e8f5ec; }
.download-card__icon--intermediate { background: #fff3e0; }
.download-card__icon--advanced     { background: #fdecea; }
.download-card__info { flex: 1; }
.download-card__title {
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 2px;
    font-size: 0.95rem;
}
.download-card__meta { font-size: 0.8rem; color: var(--grey-mid); }

/* ── Stats strip ───────────────────────────────────────────── */
.stats-strip {
    background: var(--green);
    padding: 40px 24px;
}
.stats-strip__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
.stat__number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--white);
    line-height: 1;
    margin-bottom: 4px;
}
.stat__label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.8);
    font-weight: 500;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
    background: var(--navy);
    color: rgba(255,255,255,0.6);
    padding: 60px 0 32px;
}
.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 48px;
}
.footer__brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--white);
    margin-bottom: 12px;
}
.footer__brand span { color: var(--gold); }
.footer__tagline { font-size: 0.875rem; margin-bottom: 20px; }
.footer__heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 16px;
}
.footer__links { list-style: none; }
.footer__links li { margin-bottom: 8px; }
.footer__links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.875rem;
    transition: color 0.2s;
}
.footer__links a:hover { color: var(--white); text-decoration: none; }
.footer__bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 24px 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .footer__inner { grid-template-columns: 1fr 1fr; gap: 32px; }
    .stats-strip__inner { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .hero__inner { grid-template-columns: 1fr; gap: 40px; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .grid-4 { grid-template-columns: 1fr 1fr; }
    .nav__links { display: none; }
    .nav__hamburger { display: flex; }
    .nav__links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--navy);
        padding: 24px;
        gap: 16px;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .footer__inner { grid-template-columns: 1fr; gap: 32px; }
    .footer__bottom { flex-direction: column; gap: 8px; text-align: center; }
    .stats-strip__inner { grid-template-columns: repeat(2, 1fr); }
    .daily-puzzle { padding: 24px; }
}

@media (max-width: 480px) {
    .grid-4 { grid-template-columns: 1fr; }
    .hero__actions { flex-direction: column; }
    .btn--lg { width: 100%; justify-content: center; }
}

/* ── Utilities ─────────────────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-48 { margin-top: 48px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.mb-48 { margin-bottom: 48px; }

/* ── Ad modal overlay ──────────────────────────────────────── */
.ad-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.ad-overlay.show { display: flex; }
.ad-modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.ad-modal h3 { margin-bottom: 8px; }
.ad-modal p { margin-bottom: 24px; font-size: 0.9rem; }
.ad-modal__countdown {
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-display);
    color: var(--green);
    margin-bottom: 16px;
}
.ad-placeholder {
    background: var(--cream);
    border: 2px dashed var(--grey-light);
    border-radius: var(--radius);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-mid);
    font-size: 0.8rem;
    margin-bottom: 24px;
}
