/* ============================================================
   daitoua.com - Deco Watercolor Formalism
   ============================================================ */

/* --- Custom Properties --- */
:root {
    --deep-water: #1B3A4B;
    --morning-fog: #F0E6D3;
    --brass-inlay: #C9A84C;
    --tide-pool: #6B8F9E;
    --coral-shallow: #D4826A;
    --wash-blue: #A8C5D6;
    --deep-navy: #0D1F2D;
    --warm-white: #FAF7F2;
    --text-body: #2C3E50;
    --text-light: #D6CFC4;
    --rhythm: 1.5rem;
    --margin-x: clamp(24px, 5vw, 80px);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 17px;
    line-height: 1.95;
    color: var(--text-body);
    background: var(--morning-fog);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Poiret One', 'Josefin Sans', sans-serif;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

/* --- Chamber Base --- */
.chamber {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

.chamber.visible {
    opacity: 1;
    transform: translateY(0);
}

.chamber .wash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* --- Chamber Transitions (watercolor bleed zones) --- */
.chamber-transition {
    height: 15vh;
    position: relative;
    pointer-events: none;
}

.chamber-transition[data-from="1"][data-to="2"],
.chamber-transition[data-from="2"][data-to="3"] {
    background: linear-gradient(
        to bottom,
        var(--morning-fog),
        rgba(240, 230, 211, 0)
    );
}

.chamber-transition[data-from="3"][data-to="4"] {
    background: linear-gradient(
        to bottom,
        var(--morning-fog),
        var(--deep-water)
    );
}

.chamber-transition[data-from="4"][data-to="5"] {
    background: linear-gradient(
        to bottom,
        var(--deep-water),
        var(--deep-water)
    );
}

/* --- Chamber 1: Threshold --- */
.chamber-threshold {
    background: var(--morning-fog);
    transform: translateY(0);
}

.wash-1 {
    background:
        radial-gradient(ellipse 60% 40% at 45% 50%, rgba(168, 197, 214, 0.30) 0%, transparent 70%),
        radial-gradient(ellipse 30% 50% at 70% 30%, rgba(107, 143, 158, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 40% 35% at 30% 65%, rgba(212, 130, 106, 0.06) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 1.2s ease-out;
}

.chamber-threshold.visible .wash-1 {
    opacity: 1;
}

.title-block {
    position: relative;
    z-index: 1;
    text-align: center;
    clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%);
    opacity: 0;
    transform: translateY(20px);
    transition: clip-path 1s ease-in-out 0.4s,
                opacity 0.8s ease-out 1.0s,
                transform 0.8s ease-out 1.0s;
}

.chamber-threshold.visible .title-block {
    clip-path: polygon(10% 0%, 90% 0%, 100% 15%, 100% 85%, 90% 100%, 10% 100%, 0% 85%, 0% 15%);
    opacity: 1;
    transform: translateY(0);
}

.site-title {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(40px, 8vw, 96px);
    font-weight: 400;
    color: var(--deep-water);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    line-height: 1.1;
    padding: calc(var(--rhythm) * 2) calc(var(--rhythm) * 3);
}

.title-subtitle {
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--tide-pool);
    margin-top: var(--rhythm);
    padding-bottom: calc(var(--rhythm) * 2);
}

/* --- Chamber 2: Gallery --- */
.chamber-gallery {
    background: var(--morning-fog);
    padding: 0;
    flex-direction: column;
}

.wash-2 {
    background:
        repeating-linear-gradient(90deg, transparent, transparent 80px, rgba(107, 143, 158, 0.08) 80px, rgba(107, 143, 158, 0.08) 82px),
        repeating-linear-gradient(90deg, transparent, transparent 140px, rgba(168, 197, 214, 0.10) 140px, rgba(168, 197, 214, 0.10) 143px),
        repeating-linear-gradient(90deg, transparent, transparent 200px, rgba(107, 143, 158, 0.06) 200px, rgba(107, 143, 158, 0.06) 202px);
}

.gallery-track {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--rhythm) * 1.5);
}

.gallery-scroll {
    display: flex;
    gap: calc(var(--rhythm) * 2);
    padding: calc(var(--rhythm) * 2) var(--margin-x);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    scrollbar-width: none;
}

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

.gallery-panel {
    flex: 0 0 auto;
    width: clamp(280px, 30vw, 380px);
    height: 70vh;
    min-height: 400px;
    scroll-snap-align: center;
}

.panel-frame {
    position: relative;
    width: 100%;
    height: 100%;
    border: 1px solid var(--brass-inlay);
    display: flex;
    align-items: flex-end;
    padding: calc(var(--rhythm) * 2);
    background: rgba(250, 247, 242, 0.6);
    backdrop-filter: blur(2px);
}

/* --- Gallery Indicators --- */
.gallery-indicator {
    display: flex;
    gap: 12px;
    padding-bottom: calc(var(--rhythm) * 2);
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tide-pool);
    opacity: 0.3;
    transition: opacity 300ms ease, background 300ms ease;
    cursor: pointer;
}

.gallery-dot.active {
    opacity: 1;
    background: var(--brass-inlay);
}

/* --- Deco Corner Ornaments --- */
.deco-corner {
    position: absolute;
    width: 24px;
    height: 24px;
}

.deco-corner::before,
.deco-corner::after {
    content: '';
    position: absolute;
    background: var(--brass-inlay);
    opacity: 0.8;
}

.deco-tl {
    top: 4px;
    left: 4px;
}
.deco-tl::before {
    width: 24px;
    height: 2px;
    top: 0;
    left: 0;
}
.deco-tl::after {
    width: 2px;
    height: 24px;
    top: 0;
    left: 0;
}

.deco-tr {
    top: 4px;
    right: 4px;
}
.deco-tr::before {
    width: 24px;
    height: 2px;
    top: 0;
    right: 0;
}
.deco-tr::after {
    width: 2px;
    height: 24px;
    top: 0;
    right: 0;
}

.deco-bl {
    bottom: 4px;
    left: 4px;
}
.deco-bl::before {
    width: 24px;
    height: 2px;
    bottom: 0;
    left: 0;
}
.deco-bl::after {
    width: 2px;
    height: 24px;
    bottom: 0;
    left: 0;
}

.deco-br {
    bottom: 4px;
    right: 4px;
}
.deco-br::before {
    width: 24px;
    height: 2px;
    bottom: 0;
    right: 0;
}
.deco-br::after {
    width: 2px;
    height: 24px;
    bottom: 0;
    right: 0;
}

.panel-content {
    position: relative;
    z-index: 1;
}

.panel-heading {
    font-family: 'Poiret One', sans-serif;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 400;
    color: var(--deep-water);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-bottom: var(--rhythm);
}

.panel-text {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-body);
}

/* --- Chamber 3: Manifesto --- */
.chamber-manifesto {
    background: var(--morning-fog);
    padding: calc(var(--rhythm) * 6) var(--margin-x);
}

.wash-3 {
    background:
        radial-gradient(ellipse 50% 40% at 65% 45%, rgba(212, 130, 106, 0.04) 0%, transparent 70%);
}

.manifesto-text {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.manifesto-text p {
    margin-bottom: calc(var(--rhythm) * 2);
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 17px;
    line-height: 1.95;
    color: var(--text-body);
}

.pull-quote {
    font-family: 'Poiret One', sans-serif;
    font-size: 34px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--coral-shallow);
    letter-spacing: 0.05em;
    text-transform: none;
    border-left: 3px solid var(--brass-inlay);
    padding-left: calc(var(--rhythm) * 1.5);
    margin: calc(var(--rhythm) * 3) 0;
    font-style: italic;
}

/* --- Chamber 4: Mosaic --- */
.chamber-mosaic {
    background: var(--deep-water);
    padding: 0;
    align-items: stretch;
}

.mosaic-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    min-height: 100vh;
}

.mosaic-tile {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    transition: z-index 0ms;
}

.mosaic-tile svg {
    display: block;
    width: 100%;
    height: 100%;
    transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mosaic-tile:hover svg,
.mosaic-tile:active svg {
    transform: scale(1.08);
}

.mosaic-tile:hover,
.mosaic-tile.tile-hover {
    z-index: 2;
}

/* --- Chamber 5: Horizon --- */
.chamber-horizon {
    background: var(--deep-navy);
    flex-direction: column;
}

.wash-5 {
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(168, 197, 214, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 30% 70%, rgba(13, 31, 45, 0.8) 0%, transparent 70%),
        radial-gradient(ellipse 70% 60% at 70% 60%, rgba(27, 58, 75, 0.4) 0%, transparent 65%);
    animation: waterShift 60s ease-in-out infinite;
}

@keyframes waterShift {
    0% {
        background-position: 0% 0%, 0% 0%, 0% 0%;
    }
    33% {
        background-position: 5% -3%, -3% 5%, 4% -2%;
    }
    66% {
        background-position: -3% 4%, 5% -4%, -5% 3%;
    }
    100% {
        background-position: 0% 0%, 0% 0%, 0% 0%;
    }
}

.horizon-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--rhythm) * 2);
}

.horizon-label {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brass-inlay);
}

.horizon-contact {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-light);
    opacity: 0.7;
}

.horizon-compass {
    width: 48px;
    height: 48px;
    margin-top: var(--rhythm);
    opacity: 0.5;
}

/* --- Compass Rose Navigation --- */
.compass-nav {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(13, 31, 45, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100;
    transition: width 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
                height 400ms cubic-bezier(0.34, 1.56, 0.64, 1),
                border-radius 400ms ease;
    overflow: hidden;
}

.compass-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    transition: opacity 300ms ease;
}

.compass-labels {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease 100ms;
}

.compass-nav.expanded {
    width: 240px;
    height: 240px;
    border-radius: 50%;
}

.compass-nav.expanded .compass-icon {
    opacity: 0.3;
}

.compass-nav.expanded .compass-labels {
    opacity: 1;
    pointer-events: auto;
}

.compass-link {
    position: absolute;
    top: 50%;
    left: 50%;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--brass-inlay);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transform: rotate(var(--angle)) translateX(80px) rotate(calc(-1 * var(--angle)));
    margin-top: -8px;
    margin-left: -30px;
    transition: color 200ms ease;
}

.compass-link:hover {
    color: var(--warm-white);
}

/* --- Prefers Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .chamber {
        opacity: 1;
        transform: none;
    }

    .chamber-threshold .title-block {
        clip-path: polygon(10% 0%, 90% 0%, 100% 15%, 100% 85%, 90% 100%, 10% 100%, 0% 85%, 0% 15%);
        opacity: 1;
        transform: none;
    }

    .wash-1 {
        opacity: 1;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .mosaic-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-panel {
        width: 80vw;
        height: 60vh;
    }

    .compass-nav {
        bottom: 20px;
        right: 20px;
    }

    .pull-quote {
        font-size: 26px;
    }

    .chamber-manifesto {
        padding: calc(var(--rhythm) * 3) var(--margin-x);
    }
}

@media (max-width: 480px) {
    .site-title {
        letter-spacing: 0.1em;
    }

    .gallery-panel {
        width: 85vw;
        height: 55vh;
    }

    .pull-quote {
        font-size: 22px;
    }
}
