/* ==========================================================================
   economy.css — the Economy page (pages/economy.html). Load AFTER site.css and registry.css.
   The page uses the registry shell (registry.css, body.reg-page, theme "economy"): this file
   only styles what is inside the panels. Tables from 761 px up, one card per row below that.
   Hover pop (cards, rows, jump links) uses the shell's --reg-pop-* knobs, so html.calm stills it.
   ========================================================================== */

.economy-page { line-height: 1.55; }

/* --- jump links: a row of glass pills under the title --- */
.eco-jump {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 34px;
}

.eco-jump a {
    display: inline-flex;
    align-items: center;
    min-height: 50px;
    padding: 0 22px;
    box-sizing: border-box;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--deep2) 80%, transparent);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-fantasy);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    transition: color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease,
                transform var(--reg-pop-ms) var(--reg-pop-ease);
}

/* --- sections (the panels themselves are .reg-panel in registry.css) --- */
.eco-section { scroll-margin-top: calc(var(--reg-bar-h) + 12px); }

.eco-section h3 {
    margin: 0 0 6px;
    color: var(--accent);
    font-family: var(--font-fantasy);
    font-size: 1.85rem;
    letter-spacing: 0.04em;
}

.eco-intro { margin: 0 0 22px; color: var(--ink-soft); font-size: 1.1rem; }

.eco-note { color: var(--ink-soft); font-size: 1rem; margin: 16px 0 0; }

.eco-dim { color: #6f6a82; }

.eco-ok { color: #6fdc8c; }
.eco-short { color: #ff6b6b; }

.eco-verdict {
    font-weight: bold;
    margin: 0 0 14px;
}

/* --- coin ladder: three minted coins --- */
.eco-coins {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.eco-coin {
    --metal: var(--accent);
    --metal-dark: var(--accent2);
    --metal-light: var(--glint);
    position: relative;
    padding: 20px 20px 20px 88px;
    min-height: 64px;
    border: 1px solid color-mix(in srgb, var(--metal) 28%, transparent);
    border-radius: 14px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--metal) 9%, transparent), rgba(255, 255, 255, 0.02));
    color: var(--ink);
    font-size: 1.1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform var(--reg-pop-ms) var(--reg-pop-ease);
}
/* the coin face: a disc with a raised rim and a light spot */
.eco-coin::before {
    content: '';
    position: absolute;
    left: 20px; top: 50%;
    width: 52px; height: 52px;
    margin-top: -26px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, var(--metal-light) 0 12%, var(--metal) 45%, var(--metal-dark) 100%);
    box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--metal-dark) 80%, transparent),
                inset 0 0 0 4px color-mix(in srgb, var(--metal-light) 50%, transparent),
                0 0 14px color-mix(in srgb, var(--metal) 40%, transparent);
}
.eco-coin:nth-child(1) { --metal: #d4834a; --metal-dark: #8a4a22; --metal-light: #ffd2b0; }   /* copper */
.eco-coin:nth-child(2) { --metal: #c9d2dc; --metal-dark: #78828f; --metal-light: #ffffff; }   /* silver */

.eco-coin-name {
    color: var(--metal-light);
    font-family: var(--font-fantasy);
    font-weight: bold;
    font-size: 1.4rem;
    margin-bottom: 3px;
}

/* --- tables --- */
.eco-table-wrap {
    width: 100%;
    overflow-x: auto;               /* safety net: a table that is still too wide scrolls inside itself, never the page */
    padding: 4px 8px;               /* room for a popped row, so it never makes the wrapper scroll */
    margin: -4px -8px;
}

.eco-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
    color: var(--ink);
}

.eco-table th {
    text-align: left;
    padding: 10px 12px;
    color: var(--accent);
    font-family: var(--font-fantasy);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    white-space: nowrap;
}

.eco-table td {
    padding: 14px 12px;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.eco-table tbody tr {
    transition: background-color 0.2s ease, transform var(--reg-pop-ms) var(--reg-pop-ease);
}

.eco-table strong { color: var(--glint); font-family: var(--font-fantasy); }

.eco-table .num { text-align: right; white-space: nowrap; }

.eco-table td:last-child:not(.num) { font-style: italic; color: var(--ink-soft); }

.eco-table code { color: var(--accent); font-family: 'Orbitron', monospace; font-size: 0.85em; }

/* hidden from the eye, read by screen readers */
.eco-sr {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- hover pop (mouse) and press pop (touch) --- */
@media (hover: hover) {
    .eco-jump a:hover {
        border-color: var(--accent);
        color: var(--accent);
        box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 35%, transparent);
        transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-s));
    }
    .eco-coin:hover {
        border-color: color-mix(in srgb, var(--metal) 70%, transparent);
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4), 0 0 18px color-mix(in srgb, var(--metal) 28%, transparent);
        transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-s));
    }
    .eco-table tbody tr:hover {
        background-color: color-mix(in srgb, var(--accent) 10%, transparent);
        transform: translateY(-2px) scale(var(--reg-pop-row));
    }
}
.eco-jump a:focus-visible { border-color: var(--accent); color: var(--accent); }

@media (hover: none) {
    .eco-jump a:active,
    .eco-coin:active { transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-s)); }
}
html.calm .eco-table tbody tr:hover { transform: none; }

/* --- narrow desktops and landscape phones: a little smaller and tighter, so the seven-column table fits --- */
@media (min-width: 761px) and (max-width: 1100px) {
    .eco-table { font-size: 0.96rem; }
    .eco-table th { font-size: 0.74rem; letter-spacing: 0.5px; }
    .eco-table th, .eco-table td { padding-left: 6px; padding-right: 6px; }
    .eco-coin { font-size: 1rem; }
}
@media (min-width: 761px) and (max-width: 860px) {
    .eco-table { font-size: 0.88rem; }
    .eco-table th { font-size: 0.7rem; letter-spacing: 0.3px; }
    .eco-table th, .eco-table td { padding-left: 4px; padding-right: 4px; }
}

/* --- phones: a card per row --- */
@media (max-width: 760px) {
    .eco-jump { gap: 8px; margin-bottom: 24px; }
    .eco-jump a { padding: 0 16px; font-size: 0.82rem; }
    .eco-section h3 { font-size: 1.5rem; }
    .eco-intro { font-size: 1rem; }
    .eco-note { font-size: 0.9rem; }
    .eco-coin { font-size: 1rem; }
    .eco-table { font-size: 1rem; }

    .eco-table, .eco-table tbody, .eco-table tr, .eco-table td { display: block; width: 100%; box-sizing: border-box; }

    .eco-table thead { position: absolute; left: -9999px; }

    .eco-table tr {
        margin-bottom: 12px;
        padding: 10px 12px;
        border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.03);
    }

    .eco-table td {
        display: flex;
        justify-content: space-between;
        gap: 14px;
        padding: 6px 0;
        border-bottom: none;
        text-align: right;
    }

    .eco-table td::before {
        content: attr(data-label);
        flex: none;
        color: var(--accent);
        font-family: var(--font-fantasy);
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        text-align: left;
        padding-top: 2px;
    }

    .eco-table .num { white-space: normal; }

    .eco-table td:first-child { font-size: 1.1rem; }

    /* cards grow by the same 3% as the coins when pressed */
    .eco-table tbody tr:active { transform: translateY(var(--reg-pop-y)) scale(var(--reg-pop-s)); }
}
