/* ========================================================================
   DECAY — 3er-Raster, klickbare Panels
   ======================================================================== */

:root {
    --ink: #0F1216;
    --paper: #FFFFFF;
    --line: rgba(255, 255, 255, 0.22);
    --font-body: 'Inter', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

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

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--ink);
    color: var(--paper);
    font-family: var(--font-body);
}

a {
    color: inherit;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--paper);
    color: var(--ink);
    padding: 10px 16px;
    z-index: 100;
}
.skip-link:focus {
    left: 0;
}

/* ------------------------------------------------------------------------
   LOGIN BUTTON
   ------------------------------------------------------------------------ */

.login-btn {
    position: fixed;
    /* safe-area: unter der Notch bzw. Statusleiste nicht anschneiden */
    top: max(18px, env(safe-area-inset-top, 0px));
    right: max(18px, env(safe-area-inset-right, 0px));
    z-index: 10;
    /* mind. 44px hoch — darunter trifft man mit dem Finger schlecht */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    text-decoration: none;
    color: var(--paper);
    background: rgba(15, 18, 22, 0.55);
    border: 1px solid var(--line);
    border-radius: 999px;
    backdrop-filter: blur(4px);
    transition: background 0.25s ease, border-color 0.25s ease;
}
.login-btn:hover,
.login-btn:focus-visible {
    background: rgba(15, 18, 22, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
}

/* ------------------------------------------------------------------------
   GRID
   ------------------------------------------------------------------------ */

main {
    position: relative;
    /* dvh statt vh: auf Handys wird die ein- und ausblendende Adressleiste
       sonst mitgerechnet und der Inhalt ragt unten heraus. */
    height: 100dvh;
}

.grid {
    list-style: none;
    display: flex;
    height: 100%;
}

.panel {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    z-index: 1;
    border-right: 1px solid var(--line);
    transform: scale(1);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.panel:last-child {
    border-right: none;
}

.panel-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

/* Die Aufteilung bleibt fix (immer 50/50) — das gehoverte Panel wächst
   stattdessen über seine eigene Box hinaus nach links UND rechts und
   legt sich über die Nachbarn. */
/* Nur bei echtem Mauszeiger vergroessern. Auf Touch-Geraeten bleibt ein
   :hover-Zustand nach dem Antippen haengen — das Panel bliebe dauerhaft
   vergroessert und wuerde das Nachbarpanel verdecken. */
@media (hover: hover) and (pointer: fine) {
    .panel:hover,
    .panel:focus-within {
        transform: scale(1.18);
        z-index: 5;
    }
    .panel:hover .panel-scrim,
    .panel:focus-within .panel-scrim {
        background: rgba(10, 12, 15, 0.2);
    }
    .panel:hover .panel-title,
    .panel:focus-within .panel-title {
        font-size: clamp(1.3rem, 2.2vw, 2rem);
    }
}

/* Tastaturbedienung muss auch auf Touch sichtbar bleiben */
.panel:focus-within {
    z-index: 5;
}

.panel-link {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    outline-offset: -3px;
}

.panel-link:focus-visible {
    outline: 2px solid var(--paper);
}

.panel-scrim {
    position: absolute;
    inset: 0;
    background: rgba(10, 12, 15, 0.38);
    transition: background 0.4s ease;
}


.panel-title {
    position: relative;
    font-weight: 700;
    font-size: clamp(1.05rem, 1.7vw, 1.6rem);
    letter-spacing: -0.01em;
    text-align: center;
    padding: 0 12px;
    transition: font-size 0.4s ease;
}


/* ------------------------------------------------------------------------
   MOBILE — Spalten werden zu Zeilen
   ------------------------------------------------------------------------ */

@media (max-width: 760px) {
    html, body {
        overflow-y: auto;
    }
    main {
        height: auto;
        min-height: 100vh;
    }
    .grid {
        flex-direction: column;
        height: auto;
    }
    .panel {
        /* Zwei Kacheln teilen sich die Hoehe. 130px waren so niedrig, dass
           unten viel Leerraum blieb und die Ziele klein wirkten. */
        min-height: max(160px, calc((100dvh - 2px) / 2));
        border-right: none;
        border-bottom: 1px solid var(--line);
    }
    .panel:last-child {
        border-bottom: none;
    }
}
