
/* =========================================
   1. Design tokens
========================================= */

:root {
    color-scheme: dark;
    --bg: #0c0e0d;
    --bg-secondary: #111412;
    --surface: #151916;
    --surface-hover: #1b211d;
    --border: #252c27;
    --border-hover: #39463d;
    --text: #e8ede9;
    --text-secondary: #a0aaa3;
    --text-muted: #69756d;
    --accent: #9bc6a5;
    --accent-hover: #b5d8bd;
    --success: #83c994;
    --radius: 12px;
    --content-width: 1120px;
    --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* =========================================
   2. Reset and global styles
========================================= */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: 40px;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

main {
    flex: 1 0 auto;
    width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

::selection {
    background: var(--accent);
    color: var(--bg);
}


/* =========================================
   3. Footer
========================================= */

.site-footer {
    flex-shrink: 0;
    width: 100%;
    padding: 24px 0;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

    .site-footer a {
        transition: color 180ms ease;
    }

        .site-footer a:hover {
            color: var(--accent);
        }


/* =========================================
   4. Main layout
========================================= */

.home {
    width: min(var(--content-width), calc(100% - 48px));
    margin: 0 auto;
}


/* =========================================
   5. Hero
========================================= */

.hero {
    min-height: 300px;
    padding: 100px 0 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.hero-content {
    max-width: 720px;
}

.eyebrow {
    display: inline-block;
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero h1 {
    margin: 24px 0 18px;
    font-size: clamp(48px, 8vw, 88px);
    line-height: 1.05;
    font-weight: 650;
    letter-spacing: -5px;
}

    .hero h1 span {
        color: var(--accent);
    }

.hero-description {
    max-width: 500px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1.8;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 38px;
    padding: 11px 17px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    transition: 180ms ease;
}

    .hero-link:hover {
        border-color: var(--accent);
        color: var(--accent);
        background: rgba(155, 198, 165, 0.04);
    }

    .hero-link span {
        color: var(--accent);
    }

.hero-meta {
    display: flex;
    justify-content: space-between;
    /*padding-top: 20px; */
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}


/* =========================================
   6. Sections
========================================= */

.section {
    padding: 20px 0;
    border-top: 1px solid var(--border);
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 38px;
}

    .section-heading h2 {
        margin: 10px 0 0;
        font-size: 36px;
        font-weight: 600;
        letter-spacing: -1.5px;
        line-height: 1.2;
    }

    .section-heading > p {
        max-width: 300px;
        margin: 0;
        color: var(--text-secondary);
        font-size: 13px;
    }


/* =========================================
   7. Service cards
========================================= */

.service-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.service-card {
    min-height: 225px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

    .service-card:hover {
        background: var(--surface-hover);
        border-color: var(--border-hover);
       /* transform: translateY(-3px); */
    }

.service-card-link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.service-card-top {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.service-icon {
    min-width: 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
}

.service-card h3 {
    margin: 36px 0 7px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.service-card > p {
    max-width: 260px;
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
}

.card-arrow {
    position: absolute;
    right: 23px;
    bottom: 20px;
    color: var(--text-muted);
    font-size: 18px;
    transition: color 180ms ease, transform 180ms ease;
}

.service-card:hover .card-arrow {
    color: var(--accent);
    transform: translate(2px, -2px);
}

.service-card.service-disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

    .service-card.service-disabled .card-arrow {
        opacity: 0.5;
    }


/* =========================================
   8. Service status indicators
========================================= */

.service-status {
    width: 110px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
}

    .service-status .status-dot {
        display: block;
        flex: 0 0 7px;
        width: 7px;
        height: 7px;
        border-radius: 50%;
    }

/* Online */
.status-up {
    color: #22c55e;
}

    .status-up .status-dot {
        background: #22c55e;
    }

/* Offline */
.status-down {
    color: #ef4444;
}

    .status-down .status-dot {
        background: #ef4444;
    }

/* Maintenance */
.status-maintenance {
    color: #eab308;
}

    .status-maintenance .status-dot {
        background: #eab308;
    }

/* Unknown */
.status-tba {
    color: #9ca3af;
}

    .status-tba .status-dot {
        background: #9ca3af;
    }


/* =========================================
   9. Admin controls
========================================= */

.service-admin-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

    .service-admin-controls button {
        padding: 6px 9px;
        border: 1px solid var(--border);
        border-radius: 4px;
        background: transparent;
        color: inherit;
        font-size: 11px;
        cursor: pointer;
    }

        .service-admin-controls button:hover {
            border-color: var(--accent);
        }

        .service-admin-controls button.active {
            border-color: currentColor;
            background: rgba(128, 128, 128, 0.15);
            font-weight: 700;
        }


/* =========================================
   10. Service editor
========================================= */

.service-editor,
.add-service {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

    .service-editor summary,
    .add-service summary {
        cursor: pointer;
        font-size: 13px;
        font-weight: 600;
    }

    .service-editor form,
    .add-service form {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }

    .service-editor label,
    .add-service label {
        font-size: 12px;
        opacity: 0.8;
    }

    .service-editor input:not([type="checkbox"]),
    .service-editor textarea,
    .service-editor select,
    .add-service input:not([type="checkbox"]),
    .add-service textarea,
    .add-service select {
        width: 100%;
        padding: 9px;
        border: 1px solid var(--border);
        border-radius: 4px;
        background: var(--bg-secondary);
        color: var(--text);
        font: inherit;
    }

    .service-editor textarea,
    .add-service textarea {
        min-height: 70px;
        resize: vertical;
    }

    .service-editor button,
    .add-service button,
    .service-order-controls button {
        padding: 8px 12px;
        border: 1px solid var(--border);
        border-radius: 4px;
        background: transparent;
        color: inherit;
        cursor: pointer;
    }

        .service-editor button:hover,
        .add-service button:hover,
        .service-order-controls button:hover {
            border-color: var(--accent);
        }


/* =========================================
   11. Service ordering
========================================= */

.service-order-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

    .service-order-controls form {
        margin: 0;
    }

    .service-order-controls .delete-button {
        color: #ef4444;
        border-color: #ef4444;
    }

        .service-order-controls .delete-button:hover {
            background: rgba(239, 68, 68, 0.1);
        }


/* =========================================
   12. Projects
========================================= */

.projects-placeholder {
    min-height: 150px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

    .projects-placeholder p {
        margin: 0;
        color: var(--text);
        font-size: 15px;
    }

    .projects-placeholder span {
        color: var(--text-muted);
        font-size: 12px;
    }


/* =========================================
   13. About
========================================= */

.about-section {
    padding: 100px 0 130px;
    border-top: 1px solid var(--border);
}

    .about-section h2 {
        max-width: 650px;
        margin: 22px 0;
        font-size: clamp(32px, 5vw, 54px);
        font-weight: 600;
        line-height: 1.2;
        letter-spacing: -2px;
    }

    .about-section > p {
        max-width: 530px;
        margin: 0;
        color: var(--text-secondary);
        font-size: 15px;
        line-height: 1.9;
    }


/* =========================================
   14. Tracker
========================================= */

.tracker-page {
    max-width: 1500px;
    margin: 60px auto;
    padding: 0 24px 60px;
}

.tracker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 36px;
}

    .tracker-header h1 {
        margin: 12px 0 8px;
        color: #fff;
        font-size: 2.5rem;
        font-weight: 700;
    }

    .tracker-header p {
        margin: 0;
        color: #999;
    }

.tracker-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #aaa;
    font-size: 0.9rem;
}

    .tracker-status .status-dot {
        display: block;
        flex: 0 0 8px;
        width: 8px;
        height: 8px;
        background: #6dbb8b;
        border-radius: 50%;
    }

.tracker-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.tracker-card {
    padding: 22px;
    background: #151515;
    border: 1px solid #292929;
    border-radius: 10px;
}

    .tracker-card span {
        display: block;
        margin-bottom: 12px;
        color: #888;
        font-size: 0.8rem;
    }

    .tracker-card strong {
        display: block;
        color: #fff;
        font-size: 1.15rem;
        overflow-wrap: anywhere;
    }

.tracker-empty {
    padding: 70px 24px;
    text-align: center;
    border: 1px solid #292929;
    border-radius: 10px;
    background: #151515;
}

    .tracker-empty h2 {
        color: #fff;
    }

    .tracker-empty p {
        color: #888;
    }

.tracker-table-container {
    overflow-x: auto;
    border: 1px solid #292929;
    border-radius: 10px;
    background: #151515;
}

.tracker-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    color: #ccc;
    font-size: 0.9rem;
}

    .tracker-table th {
        background: #1b1b1b;
        color: #888;
        font-weight: 500;
        text-align: left;
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .tracker-table th,
    .tracker-table td {
        padding: 15px 18px;
        border-bottom: 1px solid #292929;
    }

    .tracker-table tbody tr:last-child td {
        border-bottom: none;
    }

    .tracker-table tbody tr:hover {
        background: #202020;
    }

    .tracker-table a {
        color: #8ab4f8;
    }

        .tracker-table a:hover {
            color: #fff;
            text-decoration: underline;
        }


/* =========================================
   15. Privacy
========================================= */

.privacy-page {
    max-width: 850px;
    margin: 60px auto;
    padding: 0 24px 60px;
    color: #d1d5db;
    line-height: 1.8;
}

    .privacy-page h1 {
        margin-bottom: 12px;
        color: #fff;
        font-size: 2.4rem;
        font-weight: 700;
    }

    .privacy-page h2 {
        margin-top: 40px;
        margin-bottom: 16px;
        color: #fff;
        font-size: 1.35rem;
    }

    .privacy-page p {
        margin-bottom: 20px;
    }

    .privacy-page ul {
        margin: 20px 0 28px;
        padding-left: 24px;
    }

    .privacy-page li {
        margin-bottom: 12px;
        padding-left: 6px;
    }

        .privacy-page li::marker {
            color: #888;
        }

    .privacy-page strong {
        color: #fff;
        font-weight: 600;
    }

    .privacy-page a {
        color: #8ab4f8;
        transition: color 0.2s ease;
    }

        .privacy-page a:hover {
            color: #fff;
            text-decoration: underline;
        }


/* =========================================
   16. Responsive design
========================================= */

@media (max-width: 800px) {
    .hero {
        min-height: 540px;
        padding-top: 110px;
    }

    .service-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section {
        padding: 75px 0;
    }

    .tracker-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .tracker-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .home {
        width: calc(100% - 36px);
    }

    .hero {
        min-height: 490px;
        padding-top: 90px;
    }

        .hero h1 {
            font-size: clamp(43px, 12vw, 60px);
            letter-spacing: -3px;
        }

    .hero-description {
        font-size: 15px;
    }

    .hero-meta {
        font-size: 10px;
    }

    .section {
        padding: 65px 0;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

        .section-heading h2 {
            font-size: 30px;
        }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        min-height: 195px;
    }

    .about-section {
        padding: 75px 0 90px;
    }

        .about-section h2 {
            font-size: 36px;
            letter-spacing: -1.3px;
        }
}

@media (max-width: 450px) {
    .tracker-summary {
        grid-template-columns: 1fr;
    }

    .tracker-header h1 {
        font-size: 2rem;
    }
}


/* =========================================
   17. Accessibility
========================================= */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
