/* Sayfa iskeleti: üst çubuk, menü, dil seçimi, içindekiler, arka plan sahneleri ve proje girişleri. */

.scene-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.scene-wash,
.ambient-stage,
.ambient-game {
    position: absolute;
    inset: 0;
}

/* Sayfa değişince arka plan anında değişir: açık sayfadan koyu sayfaya geçişte yumuşak renk geçişi beyaza yakın
   bir ara ton gösteriyordu. */
.scene-wash {
    background: radial-gradient(ellipse at 72% 22%, var(--world-glow), transparent 70%), var(--world);
}

body[data-theme="aplomb"] .scene-wash {
    background: url("../assets/aplomb-paper.webp") center / 720px, var(--world);
}

.ambient-game {
    display: none;
    opacity: .58;
}

body[data-theme="aplomb"] [data-scene="aplomb"],
body[data-theme="mozaik-blast"] [data-scene="mozaik-blast"],
body[data-theme="crumble-crew"] [data-scene="crumble-crew"] {
    display: block;
}

.ambient-game[data-scene="aplomb"] .balance-sculpture {
    width: 380px;
    height: 420px;
    left: -140px;
    top: 53%;
    opacity: .32;
    transform: rotate(-12deg);
}

.ambient-game[data-scene="mozaik-blast"] .mosaic-board {
    width: 285px;
    left: -165px;
    top: 48%;
    opacity: .56;
}

.ambient-game .loose-tile-a {
    left: 92%;
    top: 14%;
    width: 105px;
}

.ambient-game .loose-tile-b {
    left: 92%;
    top: 76%;
    width: 76px;
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    height: var(--header-height);
    z-index: 20;
    border-bottom: 1px solid var(--header-line);
    background: var(--header-bg);
    color: var(--header-ink);
    backdrop-filter: blur(18px);
}

.header-inner {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 42px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 36px;
}

body[data-theme="crumble-crew"] .site-header,
body[data-theme="crumble-crew"] .contents {
    backdrop-filter: none;
}

.main-nav {
    display: flex;
    height: 100%;
    align-items: center;
    gap: 32px;
    margin-left: auto;
}

.main-nav a {
    text-decoration: none;
    padding: 12px 0;
    position: relative;
    font-size: 14px;
    color: var(--header-muted);
    white-space: nowrap;
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 5px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transition: transform .2s;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--header-ink);
}

.main-nav a.is-active::after {
    transform: scaleX(1);
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.lang-switch a {
    --flag-field: none;
    --flag-mark: currentColor;
    display: grid;
    place-items: center;
    padding: 12px 0;
    color: var(--header-muted);
    text-decoration: none;
    transition: color .2s;
}

.lang-switch a:hover,
.lang-switch a:focus-visible,
.lang-switch a[aria-current="true"] {
    color: var(--header-ink);
}

.lang-switch a[aria-current="true"] {
    --flag-field: currentColor;
    --flag-mark: var(--header-bg);
}

.flag {
    display: block;
    width: 24px;
    height: 16px;
}

.flag-field {
    fill: var(--flag-field);
}

.flag-mark {
    fill: var(--flag-mark);
}

.flag-lines {
    stroke: var(--flag-mark);
}

.layout {
    position: relative;
    z-index: 1;
    max-width: 1380px;
    margin: 0 auto;
    padding: calc(var(--header-height) + 50px) 42px 0;
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 48px;
    overflow-x: clip;
}

.contents {
    position: sticky;
    top: calc(var(--header-height) + 35px);
    align-self: start;
    max-height: calc(100dvh - var(--header-height) - 58px);
    overflow-y: auto;
    color: var(--hero-ink);
    padding: 4px 0 22px;
    scrollbar-width: thin;
}

.contents-page {
    font-size: 17px;
    font-weight: 500;
    margin: 0 0 16px;
}

.contents-nav {
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ffffff35;
}

body[data-theme="ben-kimim"] .contents-nav,
body[data-theme="aplomb"] .contents-nav {
    border-color: #a1967d50;
}

.contents-nav a {
    padding: 8px 0 8px 14px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    text-decoration: none;
    color: var(--hero-soft);
    font-size: 13px;
    line-height: 1.4;
}

.contents-nav a:hover,
.contents-nav a.is-active {
    color: var(--hero-ink);
}

.contents-nav a.is-active {
    border-left-color: currentColor;
}

.content {
    min-width: 0;
}

.page {
    min-width: 0;
}

.page:not(#ben-kimim) {
    padding-bottom: clamp(32px, 4vw, 56px);
}

.page:not([hidden])+.page:not([hidden]) {
    margin-top: 80px;
}

.introduction {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    padding: 10px 0 40px;
    color: var(--hero-ink);
    isolation: isolate;
}

.hero-copy {
    position: relative;
    z-index: 2;
    width: 56%;
}

.hero-copy h1 {
    max-width: none;
    margin: 0;
}

.store-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 392px;
    margin-top: 30px;
}

.store-button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 160px;
    max-width: 190px;
    min-height: 66px;
    gap: 13px;
    padding: 12px 16px;
    border: 1px solid #ffffff24;
    border-radius: 12px;
    background: linear-gradient(145deg, #2e3135, #17191c);
    color: #fff;
    box-shadow: 0 6px 18px #00000014, inset 0 1px 0 #ffffff12;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.store-button:any-link:hover {
    transform: translateY(-3px);
    border-color: #ffffff66;
    box-shadow: 0 9px 24px #00000026, inset 0 1px 0 #ffffff12;
}

.store-button[aria-disabled="true"] {
    cursor: default;
}

.store-icon {
    flex: 0 0 27px;
    width: 27px;
    height: 31px;
}

.store-button[data-store="app-store"] .store-icon {
    flex-basis: 32px;
    width: 32px;
    height: 36px;
}

.store-label {
    display: grid;
    gap: 5px;
    text-align: left;
}

.store-status {
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: .1px;
    color: #ffffffb3;
}

.store-name {
    font-size: 19px;
    font-weight: 500;
    letter-spacing: -.4px;
    line-height: 1;
}

/* "Tarayıcıda oyna": mağaza düğmelerinin altında bütün satırı kaplar; boyu ve görünüşü onlarla aynı. */
.store-button.play-button {
    flex-basis: 100%;
    max-width: none;
}

.play-icon {
    flex: 0 0 30px;
    width: 30px;
    height: 23px;
}

.hero-art {
    position: absolute;
    z-index: 1;
    right: -5px;
    top: 0;
    width: 42%;
    height: 100%;
    pointer-events: none;
    perspective: 950px;
}

.drifter {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    animation: float-object 9s ease-in-out infinite;
    animation-delay: var(--delay);
    perspective: 1000px;
}

.cube-live {
    perspective: none;
}

.cube-canvas {
    position: absolute;
    left: -55%;
    top: -55%;
    width: 210%;
    height: 210%;
}

.cube-ambient {
    perspective: none;
    will-change: translate;
}

.cube-sprite {
    position: absolute;
    left: -35%;
    top: -35%;
    width: 170%;
    height: 170%;
    overflow: visible;
}

.hero-art.is-offscreen .cube-drifter,
body.is-visibility-paused .cube-drifter {
    animation-play-state: paused;
}

.balance-sculpture {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: visible;
    top: -5%;
}

.hanging-thread {
    stroke: #967c54;
    stroke-width: 1.4;
}

.balance-arm {
    transform-box: view-box;
    animation: balance-sway 9s ease-in-out infinite alternate;
}

.arm-main {
    transform-origin: 200px 118px;
}

.arm-small {
    transform-origin: 315px 193px;
    animation-duration: 7s;
    animation-delay: -3s;
}

.mosaic-board {
    position: absolute;
    left: 0;
    top: 16%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    transform: rotate(-11deg);
    animation: ceramic-float 11s ease-in-out infinite;
    filter: drop-shadow(10px 24px 12px #063c3a44);
}

.mosaic-board img {
    width: 100%;
    height: auto;
}

.loose-tile {
    position: absolute;
    width: 24%;
    animation: float-object 8s ease-in-out infinite;
    filter: drop-shadow(0 10px 10px #073c3a22);
}

.loose-tile-a {
    left: 66%;
    top: 0;
    transform: rotate(17deg);
    animation-delay: -3s;
}

.loose-tile-b {
    left: -16%;
    top: 75%;
    transform: rotate(-23deg);
}

@keyframes float-object {

    0%,
    100% {
        translate: 0 0;
    }

    50% {
        translate: -8px -24px;
    }
}

@keyframes balance-sway {
    from {
        rotate: -6deg;
    }

    to {
        rotate: 6deg;
    }
}

@keyframes ceramic-float {

    0%,
    100% {
        transform: translateY(0) rotate(-11deg);
    }

    50% {
        transform: translateY(-18px) rotate(-6deg);
    }
}

@media (max-width: 1100px) {
    .header-inner {
        padding: 0 30px;
    }

    .main-nav {
        gap: 23px;
    }

    .layout {
        padding-left: 30px;
        padding-right: 30px;
        grid-template-columns: 165px minmax(0, 1fr);
        gap: 34px;
    }

    .hero-art .cube-drifter {
        scale: .76;
    }

    .hero-copy {
        width: 58%;
    }
}

@media (max-width: 760px) {
    :root {
        --mobile-contents-height: 43px;
    }

    .header-inner {
        padding: 0 16px;
        gap: 16px;
    }

    .main-nav {
        flex: 1;
        min-width: 0;
        justify-content: space-between;
        gap: 10px;
    }

    .main-nav a {
        font-size: 12px;
    }

    .lang-switch {
        gap: 8px;
    }

    .flag {
        width: 20px;
        height: 14px;
    }

    .main-nav a::after {
        bottom: 5px;
    }

    .layout {
        display: block;
        padding: calc(var(--header-height) + var(--mobile-contents-height)) 22px 0;
    }

    .contents {
        position: fixed;
        top: var(--header-height);
        right: 0;
        left: 0;
        z-index: 12;
        width: 100%;
        height: var(--mobile-contents-height);
        max-height: none;
        margin: 0;
        padding: 0 22px;
        background: var(--header-bg);
        overflow: hidden;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: 1px solid var(--header-line);
    }

    .contents-page {
        display: none;
    }

    .contents-nav {
        height: 100%;
        flex-direction: row;
        align-items: stretch;
        gap: 20px;
        border-left: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .contents-nav::-webkit-scrollbar {
        display: none;
    }

    .contents-nav a {
        display: flex;
        align-items: center;
        flex-shrink: 0;
        margin: 0;
        padding: 12px 0;
        border-left: 0;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
        font-size: 12px;
    }

    .contents-nav a.is-active {
        border-bottom-color: currentColor;
    }

    .introduction {
        min-height: 400px;
        padding: 300px 0 35px;
        align-items: flex-end;
    }

    .hero-copy {
        width: 100%;
    }

    .store-links {
        margin-top: 25px;
    }

    .store-button {
        min-height: 62px;
        padding: 12px;
        gap: 10px;
    }

    .store-name {
        font-size: 18px;
    }

    .hero-art {
        top: 16px;
        height: 260px;
        width: 265px;
        right: calc(50% - 132px);
    }

    .hero-art .cube-drifter {
        scale: .64;
    }

    .hero-art .cube-drifter:nth-child(3) {
        top: 45%;
    }

    .hero-art .cube-drifter:nth-child(4) {
        display: none;
    }

    .hero-art .mosaic-board {
        width: 240px;
        left: 10px;
        top: 2%;
    }

    .hero-art .loose-tile {
        width: 53px;
    }

    .hero-art .loose-tile-b {
        top: 68%;
    }

    .hero-art .balance-sculpture {
        height: 300px;
        top: -40px;
    }

    .ambient-game {
        opacity: .2;
    }
}

@media (max-width: 360px) {
    .header-inner {
        padding-left: 12px;
        padding-right: 12px;
        gap: 10px;
    }

    .main-nav {
        gap: 8px;
    }

    .main-nav a {
        font-size: 11px;
    }

    .lang-switch a[aria-current] {
        display: none;
    }

    .layout {
        padding-left: 16px;
        padding-right: 16px;
    }

    .contents {
        padding-left: 16px;
        padding-right: 16px;
    }
}
