/* =============================================================================
   xyzroot.com — design system (Phase 1)
   Dark operational aesthetic. Vanilla CSS, no build step.
   ========================================================================== */

:root {
    /* Palette */
    --bg:          #0d0f12;
    --surface:     #161a1f;
    --amber:       #c9873a;
    --blue:        #3a6fc9;
    --text:        #e8e4dc;
    --muted:       #7a7f88;
    --divider:     #23282e;
    --live:        #1D9E75;
    --migrating:   #BA7517;

    /* Derived surfaces (card hover lightening) */
    --surface-hover: #1c2127;
    --amber-bright:  #e0a253;

    /* Fonts */
    --font-head: "DM Serif Display", Georgia, serif;
    --font-body: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;

    /* Rhythm */
    --maxw: 1100px;
    --radius: 8px;
}

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

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3 {
    font-family: var(--font-head);
    font-weight: 400;
    line-height: 1.1;
}

/* --- Status bar ----------------------------------------------------------- */
/* Single top row, mono, muted. Dashboard readout — not a banner. */
.status-bar {
    width: 100%;
    border-bottom: 1px solid var(--divider);
    background: var(--bg);
}

.status-bar__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.status-bar__readout {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.status-bar__logout {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    color: var(--muted);
    transition: color 0.15s ease;
}

.status-bar__logout:hover {
    color: var(--amber);
}

/* --- Hub layout ----------------------------------------------------------- */
.hub {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 40px 24px;
}

/* --- Card grid ------------------------------------------------------------ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Card ----------------------------------------------------------------- */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    padding: 20px 22px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.card__badge {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    padding: 3px 8px;
    border: 1px solid var(--divider);
    border-radius: 4px;
}

.card__name {
    font-size: 1.75rem;
    margin-top: 14px;
    color: var(--text);
}

.card__desc {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.9375rem;
}

.card__footer {
    margin-top: auto;
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card__status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--muted);
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.dot--live      { background: var(--live); }
.dot--migrating { background: var(--migrating); }

.card__arrow {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--amber);
    transition: transform 0.15s ease, color 0.15s ease;
}

.card__soon {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--migrating);
    border: 1px solid var(--migrating);
    border-radius: 4px;
    padding: 3px 8px;
}

/* --- Active card state ---------------------------------------------------- */
.card--active {
    cursor: pointer;
    opacity: 1;
}

.card--active:hover {
    background: var(--surface-hover);
    border-color: var(--amber-bright);
    border-left-color: var(--amber-bright);
}

.card--active:hover .card__arrow {
    transform: translateX(3px);
    color: var(--amber-bright);
}

/* --- Migrating card state ------------------------------------------------- */
.card--migrating {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

/* --- Auth (login) --------------------------------------------------------- */
.auth-wrap {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.auth-card {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--divider);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius);
    padding: 32px;
}

.auth-card h1 {
    font-size: 1.875rem;
    margin-bottom: 4px;
}

.auth-sub {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 26px;
}

.auth-form label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: var(--muted);
    margin-bottom: 6px;
}

.auth-form input {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 18px;
    background: var(--bg);
    border: 1px solid var(--divider);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.9375rem;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--amber);
}

.btn-amber {
    width: 100%;
    padding: 11px;
    background: var(--amber);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.btn-amber:hover {
    background: var(--amber-bright);
}

.auth-error {
    margin-bottom: 18px;
    padding: 10px 12px;
    border: 1px solid var(--divider);
    border-left: 3px solid var(--amber);
    border-radius: 6px;
    background: rgba(201, 135, 58, 0.08);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--text);
}

/* --- Footer --------------------------------------------------------------- */
.site-footer {
    flex-shrink: 0;
    text-align: center;
    padding: 24px 16px;
    border-top: 1px solid var(--divider);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
}
