/* GADGET Design - one-page site.
   Layout: one centred column; projects are a ruled list, name left, detail right. */

/* Schibsted Grotesk (SIL Open Font License 1.1), served from this site so that
   no visitor IP address reaches a third-party font CDN. Variable weight 400-700. */
@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/schibsted-grotesk-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                   U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                   U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Schibsted Grotesk";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("../fonts/schibsted-grotesk-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
                   U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF,
                   U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --bg: #f6f6f4;
    --surface: #ffffff;
    --ink: #1c2024;
    --muted: #5d6670;
    --line: #dfe1e0;
    --accent: #3f618c;        /* dusty Nordic take on the C64 boot blue */
    --font: "Schibsted Grotesk", "Segoe UI", system-ui, sans-serif;
    --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #16181a;
        --surface: #1d2023;
        --ink: #e7e9ea;
        --muted: #9aa3ab;
        --line: #2c3135;
        --accent: #90a9cd;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
}

.wrap {
    max-width: 780px;
    margin: 0 auto;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Header */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 28px;
    justify-content: space-between;
    align-items: baseline;
    padding-block: 16px;
}

.logo {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--ink);
}

.site-header nav {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
}

.site-header nav a {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.93rem;
}

.site-header nav a:hover { color: var(--accent); text-decoration: none; }

.site-header nav a[aria-current="page"] { color: var(--ink); }

/* Hero */

.hero { padding-block: 72px 16px; }

.ready {
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin: 0 0 18px;
}

/* The C64's block cursor, drawn as a box rather than a block character. */
.cursor {
    display: inline-block;
    width: 0.62em;
    height: 1.05em;
    margin-left: 0.1em;
    vertical-align: -0.2em;
    background: currentColor;
    animation: blink 1.1s steps(1) infinite;
}

/* Keeps "8-bit" on one line. */
.nobr { white-space: nowrap; }

@keyframes blink { 50% { opacity: 0; } }

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

.hero h1 {
    font-size: clamp(1.9rem, 4.6vw, 2.7rem);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.015em;
    text-wrap: balance;
    margin: 0 0 22px;
    max-width: 20ch;
}

.lead {
    color: var(--muted);
    font-size: 1.08rem;
    max-width: 60ch;
    margin: 0;
}

/* Page intro (for fun) */

.intro { padding-block: 56px 0; }

.intro .page-title { margin-bottom: 14px; }

/* Sections */

section { padding-block: 44px 8px; }

h2 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted);
    margin: 0 0 4px;
}

.note {
    color: var(--muted);
    max-width: 62ch;
    margin: 20px 0 0;
}

/* Project list */

.projects {
    list-style: none;
    margin: 0;
    padding: 0;
}

.project {
    display: grid;
    grid-template-columns: minmax(0, 290px) minmax(0, 1fr);
    gap: 24px 32px;
    align-items: start;
    padding-block: 28px;
    border-top: 1px solid var(--line);
}

.project:last-child { border-bottom: 1px solid var(--line); }

/* Képernyőkép. A C64-es felvételek pixelesek, ezért nagyításnál nem mosódhatnak. */
.shot { display: block; }

.shot img {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
    border: 1px solid var(--line);
    border-radius: 3px;
    transition: border-color 0.15s ease;
}

.shot.pixel img { image-rendering: pixelated; }

a.shot:hover img { border-color: var(--accent); }

.shot.empty {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 3px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.project-text { min-width: 0; }

.project h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.project p { margin: 0; }

.project .tags { margin-bottom: 12px; }

.project .desc { color: var(--muted); }

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tags span {
    font-family: var(--mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 1px 6px;
}

.links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 20px;
    font-weight: 500;
    font-size: 0.95rem;
}

.project .links { margin-top: 14px; }

/* Play button (for fun) */

.links a.play {
    display: inline-block;
    padding: 5px 20px;
    border-radius: 3px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.links a.play:hover { text-decoration: none; filter: brightness(1.12); }

.soon {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

@media (max-width: 620px) {
    .project {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .hero { padding-block: 48px 12px; }
}

/* Text pages (privacy) */

.page-title {
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin: 0 0 6px;
}

.updated {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 0 0 8px;
}

.prose { padding-block: 8px 0; }

.prose h2 {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 36px 0 10px;
}

.prose p, .prose li { max-width: 68ch; }

.prose p { margin: 0 0 14px; }

.prose ul { margin: 0 0 14px; padding-left: 20px; }

.prose li { margin-bottom: 6px; }

.lede {
    font-size: 1.05rem;
    color: var(--muted);
    border-left: 2px solid var(--line);
    padding-left: 16px;
}

.table-wrap {
    overflow-x: auto;
    margin: 0 0 16px;
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 520px;
    font-size: 0.92rem;
}

th, td {
    text-align: left;
    vertical-align: top;
    padding: 10px 14px 10px 0;
    border-bottom: 1px solid var(--line);
}

th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    border-bottom-color: var(--ink);
}

td { color: var(--muted); }

td:first-child { color: var(--ink); }

/* Game player: a full-screen dialog, the game in an iframe */

.player {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #000;
    color: #e7e9ea;
}

.player[open] {
    display: flex;
    flex-direction: column;
}

.player::backdrop { background: #000; }

html:has(.player[open]) { overflow: hidden; }

.player-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 22px;
    padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
    background: #16181a;
    border-bottom: 1px solid #2c3135;
    font-size: 0.9rem;
}

.player-title {
    margin-right: auto;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.player-bar a { color: #90a9cd; }

.player-close {
    font: inherit;
    font-weight: 600;
    color: #e7e9ea;
    background: transparent;
    border: 1px solid #2c3135;
    border-radius: 3px;
    padding: 3px 14px;
    cursor: pointer;
}

.player-close:hover { border-color: #90a9cd; }

.player-close:focus-visible { outline: 2px solid #90a9cd; outline-offset: 2px; }

.player iframe {
    display: block;
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #000;
}

/* Footer */

footer {
    border-top: 1px solid var(--line);
    margin-top: 56px;
    padding-block: 28px;
    color: var(--muted);
    font-size: 0.9rem;
}
