/* ============================================================
   everbest — private tools hub
   Dunkler/Nightmode-Look. Akzent: warmes Amber (subtile Brücke
   zu Trailhands, aber klar eigene Identität).
   ============================================================ */

:root {
    /* base */
    --bg-0:       #0a0e13;   /* page background base */
    --bg-1:       #11161d;   /* slight elevation */
    --surface:    #161c25;   /* card */
    --surface-2:  #1c2430;   /* hover / accent surface */
    --surface-3:  #232c3a;   /* inner hover */

    /* lines */
    --line:       rgba(255, 255, 255, 0.06);
    --line-2:     rgba(255, 255, 255, 0.12);
    --line-3:     rgba(255, 255, 255, 0.18);

    /* text */
    --text:       #e8edf3;
    --text-dim:   #8a96a6;
    --text-dim-2: #5b6776;

    /* accent — warm amber */
    --accent:     #f2c03d;
    --accent-2:   #f6cf65;
    --accent-soft:rgba(242, 192, 61, 0.14);
    --accent-glow:rgba(242, 192, 61, 0.32);

    /* danger */
    --danger:     #ef6a5e;
    --danger-soft:rgba(239, 106, 94, 0.12);

    /* shadow */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.40), 0 1px 2px rgba(0, 0, 0, 0.30);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.50), 0 2px 6px rgba(0, 0, 0, 0.30);
    --shadow-accent: 0 0 0 1px var(--accent-glow), 0 8px 24px rgba(242, 192, 61, 0.18);

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg-0);
    background-image:
        radial-gradient(1200px 600px at 12% -10%, rgba(242, 192, 61, 0.06), transparent 60%),
        radial-gradient(1000px 700px at 110% 110%, rgba(91, 103, 118, 0.10), transparent 55%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ============================================================
   LOGIN GATE
   ============================================================ */
.gate {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding: 32px;
    background:
        radial-gradient(900px 500px at 50% 30%, rgba(242, 192, 61, 0.06), transparent 70%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
    transition: opacity 0.32s ease;
}
.gate--hidden {
    opacity: 0;
    pointer-events: none;
}

.gate-card {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 36px 28px 28px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.gate-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    margin: 0 auto 18px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(242, 192, 61, 0.22);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gate-mark:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-accent);
}

.gate-title {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text);
}
.gate-sub {
    margin: 4px 0 22px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.gate-field {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-0);
    border: 1px solid var(--line-2);
    border-radius: 12px;
    padding: 4px 4px 4px 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.gate-field:focus-within {
    border-color: rgba(242, 192, 61, 0.45);
    box-shadow: 0 0 0 4px rgba(242, 192, 61, 0.10);
}

.gate-field input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    padding: 12px 0;
    letter-spacing: 0.04em;
}
.gate-field input::placeholder { color: var(--text-dim-2); }

.gate-field button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #1a1305;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.gate-field button:hover { background: var(--accent-2); }
.gate-field button:active { transform: scale(0.97); }

.gate-err {
    margin: 12px 0 0;
    min-height: 18px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--danger);
    opacity: 0;
    transition: opacity 0.18s ease;
}
.gate-err.on { opacity: 1; }

.gate-foot {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--text-dim-2);
}

/* shake on wrong password */
@keyframes pwShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-3px); }
    80%      { transform: translateX(2px); }
}
.shake { animation: pwShake 0.45s ease; }

/* ============================================================
   HUB
   ============================================================ */
.hub {
    max-width: 1180px;
    margin: 0 auto;
    padding: 56px 28px 32px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.hub--shown {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Header ---------- */
.hub-header {
    text-align: center;
    margin-bottom: 44px;
    position: relative;
}
.hub-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    margin-bottom: 14px;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(242, 192, 61, 0.22);
}
.hub-title {
    margin: 0;
    font-size: clamp(34px, 5vw, 52px);
    font-weight: 900;
    letter-spacing: 0.06em;
    color: var(--text);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
}
.hub-tag {
    margin: 10px 0 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: var(--text-dim);
}
.hub-tag::before, .hub-tag::after {
    content: "";
    display: inline-block;
    width: 28px;
    height: 1px;
    background: var(--line-3);
    vertical-align: middle;
    margin: 0 14px;
}

/* ---------- Tile grid ---------- */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 8px 0 40px;
}
@media (min-width: 900px) {
    .tiles { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- Tile ---------- */
.tile {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease,
                border-color 0.18s ease, background 0.18s ease;
    min-width: 0;
    min-height: 0;
}
a.tile { cursor: pointer; }

a.tile:hover {
    transform: translateY(-3px);
    background: var(--surface-2);
    border-color: var(--line-2);
    box-shadow: var(--shadow-md);
}
a.tile:hover .tile-art { color: var(--accent); }
a.tile:hover .tile-name { color: var(--accent-2); }

a.tile:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* placeholder tile — visually distinct, not clickable */
.tile--soon {
    border: 1px dashed var(--line-3);
    background: transparent;
    box-shadow: none;
    opacity: 0.55;
}
.tile--soon .tile-art { background: transparent; }
.tile--soon .tile-meta { background: transparent; }

/* ---------- Tile art ---------- */
.tile-art {
    aspect-ratio: 4 / 3;
    background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: color 0.18s ease, background 0.18s ease;
    border-bottom: 1px solid var(--line);
}
.tile-art svg {
    width: 70%;
    height: 70%;
    max-width: 100%;
    max-height: 100%;
    transition: transform 0.25s ease;
}
a.tile:hover .tile-art svg { transform: scale(1.05); }

/* ---------- Tile meta ---------- */
.tile-meta {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.15) 100%);
}
.tile-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text);
    transition: color 0.18s ease;
}
.tile-desc {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-dim);
}

/* ---------- Footer ---------- */
.hub-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-dim-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}
.hub-foot-text {
    padding: 4px 0;
}
.logout-btn {
    background: transparent;
    border: 1px solid var(--line-2);
    color: var(--text-dim);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.logout-btn:hover {
    color: var(--text);
    border-color: var(--line-3);
    background: var(--surface);
}

/* ---------- Smaller screens ---------- */
@media (max-width: 600px) {
    .hub { padding: 36px 18px 24px; }
    .hub-title { letter-spacing: 0.04em; }
    .tiles { gap: 14px; }
    .tile { border-radius: 14px; }
    .tile-art { aspect-ratio: 16 / 10; }
    .hub-tag::before, .hub-tag::after { width: 18px; margin: 0 8px; }
    .gate-card { padding: 28px 22px 22px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition: none !important;
        animation: none !important;
    }
    a.tile:hover { transform: none; }
}
