:root {
    --bg: #051612;
    --surface: #0b2721;
    --soft: #123c31;
    --text: #eef6f4;
    --muted: #c0d1cc;
    --accent: #00e07a;
    --accent-2: #00cfd1;
    --radius: 14px;
    --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 1rem;
    overflow-x: hidden;
}

.container {
    width: min(1100px, 90vw);
    margin: 0 auto;
}

a { color: var(--accent-2); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--text); }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.65rem); margin-bottom: 0.75rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
p { color: var(--muted); margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

img { max-width: 100%; height: auto; display: block; }

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(5, 22, 18, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 0;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.brand img { border-radius: 6px; }
.brand small { color: var(--accent); font-size: 0.75rem; font-weight: 400; }

.site-nav { display: flex; gap: 1.25rem; align-items: center; }
.site-nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: color var(--transition);
}
.site-nav a:hover { color: var(--text); }

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 0.4rem 0.55rem;
    cursor: pointer;
    color: var(--text);
    font-size: 1.3rem;
    line-height: 1;
}

/* ── Hero ── */
.hero {
    padding: 4rem 0 3rem;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    width: 500px;
    height: 500px;
    right: -150px;
    top: -150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,224,122,0.15) 0%, transparent 65%);
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    left: -100px;
    bottom: -100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,207,209,0.08) 0%, transparent 65%);
    pointer-events: none;
}

.hero-grid {
    position: relative;
    z-index: 1;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-2);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.intro {
    max-width: 720px;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    border-radius: 999px;
    padding: 0.75rem 1.4rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    transition: transform var(--transition), box-shadow var(--transition);
    border: none;
    cursor: pointer;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: #022216;
}
.btn-secondary {
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text);
    background: transparent;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ── Content sections ── */
.content-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2.5rem 0;
}

.content-card {
    background: linear-gradient(160deg, var(--surface), rgba(18,60,49,0.5));
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius);
    padding: 2rem 1.8rem;
}

.content-card p {
    font-size: 1.02rem;
    line-height: 1.75;
}

/* ── Definition row (homepage) ── */
.definition-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1.5rem 0;
}

.definition-card {
    background: linear-gradient(145deg, rgba(16,46,38,0.9), rgba(10,33,27,0.9));
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.definition-card h2 { font-size: 1.1rem; }

/* ── Card grid + feature cards ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.feature-card {
    text-decoration: none;
    background: var(--surface);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    padding: 1.3rem;
    transition: transform var(--transition), border-color var(--transition);
}
.feature-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0,224,122,0.3);
}
.feature-card h3 { color: var(--text); }
.feature-card p { font-size: 0.92rem; }
.feature-card .content-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* ── Related links, visual examples ── */
.related-links, .visual-examples, .faq-section, .tool-panel, .download-panel, .compare-table-wrap {
    padding: 2.5rem 0;
}
.section-intro {
    color: var(--muted);
    font-size: 1rem;
    margin: -0.5rem 0 1.5rem;
    max-width: 640px;
}

/* ── FAQ ── */
.faq-item {
    background: rgba(11,40,34,0.6);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    margin-bottom: 0.6rem;
    overflow: hidden;
}

.faq-item summary {
    padding: 1rem 1.3rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.02rem;
    color: var(--text);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::after {
    content: "+";
    font-size: 1.3rem;
    color: var(--accent);
    flex-shrink: 0;
    margin-left: 1rem;
    transition: transform var(--transition);
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-answer {
    padding: 0 1.3rem 1.2rem;
}

.faq-answer p {
    font-size: 0.98rem;
    line-height: 1.75;
}

/* ── Tool form ── */
.tool-form textarea, .tool-form select, .tool-form input[type="text"], .tool-form input:not([type]) {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(7,32,27,0.8);
    color: var(--text);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition);
}
.tool-form textarea:focus, .tool-form select:focus, .tool-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.tool-form label {
    display: block;
    margin: 1rem 0 0.4rem;
    font-weight: 600;
    font-size: 0.92rem;
}

.tool-result {
    white-space: pre-wrap;
    background: rgba(10,37,31,0.7);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1.2rem;
    margin-top: 1.2rem;
    color: #d8f0ea;
    font-size: 0.95rem;
    line-height: 1.7;
    min-height: 60px;
}

/* ── Showcase image (homepage) ── */
.hero-showcase {
    margin: 1.5rem auto 2rem;
    max-width: 460px;
}
.hero-showcase img {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

/* ── Quota popup ── */
.quota-popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 200;
}
.quota-popup.active { display: flex; }
.quota-card {
    width: min(520px, 95vw);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── Comparison table ── */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
th, td {
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.7rem 0.9rem;
    text-align: left;
    font-size: 0.93rem;
}
th {
    background: rgba(0,224,122,0.08);
    font-weight: 600;
    color: var(--text);
}
td { color: var(--muted); }

/* ── Download panel ── */
.download-panel .content-card {
    text-align: center;
    padding: 2.5rem 2rem;
}

/* ── Footer ── */
.site-footer {
    margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.25);
}
.footer-grid {
    padding: 2rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}
.footer-grid h2 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin: 0.35rem 0; }
.footer-grid a { color: var(--accent-2); font-size: 0.92rem; }
.footer-bottom {
    padding: 0.6rem 0 1.5rem;
    color: #9cb3ad;
    font-size: 0.85rem;
}

/* ── Responsive ── */
@media (max-width: 800px) {
    .nav-toggle { display: block; }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(5,22,18,0.97);
        backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 1rem 5vw 1.5rem;
        gap: 0.6rem;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }
    .site-nav.open { display: flex; }
    .site-nav a { font-size: 1.05rem; padding: 0.5rem 0; }

    .site-header { position: relative; }

    .hero { padding: 2.5rem 0 2rem; }
    h1 { font-size: 1.7rem; }

    .content-card { padding: 1.5rem 1.2rem; }
    .definition-row { grid-template-columns: 1fr; }
    .fm-tool-grid { grid-template-columns: 1fr; }
    .fm-tool-output { min-height: 200px; }
}

/* ── AI Tool (above the fold) ── */
.fm-tool {
    padding: 0 0 2rem;
}
.fm-tool > .container {
    background: linear-gradient(160deg, var(--surface), rgba(18,60,49,0.45));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: 0 4px 32px rgba(0,0,0,0.25);
}
.fm-tool h2 {
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    color: var(--accent);
}
.fm-tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
    align-items: start;
}
.fm-tool-input, .fm-tool-output {
    background: rgba(7,32,27,0.4);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 1.3rem;
}
.fm-textarea-wrap { position: relative; margin-bottom: 0.8rem; }
.fm-textarea-wrap textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(7,32,27,0.6);
    color: var(--text);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    line-height: 1.6;
}
.fm-textarea-wrap textarea:focus { outline: none; border-color: var(--accent); }

.fm-prefs-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.fm-pref-trigger {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    background: rgba(7,32,27,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color var(--transition);
    text-align: left;
    width: 100%;
}
.fm-pref-trigger:hover { border-color: var(--accent); }
.fm-pref-flag { font-size: 1.1rem; flex-shrink: 0; }
.fm-pref-label { font-weight: 600; white-space: nowrap; }
.fm-pref-summary { color: var(--muted); font-size: 0.82rem; flex: 1; }
.fm-chevron { color: var(--muted); margin-left: auto; font-size: 1.2rem; flex-shrink: 0; }

.fm-generate-btn { width: 100%; text-align: center; margin-top: 0; }

/* Tool output */
.fm-tool-output {
    display: flex;
    flex-direction: column;
    min-height: 280px;
}
.fm-result-placeholder {
    color: var(--muted);
    font-size: 0.95rem;
    padding: 1rem 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.fm-result-text {
    white-space: pre-wrap;
    font-size: 0.93rem;
    line-height: 1.75;
    color: #d8f0ea;
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}
.fm-result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex: 1;
    color: var(--muted);
    font-size: 0.92rem;
}
.fm-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: fm-spin 0.7s linear infinite;
}
@keyframes fm-spin { to { transform: rotate(360deg); } }

.fm-result-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.07);
    margin-top: 0.8rem;
}
.fm-action-btn {
    flex: 1;
    padding: 0.55rem 0.6rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    transition: border-color var(--transition), background var(--transition);
}
.fm-action-btn:hover { border-color: var(--accent); background: rgba(0,224,122,0.06); }
.fm-action-clear:hover { border-color: #e74c3c; background: rgba(231,76,60,0.06); }

/* ── Modals ── */
.fm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.fm-modal.open {
    display: flex;
}

.fm-modal-sheet {
    width: min(500px, 100%);
    max-height: 85vh;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    animation: fm-slideUp 0.25s ease-out;
}
@keyframes fm-slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.fm-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}
.fm-modal-head h3 { font-size: 1.1rem; margin: 0; }
.fm-modal-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.2rem;
}
.fm-modal-body { padding: 1rem 1.2rem 1.5rem; }

/* Language list */
.fm-lang-list { display: flex; flex-direction: column; gap: 0.3rem; }
.fm-lang-opt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 0.8rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.95rem;
    font-family: inherit;
    transition: background var(--transition);
    text-align: left;
    width: 100%;
}
.fm-lang-opt:hover { background: rgba(0,224,122,0.08); }
.fm-lang-opt.selected { color: var(--accent); border-color: var(--accent); }

/* Preference chips */
.fm-pref-section { margin-bottom: 1.2rem; }
.fm-pref-section h4 { font-size: 0.92rem; margin-bottom: 0.6rem; color: var(--muted); }
.fm-pref-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fm-chip {
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    transition: all var(--transition);
}
.fm-chip:hover { background: rgba(0,224,122,0.08); }
.fm-chip.selected { background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #022216; border-color: transparent; font-weight: 600; }
