:root {
    --bg: #0e0e11;
    --text: #ece8e0;
    --muted: #8f8a80;
    --accent: #ffffff;
    --line: rgba(255, 255, 255, 0.14);
    --panel: rgba(14, 14, 17, 0.82);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Lora", Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2 {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 600;
    margin: 0;
}

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

/* Ikonok: letöltött SVG-k (icons/ mappa), a szöveg színét öröklik */
.icon {
    width: 1.05em;
    height: 1.05em;
    flex-shrink: 0;
    background-color: currentColor;
    -webkit-mask: var(--src) center / contain no-repeat;
    mask: var(--src) center / contain no-repeat;
}

.i-pickaxe { --src: url("icons/pickaxe.svg"); }
.i-modrinth { --src: url("icons/modrinth.svg"); }
.i-youtube { --src: url("icons/youtube.svg"); }
.i-github { --src: url("icons/github.svg"); }
.i-globe { --src: url("icons/globe.svg"); }
.i-terminal { --src: url("icons/terminal.svg"); }
.i-mail { --src: url("icons/mail.svg"); }
.i-discord { --src: url("icons/discord.svg"); }
.i-reload { --src: url("icons/rotate-cw.svg"); }
.i-arrow-left { --src: url("icons/arrow-left.svg"); }

/* Tipp a cím mellett: csak ott látszik, ahol az infódobozok is működnek */
.hint {
    display: none;
}

header,
main,
footer {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Pixeles háttér: a script.js rajzolja, fentről és lentről is jön, középen elhalványul */
#pixels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* ---------- Fejléc ---------- */
header {
    padding-top: 72px;
    padding-bottom: 36px;
}

header h1 {
    font-size: clamp(2.3rem, 7vw, 3.4rem);
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 26px;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--line);
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

nav a:hover,
nav a:focus-visible,
a.tile:hover,
a.tile:focus-visible {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.1);
}

/* ---------- Főtartalom ---------- */
main {
    padding-top: 28px;
    padding-bottom: 72px;
}

section + section {
    margin-top: 56px;
}

h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.7rem;
    margin-bottom: 16px;
}

/* kis négyzet a cím előtt, mint egy pixel */
h2::before {
    content: "";
    width: 12px;
    height: 12px;
    background: var(--accent);
    opacity: 0.85;
}

p {
    margin: 0;
}

section > p:not(.note) {
    max-width: 36em;
    font-size: 1.12rem;
}

/* Munkák */
.works {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    align-items: start;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.tile .icon {
    width: 1.6rem;
    height: 1.6rem;
}

.tile strong {
    display: block;
    overflow-wrap: anywhere;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.3;
}

.tile small {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.tile-soon {
    border-style: dashed;
    color: var(--muted);
    cursor: default;
}

.tag {
    margin-top: 2px;
    font-size: 0.7rem !important;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.note {
    margin-top: 18px;
    color: var(--muted);
    font-style: italic;
    font-size: 0.95rem;
}

/* ---------- Lábléc ---------- */
footer {
    margin-top: auto;
    padding-top: 20px;
    padding-bottom: 36px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---------- Telefon ---------- */
@media (max-width: 719px) {
    header,
    main,
    footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    header {
        padding-top: 48px;
    }

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

/* ---------- Infódobozok (csak egérrel, széles ablakban) ---------- */
.aside {
    display: none;
}

@media (hover: hover) and (min-width: 1180px) {
    :root {
        --reach: 768px;   /* a tartalom bal szélétől az infódobozig */
    }

    /* A tartalom + az infóoszlop együtt középen áll, így a tartalom kissé balra tolódik */
    header,
    main,
    footer {
        margin-left: max(0px, calc((100% - 1032px) / 2));
        margin-right: auto;
    }

    .unit {
        position: relative;
    }

    .unit-fit {
        width: fit-content;
    }

    .hint {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        position: absolute;
        left: calc(100% + 20px);
        top: 30px;
        transform: translateY(-50%);
        white-space: nowrap;
        font-size: 0.9rem;
        font-style: italic;
        color: var(--muted);
        opacity: 0.85;
        pointer-events: none;
        transition: opacity 0.18s ease;
    }

    .hint .icon {
        animation: nudge 2.4s ease-in-out infinite;
    }

    .unit:hover > .hint,
    .unit:focus-within > .hint {
        opacity: 0;
    }

    @keyframes nudge {
        0%, 100% { transform: translateX(0); }
        50%      { transform: translateX(-5px); }
    }

    @media (prefers-reduced-motion: reduce) {
        .hint .icon { animation: none; }
    }

    .aside {
        display: block;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.18s ease, visibility 0s linear 0.18s;
    }

    .unit:hover > .aside,
    .unit:focus-within > .aside {
        opacity: 1;
        visibility: visible;
        transition-delay: 0s;
    }

    /* vonal az egységtől az infódobozig (a magasabb átlátszó sáv segít átérni az egérrel) */
    .aside-line {
        position: absolute;
        left: 100%;
        top: calc(var(--y) - 12px);
        width: calc(var(--reach) - 100%);
        height: 24px;
    }

    .aside-line::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 11px;
        height: 1px;
        background: rgba(255, 255, 255, 0.4);
    }

    .aside-line::after {
        content: "";
        position: absolute;
        left: 0;
        top: 9px;
        width: 5px;
        height: 5px;
        background: var(--accent);
    }

    .aside-box {
        position: absolute;
        left: var(--reach);
        top: calc(var(--y) - 20px);
        width: 240px;
        padding: 10px 14px;
        background: var(--panel);
        border: 1px solid rgba(255, 255, 255, 0.3);
        font-size: 0.88rem;
        line-height: 1.5;
        color: var(--text);
    }

    .aside-box-fit {
        width: fit-content;
    }

    .aside-center .aside-box {
        top: var(--y);
        transform: translateY(-50%);
    }

    .aside-box p + p {
        margin-top: 8px;
        color: var(--muted);
    }

    .aside-btn {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        padding: 7px 14px;
        font: inherit;
        font-size: 0.92rem;
        color: var(--text);
        background: transparent;
        border: 1px solid var(--line);
        cursor: pointer;
        transition: border-color 0.15s, background 0.15s;
    }

    .aside-btn:hover,
    .aside-btn:focus-visible {
        border-color: rgba(255, 255, 255, 0.45);
        background: rgba(255, 255, 255, 0.06);
    }
}

@media (min-width: 720px) {
    .contact .works {
        grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
        max-width: 660px;
    }
}
