:root {
    --primary-deep: #1B2838;
    --primary-light: #F0EDE5;
    --accent-warm: #C67B5C;
    --accent-cool: #5C9EA3;
    --neutral-mid: #3D4A5C;
    --neutral-warm: #8E7B6D;
    --glitch-highlight: #E8B4A2;
    --shadow-tone: #2A2F3A;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Serif 4', Georgia, serif;
    color: var(--neutral-mid);
    background: var(--primary-deep);
    overflow: hidden;
}

.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ========== Scroll Container ========== */
.scroll-container {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
}

/* ========== Panels ========== */
.panel {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    scroll-snap-align: start;
    display: grid;
    grid-template-rows: 1fr auto 2fr;
    grid-template-columns: 1fr 3fr 1fr;
    overflow: hidden;
}

.panel--light {
    background-color: var(--primary-light);
}

.panel--dark {
    background-color: var(--primary-deep);
}

/* ========== Weave Background ========== */
.weave-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: fadeInWeave 1.2s 0.8s ease-out forwards;
}

@keyframes fadeInWeave {
    to { opacity: 1; }
}

/* ========== Content Islands ========== */
.content-island {
    position: relative;
    z-index: 2;
    padding: 2.5rem;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-island.visible {
    opacity: 1;
    transform: translateY(0);
}

.content-island--center-left {
    grid-row: 2;
    grid-column: 1 / 3;
    padding-left: 8vw;
    align-self: center;
}

.content-island--lower-right {
    grid-row: 2 / 4;
    grid-column: 2 / 4;
    align-self: end;
    margin-bottom: 15vh;
    margin-right: 6vw;
    max-width: 560px;
    justify-self: end;
    transform: perspective(1200px) rotateY(2deg) translateY(30px);
}

.content-island--lower-right.visible {
    transform: perspective(1200px) rotateY(2deg) translateY(0);
}

.content-island--upper-left {
    grid-row: 1 / 3;
    grid-column: 1 / 3;
    align-self: end;
    margin-top: 15vh;
    margin-left: 8vw;
    max-width: 520px;
    transform: perspective(1200px) rotateY(2deg) translateY(30px);
}

.content-island--upper-left.visible {
    transform: perspective(1200px) rotateY(2deg) translateY(0);
}

.content-island--center-right {
    grid-row: 2;
    grid-column: 2 / 4;
    align-self: center;
    margin-right: 8vw;
    max-width: 540px;
    justify-self: end;
    transform: perspective(1200px) rotateY(-2deg) translateY(30px);
}

.content-island--center-right.visible {
    transform: perspective(1200px) rotateY(-2deg) translateY(0);
}

.content-island--lower-left {
    grid-row: 2 / 4;
    grid-column: 1 / 3;
    align-self: end;
    margin-bottom: 15vh;
    margin-left: 8vw;
    max-width: 540px;
    transform: perspective(1200px) rotateY(2deg) translateY(30px);
}

.content-island--lower-left.visible {
    transform: perspective(1200px) rotateY(2deg) translateY(0);
}

.content-island--center {
    grid-row: 2;
    grid-column: 2;
    align-self: center;
    justify-self: center;
    text-align: center;
}

/* ========== Typography ========== */
.glitch-heading {
    font-family: 'Bricolage Grotesque', sans-serif;
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 7rem);
    letter-spacing: -0.03em;
    line-height: 1.05;
    position: relative;
    color: var(--primary-deep);
}

.panel--dark .glitch-heading {
    color: var(--primary-light);
}

.glitch-heading::before,
.glitch-heading::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.glitch-heading::before {
    color: var(--accent-warm);
    opacity: 0.5;
    animation: glitch-halo-warm 4s steps(1) infinite;
}

.glitch-heading::after {
    color: var(--accent-cool);
    opacity: 0.5;
    animation: glitch-halo-cool 4s steps(1) infinite;
}

@keyframes glitch-halo-warm {
    0%, 49% { transform: translate(1.5px, -0.5px); }
    50%, 100% { transform: translate(1px, 0.5px); }
}

@keyframes glitch-halo-cool {
    0%, 49% { transform: translate(-1.5px, 0.5px); }
    50%, 100% { transform: translate(-1px, -0.5px); }
}

.glitch-heading--small {
    font-size: clamp(2rem, 5vw, 4rem);
}

.label {
    display: block;
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--neutral-warm);
    margin-bottom: 1.2rem;
}

.glitch-heading + .label {
    margin-top: 1rem;
    margin-bottom: 0;
}

.body-text {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.72;
    color: var(--neutral-mid);
    margin-bottom: 1.2rem;
}

.body-text:last-child {
    margin-bottom: 0;
}

.panel--dark .body-text {
    color: var(--primary-light);
}

.pull-quote {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    line-height: 1.4;
    color: var(--accent-warm);
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* ========== Link List ========== */
.link-list {
    list-style: none;
    padding: 0;
}

.link-list li {
    margin-bottom: 1rem;
}

.tilt-link {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 600;
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    color: var(--accent-cool);
    text-decoration: none;
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tilt-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--accent-cool);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s ease-out;
}

.tilt-link:hover::after {
    transform: scaleX(1);
}

/* ========== Pojagi Seams ========== */
.pojagi-seam {
    position: absolute;
    top: 38%;
    left: 10%;
    width: 80%;
    height: 2px;
    z-index: 1;
}

.pojagi-seam--vertical {
    top: 10%;
    left: 38%;
    width: 2px;
    height: 80%;
}

/* ========== Floating Elements ========== */
.floating-element {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    animation: floatDrift var(--dur) cubic-bezier(0.37, 0, 0.63, 1) infinite alternate;
    transform: rotateX(5deg) rotateY(-3deg);
    box-shadow: 0 8px 32px rgba(27, 40, 56, 0.08);
}

.float-circle {
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--color);
    opacity: var(--opacity);
}

.float-rect {
    width: var(--w);
    height: var(--h);
    border-radius: 6px;
    background: var(--color);
    opacity: var(--opacity);
}

@keyframes floatDrift {
    0% {
        transform: rotateX(5deg) rotateY(-3deg) translate(var(--x1), var(--y1)) rotateZ(0deg);
    }
    100% {
        transform: rotateX(5deg) rotateY(-3deg) translate(var(--x2), var(--y2)) rotateZ(3deg);
    }
}

/* ========== Navigation Disc ========== */
.nav-disc {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    width: 40px;
    height: 40px;
    cursor: pointer;
    mix-blend-mode: difference;
}

.nav-disc__inner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-cool);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    animation: navDiscEntry 0.6s 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes navDiscEntry {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.nav-disc__menu {
    position: absolute;
    bottom: 50px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nav-disc.active .nav-disc__menu {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

.nav-disc__item {
    font-family: 'DM Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-light);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.3rem 0.6rem;
    background: var(--shadow-tone);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-disc__item:hover {
    background: var(--accent-cool);
}

/* ========== Colophon ========== */
.colophon-content {
    opacity: 0;
    transform: translateY(30px);
}

.colophon-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========== Selection ========== */
::selection {
    background: var(--glitch-highlight);
    color: var(--primary-deep);
}

/* ========== Panel 1 specifics ========== */
.panel1-content .label {
    margin-top: 0.8rem;
}
