/* ======================================================
   bada.cafe - Styles
   Palette: Muted Nebula
   Fonts: Caveat, Cormorant Garamond, Inter
   ====================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: #1C1926;
    color: #D8D0E4;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    line-height: 1.65;
    overflow-x: hidden;
}

/* ---------- Background Gradient (fixed) ---------- */
.bg-gradient {
    position: fixed;
    inset: 0;
    z-index: -3;
    background: linear-gradient(to bottom, #1C1926 0%, #0E0B14 100%);
}

/* ---------- Scan-line Overlay ---------- */
.scanlines {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(138, 127, 163, 0.03) 1px,
        rgba(138, 127, 163, 0.03) 2px
    );
}

/* ---------- Tessellation Layer ---------- */
.tessellation-layer {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.tessellation-svg {
    width: 200%;
    height: 200%;
    animation: tessellationDrift 30s linear infinite;
}

@keyframes tessellationDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-0.5%); }
}

/* ---------- Navigation ---------- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(28, 25, 38, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(138, 127, 163, 0.1);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.6rem;
    color: #D8D0E4;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-menu-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.menu-line {
    display: block;
    width: 24px;
    height: 1px;
    background: #8A7FA3;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}

.nav-menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* Navigation Overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(28, 25, 38, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nav-overlay-inner {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
}

.nav-link {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #D8D0E4;
    text-decoration: none;
    transition: color 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.nav-overlay.active .nav-link {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

.nav-overlay.active .nav-link:nth-child(1) { transition-delay: 0.1s; }
.nav-overlay.active .nav-link:nth-child(2) { transition-delay: 0.2s; }
.nav-overlay.active .nav-link:nth-child(3) { transition-delay: 0.3s; }
.nav-overlay.active .nav-link:nth-child(4) { transition-delay: 0.4s; }

.nav-link:hover {
    color: #9E7B8A;
}

/* ---------- THE THRESHOLD ---------- */
.threshold {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

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

.site-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5.5rem);
    color: #D8D0E4;
    line-height: 1.2;
    margin-bottom: 2rem;
}

.title-letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(60px) scale(0.92);
}

.title-letter.animate {
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--delay) * 80ms);
}

.threshold-line {
    width: 0;
    height: 1px;
    background: #8A7FA3;
    margin: 0 auto 1.5rem;
    transition: width 1.2s ease;
}

.threshold-line.animate {
    width: min(320px, 60vw);
}

.threshold-tagline {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7B6F8E;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.threshold-tagline.animate {
    opacity: 1;
}

/* Wireframe decorations */
.wireframe-decor {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.wireframe-threshold {
    right: 8%;
    bottom: 15%;
    width: 120px;
    height: 120px;
}

.wireframe-polyhedron {
    width: 100%;
    height: 100%;
    animation: rotatePolyhedron 12s linear infinite;
}

@keyframes rotatePolyhedron {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.wireframe-icosa {
    animation-duration: 15s;
}

.wireframe-octa {
    animation-duration: 10s;
    animation-direction: reverse;
}

/* ---------- BOUNCE ENTER ANIMATION ---------- */
@keyframes bounceEnter {
    0% { opacity: 0; transform: translateY(60px) scale(0.92); }
    60% { opacity: 1; transform: translateY(-8px) scale(1.02); }
    80% { transform: translateY(3px) scale(0.99); }
    100% { transform: translateY(0) scale(1); }
}

.bounce-target {
    opacity: 0;
    transform: translateY(60px) scale(0.92);
}

.bounce-target.revealed {
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ---------- THE GRID FIELD ---------- */
.grid-field {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 8rem;
}

.grid-row {
    display: grid;
    gap: 4rem;
    margin-bottom: 4rem;
}

.grid-row-1 {
    grid-template-columns: 2fr 1fr;
}

.grid-row-2 {
    grid-template-columns: 2fr 1fr;
}

.grid-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

/* ---------- CARDS ---------- */
.card {
    position: relative;
    background: #252131;
    border: 1px solid rgba(138, 127, 163, 0.15);
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(14, 11, 20, 0.6);
    padding: 2.4rem;
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
}

.card:hover {
    border-color: rgba(158, 123, 138, 0.35);
    box-shadow: 0 12px 48px rgba(14, 11, 20, 0.8);
}

.card-tall {
    min-height: 480px;
    display: flex;
    flex-direction: column;
}

.card-tall .card-body {
    flex: 1;
}

/* Reticle corner markers */
.card-reticle {
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
    animation: reticlePulse 4s ease-in-out infinite;
}

.card-reticle::before,
.card-reticle::after {
    content: '';
    position: absolute;
    background: #8A7FA3;
}

.card-reticle::before {
    width: 1px;
    height: 100%;
    left: 50%;
}

.card-reticle::after {
    width: 100%;
    height: 1px;
    top: 50%;
}

/* Gap in center of reticle */
.card-reticle-tl { top: -4px; left: -4px; }
.card-reticle-tr { top: -4px; right: -4px; }
.card-reticle-bl { bottom: -4px; left: -4px; }
.card-reticle-br { bottom: -4px; right: -4px; }

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

/* Data readout strips */
.data-readout-strip {
    width: 100%;
    height: 2px;
    overflow: hidden;
    position: relative;
    margin-bottom: 1.5rem;
    background: rgba(123, 111, 142, 0.1);
}

.readout-text {
    position: absolute;
    top: -6px;
    left: 0;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.6rem;
    color: #7B6F8E;
    letter-spacing: 0.1em;
    animation: dataScroll 20s linear infinite;
}

@keyframes dataScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Card typography */
.card-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    color: #D8D0E4;
    line-height: 1.2;
    margin-bottom: 1.2rem;
}

.bracket-left,
.bracket-right {
    color: #5A8A8F;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.75em;
    vertical-align: middle;
}

.card-body {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 1.65;
    color: #D8D0E4;
    letter-spacing: 0.02em;
    margin-bottom: 1.5rem;
}

.card-meta {
    margin-top: auto;
}

.meta-label {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7B6F8E;
}

/* Orbital ring diagrams */
.orbital-diagram {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.orbital-svg {
    width: 120px;
    height: 120px;
}

.orbital-large .orbital-svg {
    width: 180px;
    height: 180px;
}

.orbital-ring {
    transform-origin: center;
}

.ring-1 { animation: orbitSpin 12s linear infinite; }
.ring-2 { animation: orbitSpin 9s linear infinite reverse; }
.ring-3 { animation: orbitSpin 7s linear infinite; }
.ring-4 { animation: orbitSpin 15s linear infinite reverse; }
.ring-5 { animation: orbitSpin 20s linear infinite; }

@keyframes orbitSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Wireframe decorations in the grid */
.wireframe-grid-right {
    position: absolute;
    right: -60px;
    top: 30%;
    width: 100px;
    height: 100px;
}

.wireframe-grid-left {
    position: absolute;
    left: -50px;
    top: 65%;
    width: 80px;
    height: 80px;
}

/* ---------- THE DEEP FIELD ---------- */
.deep-field {
    position: relative;
    max-width: 48rem;
    margin: 0 auto;
    padding: 4rem 2rem 8rem;
}

.deep-field-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    /* Dusty Rose radial glow */
    background: radial-gradient(ellipse at center, #8A6070 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 1s ease;
    z-index: -1;
}

.deep-field-glow.visible {
    opacity: 0.08;
}

.card-deep {
    max-width: 48rem;
    margin: 0 auto 8rem;
}

.card-deep:last-child {
    margin-bottom: 0;
}

/* ---------- TERMINUS ---------- */
.terminus {
    padding: 8rem 2rem 6rem;
    text-align: center;
}

.terminus-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #7B6F8E;
    margin-bottom: 2rem;
}

.terminus-line {
    width: 60px;
    height: 1px;
    background: #8A7FA3;
    margin: 0 auto 2rem;
    opacity: 0.4;
}

.terminus-coord {
    font-family: 'Caveat', cursive;
    font-weight: 400;
    font-size: 1.4rem;
    color: #7B6F8E;
}

.champagne-highlight {
    color: #C4AE8B;
}

/* ---------- Utility / Palette Reference ---------- */
/* #FFFFFF available for rare high-contrast moments */
.text-white {
    color: #FFFFFF;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .grid-row-1,
    .grid-row-2,
    .grid-row-3 {
        grid-template-columns: 1fr;
    }

    .grid-field {
        padding: 2rem 1.5rem 6rem;
    }

    .card {
        padding: 2rem;
    }

    .card-tall {
        min-height: auto;
    }

    .wireframe-grid-right,
    .wireframe-grid-left {
        display: none;
    }

    .wireframe-threshold {
        right: 4%;
        width: 80px;
        height: 80px;
    }

    .nav-inner {
        padding: 1rem 1.5rem;
    }

    .deep-field {
        padding: 2rem 1.5rem 6rem;
    }

    .card-deep {
        margin-bottom: 6rem;
    }
}

@media (max-width: 600px) {
    .grid-row {
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .threshold {
        padding: 2rem 1rem;
    }

    .deep-field {
        padding: 2rem 1rem 4rem;
    }

    .terminus {
        padding: 6rem 1rem 4rem;
    }
}
