/* Font references retained locally: IBM Plex Mono (weights 300 400), Noto Sans JP (Google Fonts named in DESIGN.md). Interaction Interactions:** */

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    background: #0d0d10;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    background: #0d0d10;
    color: #c0c0c8;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

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

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 280px;
    height: 100vh;
    padding: 48px 32px;
    overflow: hidden;
    background: #1a1a1e;
}

.sidebar::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, rgba(232, 232, 240, 0.2), transparent);
}

.wordmark {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    color: #e8e8f0;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: clamp(1.15rem, 1.6vw, 1.45rem);
    font-weight: 300;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.sidebar-nav {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.nav-label {
    position: absolute;
    left: 32px;
    display: inline-block;
    width: max-content;
    color: #6b6b74;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.15em;
    line-height: 1.5;
    pointer-events: auto;
    text-transform: uppercase;
    transition: color 300ms ease;
}

.nav-label:nth-child(1) { top: 40%; }
.nav-label:nth-child(2) { top: 55%; }
.nav-label:nth-child(3) { top: 70%; }

.nav-label::after {
    content: "";
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    width: 0;
    height: 1px;
    background: #e8e8f0;
    transition: width 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nav-label:hover {
    color: #e8e8f0;
}

.nav-label:hover::after {
    width: 40px;
}

.nav-label.active {
    color: #a0937a;
}

.nav-label.active::after {
    width: 24px;
}

.art-well {
    position: relative;
    z-index: 1;
    width: 64px;
    height: 64px;
}

.art-well::after {
    content: "";
    position: absolute;
    inset: -12px;
    border: 1px dashed rgba(107, 107, 116, 0.4);
}

#genCanvas {
    display: block;
    width: 64px;
    height: 64px;
}

.topbar,
.mobile-menu {
    display: none;
}

.ma-canvas {
    margin-left: 280px;
    background: #0d0d10;
    scroll-snap-type: y mandatory;
    scroll-padding-top: 0;
}

.section {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    overflow: hidden;
    scroll-snap-align: start;
}

.tokonoma {
    background: linear-gradient(to bottom, #0d0d10 0%, #141419 100%);
}

.ghost-kanji {
    position: absolute;
    color: #c0c0c8;
    font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
    font-size: 20vw;
    font-weight: 300;
    line-height: 1;
    opacity: 0.03;
    pointer-events: none;
    transform: translateY(-3vh);
    user-select: none;
}

.tokonoma-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-wordmark {
    color: #e8e8f0;
    font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 300;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.hero-tagline {
    margin-top: 22px;
    color: #6b6b74;
    font-size: 14px;
    letter-spacing: 0.1em;
}

.craft {
    background:
        radial-gradient(circle at 78% 22%, rgba(160, 147, 122, 0.045), transparent 30%),
        #0d0d10;
}

.craft-items {
    width: min(620px, calc(100vw - 380px));
}

.craft-item {
    display: flex;
    align-items: center;
    gap: 18px;
    width: max-content;
    max-width: 100%;
    color: #c0c0c8;
    white-space: nowrap;
}

.craft-item + .craft-item {
    margin-top: 58px;
}

.craft-item-two {
    margin-left: 80px;
}

.craft-item-three {
    margin-left: 160px;
}

.craft-motif {
    flex: 0 0 32px;
    animation: motif-pulse 4s ease-in-out infinite;
}

.craft-motif circle {
    stroke: #c0c0c8;
    stroke-width: 0.5;
    vector-effect: non-scaling-stroke;
}

.craft-motif circle:nth-child(2) {
    opacity: 0.75;
}

.craft-motif circle:nth-child(3) {
    opacity: 0.45;
}

@keyframes motif-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.chrome-divider {
    position: absolute;
    left: 12vw;
    right: 12vw;
    height: 1px;
    opacity: 0.4;
    background-image: repeating-linear-gradient(to right, #6b6b74 0 4px, transparent 4px 16px);
}

.chrome-divider.top {
    top: 18vh;
}

.chrome-divider.bottom {
    bottom: 18vh;
}

.signal {
    background: #0d0d10;
}

.signal::before {
    content: "";
    position: absolute;
    top: 0;
    left: 18vw;
    right: 18vw;
    height: 1px;
    opacity: 0.4;
    background-image: repeating-linear-gradient(to right, #6b6b74 0 4px, transparent 4px 16px);
}

.signal-content {
    text-align: center;
}

.signal-label {
    margin-bottom: 24px;
    color: #6b6b74;
    font-size: 11px;
    letter-spacing: 0.15em;
    line-height: 1.5;
    text-transform: uppercase;
}

.signal-input {
    display: block;
    width: 320px;
    max-width: 80vw;
    padding: 12px 16px;
    border: 1px solid #e8e8f0;
    outline: 0;
    background: transparent;
    color: #c0c0c8;
    font: inherit;
    letter-spacing: 0.02em;
    text-align: center;
    transition: border-color 300ms ease, color 300ms ease;
}

.signal-input::placeholder {
    color: #6b6b74;
}

.signal-input.shake {
    animation: shake 500ms ease;
    border-color: #c45c3e;
}

.signal-input.success {
    border-color: #d4a574;
    color: #d4a574;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-4px); }
    30%, 70% { transform: translateX(4px); }
}

.signal-confirm {
    margin-top: 16px;
    color: #d4a574;
    font-size: 12px;
    font-weight: 300;
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 600ms ease;
}

.signal-confirm.visible {
    opacity: 1;
}

.cursor-trail {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 999;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #d4a574;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(-20px, -20px, 0);
    transition: opacity 600ms ease;
}

@media (max-width: 768px) {
    html {
        scroll-padding-top: 56px;
    }

    .sidebar {
        display: none;
    }

    .topbar {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 56px;
        padding: 0 24px;
        background: #1a1a1e;
    }

    .topbar-wordmark {
        color: #e8e8f0;
        font-size: 14px;
        font-weight: 300;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 32px;
        padding: 8px;
        border: 0;
        background: transparent;
    }

    .hamburger span {
        display: block;
        width: 16px;
        height: 1px;
        background: #c0c0c8;
        transition: opacity 300ms ease, transform 300ms ease;
    }

    .hamburger.open span:nth-child(1) {
        transform: translateY(5px) rotate(45deg);
    }

    .hamburger.open span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.open span:nth-child(3) {
        transform: translateY(-5px) rotate(-45deg);
    }

    .mobile-menu {
        position: fixed;
        left: 0;
        right: 0;
        top: 56px;
        z-index: 99;
        display: flex;
        flex-direction: column;
        gap: 18px;
        padding: 22px 24px 26px;
        background: #1a1a1e;
        transform: translateY(-110%);
        transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1);
    }

    .mobile-menu.open {
        transform: translateY(0);
    }

    .mobile-nav-label {
        color: #6b6b74;
        font-size: 12px;
        letter-spacing: 0.15em;
        text-transform: uppercase;
    }

    .ma-canvas {
        margin-left: 0;
    }

    .section {
        min-height: 100vh;
        padding-top: 56px;
    }

    .ghost-kanji {
        font-size: 42vw;
    }

    .craft-items {
        width: min(86vw, 420px);
    }

    .craft-item,
    .craft-item-two,
    .craft-item-three {
        margin-left: 0;
        white-space: normal;
    }

    .craft-item + .craft-item {
        margin-top: 46px;
    }

    .chrome-divider {
        left: 8vw;
        right: 8vw;
    }

    .cursor-trail {
        display: none;
    }
}
