/* ========================================
   ppss.ee — Arctic Aquatic Deco
   Scandinavian · Z-Pattern · Chrome-Metallic
   ======================================== */

/* --- CSS Custom Properties --- */
:root {
    --deep-arctic: #0e1218;
    --slate-depths: #181e28;
    --fjord-chrome: #b4c3d2;
    --polar-silver: #e8eef4;
    --frost-edge: rgba(200, 210, 220, 0.18);
    --neon-angelfish: #00e5c3;
    --coral-flash: #ff6b8a;
    --bioluminescent-blue: #4d9fff;
    --glass-tint: rgba(24, 30, 40, 0.45);
    --bounce-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    background: var(--deep-arctic);
    color: var(--fjord-chrome);
    overflow: hidden;
    letter-spacing: 0.02em;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* --- Background Depth Layer --- */
.bg-depth {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0e1218 0%, #181e28 60%, #0e1218 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
    z-index: 0;
}

/* --- Scroll Container --- */
.scroll-container {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    position: relative;
    z-index: 1;
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Navigation --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(14, 18, 24, 0.7);
    border-bottom: 1px solid var(--frost-edge);
}

.nav-logo {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    color: var(--polar-silver);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.nav-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    width: 28px;
}

.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: linear-gradient(135deg, #b4c3d2 0%, #e8eef4 40%, #b4c3d2 100%);
    transition: all 0.3s ease;
}

.nav-hamburger.active span:first-child {
    transform: rotate(45deg) translate(4px, 4px);
    background: var(--coral-flash);
}

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

.nav-hamburger.active span:last-child {
    transform: rotate(-45deg) translate(4px, -4px);
    background: var(--coral-flash);
}

/* --- Menu Overlay --- */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 18, 24, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.menu-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: center;
}

.menu-link {
    font-family: 'Poiret One', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    color: var(--fjord-chrome);
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.menu-link:hover {
    color: var(--neon-angelfish);
}

/* --- Hero Section --- */
.section-hero {
    flex-direction: column;
    background: var(--deep-arctic);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.seahorse-svg {
    width: 80px;
    height: 140px;
    opacity: 0;
}

.seahorse-path {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
}

.seahorse-svg.animate .seahorse-path {
    animation: drawSeahorse 1200ms ease-out forwards;
}

@keyframes drawSeahorse {
    to {
        stroke-dashoffset: 0;
    }
}

.hero-title {
    font-family: 'Poiret One', cursive;
    font-size: clamp(3rem, 7vw, 6rem);
    color: var(--polar-silver);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    line-height: 1.05;
    opacity: 0;
}

.hero-title .letter {
    display: inline-block;
    opacity: 0;
}

.hero-title .letter.visible {
    animation: letterBounceIn 80ms var(--bounce-easing) forwards;
}

@keyframes letterBounceIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-line {
    width: 35vw;
    height: 1px;
    background: linear-gradient(135deg, #b4c3d2 0%, #e8eef4 40%, #b4c3d2 100%);
    transform: scaleX(0);
    transition: transform 600ms ease-out;
}

.hero-line.animate {
    transform: scaleX(1);
}

/* --- Fish Flash Accent Line --- */
.fish-flash-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #00e5c3 0%, #4d9fff 50%, #ff6b8a 100%);
    background-size: 200% 100%;
    animation: fishFlashFlow 12s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.fish-flash-line.visible {
    opacity: 1;
}

@keyframes fishFlashFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* --- Z-Pattern Grid --- */
.z-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-template-rows: auto 1fr auto;
    column-gap: 24px;
    row-gap: 48px;
    width: 100%;
    max-width: 1400px;
    padding: 5rem 3rem 3rem;
    height: 100vh;
    align-content: center;
    position: relative;
}

/* Diagonal Connector */
.diagonal-connector {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 48%, rgba(180, 195, 210, 0.12) 49%, rgba(180, 195, 210, 0.12) 51%, transparent 52%);
    pointer-events: none;
    opacity: 0.4;
    z-index: 0;
}

/* Zones */
.zone {
    position: relative;
    z-index: 1;
}

.zone-a {
    grid-column: 1 / 6;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-self: start;
}

.zone-b {
    grid-column: 7 / 13;
    grid-row: 1;
    align-self: start;
}

.zone-c {
    grid-column: 1 / 7;
    grid-row: 3;
    align-self: end;
}

.zone-d {
    grid-column: 8 / 13;
    grid-row: 3;
    align-self: end;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* --- Typography --- */
.accent-label {
    font-family: 'Poiret One', cursive;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--neon-angelfish);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.section-heading {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.6rem, 3.5vw, 3rem);
    color: var(--polar-silver);
    letter-spacing: 0.08em;
    line-height: 1.15;
    text-transform: uppercase;
}

.card-meta {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: var(--fjord-chrome);
    letter-spacing: 0.04em;
    opacity: 0.7;
    display: block;
}

.card-body {
    font-family: 'Jost', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    color: var(--fjord-chrome);
    letter-spacing: 0.02em;
    line-height: 1.65;
    margin: 1rem 0;
}

.card-body-small {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: var(--fjord-chrome);
    letter-spacing: 0.04em;
    line-height: 1.6;
    margin: 0.5rem 0;
}

/* --- Glassmorphic Cards --- */
.glass-card {
    background: var(--glass-tint);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid var(--frost-edge);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(232, 238, 244, 0.06);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(180, 195, 210, 0.04) 0%, transparent 60%);
    pointer-events: none;
    transition: background 0.3s ease;
}

.glass-card:hover {
    border-color: rgba(0, 229, 195, 0.3);
    box-shadow: 0 12px 48px rgba(0, 229, 195, 0.08), inset 0 1px 0 rgba(232, 238, 244, 0.06);
}

.glass-card:hover::before {
    background: linear-gradient(135deg, rgba(180, 195, 210, 0.08) 0%, transparent 60%);
}

/* Touch-active state for mobile (mirrors hover) */
.glass-card.touch-active {
    border-color: rgba(0, 229, 195, 0.3);
    box-shadow: 0 12px 48px rgba(0, 229, 195, 0.08), inset 0 1px 0 rgba(232, 238, 244, 0.06);
}

.glass-card.touch-active::before {
    background: linear-gradient(135deg, rgba(180, 195, 210, 0.08) 0%, transparent 60%);
}

/* Card Sizes */
.glass-panel {
    border-radius: 16px;
    min-height: 200px;
}

.glass-specimen {
    border-radius: 12px;
    min-height: 150px;
}

.glass-tag {
    border-radius: 8px;
    padding: 1.2rem;
}

/* --- Corner Brackets --- */
.card-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.card-corner::before,
.card-corner::after {
    content: '';
    position: absolute;
    background: var(--fjord-chrome);
    opacity: 0;
    transition: opacity 0.4s ease 0.2s;
}

.card-corner::before {
    width: 2px;
    height: 24px;
}

.card-corner::after {
    width: 24px;
    height: 2px;
}

.card-corner.tl { top: -1px; left: -1px; }
.card-corner.tl::before { top: 0; left: 0; }
.card-corner.tl::after { top: 0; left: 0; }

.card-corner.tr { top: -1px; right: -1px; }
.card-corner.tr::before { top: 0; right: 0; }
.card-corner.tr::after { top: 0; right: 0; }

.card-corner.bl { bottom: -1px; left: -1px; }
.card-corner.bl::before { bottom: 0; left: 0; }
.card-corner.bl::after { bottom: 0; left: 0; }

.card-corner.br { bottom: -1px; right: -1px; }
.card-corner.br::before { bottom: 0; right: 0; }
.card-corner.br::after { bottom: 0; right: 0; }

.bounce-target.visible .card-corner::before,
.bounce-target.visible .card-corner::after {
    opacity: 0.35;
}

/* --- Chrome Divider Sections --- */
.section-divider {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chrome-rule {
    width: 40vw;
    height: 1px;
    border: none;
    background: linear-gradient(to right, transparent, #b4c3d2 30%, #e8eef4 50%, #b4c3d2 70%, transparent);
}

.chrome-rule.shimmer {
    animation: shimmerRule 6s ease-in-out infinite;
}

.footer-rule {
    margin: 2rem 0;
}

@keyframes shimmerRule {
    0%, 100% {
        background: linear-gradient(to right, transparent, #b4c3d2 30%, #e8eef4 50%, #b4c3d2 70%, transparent);
    }
    50% {
        background: linear-gradient(to right, transparent, #b4c3d2 20%, #e8eef4 40%, #b4c3d2 60%, transparent);
    }
}

/* --- Fish SVGs --- */
.angelfish-svg {
    width: 140px;
    height: 140px;
}

.angelfish-svg-small {
    width: 100px;
    height: 100px;
}

.neon-tetra {
    width: 70px;
    height: 35px;
    margin-top: 1rem;
}

.neon-tetra-large {
    width: 80px;
    height: 40px;
}

.discus-svg {
    position: absolute;
    width: 90px;
    height: 90px;
    opacity: 0.15;
    top: -20px;
    right: -10px;
}

.betta-tail {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 50px;
    height: 50px;
    opacity: 0.5;
}

.footer-seahorse {
    width: 60px;
    height: 105px;
    opacity: 0.4;
}

/* Fish Animations */
.fish-float {
    animation: fishFloat 8s ease-in-out infinite;
}

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

.fish-swim {
    opacity: 0;
    transform: translateX(40px);
}

.fish-swim.visible {
    animation: fishSwimIn 500ms var(--bounce-easing) forwards, fishFloat 8s ease-in-out infinite 0.5s;
}

@keyframes fishSwimIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- Art-Deco Fan Rays --- */
.fan-rays {
    position: absolute;
    width: 80px;
    height: 80px;
    background: conic-gradient(
        from 180deg at 100% 100%,
        transparent 0deg,
        rgba(180, 195, 210, 0.2) 0.5deg,
        transparent 1deg,
        transparent 15deg,
        rgba(180, 195, 210, 0.2) 15.5deg,
        transparent 16deg,
        transparent 30deg,
        rgba(180, 195, 210, 0.2) 30.5deg,
        transparent 31deg,
        transparent 45deg,
        rgba(180, 195, 210, 0.2) 45.5deg,
        transparent 46deg,
        transparent 60deg,
        rgba(180, 195, 210, 0.2) 60.5deg,
        transparent 61deg,
        transparent 75deg,
        rgba(180, 195, 210, 0.2) 75.5deg,
        transparent 76deg,
        transparent 90deg
    );
    opacity: 0;
    pointer-events: none;
}

.fan-rays-br {
    bottom: -10px;
    right: -10px;
}

/* --- Bounce-Enter Animation --- */
.bounce-target {
    opacity: 0;
    transform: translateY(60px);
    transition: none;
}

.bounce-target.visible {
    animation: bounceEnter 600ms var(--bounce-easing) forwards;
}

@keyframes bounceEnter {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Heading bounce */
.section-heading {
    opacity: 0;
    transform: translateY(30px);
}

.bounce-target.visible .section-heading {
    animation: headingBounce 450ms var(--bounce-easing) forwards;
}

@keyframes headingBounce {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Footer --- */
.section-footer {
    min-height: 50vh;
    flex-direction: column;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-text {
    font-family: 'Poiret One', cursive;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--polar-silver);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.footer-meta {
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.8rem);
    color: var(--fjord-chrome);
    letter-spacing: 0.06em;
    opacity: 0.5;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    .bounce-target {
        opacity: 1;
        transform: none;
    }

    .bounce-target.visible {
        animation: none;
    }

    .bounce-target.visible .section-heading {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .fish-float {
        animation: none;
    }

    .fish-swim {
        opacity: 1;
        transform: none;
    }

    .fish-swim.visible {
        animation: none;
    }

    .seahorse-svg {
        opacity: 0.4;
    }

    .seahorse-svg.animate .seahorse-path {
        animation: none;
        stroke-dashoffset: 0;
    }

    .hero-title {
        opacity: 1;
    }

    .hero-title .letter {
        opacity: 1;
    }

    .hero-title .letter.visible {
        animation: none;
    }

    .hero-line {
        transform: scaleX(1);
    }

    .fish-flash-line {
        opacity: 1;
        animation: none;
    }

    .shimmer {
        animation: none;
    }

    .fan-rays {
        opacity: 0.2;
    }

    .card-corner::before,
    .card-corner::after {
        opacity: 0.35;
        transition: none;
    }
}

/* --- Responsive: Mobile --- */
@media (max-width: 768px) {
    .z-grid {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding: 5rem 1rem 2rem;
        height: auto;
        min-height: 100vh;
        justify-content: center;
    }

    .diagonal-connector {
        display: none;
    }

    .zone-a,
    .zone-b,
    .zone-c,
    .zone-d {
        width: 100%;
    }

    .glass-card {
        width: 100%;
        margin: 0 auto;
    }

    .angelfish-svg,
    .angelfish-svg-small {
        width: 84px;
        height: 84px;
    }

    .neon-tetra {
        width: 42px;
        height: 21px;
    }

    .neon-tetra-large {
        width: 48px;
        height: 24px;
    }

    .discus-svg {
        width: 54px;
        height: 54px;
    }

    .betta-tail {
        width: 30px;
        height: 30px;
    }

    .chrome-rule {
        width: 60vw;
    }

    .fan-rays {
        width: 48px;
        height: 48px;
    }

    .footer-seahorse {
        width: 36px;
        height: 63px;
    }

    .nav-bar {
        padding: 0.75rem 1rem;
    }
}
