:root {
    --bg-primary: #0d1b0e;
    --bg-secondary: #1b4332;
    --surface: #2d6a4f;
    --text-primary: #e8eddf;
    --text-secondary: #a3b18a;
    --accent: #52b788;
    --accent-hot: #b7e4c7;
    --highlight: #d8f3dc;
}

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

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Nunito Sans', sans-serif;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.72;
}

/* Bokeh Background */
.bokeh-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    animation: bokeh-fade-in 1.5s ease-out 0.2s forwards;
}

.bokeh-back {
    z-index: 0;
    background:
        radial-gradient(circle 60px at 15% 25%, rgba(82,183,136,0.06) 0%, transparent 70%),
        radial-gradient(circle 90px at 70% 60%, rgba(183,228,199,0.04) 0%, transparent 70%),
        radial-gradient(circle 45px at 40% 80%, rgba(82,183,136,0.05) 0%, transparent 70%),
        radial-gradient(circle 120px at 85% 20%, rgba(163,177,138,0.03) 0%, transparent 70%),
        radial-gradient(circle 50px at 25% 55%, rgba(82,183,136,0.04) 0%, transparent 70%);
    animation: bokeh-fade-in 1.5s ease-out 0.2s forwards, bokeh-drift 30s ease-in-out infinite alternate;
}

.bokeh-mid {
    z-index: 1;
    background:
        radial-gradient(circle 80px at 55% 35%, rgba(82,183,136,0.08) 0%, transparent 70%),
        radial-gradient(circle 100px at 20% 70%, rgba(183,228,199,0.05) 0%, transparent 70%),
        radial-gradient(circle 70px at 80% 45%, rgba(82,183,136,0.06) 0%, transparent 70%),
        radial-gradient(circle 55px at 45% 15%, rgba(163,177,138,0.04) 0%, transparent 70%);
    animation: bokeh-fade-in 1.5s ease-out 0.2s forwards, bokeh-drift 25s ease-in-out 2s infinite alternate-reverse;
}

.bokeh-front {
    z-index: 2;
    background:
        radial-gradient(circle 140px at 30% 40%, rgba(82,183,136,0.1) 0%, transparent 70%),
        radial-gradient(circle 180px at 75% 70%, rgba(183,228,199,0.06) 0%, transparent 70%),
        radial-gradient(circle 100px at 60% 20%, rgba(82,183,136,0.08) 0%, transparent 70%);
    animation: bokeh-fade-in 1.5s ease-out 0.2s forwards, bokeh-drift 35s ease-in-out 1s infinite alternate;
}

@keyframes bokeh-fade-in {
    to { opacity: 1; }
}

@keyframes bokeh-drift {
    from { background-position: 0 0; }
    to { background-position: 20px -15px; }
}

/* Scroll Container */
.scroll-container {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: row;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* Panels */
.panel {
    flex: 0 0 100vw;
    height: 100vh;
    position: relative;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-content {
    flex: 0 0 100vw;
    margin-right: -8vw;
}

.panel-breathing {
    flex: 0 0 60vw;
}

.panel-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 6rem;
    padding-bottom: 80px;
    position: relative;
}

/* Panel: Origin */
#panel-origin .panel-inner {
    justify-content: flex-end;
    align-items: flex-start;
    padding-bottom: 20vh;
}

.site-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    letter-spacing: -0.03em;
    color: var(--text-primary);
    transform: translateX(-100vw);
    animation: lunge-in 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s forwards;
}

@keyframes lunge-in {
    to { transform: translateX(0); }
}

.tagline {
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    max-width: 38ch;
    opacity: 0;
    animation: fade-in 0.8s ease-out 2.5s forwards;
}

@keyframes fade-in {
    to { opacity: 1; }
}

.trailing-line {
    position: absolute;
    height: 1px;
    background: var(--accent);
    top: 72%;
}

.trailing-line-right {
    right: 0;
    width: 40%;
    opacity: 0;
    animation: fade-in 1s ease-out 3s forwards;
}

.trailing-line-left {
    left: 0;
    width: 40%;
}

/* Floating elements */
.floating-kanji {
    position: absolute;
    font-size: 4rem;
    font-weight: 100;
    opacity: 0.08;
    color: var(--text-primary);
    top: 20%;
    right: 15%;
    animation: float 6s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * 0.8s);
}

.floating {
    animation: float 6s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * 0.8s);
}

@keyframes float {
    from { transform: translateY(0); }
    to { transform: translateY(-20px); }
}

/* Breathing panels */
.breathing-kanji {
    font-size: 8rem;
    font-weight: 100;
    opacity: 0.12;
    color: var(--text-primary);
}

/* Panel columns */
.panel-columns {
    display: grid;
    grid-template-columns: 1fr minmax(200px, 0.6fr);
    gap: 4rem;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 4rem 6rem;
    padding-bottom: 80px;
}

.col-text {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.col-text p {
    max-width: 38ch;
    color: var(--text-secondary);
}

.col-visual {
    position: relative;
    height: 60%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

/* Panel titles */
.panel-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5rem);
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
}

/* Zoom focus animation */
.zoom-focus {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(4px);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.5s ease-out,
                filter 0.6s ease-out;
    transition-delay: calc(var(--i, 0) * 0.15s);
}

.zoom-focus.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* Enso circles */
.enso {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    border-color: var(--accent) var(--accent) var(--accent) transparent;
    animation: enso-rotate 12s linear infinite;
    animation-delay: calc(var(--i) * 1.5s);
    opacity: 0.4;
}

@keyframes enso-rotate {
    to { transform: rotate(360deg); }
}

/* Principles */
.principle {
    margin-bottom: 2rem;
}

.principle-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.principle p {
    max-width: 38ch;
}

.principle-card {
    width: 80%;
    height: 70%;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dot-grid, .dot-grid-inner {
    display: grid;
    grid-template-columns: repeat(4, 3px);
    grid-template-rows: repeat(4, 3px);
    gap: 12px;
    opacity: 0.15;
}

.dot-grid {
    position: absolute;
    bottom: 25%;
    right: 20%;
}

.dot-grid::before, .dot-grid-inner::before,
.dot-grid::after, .dot-grid-inner::after {
    content: '';
}

/* We'll use box-shadow for dot grids instead */
.dot-grid-inner {
    width: 60px;
    height: 60px;
    background-image: radial-gradient(circle, var(--text-secondary) 1.5px, transparent 1.5px);
    background-size: 15px 15px;
    display: block;
    opacity: 0.2;
}

.dot-grid {
    width: 48px;
    height: 48px;
    background-image: radial-gradient(circle, var(--text-secondary) 1.5px, transparent 1.5px);
    background-size: 12px 12px;
    display: block;
    opacity: 0.1;
    animation: float 5s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * 0.8s);
}

/* Motion Study */
.motion-rects {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    align-items: center;
}

.motion-rect {
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rect-slide {
    width: 120px;
    height: 180px;
}

.rect-scale {
    width: 160px;
    height: 120px;
}

.rect-rotate {
    width: 100px;
    height: 100px;
}

.rect-slide:hover {
    transform: translateX(30px);
}

.rect-scale:hover {
    transform: scale(1.2);
}

.rect-rotate:hover {
    transform: rotate(15deg);
}

/* Coda */
.panel-coda-inner {
    align-items: center;
    text-align: center;
}

.coda-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    letter-spacing: -0.03em;
}

.coda-letter {
    opacity: calc(0.3 + var(--i) * 0.175);
}

.coda-text {
    margin-top: 2rem;
    color: var(--text-secondary);
    max-width: 38ch;
}

/* Navigation Strip */
.nav-strip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: rgba(27, 67, 50, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.nav-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.nav-indicator.active {
    background: var(--accent);
    transform: scale(1.3);
}

/* Responsive */
@media (max-width: 768px) {
    .panel-content {
        margin-right: 0;
    }
    .panel-breathing {
        flex: 0 0 40vw;
    }
    .nav-strip {
        height: 56px;
    }
    .panel-columns {
        grid-template-columns: 1fr;
        padding: 2rem 3rem;
    }
    .col-visual {
        display: none;
    }
    .panel-inner {
        padding: 2rem 3rem;
    }
}

@media (max-width: 480px) {
    .floating-kanji:nth-child(n+3),
    .enso:nth-child(n+3) {
        display: none;
    }
}
