/* memtavo - base stylesheet. Mobile-first, no framework. */

:root {
    --color-bg: #0b0d12;
    --color-bg-alt: #12151d;
    --color-surface: #171b25;
    --color-border: #262b38;
    --color-text: #e6e8ee;
    --color-text-muted: #9aa1b1;
    --color-accent: #6366f1;
    --color-accent-hover: #818cf8;
    --color-success: #34d399;
    --color-danger: #f87171;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

    --radius: 10px;
    --max-width: 1120px;
    --header-height: 84px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    line-height: 1.6;
    font-size: 16px;
}

h1, h2, h3, h4 {
    line-height: 1.25;
    margin: 0 0 0.6em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

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

code, pre {
    font-family: var(--font-mono);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

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

/* Off-screen (not display:none) so honeypot fields still exist for naive bots to fill */
.visually-hidden-field {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.65em 1.4em;
    border-radius: var(--radius);
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 1rem;
}
.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-secondary {
    background: transparent;
    color: var(--color-text);
    border-color: var(--color-border);
}
.btn-secondary:hover { border-color: var(--color-accent-hover); color: var(--color-accent-hover); }

/* Header / Nav */
.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
}

.brand-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.brand {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--color-text);
}
.brand:hover { text-decoration: none; color: var(--color-accent-hover); }

.github-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem;
    color: var(--color-text-muted);
}
/* Footer variant: no icon-only padding needed once there's visible text next to it */
.footer-col .github-link {
    padding: 0;
}
.github-link:hover {
    text-decoration: none;
    color: var(--color-text);
}
.github-link svg {
    width: 20px;
    height: 20px;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
}
.nav-toggle-bar {
    width: 18px;
    height: 2px;
    background: var(--color-text);
    display: block;
}

.primary-nav {
    display: none;
    width: 100%;
}
.primary-nav.open {
    display: block;
}
.primary-nav ul {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.primary-nav a {
    color: var(--color-text-muted);
    font-weight: 500;
}
.primary-nav a.active,
.primary-nav a:hover {
    color: var(--color-text);
}

@media (min-width: 768px) {
    .nav-toggle { display: none; }
    .nav-bar { flex-wrap: nowrap; }
    .primary-nav {
        display: block;
        width: auto;
    }
    .primary-nav ul {
        flex-direction: row;
        margin: 0;
        gap: 1.75rem;
    }
}

/* Hero */
.hero {
    padding: 4rem 0 3rem;
    text-align: center;
}
.hero h1 {
    font-size: 2.25rem;
    max-width: 720px;
    margin: 0 auto 0.6em;
}
.hero p.lead {
    color: var(--color-text-muted);
    max-width: 620px;
    margin: 0 auto 2em;
    font-size: 1.1rem;
}
.hero-ctas {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-github-mention {
    margin: 1.5rem 0 0;
}
.hero-github-mention .github-link {
    display: inline-flex;
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .hero h1 { font-size: 3rem; }
}

/* Code block */
.code-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow-x: auto;
    text-align: left;
    max-width: 640px;
    margin: 0 auto;
    position: relative;
}
.code-block pre {
    margin: 0;
    color: var(--color-text);
    font-size: 0.9rem;
}
.copy-btn {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    border-radius: 6px;
    padding: 0.3em 0.6em;
    font-size: 0.75rem;
    cursor: pointer;
}
.copy-btn:hover { color: var(--color-text); }

/* Sections */
.section {
    padding: 3rem 0;
    border-top: 1px solid var(--color-border);
}

/* Anchor-nav targets: the sticky header would otherwise cover the top of
   whatever section is scrolled to via a nav/CTA link. */
#features,
#pricing,
#about {
    scroll-margin-top: var(--header-height);
}
.section-heading {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 2.5rem;
}
.section-heading p {
    color: var(--color-text-muted);
}

/* Feature grid */
.grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--color-text-muted); margin-bottom: 0; }

/* How it works steps */
.steps {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    counter-reset: step;
}
@media (min-width: 768px) {
    .steps { grid-template-columns: repeat(3, 1fr); }
}
.step {
    text-align: center;
}
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

/* Tables */
table.compare {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
table.compare th,
table.compare td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}
table.compare th {
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    font-weight: 600;
}
table.compare tr:last-child td { border-bottom: none; }
.highlight-col {
    color: var(--color-success);
    font-weight: 700;
}

/* Pricing */
.pricing-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}
@media (min-width: 700px) {
    .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .pricing-grid { grid-template-columns: repeat(4, 1fr); }
}
.price-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
}
.price-card.popular {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 1px var(--color-accent);
}
.popular-badge {
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25em 0.75em;
    border-radius: 999px;
}
.price-amount {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0.4em 0;
}
.price-amount span {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-muted);
}
.price-card ul {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0;
    flex: 1;
}
.price-card li {
    padding: 0.4em 0;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}
.price-card li:first-child { border-top: none; }

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}
.form-group label {
    display: block;
    margin-bottom: 0.4em;
    font-weight: 600;
    font-size: 0.9rem;
}
.form-group input,
.form-group textarea {
    width: 100%;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.65em 0.8em;
    color: var(--color-text);
    font-family: inherit;
    font-size: 1rem;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-accent);
}

.alert {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.alert-success {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}
.alert-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

/* CTA band */
.cta-band {
    text-align: center;
    padding: 3.5rem 0;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-alt);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: 1fr;
    margin-bottom: 2rem;
}
@media (min-width: 640px) {
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
.footer-col h4 {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col li { margin-bottom: 0.5em; }
.footer-col p { color: var(--color-text-muted); }
.footer-bottom {
    border-top: 1px solid var(--color-border);
    padding-top: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Docs stub */
.docs-stub {
    text-align: center;
    padding: 4rem 0;
}

/* Contact modal (native <dialog>) */
dialog.modal {
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 2rem 1.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 100vh;
    overflow-y: auto;
    position: fixed;
    margin: auto;
}

dialog.modal::backdrop {
    background: rgba(3, 4, 8, 0.7);
}

@media (max-width: 480px) {
    dialog.modal {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        margin: 0;
    }
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.9rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
}
.modal-close:hover {
    color: var(--color-text);
}

.modal-alert {
    margin-bottom: 1.25rem;
}
