/* site.css — home page only (not loaded by admin pages) */

:root {
    --accent:      #2563eb;
    --accent-dark: #1d4ed8;
    --text:        #1a1a2e;
    --text-muted:  #6b7280;
    --bg:          #ffffff;
    --bg-alt:      #f8fafc;
    --border:      #e5e7eb;
    --radius:      8px;
    --max-width:   1100px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Sticky footer (flexbox) ── */
html, body {
    height: 100%;
}

body.home-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.home-page > main,
body.home-page > .content {
    flex: 1 0 auto;
}

body.home-page > footer {
    flex-shrink: 0;
}

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* ── Responsive form card ── */
.form-card {
    max-width: 720px;
    margin: 0 auto;
    box-sizing: border-box;
}

.form-card input[type="text"],
.form-card input[type="password"],
.form-card input[type="email"],
.form-card textarea,
.form-card select {
    width: 100%;
    box-sizing: border-box;
}

.form-card textarea {
    min-height: 8rem;
    resize: vertical;
}

/* ── Table wrap (horizontal scroll on narrow viewports) ── */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap > table {
    min-width: 720px;
}

/* ── Header ── */
.site-header {
    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 0.75rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: -0.02em;
}

/* ── Nav ── */
.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

.nav-list li a {
    color: var(--text);
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
    display: inline-block;
}

.nav-list li a:hover {
    background: var(--bg-alt);
    color: var(--accent);
}

.nav-list button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-list button:hover {
    background: var(--bg-alt);
    color: var(--accent);
    border-color: var(--accent);
}

/* ── Hero ── */
.hero {
    padding: 6rem 0 5rem;
    text-align: center;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text);
}

.hero-sub {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ── Buttons ── */
.btn {
    display: inline-block;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

/* ── Services ── */
.services {
    padding: 5rem 0;
    background: var(--bg);
}

.services h2,
.about h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    padding: 1.75rem;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--accent);
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ── Architecture (system diagram) ── */
.architecture {
    padding: 5rem 0;
    background: var(--bg);
    border-top: 1px solid var(--border);
}

.architecture h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.arch-caption {
    max-width: 680px;
    margin: 0 auto 2.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.arch-diagram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.arch-tier {
    width: 100%;
    max-width: 880px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    padding: 1.25rem 1.25rem 1.5rem;
    text-align: center;
}

.arch-tier-label {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
}

.arch-row {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.6rem;
}

.arch-row--wrap {
    flex-wrap: wrap;
}

.arch-row--phases {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.6rem;
}

.arch-node {
    display: inline-block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.55rem 0.9rem;
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 500;
}

.arch-node--primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}

.arch-phase {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem 0.4rem;
    font-size: 0.85rem;
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    line-height: 1.25;
}

.arch-phase b {
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.arch-phase span {
    color: var(--text);
    font-weight: 500;
}

.arch-arrow {
    width: 2px;
    height: 28px;
    background: var(--border);
    position: relative;
}

.arch-arrow::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--border);
    transform: translateX(-50%);
}

/* ── About ── */
.about {
    padding: 5rem 0;
    background: var(--bg-alt);
}

.about p {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ── Footer ── */
.site-footer {
    background: var(--text);
    color: rgba(255, 255, 255, 0.7);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

.site-footer a:hover {
    color: #fff;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .arch-row--phases {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }

    .form-card {
        max-width: 100%;
    }

    .hero {
        padding: 4rem 0 3rem;
    }

    .nav-list li a {
        padding: 0.4rem 0.5rem;
        font-size: 0.85rem;
    }

    .nav-list button {
        padding: 0.35rem 0.5rem;
        font-size: 0.85rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .services,
    .about,
    .architecture {
        padding: 3rem 0;
    }

    .arch-row--phases {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .arch-tier {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-list {
        flex-direction: column;
        align-items: flex-start;
    }
}
