/* ==========================================================================
   Raspi-Sump v2 — static homepage stylesheet
   Mobile-first. All colours via CSS custom properties. Dark by default.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    --brand:        #007f7f;
    --brand-dark:   #005a5a;
    --brand-text:   #ffffff;

    --bg:           #f4f6f8;
    --surface:      #ffffff;
    --text:         #222222;
    --text-muted:   #666666;
    --border:       #dddddd;

    --nav-height:   3.5rem;
    --radius:       4px;
    --max-width:    1000px;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[data-theme="dark"] {
    --bg:           #1a1a1a;
    --surface:      #252525;
    --text:         #e8e8e8;
    --text-muted:   #909090;
    --border:       #3a3a3a;
}

/* --------------------------------------------------------------------------
   2. Reset / base
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    background: var(--border);
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.88em;
}

[data-theme="dark"] code {
    background: #333;
    color: #e8e8e8;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

/* --------------------------------------------------------------------------
   3. Navigation
   -------------------------------------------------------------------------- */
.site-nav {
    background: var(--brand);
    color: var(--brand-text);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: var(--nav-height);
    position: relative;
    flex-shrink: 0;
    gap: 0.5rem;
}

.nav-brand {
    color: var(--brand-text);
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    flex: 1;
}

.nav-brand:hover {
    color: var(--brand-text);
    text-decoration: none;
    opacity: 0.9;
}

/* Hidden checkbox for hamburger */
.nav-check {
    display: none;
}

/* Hamburger label */
.nav-toggle-label {
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--brand-text);
    padding: 0.25rem 0.5rem;
    user-select: none;
}

/* Nav links — hidden on mobile, shown when checkbox checked */
.nav-links {
    display: none;
    list-style: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--brand);
    z-index: 200;
    border-top: 2px solid var(--brand-dark);
    padding: 0.5rem 0;
}

.nav-check:checked ~ .nav-links {
    display: block;
}

.nav-links > li > a {
    display: block;
    padding: 0.65rem 1.25rem;
    color: var(--brand-text);
    text-decoration: none;
}

.nav-links > li > a:hover {
    background: var(--brand-dark);
    text-decoration: none;
}

.btn-donate {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    margin: 0.4rem 1.25rem;
    background: var(--surface);
    color: var(--brand) !important;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
}

.btn-donate:hover {
    background: #e8e8e8;
}

/* Theme toggle button */
.btn-theme-toggle {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius);
    color: var(--brand-text);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.3rem 0.7rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.12);
}

.theme-icon-sun  { display: none; }
.theme-icon-moon { display: inline; }

[data-theme="dark"] .theme-icon-sun  { display: inline; }
[data-theme="dark"] .theme-icon-moon { display: none; }

/* Desktop nav */
@media (min-width: 768px) {
    .nav-toggle-label {
        display: none;
    }

    .nav-brand {
        flex: none;
        margin-right: 1rem;
    }

    .nav-links {
        display: flex !important;
        position: static;
        background: transparent;
        border: none;
        padding: 0;
        align-items: center;
        gap: 0.1rem;
        flex: 1;
        margin-left: auto;
        justify-content: flex-end;
    }

    .nav-links > li > a {
        padding: 0.45rem 0.75rem;
        border-radius: var(--radius);
        white-space: nowrap;
    }

    .btn-donate {
        margin: 0 0.25rem;
    }
}

/* Dark mode nav overrides */
[data-theme="dark"] .site-nav {
    background: #111111;
    border-bottom: 2px solid var(--brand);
}

[data-theme="dark"] .nav-links {
    background: #111111;
    border-top-color: #2a2a2a;
}

[data-theme="dark"] .nav-links > li > a:hover {
    background: #222222;
}

[data-theme="dark"] .btn-donate:hover {
    background: #3a3a3a;
}

/* --------------------------------------------------------------------------
   4. Main layout
   -------------------------------------------------------------------------- */
main {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem 3rem;
}

/* --------------------------------------------------------------------------
   5. Pre-release banner
   -------------------------------------------------------------------------- */
.prerelease-banner {
    background: #332700;
    color: #ffd54f;
    border: 1px solid #664d00;
    border-radius: var(--radius);
    padding: 0.75rem 1.1rem;
    font-size: 0.9rem;
    margin-top: 1.25rem;
    line-height: 1.5;
}

.prerelease-banner a {
    color: #ffd54f;
    text-decoration: underline;
}

.prerelease-banner a:hover {
    color: #ffe082;
}

[data-theme="light"] .prerelease-banner {
    background: #fff8e1;
    color: #6d4c00;
    border-color: #ffc107;
}

[data-theme="light"] .prerelease-banner a {
    color: #6d4c00;
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
    text-align: center;
    padding: 3rem 1rem 2.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2.5rem;
}

.hero-logo {
    max-width: 520px;
    width: 90%;
    margin-bottom: 1.25rem;
    border-radius: 0;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: var(--brand);
    color: var(--brand-text);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--brand-dark);
    color: var(--brand-text);
    text-decoration: none;
}

.btn-secondary {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: transparent;
    color: var(--brand);
    border: 2px solid var(--brand);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--brand);
    color: var(--brand-text);
    text-decoration: none;
}

/* --------------------------------------------------------------------------
   6. Content sections
   -------------------------------------------------------------------------- */
.content-section {
    margin-bottom: 3rem;
}

.content-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--brand);
    display: inline-block;
}

.content-section p {
    margin-bottom: 0.9rem;
    max-width: 760px;
}

.content-section p:last-child {
    margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   7. Feature grid
   -------------------------------------------------------------------------- */
.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

@media (min-width: 560px) {
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 800px) {
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.feature-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--brand);
}

.feature-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 0;
    max-width: none;
}

/* --------------------------------------------------------------------------
   8. Feature list (legacy features)
   -------------------------------------------------------------------------- */
.feature-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.3rem;
    margin-top: 0.75rem;
}

@media (min-width: 640px) {
    .feature-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.feature-list li {
    padding: 0.3rem 0 0.3rem 1.1rem;
    position: relative;
    font-size: 0.92rem;
    color: var(--text);
}

.feature-list li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--brand);
}

/* --------------------------------------------------------------------------
   9. Platform badges / OS list
   -------------------------------------------------------------------------- */
.platform-list {
    list-style: none;
    padding: 0;
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.platform-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.badge-os {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge-recommended {
    background: #d4edda;
    color: #155724;
}

.badge-supported {
    background: #cce5ff;
    color: #004085;
}

.badge-not-supported {
    background: #f8d7da;
    color: #721c24;
}

[data-theme="dark"] .badge-recommended   { background: #1b3a20; color: #6fcf6f; }
[data-theme="dark"] .badge-supported     { background: #1a2a3a; color: #7ec8f7; }
[data-theme="dark"] .badge-not-supported { background: #3a1a1a; color: #e07878; }

/* --------------------------------------------------------------------------
   10. Installation block
   -------------------------------------------------------------------------- */
.install-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
}

.install-block h3 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.install-block pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    white-space: pre;
    margin: 0;
}

/* --------------------------------------------------------------------------
   11. Hardware section — images
   -------------------------------------------------------------------------- */
.image-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    align-items: flex-start;
}

.image-row img {
    flex: 1 1 260px;
    max-width: 100%;
    border: 1px solid var(--border);
    object-fit: cover;
}

.image-block {
    margin-top: 1.25rem;
}

.image-block img {
    border: 1px solid var(--border);
    max-width: 560px;
    width: 100%;
}

.image-caption {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    font-style: italic;
}

/* --------------------------------------------------------------------------
   12. App screenshot
   -------------------------------------------------------------------------- */
.screenshot-block {
    margin-top: 1.25rem;
}

.screenshot-block img {
    width: 100%;
    max-width: 900px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    display: block;
}

[data-theme="dark"] .screenshot-block img {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

/* --------------------------------------------------------------------------
   13. Community / support cards
   -------------------------------------------------------------------------- */
.support-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}

@media (min-width: 560px) {
    .support-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.support-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.support-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.5rem;
}

.support-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    max-width: none;
}

.support-card a.btn-primary,
.support-card a.btn-secondary {
    font-size: 0.88rem;
    padding: 0.45rem 1rem;
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */
footer {
    text-align: center;
    padding: 1.25rem 1rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

footer a {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--brand);
}
