/* ============================================================
   KKAJI.COM - NEOMORPHIC LUXURY NOIR
   Typography anchors: "Playfair Display" (Google Fonts), Playfair's ornamental drama. JetBrains Mono" (Google Fonts) uppercase: an email and a location. Body text at `clamp(0.95rem. Playfair Display 900 at maximum scale (`clamp(4rem. Playfair Display 700i at `clamp(1.5rem. Playfair Display 700 and a one-line descriptor in DM Sans 400 — slides up 8px on hover. Interaction Principles:* Principles: Principles:** Intersection Observer at `threshold: 0.2`. Elements animate in once and stay — no animate-out-on-exit. Intersection Observer calculations.
   ============================================================ */

/* CSS Variables & Color Palette */
:root {
    --void: #050505;
    --surface: #0d0d0d;
    --elevated: #1a1815;
    --accent-primary: #d4af37;
    --accent-secondary: #e8d48b;
    --text-primary: #a0998a;
    --text-secondary: #666058;
    --text-whisper: #5c5647;
    --glow: rgba(212, 175, 55, 0.15);
    --glow-subtle: rgba(212, 175, 55, 0.08);
    --glow-faint: rgba(212, 175, 55, 0.04);
    --shadow-dark: rgba(0, 0, 0, 0.8);

    --font-display: 'Playfair Display', serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-material: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   GLOBAL STYLES
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--void);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            var(--glow-faint) 49px,
            var(--glow-faint) 50px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            var(--glow-faint) 49px,
            var(--glow-faint) 50px
        );
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: clamp(0.95rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    letter-spacing: 0.015em;
    overflow-x: hidden;
}

/* ============================================================
   NAVIGATION BAR
   ============================================================ */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.6s var(--ease-material) 1.5s;
}

body.scrolled .navbar {
    opacity: 1;
}

.navbar-wordmark {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2vw, 2rem);
    font-weight: 900;
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: -0.02em;
}

.navbar-dots {
    display: flex;
    gap: 1.5rem;
}

.navbar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(212, 175, 55, 0.3);
    cursor: pointer;
    transition: all 0.3s var(--ease-material);
}

.navbar-dot:hover {
    background: var(--accent-primary);
    transform: scale(1.2);
}

.navbar-dot.active {
    background: var(--accent-primary);
    box-shadow: 0 0 8px var(--accent-primary);
}

/* ============================================================
   CHAMBERS - FULL VIEWPORT SECTIONS
   ============================================================ */

.chamber {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 2rem 2rem;
}

/* Chamber I - The Threshold */
.chamber-threshold {
    background: var(--void);
    align-items: center;
    padding-top: 2rem;
}

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

.magpie-hero {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 150px;
    margin: 0 auto;
}

.magpie-constellation {
    position: relative;
    width: 100%;
    height: 100%;
}

.magpie-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0;
    animation: magpie-appear 0.4s ease-out forwards;
    animation-delay: calc(var(--delay) * 150ms);
}

/* Magpie constellation pattern - 7 dots in flight formation */
.magpie-hero .magpie-dot:nth-child(1) { top: 20%; left: 30%; }
.magpie-hero .magpie-dot:nth-child(2) { top: 10%; left: 50%; }
.magpie-hero .magpie-dot:nth-child(3) { top: 25%; left: 70%; }
.magpie-hero .magpie-dot:nth-child(4) { top: 40%; left: 40%; }
.magpie-hero .magpie-dot:nth-child(5) { top: 50%; left: 60%; }
.magpie-hero .magpie-dot:nth-child(6) { top: 70%; left: 35%; }
.magpie-hero .magpie-dot:nth-child(7) { top: 80%; left: 65%; }

.magpie-footer {
    position: relative;
    width: 200px;
    height: 100px;
    margin: 2rem auto 0;
}

.magpie-footer .magpie-dot:nth-child(1) { top: 20%; left: 70%; }
.magpie-footer .magpie-dot:nth-child(2) { top: 10%; left: 50%; }
.magpie-footer .magpie-dot:nth-child(3) { top: 25%; left: 30%; }
.magpie-footer .magpie-dot:nth-child(4) { top: 40%; left: 60%; }
.magpie-footer .magpie-dot:nth-child(5) { top: 50%; left: 40%; }
.magpie-footer .magpie-dot:nth-child(6) { top: 70%; left: 65%; }
.magpie-footer .magpie-dot:nth-child(7) { top: 80%; left: 35%; }

@keyframes magpie-appear {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.threshold-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 12vw, 9rem);
    font-weight: 900;
    color: var(--accent-primary);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin: 2rem 0;
    opacity: 0;
    animation: title-fade-in 0.8s ease-out forwards;
    animation-delay: 1.5s;
}

.threshold-subtitle {
    font-family: var(--font-body);
    font-weight: 300;
    font-size: clamp(0.95rem, 1.5vw, 1.25rem);
    color: var(--text-primary);
    letter-spacing: 0.015em;
    opacity: 0;
    animation: title-fade-in 0.8s ease-out forwards;
    animation-delay: 2.3s;
}

@keyframes title-fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.threshold-chevron {
    position: fixed;
    bottom: 2.5rem;
    left: calc(50% - 1px);
    width: 2px;
    height: 64px;
    background: linear-gradient(to bottom, transparent, var(--accent-primary), transparent);
    opacity: 0;
    animation: chevron-pulse 1s ease-in-out 3s infinite forwards;
}

.threshold-chevron::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 18px;
    height: 18px;
    border-right: 1px solid var(--accent-primary);
    border-bottom: 1px solid var(--accent-primary);
    transform: translateX(-50%) rotate(45deg);
}

.chevron-pulse {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-primary), transparent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes chevron-pulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

/* ============================================================
   THRESHOLD SEPARATORS
   ============================================================ */

.threshold-separator {
    width: 100%;
    height: 4px;
    background: #050505;
    position: relative;
    box-shadow: 0 0 28px rgba(212, 175, 55, 0.18);
}

.ripple-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ripple-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    stroke: #5c5647;
    animation: ripple-dash 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards, ripple-gold 1.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ripple-dash {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes ripple-gold {
    0% { stroke: #5c5647; }
    60%, 100% { stroke: #d4af37; }
}

/* ============================================================
   CHAMBER II - THE COLLECTION
   ============================================================ */

.chamber-collection {
    min-height: 200vh;
    padding: 12vh 2rem 14vh;
    background: var(--void);
    display: block;
}

.collection-heading {
    width: min(1400px, 100%);
    margin: 0 auto clamp(2rem, 6vw, 5rem);
    position: relative;
    z-index: 10;
}

.mono-kicker,
.card-meta {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--text-whisper);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.collection-heading h2 {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 7.5rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #d4af37;
    max-width: 950px;
    margin-top: 0.35em;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.portfolio-grid {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: clamp(16px, 3vw, 48px);
    z-index: 10;
}

/* ============================================================
   PORTFOLIO CARDS
   ============================================================ */

.portfolio-card {
    position: relative;
    background: var(--surface);
    border: 1px solid rgba(212, 175, 55, 0);
    border-radius: 24px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    min-height: 240px;

    /* Neomorphic double shadow */
    box-shadow:
        8px 8px 24px var(--shadow-dark),
        inset 2px 2px 6px var(--glow-subtle);

    /* Ripple reveal animation */
    opacity: 0;
    transform: scale(0.95) translateY(22px);

    cursor: pointer;
    transition: all 0.4s var(--ease-material);
    overflow: hidden;
}

.portfolio-card::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.14) 0%, rgba(232, 212, 139, 0.05) 35%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
}

.portfolio-card.revealed {
    animation: card-ripple-reveal 0.8s var(--ease-out) forwards;
}

.portfolio-card.revealed::before,
.portfolio-card.rippling::before {
    animation: card-ripple-bloom 0.8s var(--ease-out) forwards;
}

@keyframes card-ripple-reveal {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(22px);
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes card-ripple-bloom {
    0% { width: 0; height: 0; opacity: 0.8; }
    72% { opacity: 0.35; }
    100% { width: 160%; height: 160%; opacity: 0; }
}

.portfolio-card:nth-child(1) {
    animation-delay: 0.2s;
}

.portfolio-card:nth-child(2) {
    animation-delay: 0.4s;
}

.portfolio-card:nth-child(3) {
    animation-delay: 0.6s;
}

.portfolio-card:nth-child(4) {
    animation-delay: 0.8s;
}

.portfolio-card:nth-child(5) {
    animation-delay: 1s;
}

.portfolio-card:nth-child(6) {
    animation-delay: 1.2s;
}

.portfolio-card:nth-child(7) {
    animation-delay: 1.4s;
}

.portfolio-card:nth-child(8) {
    animation-delay: 1.6s;
}

.portfolio-card:nth-child(9) {
    animation-delay: 1.8s;
}

.portfolio-card:hover {
    box-shadow:
        12px 12px 36px rgba(0, 0, 0, 0.9),
        inset 2px 2px 8px rgba(212, 175, 55, 0.15),
        0 0 1px 1px rgba(212, 175, 55, 0.3);
    background: var(--elevated);
    border-color: rgba(212, 175, 55, 0.3);
    transform: translateY(-4px) scale(0.995);
}

.portfolio-card:hover .card-title {
    transform: translateY(-8px);
}

.portfolio-card:hover .card-descriptor {
    opacity: 1;
    transform: translateY(-4px);
}

.card-inner {
    position: relative;
    z-index: 2;
    flex: 1;
}

.card-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    margin-top: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.1;
    transition: transform 0.4s var(--ease-material);
}

.card-meta {
    opacity: 0.68;
}

.card-descriptor {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    opacity: 0.7;
    transition: all 0.4s var(--ease-material);
}

.card-constellation {
    position: absolute;
    top: 1.15rem;
    right: 1.35rem;
    width: 70px;
    height: 42px;
    opacity: 0.45;
}

.card-constellation span {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
}

.card-constellation span:nth-child(1) { top: 4px; left: 6px; }
.card-constellation span:nth-child(2) { top: 0; left: 28px; }
.card-constellation span:nth-child(3) { top: 8px; left: 52px; }
.card-constellation span:nth-child(4) { top: 20px; left: 18px; }
.card-constellation span:nth-child(5) { top: 24px; left: 40px; }
.card-constellation span:nth-child(6) { top: 34px; left: 8px; }
.card-constellation span:nth-child(7) { top: 36px; left: 58px; }

/* ============================================================
   GOLD CHEVRON FRAGMENTS
   ============================================================ */

.gold-chevron {
    position: absolute;
    width: 60px;
    height: 2px;
    background: var(--accent-primary);
    opacity: 0.25;
    transform: skewX(-25deg);
    animation: chevron-pulse-anim 4s ease-in-out infinite;
    animation-delay: calc(var(--position) * 200ms);
}

.portfolio-card .gold-chevron:nth-of-type(1) {
    top: 15%;
    right: 10%;
}

.portfolio-card .gold-chevron:nth-of-type(2) {
    top: 50%;
    right: 15%;
}

.portfolio-card .gold-chevron:nth-of-type(3) {
    bottom: 20%;
    right: 8%;
}

@keyframes chevron-pulse-anim {
    0%, 100% {
        opacity: 0.15;
    }
    50% {
        opacity: 0.35;
    }
}

/* ============================================================
   NEOMORPHIC ORBS
   ============================================================ */

.neomorphic-orb {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, var(--surface), var(--void));
    box-shadow:
        inset -10px -10px 30px rgba(0, 0, 0, 0.5),
        inset 5px 5px 15px rgba(212, 175, 55, 0.05);
    opacity: 0.3;
    z-index: 1;
}

.orb-1 {
    width: 300px;
    height: 300px;
    top: 10%;
    left: -50px;
}

.orb-2 {
    width: 250px;
    height: 250px;
    bottom: 5%;
    right: -80px;
}

/* ============================================================
   CHAMBER III - THE SIGNAL
   ============================================================ */

.chamber-signal {
    background: var(--void);
    padding: 12vh 2rem 4rem;
    align-items: flex-start;
}

.signal-content {
    max-width: 700px;
    text-align: center;
}

.signal-statement {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 700;
    font-style: italic;
    color: var(--accent-primary);
    line-height: 1.8;
    letter-spacing: -0.01em;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fade-in 0.8s ease-out forwards;
}

.signal-accent {
    font-style: italic;
    font-size: 120%;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.signal-footer {
    margin-top: 3rem;
}

.signal-contact {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-whisper);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.signal-email {
    opacity: 0;
    animation: fade-in 0.8s ease-out 0.2s forwards;
}

.signal-separator {
    color: var(--accent-primary);
    opacity: 0;
    animation: fade-in 0.8s ease-out 0.4s forwards;
}

.signal-location {
    opacity: 0;
    animation: fade-in 0.8s ease-out 0.6s forwards;
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .portfolio-card {
        grid-column: span 3 !important;
        grid-row: span 2 !important;
    }

    .hero-card {
        grid-column: 1 / 7 !important;
        grid-row: 1 / 3 !important;
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .portfolio-card {
        grid-column: 1 !important;
        grid-row: auto !important;
    }

    .navbar {
        padding: 1rem;
    }

    .navbar-wordmark {
        font-size: 1.25rem;
    }

    .navbar-dots {
        gap: 1rem;
    }

    .threshold-title {
        font-size: clamp(2rem, 10vw, 4rem);
    }

    .neomorphic-orb {
        display: none;
    }
}

/* ============================================================
   REDUCED MOTION SUPPORT
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   SCROLL STATE
   ============================================================ */

body {
    transition: all 0.3s ease-out;
}
