/* ==========================================================
   addrproxy.com - Corporate Translucence
   Palette: Translucent Frost
   Fonts: Playfair Display, Source Serif 4, DM Sans
   ========================================================== */

/* ---------- Palette Variables ---------- */
:root {
    --polar-depth: #0D1B2A;
    --twilight-ice: #1B2D45;
    --deep-slate: #1C2A3A;
    --charcoal-mist: #3A4A5C;
    --refraction-blue: #6BA4C9;
    --silver-glass: #8E9BAA;
    --pearl-blush: #D4B5A0;
    --frost-veil: rgba(220, 232, 245, 0.08);
    --crystal-edge: rgba(255, 255, 255, 0.12);
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0D1B2A;
    color: #1C2A3A;
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    line-height: 1.72;
    letter-spacing: 0.015em;
    overflow-x: hidden;
}

/* ---------- Background Layer ---------- */
#background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

#gradient-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, #1B2D45 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, #6BA4C9 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, #1B2D45 0%, transparent 55%),
        radial-gradient(ellipse at 70% 60%, #6BA4C9 0%, transparent 45%);
    background-color: #0D1B2A;
    animation:
        meshShift1 45s ease-in-out infinite alternate,
        meshShift2 37s ease-in-out infinite alternate-reverse,
        meshShift3 29s ease-in-out infinite alternate;
}

@keyframes meshShift1 {
    0% { background-position: 0% 0%, 100% 0%, 50% 100%, 70% 60%; }
    50% { background-position: 30% 20%, 70% 40%, 20% 70%, 90% 30%; }
    100% { background-position: 60% 40%, 40% 80%, 80% 20%, 10% 50%; }
}

@keyframes meshShift2 {
    0% { opacity: 1; }
    50% { opacity: 0.85; }
    100% { opacity: 1; }
}

@keyframes meshShift3 {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(8deg); }
}

/* ---------- Bubble System ---------- */
#bubble-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bubble {
    position: absolute;
    width: var(--bubble-size, 30px);
    height: var(--bubble-size, 30px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), rgba(107,164,201,0.08) 50%, transparent 70%);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 0 20px rgba(107,164,201,0.05);
    left: var(--bubble-x, 50%);
    bottom: -10%;
    pointer-events: none;
    animation:
        bubbleRise var(--bubble-duration, 25s) linear var(--bubble-delay, 0s) infinite,
        bubbleDrift 9s ease-in-out var(--bubble-delay, 0s) infinite,
        bubbleOpacity 6s ease-in-out var(--bubble-delay, 0s) infinite;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(calc(-100vh - var(--bubble-size, 30px) - 20vh));
    }
}

@keyframes bubbleDrift {
    0%, 100% {
        margin-left: 0;
    }
    25% {
        margin-left: var(--bubble-drift, 40px);
    }
    75% {
        margin-left: calc(var(--bubble-drift, 40px) * -1);
    }
}

@keyframes bubbleOpacity {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

/* ---------- Navigation Toggle ---------- */
#nav-toggle {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 1000;
    background: rgba(220, 232, 245, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 50%;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    padding: 0;
}

#nav-toggle:hover {
    background: rgba(220, 232, 245, 0.15);
    border-color: rgba(212, 181, 160, 0.3);
}

#nav-toggle svg {
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

#nav-toggle.active svg {
    transform: rotate(45deg);
}

.wave-line {
    transition: d 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

#nav-toggle:hover .wave-line-1 {
    d: path("M4,10 Q10,4 16,10 Q22,16 28,10");
}
#nav-toggle:hover .wave-line-2 {
    d: path("M4,16 Q10,11 16,16 Q22,21 28,16");
}
#nav-toggle:hover .wave-line-3 {
    d: path("M4,22 Q10,18 16,22 Q22,26 28,22");
}

/* ---------- Navigation Overlay ---------- */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 900;
    background: rgba(13, 27, 42, 0.4);
    backdrop-filter: blur(40px) brightness(0.7);
    -webkit-backdrop-filter: blur(40px) brightness(0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#nav-overlay.open {
    opacity: 1;
    visibility: visible;
}

#nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.nav-link {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: translateY(20px);
    transition: color 0.3s ease, transform 0.3s ease;
}

#nav-overlay.open .nav-link {
    opacity: 1;
    transform: translateY(0);
}

.nav-link:hover {
    color: #D4B5A0;
}

/* Staggered entrance for nav links */
#nav-overlay.open .nav-link:nth-child(1) { transition-delay: 0.05s; }
#nav-overlay.open .nav-link:nth-child(2) { transition-delay: 0.15s; }
#nav-overlay.open .nav-link:nth-child(3) { transition-delay: 0.25s; }
#nav-overlay.open .nav-link:nth-child(4) { transition-delay: 0.35s; }
#nav-overlay.open .nav-link:nth-child(5) { transition-delay: 0.45s; }
#nav-overlay.open .nav-link:nth-child(6) { transition-delay: 0.55s; }
#nav-overlay.open .nav-link:nth-child(7) { transition-delay: 0.65s; }
#nav-overlay.open .nav-link:nth-child(8) { transition-delay: 0.75s; }

/* Reset transition-delay when closing */
#nav-overlay:not(.open) .nav-link {
    transition-delay: 0s;
}

/* ---------- Main Content ---------- */
#content {
    position: relative;
    z-index: 1;
}

/* ---------- Frost Panels ---------- */
.frost-panel {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(220, 232, 245, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    opacity: 0;
    transition: opacity 0.1s linear;
}

.frost-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08) 30%, rgba(212,181,160,0.06) 50%, rgba(255,255,255,0.08) 70%, transparent);
    pointer-events: none;
}

/* Alternating negative margin for overlap effect */
.frost-panel-even {
    margin-top: -4vh;
}

/* ---------- Panel Content Positioning ---------- */
.panel-content {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 3rem;
}

.panel-content-left {
    padding-right: 50%;
}

.panel-content-right {
    padding-left: 50%;
}

.panel-content-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

/* ---------- Typography ---------- */
.hero-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    color: #1C2A3A;
    letter-spacing: 0.03em;
    line-height: 1.18;
    color: rgba(255, 255, 255, 0.92);
}

.hero-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8E9BAA;
    margin-top: 40px;
}

.hero-flourish {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #D4B5A0, transparent);
    margin-top: 2rem;
    border-radius: 1px;
}

.section-heading {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 400;
    font-size: clamp(1.5rem, 3vw, 2.6rem);
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.03em;
    line-height: 1.18;
    margin-bottom: 1.5rem;
}

.section-body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: #3A4A5C;
    line-height: 1.72;
    letter-spacing: 0.015em;
    max-width: 540px;
}

/* Enhance readability on dark frost panels */
.frost-panel .section-body {
    color: #8E9BAA;
}

/* ---------- Breath Spaces ---------- */
.breath-space {
    height: 20vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.wave-divider {
    width: 100%;
    height: 40px;
    overflow: visible;
}

.wave-divider-path {
    animation: waveDividerShift 8s ease-in-out infinite alternate;
}

@keyframes waveDividerShift {
    0% {
        d: path("M0,20 Q180,5 360,20 Q540,35 720,20 Q900,5 1080,20 Q1260,35 1440,20");
    }
    100% {
        d: path("M0,20 Q180,32 360,20 Q540,8 720,20 Q900,32 1080,20 Q1260,8 1440,20");
    }
}

/* ---------- Card-Flip System ---------- */
.card-flip-wrapper {
    margin-top: 2.5rem;
    position: relative;
    display: inline-block;
}

.card-flip {
    width: 280px;
    height: 180px;
    perspective: 1200px;
    cursor: pointer;
}

.card-front,
.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.card-front {
    background: rgba(220, 232, 245, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 4px 4px 20px rgba(0,0,0,0.1);
    transform: rotateY(0deg);
}

.card-back {
    background: rgba(220, 232, 245, 0.14);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: -4px 4px 20px rgba(0,0,0,0.1);
    transform: rotateY(180deg);
}

.card-flip.flipped .card-front {
    transform: rotateY(180deg);
    box-shadow: -4px 4px 20px rgba(0,0,0,0.1);
}

.card-flip.flipped .card-back {
    transform: rotateY(0deg);
    box-shadow: 4px 4px 20px rgba(0,0,0,0.1);
}

.card-flip:hover .card-front:not(.card-flip.flipped .card-front) {
    border-color: rgba(212, 181, 160, 0.3);
}

.card-wave-icon {
    width: 120px;
    height: 40px;
    margin-bottom: 0.75rem;
}

.card-wave-path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: wavePathDraw 4s linear infinite;
}

@keyframes wavePathDraw {
    0% { stroke-dashoffset: 400; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -400; }
}

.card-label {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8E9BAA;
}

.card-back p {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 300;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    text-align: center;
    letter-spacing: 0.015em;
}

/* ---------- Bubble Clusters ---------- */
.bubble-cluster {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
}

.micro-bubble {
    position: absolute;
    width: var(--mb-size, 6px);
    height: var(--mb-size, 6px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), rgba(107,164,201,0.1) 50%, transparent 70%);
    border: 1px solid rgba(255,255,255,0.15);
    left: var(--mb-x, 0px);
    bottom: 0;
    animation: microBubbleRise var(--mb-duration, 4s) ease-in-out var(--mb-delay, 0s) infinite;
    pointer-events: none;
}

@keyframes microBubbleRise {
    0% {
        transform: translateY(0);
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-70px);
        opacity: 0;
    }
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 3rem;
}

.footer-text {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(0.7rem, 1vw, 0.85rem);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #8E9BAA;
    font-variant-caps: all-small-caps;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .panel-content-left,
    .panel-content-right {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .panel-content {
        padding: 3rem 1.5rem;
    }

    .card-flip {
        width: 240px;
        height: 160px;
    }

    .bubble-cluster {
        right: -20px;
    }

    .nav-link {
        font-size: 1.5rem;
    }

    #nav-links {
        gap: 2rem;
    }

    #nav-toggle {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .section-heading {
        font-size: clamp(1.3rem, 5vw, 2rem);
    }

    .breath-space {
        height: 12vh;
    }
}

@media (max-width: 480px) {
    .panel-content-left,
    .panel-content-right {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    .card-flip {
        width: 220px;
        height: 150px;
    }
}
