/* Reset */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* Colors and fonts. Change a value here and it updates everywhere. */
:root {
    --bg: #000;
    --text: #ffffff;
    --text-soft: #cfcfcf;
    --text-muted: #8f8f8f;
    --text-faint: #6b6b6b;
    --line: rgba(255, 255, 255, 0.14);
    --line-soft: rgba(255, 255, 255, 0.07);
    --accent: #a3f0a3;
    --page-accent: var(--accent);
    --radius-md: 10px;

    --font-mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    --font-sans: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-pixel: 'Silkscreen', 'DM Mono', monospace;

    --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
    --edge: 10vw;
}

/* Scrollbar: hidden at rest, fades in while scrolling. */
html {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
    transition: scrollbar-color 0.8s ease;
}
html::-webkit-scrollbar { width: 5px; height: 5px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 5px;
    transition: background 0.8s ease;
}
html.is-scrolling { scrollbar-color: rgba(255, 255, 255, 0.22) transparent; }
html.is-scrolling::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.22);
    transition: background 0.15s ease;
}
html.is-scrolling::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Page base */
html, body {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
}

a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
::selection { background: var(--accent); color: #000; }

/* Skip link */
.skip-link {
    position: fixed;
    top: -100px;
    left: 1rem;
    z-index: 300;
    padding: 0.7rem 1.2rem;
    background: var(--accent);
    color: #000;
    font-size: 0.78rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 4px;
    transition: top 0.2s;
}
.skip-link:focus { top: 1rem; outline: 2px solid #fff; outline-offset: 2px; }

/* Starfield canvas */
canvas#starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* Site wrapper */
.site {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
main { position: relative; z-index: 2; flex: 1; }

/* Reveal on scroll */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.revealed {
    animation: revealIn 0.7s var(--ease-out) forwards;
    animation-delay: var(--reveal-delay, 0s);
}
@keyframes revealIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Footer */
.site-footer {
    position: relative;
    z-index: 2;
    padding: 4rem var(--edge) 3rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.site-footer a {
    display: inline-block;
    color: var(--text-soft);
    text-decoration: none;
    padding-bottom: 1px;
    border-bottom: 1px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}
.site-footer a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}
.site-footer a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px;
}

/* Hero */
.landing {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    padding: 4rem var(--edge);
}
.landing-text {
    position: relative;
    z-index: 3;
    max-width: 40ch;
    font-family: var(--font-sans);
}
.main-name {
    font-size: clamp(2.6rem, 4.6vw, 3.6rem);
    font-weight: 300;
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}
.main-name .accent { color: #8ee89a; font-weight: 400; }
.welcome-sub {
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--text-soft);
    line-height: 1.6;
    max-width: 36ch;
}

/* Solar system */
.solar-system-container {
    position: absolute;
    right: var(--edge);
    top: 50%;
    transform: translateY(-50%);
    width: 460px;
    height: 520px;
    z-index: 2;
    pointer-events: none;
}
.solar-system {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
}

.central-star {
    position: absolute;
    left: 0; top: 0;
    width: 14px; height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    pointer-events: none;
}
.central-star::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 60px; height: 60px;
    margin-left: -30px; margin-top: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.55), rgba(255,255,255,0.14) 40%, transparent 70%);
}
.central-star::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #fff;
}

/* --r is the ring's radius. Change to resize an orbit. */
.orbit-ring {
    position: absolute;
    left: 0; top: 0;
    width: calc(var(--r) * 2);
    height: calc(var(--r) * 2);
    margin-left: calc(var(--r) * -1);
    margin-top: calc(var(--r) * -1);
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.09);
}
.orbit-ring[data-orbit="1"] { --r: 55px; }
.orbit-ring[data-orbit="2"] { --r: 105px; }
.orbit-ring[data-orbit="3"] { --r: 160px; }
.orbit-ring[data-orbit="4"] { --r: 210px; }

/* Rotating arm. Planet sits at its tip. */
.orbit {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    animation: orbitSpin var(--orbit-duration) linear infinite;
    animation-delay: var(--orbit-delay);
}
@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.planet {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    transform: translateX(var(--orbit-r));
}

.planet-glow {
    position: absolute;
    left: 0; top: 0;
    width: calc(var(--planet-size) * 3.2);
    height: calc(var(--planet-size) * 3.2);
    margin-left: calc(var(--planet-size) * -1.6);
    margin-top:  calc(var(--planet-size) * -1.6);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.16), rgba(255,255,255,0.05) 35%, transparent 68%);
    pointer-events: none;
}

.planet-body {
    position: absolute;
    left: 0; top: 0;
    width: var(--planet-size);
    height: var(--planet-size);
    margin-left: calc(var(--planet-size) * -0.5);
    margin-top:  calc(var(--planet-size) * -0.5);
    border-radius: 50%;
    background: var(--planet-color);
    box-shadow:
        inset -4px -4px 12px rgba(0,0,0,0.5),
        inset 2px 2px 8px rgba(255,255,255,0.15);
}
.planet-body::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.15), transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(0,0,0,0.2), transparent 40%);
}
.planet-body::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
}

.planet-rings {
    position: absolute;
    left: 0; top: 0;
    width: calc(var(--planet-size) * 1.45);
    height: calc(var(--planet-size) * 1.45);
    margin-left: calc(var(--planet-size) * 1.45 * -0.5);
    margin-top:  calc(var(--planet-size) * 1.45 * -0.5);
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.09);
    transform: rotateX(75deg);
}

/* Per-planet size, color, orbit distance and speed. */
.planet-writing     { --planet-size: 34px; --planet-color: #e8dcc8; --orbit-r: 55px;  --orbit-duration: 28s; --orbit-delay: 0s; }
.planet-exhibitions { --planet-size: 42px; --planet-color: #92b3d6; --orbit-r: 105px; --orbit-duration: 42s; --orbit-delay: -14s; }
.planet-games       { --planet-size: 42px; --planet-color: #7cbf92; --orbit-r: 160px; --orbit-duration: 62s; --orbit-delay: -26s; }
.planet-development { --planet-size: 48px; --planet-color: #a998dd; --orbit-r: 210px; --orbit-duration: 92s; --orbit-delay: -48s; }

/* About */
.about { position: relative; padding: 8rem 8vw; }
.about-inner { width: 100%; max-width: 1200px; margin: 0 auto; }
.about-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    align-items: flex-start;
}
.about-text { flex: 1 1 340px; min-width: 300px; }

.section-title {
    font-family: var(--font-sans);
    font-size: clamp(2.2rem, 3.4vw, 3rem);
    font-weight: 300;
    color: #fff;
    margin-bottom: 2rem;
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.section-title::after {
    content: '';
    display: block;
    width: 48px;
    height: 1px;
    background: rgba(255,255,255,0.5);
    margin-top: 1.1rem;
}
.about-bio {
    font-size: 0.92rem;
    line-height: 1.8;
    color: var(--text-soft);
    max-width: 62ch;
}
.about-bio p { margin-bottom: 1.2rem; }

/* Social icons */
.social-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 2.2rem;
    align-items: center;
    margin-left: -0.5rem;
}
.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    width: 42px;
    height: 42px;
    transition: color 0.4s ease;
}
.social-icon svg { display: block; fill: currentColor; transition: fill 0.4s ease; }
.social-icon.youtube svg   { width: 34px; height: 24px; }
.social-icon.instagram svg { width: 27px; height: 27px; }
.social-icon.github svg    { width: 28px; height: 28px; }
.social-icon:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    border-radius: 6px;
}
.social-icon.youtube:hover   { color: #ff2d2d; }
.social-icon.instagram:hover { color: #e1306c; }
.social-icon.github:hover    { color: #a998dd; }

/* Portrait placeholder */
.about-portrait {
    flex: 1 1 340px;
    min-width: 280px;
    max-width: 420px;
    aspect-ratio: 4 / 5;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-faint);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
    margin-left: auto;
}

/* Category scenes */
.scenes { position: relative; }

.category-scene {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3.5rem;
    padding: 8rem 8vw;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}
.category-scene:focus-visible { outline: none; }

.category-scene[data-cat="writing"]     { --cat-color: #e8dcc8; --cat-glow: rgba(232, 220, 200, 0.5); }
.category-scene[data-cat="exhibitions"] { --cat-color: #92b3d6; --cat-glow: rgba(146, 179, 214, 0.5); }
.category-scene[data-cat="games"]       { --cat-color: #7cbf92; --cat-glow: rgba(124, 191, 146, 0.5); }
.category-scene[data-cat="development"] { --cat-color: #a998dd; --cat-glow: rgba(169, 152, 221, 0.5); }

.scene-planet {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    will-change: transform, opacity;
    transition:
        opacity 1s var(--ease-out),
        transform 1.2s var(--ease-out);
}
.category-scene[data-side="left"] .scene-planet {
    transform: translate3d(-100vw, 0, 0);
}
.category-scene[data-side="right"] .scene-planet {
    transform: translate3d(100vw, 0, 0);
}
.category-scene.visible .scene-planet {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.planet-big {
    --big-size: 200px;
    width: var(--big-size);
    height: var(--big-size);
    border-radius: 50%;
    background: var(--big-color);
    position: relative;
    box-shadow:
        inset calc(var(--big-size) * -0.09) calc(var(--big-size) * -0.09) calc(var(--big-size) * 0.24) rgba(0,0,0,0.55),
        inset calc(var(--big-size) * 0.05) calc(var(--big-size) * 0.05) calc(var(--big-size) * 0.14) rgba(255,255,255,0.15);
}
.planet-big::before {
    content: '';
    position: absolute;
    left: 50%; top: 50%;
    width: 280%; height: 280%;
    margin-left: -140%; margin-top: -140%;
    border-radius: 50%;
    background: radial-gradient(circle, var(--big-glow), transparent 65%);
    pointer-events: none;
}
.planet-big::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 50%),
        radial-gradient(circle at 70% 65%, rgba(0,0,0,0.22), transparent 45%);
    border: 1px solid rgba(255,255,255,0.09);
}
.planet-big-ring {
    position: absolute;
    top: 50%; left: 50%;
    width: 165%; height: 165%;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.14);
    transform: translate(-50%, -50%) rotateX(72deg);
    pointer-events: none;
}

.planet-big--writing     { --big-color: #e8dcc8; --big-glow: rgba(232, 220, 200, 0.18); }
.planet-big--exhibitions { --big-color: #92b3d6; --big-glow: rgba(146, 179, 214, 0.22); }
.planet-big--games       { --big-color: #7cbf92; --big-glow: rgba(124, 191, 146, 0.22); }
.planet-big--development { --big-color: #a998dd; --big-glow: rgba(169, 152, 221, 0.24); }

.scene-name {
    font-family: var(--font-sans);
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-weight: 300;
    line-height: 1;
    letter-spacing: -0.035em;
    color: var(--cat-color);
    opacity: 0;
    transition:
        opacity 0.9s var(--ease-out) 1.1s,
        text-shadow 0.4s ease;
    will-change: opacity;
}
.category-scene.visible .scene-name { opacity: 1; }
.category-scene:hover .scene-name,
.category-scene:focus-visible .scene-name {
    text-shadow: 0 0 32px var(--cat-glow);
}

/* Mobile */
@media (max-width: 900px) {
    .landing { padding: 4rem 6vw; flex-direction: column; align-items: flex-start; }
    .solar-system-container {
        position: relative;
        right: auto; top: auto;
        transform: none;
        margin: 4rem auto 0;
        width: 340px; height: 400px;
        align-self: center;
    }

    .orbit-ring[data-orbit="1"] { --r: 38px; }
    .orbit-ring[data-orbit="2"] { --r: 72px; }
    .orbit-ring[data-orbit="3"] { --r: 110px; }
    .orbit-ring[data-orbit="4"] { --r: 145px; }

    .planet-writing     { --orbit-r: 38px;  }
    .planet-exhibitions { --orbit-r: 72px;  }
    .planet-games       { --orbit-r: 110px; }
    .planet-development { --orbit-r: 145px; }

    .main-name { font-size: 2.3rem; }
    .welcome-sub { font-size: 1.05rem; }

    .about { padding: 5rem 6vw; }
    .about-hero { gap: 3rem; }
    .about-portrait { width: 100%; margin-left: 0; max-width: 100%; }

    .category-scene { gap: 2.5rem; padding: 7rem 6vw; }
    .category-scene[data-side="left"] .scene-planet { transform: translate3d(-110vw, 0, 0); }
    .category-scene[data-side="right"] .scene-planet { transform: translate3d(110vw, 0, 0); }
    .category-scene.visible .scene-planet { transform: translate3d(0, 0, 0); }

    .planet-big { --big-size: 150px; }
    .scene-name { font-size: clamp(1.9rem, 8vw, 2.6rem); }

    .site-footer { padding: 3rem 6vw 2rem; font-size: 0.78rem; }
}

@media (max-width: 600px) {
    .social-row { gap: 0.3rem; margin-left: -0.4rem; }
    .social-icon { width: 38px; height: 38px; }
    .social-icon.youtube svg   { width: 30px; height: 21px; }
    .social-icon.instagram svg { width: 24px; height: 24px; }
    .social-icon.github svg    { width: 25px; height: 25px; }

    .site-footer { font-size: 0.72rem; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0s !important;
    }
    .orbit { animation-play-state: paused; }
    .scene-planet,
    .scene-name { opacity: 1 !important; transform: none !important; }
}