/* =========================================
   bada.moe — Design System
   japanese-minimal / terracotta-warm
   ========================================= */

/* --- Custom Properties --- */
:root {
    --terracotta: #c4654a;
    --cream: #faf3eb;
    --deep-umber: #3d2b1f;
    --warm-charcoal: #2e2420;
    --soft-cream: #f5ece0;
    --burnt-sienna: #d4835e;
    --shallow-teal: #4a8f8c;
    --coral-flash: #e87f5f;
    --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;
    --font-body: 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-depth: cubic-bezier(0.33, 1, 0.68, 1);
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--cream);
    color: var(--warm-charcoal);
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.75;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Sections --- */
.section {
    position: relative;
    min-height: 100vh;
    scroll-snap-align: start;
    overflow: hidden;
}

/* --- Depth Gauge --- */
.depth-gauge {
    position: fixed;
    right: 24px;
    top: 10vh;
    height: 80vh;
    width: 4px;
    z-index: 100;
    pointer-events: none;
}

.depth-gauge-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: rgba(196, 101, 74, 0.2);
    border-radius: 2px;
}

.depth-gauge-tick {
    position: absolute;
    left: -8px;
    width: 12px;
    height: 2px;
    background: var(--terracotta);
    opacity: 0.4;
    transition: width 0.5s var(--ease-out-quint), opacity 0.5s var(--ease-out-quint);
}

.depth-gauge-tick[data-section="0"] { top: 0%; }
.depth-gauge-tick[data-section="1"] { top: 25%; }
.depth-gauge-tick[data-section="2"] { top: 50%; }
.depth-gauge-tick[data-section="3"] { top: 75%; }
.depth-gauge-tick[data-section="4"] { top: 100%; }

.depth-gauge-tick.active {
    width: 24px;
    opacity: 1;
    animation: breathe 2s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.15); }
}

.depth-gauge-active {
    position: absolute;
    left: -2px;
    width: 8px;
    height: 8px;
    background: var(--terracotta);
    border-radius: 50%;
    top: 0%;
    transition: top 0.5s var(--ease-depth);
}

/* --- Slide Reveal System --- */
.slide-reveal-wrapper {
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.slide-reveal-inner {
    display: block;
}

.slide-reveal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--terracotta);
    transform: scaleX(1);
    transform-origin: right;
    transition: transform 0.8s var(--ease-out-quint);
    z-index: 2;
}

.slide-reveal-overlay.overlay-cream {
    background: var(--cream);
}

.slide-reveal-overlay.overlay-dark {
    background: var(--deep-umber);
}

.slide-reveal-target.revealed .slide-reveal-overlay {
    transform: scaleX(0);
}

/* Staggered reveals for cards */
.reef-card[data-stagger="0"].revealed .slide-reveal-overlay { transition-delay: 0s; }
.reef-card[data-stagger="1"].revealed .slide-reveal-overlay { transition-delay: 0.15s; }
.reef-card[data-stagger="2"].revealed .slide-reveal-overlay { transition-delay: 0.3s; }
.reef-card[data-stagger="3"].revealed .slide-reveal-overlay { transition-delay: 0.45s; }
.reef-card[data-stagger="4"].revealed .slide-reveal-overlay { transition-delay: 0.6s; }

/* --- Section 1: Surface (Hero) --- */
.section-surface {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 15vh;
    background: linear-gradient(180deg, var(--terracotta) 0%, var(--cream) 100%);
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 12vw, 9rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--warm-charcoal);
    margin-bottom: var(--space-md);
}

.hero-tagline {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--warm-charcoal);
    opacity: 0.8;
    letter-spacing: 0.02em;
}

/* Swimming Fish */
.swimming-fish {
    position: absolute;
    top: 40%;
    left: -10vw;
    width: 80px;
    height: 40px;
    color: var(--terracotta);
    z-index: 1;
    animation: swimAcross 25s linear infinite, fishBob 4s ease-in-out infinite;
}

@keyframes swimAcross {
    0% { left: -10vw; }
    100% { left: 110vw; }
}

@keyframes fishBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.fish-svg {
    width: 100%;
    height: 100%;
}

/* Fish path drawing animation */
.fish-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s ease-out;
}

.fish-path.drawn {
    stroke-dashoffset: 0;
}

/* --- Wave Separator --- */
.wave-separator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--terracotta);
    opacity: 0.3;
    clip-path: polygon(
        0% 50%, 8% 0%, 16% 50%, 24% 100%, 32% 50%, 40% 0%,
        48% 50%, 56% 100%, 64% 50%, 72% 0%, 80% 50%, 88% 100%,
        96% 50%, 100% 0%, 100% 100%, 0% 100%
    );
}

/* --- Section 2: Shallows --- */
.section-shallows {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--cream);
    padding: 15vh 10vw;
}

.shallows-content {
    display: flex;
    gap: clamp(2rem, 5vw, 6rem);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    align-items: center;
}

.shallows-text {
    flex: 0 0 60%;
}

.shallows-image {
    flex: 0 0 35%;
}

.section-label {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--terracotta);
    margin-bottom: var(--space-lg);
    display: block;
}

.section-label-light {
    color: var(--coral-flash);
}

.shallows-heading {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 8vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--warm-charcoal);
    margin-bottom: var(--space-lg);
}

.shallows-body {
    font-family: var(--font-body);
    font-weight: 300;
    line-height: 1.75;
    color: var(--warm-charcoal);
    margin-bottom: var(--space-md);
    max-width: 580px;
}

.shallows-body em {
    font-style: italic;
    color: var(--terracotta);
}

/* Image Frame */
.image-frame {
    position: relative;
}

.image-reveal {
    display: block;
}

.photo-placeholder {
    aspect-ratio: 3/5;
    background: var(--soft-cream);
    border: 2px solid var(--terracotta);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fish-clownfish-large {
    width: 70%;
    height: auto;
    opacity: 0.6;
}

/* Fish Separator */
.fish-separator {
    display: flex;
    justify-content: center;
    margin: var(--space-lg) 0;
    color: var(--terracotta);
    opacity: 0.5;
}

.fish-clownfish {
    width: 40px;
    height: auto;
}

/* --- Section 3: Reef --- */
.section-reef {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--cream);
    padding: 15vh 10vw;
}

.reef-label {
    text-align: center;
}

.reef-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--warm-charcoal);
    margin-bottom: var(--space-xl);
    text-align: center;
}

.reef-cards {
    display: flex;
    gap: 32px;
    justify-content: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: var(--space-md) 0;
    width: 100%;
    max-width: 1400px;
    -webkit-overflow-scrolling: touch;
}

.reef-card {
    flex: 0 0 280px;
    height: 400px;
    scroll-snap-align: start;
    background: var(--cream);
    box-shadow: 0 2px 20px rgba(180, 100, 70, 0.08);
    border-radius: 2px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.reef-card:hover {
    box-shadow: 0 4px 30px rgba(180, 100, 70, 0.14);
    background: linear-gradient(135deg, rgba(196, 101, 74, 0.05) 0%, rgba(74, 143, 140, 0.05) 100%);
}

.card-reveal {
    display: block;
    width: 100%;
    height: 100%;
}

.card-reveal > .slide-reveal-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-image {
    flex: 0 0 60%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: var(--soft-cream);
}

.card-fish {
    width: 80%;
    height: auto;
    max-height: 160px;
}

.card-text {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.card-text h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--warm-charcoal);
    letter-spacing: -0.01em;
}

.card-text p {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--warm-charcoal);
    opacity: 0.8;
}

/* --- Section 4: Depths --- */
.section-depths {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, var(--deep-umber) 0%, var(--warm-charcoal) 100%);
    padding: 15vh 10vw;
    color: var(--soft-cream);
}

.depths-content {
    max-width: 580px;
    width: 100%;
    text-align: center;
}

.depths-text {
    margin: var(--space-xl) 0;
}

.depth-line {
    display: block;
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.9;
    color: var(--soft-cream);
    margin-bottom: var(--space-md);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.depth-line.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Depths fish */
.depths-fish {
    margin-top: var(--space-xl);
    display: flex;
    justify-content: center;
    opacity: 0.7;
}

.fish-betta {
    width: 160px;
    height: auto;
}

/* --- Section 5: Seabed (Footer) --- */
.section-seabed {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    background: var(--cream);
    padding: 10vh 10vw;
}

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

.seabed-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 400;
    color: var(--warm-charcoal);
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.seabed-line {
    width: 60px;
    height: 1px;
    background: var(--terracotta);
    margin: 0 auto var(--space-md);
}

.seabed-year {
    font-family: var(--font-mono);
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--warm-charcoal);
    opacity: 0.6;
}

/* --- Mobile Responsive --- */
@media (max-width: 640px) {
    .depth-gauge {
        right: 12px;
    }

    .shallows-content {
        flex-direction: column;
    }

    .shallows-text {
        flex: 1 1 auto;
    }

    .shallows-image {
        flex: 1 1 auto;
        max-width: 300px;
        margin: 0 auto;
    }

    .reef-cards {
        padding-left: 5vw;
        padding-right: 5vw;
        justify-content: flex-start;
    }

    .reef-card {
        flex: 0 0 260px;
    }

    .swimming-fish {
        width: 50px;
        height: 25px;
    }

    .section-shallows,
    .section-reef,
    .section-depths {
        padding: 10vh 6vw;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .shallows-content {
        gap: 3rem;
    }

    .reef-cards {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}

@media (min-width: 1025px) {
    .reef-cards {
        overflow-x: visible;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* --- SVG Drawing Specific Animations --- */
.fish-angelfish .fish-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
}

.fish-angelfish .fish-path.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.8s ease-out;
}

.fish-clownfish .fish-path,
.fish-clownfish-large .fish-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
}

.fish-clownfish .fish-path.drawn,
.fish-clownfish-large .fish-path.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.5s ease-out;
}

.card-fish .fish-path {
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
}

.card-fish .fish-path.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.5s ease-out;
}

.fish-betta .fish-path {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
}

.fish-betta .fish-path.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 3s ease-out;
}

/* Image warm filter */
.photo-placeholder img {
    filter: sepia(8%) saturate(105%) brightness(102%);
}
