/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg { max-width: 100%; display: block; }

/* Native <button> elements default to cursor:default and inherit odd
   platform styling (Safari especially) - normalize them so a <button
   class="btn"> behaves identically to an <a class="btn">. */
button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: .6; }

html { scroll-behavior: smooth; }

body {
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    transition: background-color .2s ease, color .2s ease;
}

h1, h2, h3, h4 {
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--color-text);
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: 1.5rem;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.kicker {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .02em;
    color: var(--color-accent);
    background: var(--chip-1-bg);
    padding: .4rem .9rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .85rem 1.7rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease, border-color .15s ease;
    border: 2px solid transparent;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
    background: var(--color-accent);
    color: var(--color-on-accent);
    box-shadow: var(--shadow-pop);
}
.btn--primary:hover { background: var(--color-accent-hover); }

.btn--ghost {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); background: var(--chip-1-bg); }

/* ==========================================================================
   Header / brand
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--color-border);
}

.site-header__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding-block: .9rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--color-text);
}

.brand a,
.brand a:hover {
    text-decoration: none;
}
.brand__mark {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
}
.brand__name {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--color-text);

}

.site-header__actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

/* --- main nav --- */
.main-menu__list {
    display: flex;
    gap: 1.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.main-menu a {
    color: var(--color-text);
    font-weight: 600;
    font-size: .95rem;
}
.main-menu a:hover { color: var(--color-accent); text-decoration: none; }
.main-menu a.is-active { color: var(--color-accent); }

/* --- language switcher --- */
.lang-switch { position: relative; }
.lang-switch__toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .8rem;
    border-radius: 999px;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
}
.lang-switch__toggle:hover { border-color: var(--color-accent); }
.lang-switch__menu {
    position: absolute;
    right: 0;
    top: calc(100% + .5rem);
    min-width: 9rem;
    list-style: none;
    margin: 0;
    padding: .4rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    display: none;
    z-index: 60;
}
.lang-switch__menu.is-open { display: block; }
.lang-switch__menu a {
    display: block;
    padding: .5rem .6rem;
    border-radius: 9px;
    color: var(--color-text);
    font-size: .9rem;
    font-weight: 600;
}
.lang-switch__menu a:hover { background: var(--color-bg-alt); text-decoration: none; }
.lang-switch__menu a.is-active { color: var(--color-accent); }

/* --- flags + chevron --- */
.lang-switch__flag { font-size: 1rem; line-height: 1; }
.lang-switch__menu a { display: flex; align-items: center; gap: .5rem; }
.lang-switch__chevron {
    display: inline-flex;
    color: var(--color-text-muted);
    transition: transform .18s ease;
}
.lang-switch__toggle[aria-expanded="true"] .lang-switch__chevron { transform: rotate(180deg); }

/* --- theme toggle (with visible text label) --- */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .9rem .45rem .7rem;
    border-radius: 999px;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    font-size: .85rem;
    font-weight: 700;
}
.theme-toggle:hover { border-color: var(--color-accent); }
.theme-toggle__icon { /*width: 1.05rem; height: 1.05rem;*/ display: inline-block; }
.theme-toggle__icon::before { content: "\1F319"; /*font-size: 1rem;*/ } /* moon: shown in light mode - click to go dark */
[data-theme="dark"] .theme-toggle__icon::before { content: "\2600\FE0F"; } /* sun: shown in dark mode */

/* --- hamburger (mobile only) --- */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 2.4rem;
    height: 2.4rem;
    border: 2px solid var(--color-border);
    border-radius: 9px;
    background: var(--color-surface);
    cursor: pointer;
    padding: 0;
}
.hamburger__bar {
    display: block;
    width: 1.3rem;
    height: 2px;
    margin: 0 auto;
    background: var(--color-text);
    transition: transform .2s ease, opacity .2s ease;
}
.hamburger.is-open .hamburger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open .hamburger__bar:nth-child(2) { opacity: 0; }
.hamburger.is-open .hamburger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
    .hamburger { display: flex; }
    .theme-toggle__text { display: none; }

    .site-header__bar { position: relative; flex-wrap: wrap; }
    .main-menu { order: 3; width: 100%; }

    .main-menu__list {
        display: none;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 14px;
        padding: .5rem;
        margin-top: .5rem;
        box-shadow: var(--shadow-soft);
        z-index: 55;
    }
    .main-menu__list.is-open { display: flex; }
    .main-menu__list li { border-bottom: 1px solid var(--color-border); }
    .main-menu__list li:last-child { border-bottom: none; }
    .main-menu__list a { display: block; padding: .7rem .6rem; }
}

/* ==========================================================================
   Hero - bold gradient blobs, big type
   ========================================================================== */
.hero {
    position: relative;
    padding-block: 5.5rem 4.5rem;
    overflow: hidden;
}
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: .35;
    z-index: 0;
}
.hero::before {
    width: 420px; height: 420px;
    background: var(--color-accent);
    top: -160px; right: -120px;
}
.hero::after {
    width: 320px; height: 320px;
    background: var(--color-accent-2);
    bottom: -140px; right: 220px;
    opacity: .25;
}
.hero__inner { position: relative; z-index: 1; max-width: 740px; }
.hero__title {
    font-size: clamp(2.4rem, 5.5vw, 3.75rem);
    margin: 0 0 1.1rem;
}
.hero__body {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin: 0 0 2rem;
    max-width: 56ch;
}
.hero__actions { display: flex; gap: .9rem; flex-wrap: wrap; }

/* ==========================================================================
   Features grid - colorful icon chips
   ========================================================================== */
.features { padding-block: 2rem 5rem; }
.features__title {
    font-size: 1.9rem;
    max-width: 32ch;
    margin: 0 0 2.25rem;
}
.features__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}
.feature-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 1.85rem;
    box-shadow: var(--shadow-soft);
    transition: transform .15s ease;
}
.feature-card:hover { transform: translateY(-4px); }

.feature-card__icon {
    display: inline-grid;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 12px;
    font-size: 1.3rem;
    margin-bottom: 1.1rem;
}
.feature-card:nth-child(1) .feature-card__icon { background: var(--chip-1-bg); color: var(--chip-1-fg); }
.feature-card:nth-child(2) .feature-card__icon { background: var(--chip-2-bg); color: var(--chip-2-fg); }
.feature-card:nth-child(3) .feature-card__icon { background: var(--chip-3-bg); color: var(--chip-3-fg); }

.feature-card h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .5rem; }
.feature-card p { color: var(--color-text-muted); margin: 0; }

@media (max-width: 860px) {
    .features__grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Prose / article content
   ========================================================================== */
.prose-section { padding-block: 1rem 5rem; }

.prose { max-width: 68ch; }
.prose--narrow { max-width: 60ch; margin-inline: auto; }
.prose h2 { font-size: 1.6rem; font-weight: 800; margin: 2rem 0 .75rem; }
.prose h3 { font-size: 1.25rem; font-weight: 700; margin: 1.5rem 0 .6rem; }
.prose p { margin: 0 0 1.1rem; color: var(--color-text-muted); }
.prose ul { padding-left: 1.2rem; color: var(--color-text-muted); }
.prose li { margin-bottom: .4rem; }
.prose strong { color: var(--color-text); }
.prose code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: .88em;
    background: var(--color-bg-alt);
    padding: .15em .4em;
    border-radius: 5px;
}
.prose pre {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 0 0 1.25rem;
}
.prose pre code {
    background: none;
    padding: 0;
    font-size: .85em;
    color: var(--color-text);
}

/* ==========================================================================
   Generic page header (About, Contact...)
   ========================================================================== */
.page-header {
    padding-block: 3.5rem 1rem;
}
.page-header h1 {
    font-size: clamp(2.1rem, 4vw, 2.9rem);
    margin: 0;
}

/* ==========================================================================
   Column layout (article + sidebar)
   ========================================================================== */
.layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-block: 1rem 4rem;
}
.layout--article { grid-template-columns: 1fr 280px; align-items: start; }

@media (max-width: 860px) {
    .layout--article { grid-template-columns: 1fr; }
}

/* --- widgets / sidebar --- */
.widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-soft);
}
.widget__title { margin: 0 0 .6rem; font-size: 1rem; font-weight: 700; }
.widget ul { margin: 0; padding-left: 1.1rem; color: var(--color-text-muted); }

.ad-placeholder {
    display: grid;
    place-items: center;
    min-height: 220px;
    background: var(--chip-1-bg);
    color: var(--chip-1-fg);
    border: 2px dashed var(--color-accent);
    border-radius: 16px;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    margin-top: 2rem;
    padding-block: 3rem 1.5rem;
}
.site-footer .brand { margin-bottom: .9rem; }
.site-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}
.site-footer__col p {
    color: var(--color-text-muted);
    max-width: 40ch;
    margin: 0;
}
.site-footer__col h4 { margin: 0 0 .75rem; font-size: .95rem; font-weight: 700; }
.site-footer__col ul { list-style: none; padding: 0; margin: 0; }
.site-footer__col li { margin-bottom: .5rem; }
.site-footer__col a { color: var(--color-text-muted); font-weight: 500; }
.site-footer__col a:hover { color: var(--color-accent); }

.site-footer__bottom {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
    font-size: .8rem;
    color: var(--color-text-muted);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
}
.site-footer__credit a { color: var(--color-text-muted); text-decoration: underline; }
.site-footer__credit a:hover { color: var(--color-accent); }

@media (max-width: 700px) {
    .site-footer__grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   The generator tool
   ========================================================================== */
.tool {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
    margin-top: 2.5rem;
}

.tool__privacy {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    background: var(--chip-3-bg);
    color: var(--chip-3-fg);
    border-radius: 14px;
    padding: .85rem 1.1rem;
    font-size: .88rem;
    margin-bottom: 1.75rem;
}
.tool__privacy .icon { flex: none; font-size: 1.1rem; line-height: 1; }

.tool__fields {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.25rem;
}
.tool__field {
    display: flex;
    align-items: center;
    gap: .4rem;
}
.tool__field input[type="text"] {
    width: 11rem;
    max-width: 100%;
    padding: .7rem .9rem;
    border-radius: 12px;
    border: 2px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-text);
    font-family: inherit;
    font-size: .95rem;
}
.tool__field input[type="text"]:focus {
    outline: none;
    border-color: var(--color-accent);
}
.tool__field-remove {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    border: none;
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}
.tool__field-remove:hover { background: var(--chip-2-bg); color: var(--chip-2-fg); }

.tool__add {
    background: none;
    border: 2px dashed var(--color-border);
    color: var(--color-text-muted);
    border-radius: 12px;
    padding: .68rem 1rem;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
}
.tool__add:hover { border-color: var(--color-accent); color: var(--color-accent); }

.tool__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 1.5rem 0;
    padding: 1.25rem;
    background: var(--color-bg-alt);
    border-radius: 16px;
}
.tool__control { flex: 1; min-width: 180px; }
.tool__control label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.tool__control-row {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.tool__control input[type="range"] { flex: 1; accent-color: var(--color-accent); }
.tool__control-value {
    min-width: 2.4rem;
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-accent);
}

.tool__submit {
    width: 100%;
    justify-content: center;
    font-size: 1.05rem;
    padding: 1rem;
}

/* --- loading state --- */
.tool__loading {
    display: none;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: 2.5rem 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
}
.tool__loading.is-active { display: flex; }
.tool__spinner {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    animation: tool-spin 0.8s linear infinite;
}
@keyframes tool-spin { to { transform: rotate(360deg); } }

/* --- result ticket --- */
.tool__result { display: none; }
.tool__result.is-active { display: block; }

.ticket {
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
    border-radius: 20px;
    padding: 2rem;
    color: #fff;
    text-align: center;
    margin-top: .5rem;
}
.ticket__title {
    font-size: .85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .85;
    margin-bottom: 1.1rem;
}
.ticket__numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem;
}
.ticket__ball {
    display: inline-grid;
    place-items: center;
    width: 3.2rem;
    height: 3.2rem;
    border-radius: 50%;
    background: #fff;
    color: var(--color-accent);
    font-weight: 800;
    font-size: 1.15rem;
    opacity: 0;
    transform: scale(.5);
    animation: ticket-pop .35s ease forwards;
}
@keyframes ticket-pop {
    to { opacity: 1; transform: scale(1); }
}

.tool__result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.tool__save-link {
    margin-top: 1.5rem;
    padding: 1.1rem 1.25rem;
    background: var(--chip-1-bg);
    color: var(--chip-1-fg);
    border-radius: 14px;
    font-size: .88rem;
}
.tool__save-link strong { display: block; margin-bottom: .3rem; font-size: .95rem; }
.tool__save-link-row {
    display: flex;
    gap: .5rem;
    margin-top: .75rem;
    flex-wrap: wrap;
}
.tool__save-link-row input {
    flex: 1;
    min-width: 200px;
    padding: .55rem .8rem;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: .82rem;
}

.tool__disclaimer {
    margin-top: 1.75rem;
    font-size: .78rem;
    color: var(--color-text-muted);
    text-align: center;
    line-height: 1.5;
}

/* --- live stats widget --- */
.stats-widget {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    background: var(--color-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: .5rem;
    text-align: center;
}
.stats-widget .pie-chart { width: 84px; height: 84px; margin: 0; }
.stats-widget .pie-chart::after { inset: 11px; font-size: .82rem; }
.stats-widget__title { font-size: .85rem; font-weight: 700; color: var(--color-text-muted); }

@media (max-width: 640px) {
    .tool { padding: 1.25rem; border-radius: 18px; }
    .ticket__ball { width: 2.7rem; height: 2.7rem; font-size: 1rem; }
}

/* --- vote page --- */
.vote-group { margin-top: 1.75rem; text-align: center; }
.vote-group__question { font-weight: 700; margin-bottom: .75rem; }
.vote-group__buttons { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.vote-group__note {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    padding: .7rem 1.1rem;
    border-radius: 999px;
    background: var(--chip-3-bg);
    color: var(--chip-3-fg);
    font-weight: 700;
    font-size: .9rem;
}
.vote-group__note::before { content: "\2713"; font-size: 1rem; }

/* --- pie / donut chart (pure CSS via conic-gradient) --- */
.pie-chart {
    --pct: 0;
    width: 108px;
    height: 108px;
    border-radius: 50%;
    margin: 1rem auto .5rem;
    background: conic-gradient(var(--color-accent) calc(var(--pct) * 1%), var(--color-border) 0);
    position: relative;
    transition: background .4s ease;
}
.pie-chart::after {
    content: attr(data-label);
    position: absolute;
    inset: 14px;
    background: var(--color-surface);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .95rem;
    color: var(--color-text);
    text-align: center;
    line-height: 1.15;
    padding: .3rem;
}
.pie-chart-block { text-align: center; }
.pie-chart-block__label { font-size: .8rem; font-weight: 700; color: var(--color-text-muted); margin-top: .25rem; }
.pie-charts-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* --- AdSense slot wrapper --- */
.ad-slot {
    max-width: 1180px;
    margin: 1.5rem auto;
    padding-inline: 1.5rem;
    text-align: center;
}
