/* ============================================================
   20241204.com - McBling meets Coastal
   ============================================================ */

/* --- CSS Custom Properties (Palette from DESIGN.md) --- */
:root {
    --color-primary: #2D7D9A;
    --color-sand: #E8D5B7;
    --color-coral: #E8857A;
    --color-teal: #5FB8A6;
    --color-pink: #D4A5C9;
    --color-dark: #1B3A4B;
    --color-light: #F7F3EE;
    --color-shimmer: #F0E1C8;

    --font-heading: 'Nunito', sans-serif;
    --font-accent: 'Quicksand', sans-serif;
    --font-body: 'Nunito Sans', sans-serif;
    --font-decorative: 'Playfair Display', serif;
    --font-script: 'Sacramento', cursive;

    --radius-card: 16px;
    --radius-button: 24px;
    --radius-input: 12px;
    --shadow-card: 0 8px 32px rgba(45, 80, 120, 0.12);
    --shadow-card-hover: 0 12px 40px rgba(45, 80, 120, 0.18);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.7;
    color: var(--color-dark);
    background-color: var(--color-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Sparkle Canvas --- */
#sparkleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* --- Navigation Bar --- */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(180deg, rgba(247, 243, 238, 0.85), rgba(247, 243, 238, 0.6));
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    border-bottom: 1px solid rgba(232, 213, 183, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.nav-bar.scrolled {
    box-shadow: 0 2px 20px rgba(27, 58, 75, 0.08);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--color-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color 0.3s ease;
}

.nav-logo:hover {
    color: var(--color-coral);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link {
    position: relative;
    text-decoration: none;
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-dark);
    padding-bottom: 4px;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-link .link-underline {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 8px;
    overflow: visible;
    color: var(--color-teal);
}

.nav-link .link-underline path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 0.4s ease;
}

.nav-link:hover .link-underline path {
    stroke-dashoffset: 0;
}

/* --- Hero Section --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, var(--color-shimmer) 0%, var(--color-sand) 40%, var(--color-light) 100%);
}

.hero-gradient-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(45, 125, 154, 0.65), rgba(212, 165, 201, 0.45));
    z-index: 1;
}

.hero-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
    padding: 0 32px;
}

.hero-headline {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: var(--color-light);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 24px;
    text-shadow: 0 2px 20px rgba(27, 58, 75, 0.3);
}

.hero-headline .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.hero-headline .char.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-headline .char-space {
    display: inline-block;
    width: 0.3em;
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.35rem);
    color: rgba(247, 243, 238, 0.9);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.8s ease 1.5s, transform 0.8s ease 1.5s;
}

.hero-subtitle.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Gradient Orbs --- */
.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: orbDrift 15s ease-in-out infinite;
}

.orb-1 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(212, 165, 201, 0.4), transparent 70%);
    top: 10%;
    left: -5%;
    z-index: 0;
    animation-delay: 0s;
}

.orb-2 {
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(95, 184, 166, 0.35), transparent 70%);
    top: 60%;
    right: -3%;
    z-index: 0;
    animation-delay: -5s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(232, 133, 122, 0.3), transparent 70%);
    bottom: 15%;
    left: 20%;
    z-index: 0;
    animation-delay: -10s;
}

.orb-4 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(212, 165, 201, 0.3), transparent 70%);
    top: -10%;
    right: 10%;
    z-index: 0;
}

.orb-5 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(95, 184, 166, 0.25), transparent 70%);
    bottom: -5%;
    left: 5%;
    z-index: 0;
    animation-delay: -7s;
}

@keyframes orbDrift {
    0%, 100% {
        transform: translate(0, 0);
    }
    25% {
        transform: translate(15px, -20px);
    }
    50% {
        transform: translate(-10px, 15px);
    }
    75% {
        transform: translate(20px, 10px);
    }
}

/* --- Diamond Sparkle Marks --- */
.diamond-sparkle {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--color-pink);
    transform: rotate(45deg);
    opacity: 0.7;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.diamond-sparkle:hover {
    transform: rotate(45deg) scale(1.4);
    opacity: 1;
}

.hero-diamond-1 {
    position: absolute;
    top: 15%;
    left: 12%;
    width: 10px;
    height: 10px;
    background: var(--color-shimmer);
    z-index: 3;
    animation: sparkleFloat 4s ease-in-out infinite;
}

.hero-diamond-2 {
    position: absolute;
    top: 25%;
    right: 18%;
    width: 6px;
    height: 6px;
    background: var(--color-pink);
    z-index: 3;
    animation: sparkleFloat 5s ease-in-out infinite 1s;
}

.hero-diamond-3 {
    position: absolute;
    bottom: 30%;
    left: 8%;
    width: 8px;
    height: 8px;
    background: var(--color-coral);
    z-index: 3;
    animation: sparkleFloat 3.5s ease-in-out infinite 0.5s;
}

.hero-diamond-4 {
    position: absolute;
    top: 40%;
    right: 8%;
    width: 7px;
    height: 7px;
    background: var(--color-shimmer);
    z-index: 3;
    animation: sparkleFloat 4.5s ease-in-out infinite 2s;
}

.hero-diamond-5 {
    position: absolute;
    bottom: 20%;
    right: 25%;
    width: 9px;
    height: 9px;
    background: var(--color-teal);
    z-index: 3;
    animation: sparkleFloat 5.5s ease-in-out infinite 1.5s;
}

@keyframes sparkleFloat {
    0%, 100% {
        transform: rotate(45deg) translate(0, 0) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: rotate(45deg) translate(5px, -8px) scale(1.3);
        opacity: 1;
    }
}

.heading-diamond {
    width: 8px;
    height: 8px;
    vertical-align: middle;
    margin: 0 12px;
    background: var(--color-coral);
}

.pano-diamond-1 {
    position: absolute;
    top: 20%;
    left: 15%;
    width: 8px;
    height: 8px;
    background: var(--color-shimmer);
    z-index: 3;
    animation: sparkleFloat 4s ease-in-out infinite;
}

.pano-diamond-2 {
    position: absolute;
    bottom: 25%;
    right: 20%;
    width: 6px;
    height: 6px;
    background: var(--color-pink);
    z-index: 3;
    animation: sparkleFloat 5s ease-in-out infinite 1.5s;
}

.pano-diamond-3 {
    position: absolute;
    top: 50%;
    right: 10%;
    width: 10px;
    height: 10px;
    background: var(--color-coral);
    z-index: 3;
    animation: sparkleFloat 3.5s ease-in-out infinite 0.8s;
}

/* --- Wave Dividers --- */
.wave-divider {
    position: relative;
    width: 100%;
    line-height: 0;
    margin-top: -1px;
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: 60px;
}

.wave-divider-1 {
    background: transparent;
}

.wave-divider-2 {
    background: transparent;
}

.wave-divider-3 {
    background: var(--color-dark);
}

.wave-divider-4 {
    background: var(--color-light);
}

/* --- Animated SVG Curves --- */
.flowing-curve {
    position: absolute;
    width: 100%;
    pointer-events: none;
    opacity: 0.2;
}

.flowing-curve path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: flowDraw 8s linear infinite;
}

@keyframes flowDraw {
    0% {
        stroke-dashoffset: 1000;
    }
    50% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -1000;
    }
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    color: var(--color-primary);
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

/* --- Dot Grid Background --- */
.section-dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(45, 125, 154, 0.06) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

/* --- Portfolio Section --- */
.portfolio-section {
    position: relative;
    padding: 80px 24px;
    background-color: var(--color-sand);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* --- Grid Cards --- */
.grid-card {
    position: relative;
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    min-height: 320px;
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}

.grid-card.featured {
    grid-column: span 2;
    min-height: 400px;
}

.grid-card:not(.sparkle-card):hover {
    box-shadow: var(--shadow-card-hover);
}

/* Vintage Photo Treatment */
.grid-card.vintage-photo {
    cursor: pointer;
}

.grid-card .card-image {
    position: absolute;
    inset: 0;
    filter: sepia(15%) saturate(85%) contrast(95%) brightness(105%);
    transition: transform 0.6s ease;
}

.grid-card:hover .card-image {
    transform: scale(1.03);
}

.grid-card .card-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 1;
}

.grid-card .card-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(27, 58, 75, 0.15) 100%);
    pointer-events: none;
    z-index: 2;
}

.grid-card .card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(to top, rgba(27, 58, 75, 0.7) 0%, transparent 100%);
    z-index: 3;
}

.grid-card .card-content h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-light);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.grid-card .card-content p {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(247, 243, 238, 0.85);
}

/* --- Sparkle Cards --- */
.sparkle-card {
    background: linear-gradient(160deg, #D4A5C9, #E8857A);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    min-height: 280px;
}

.sparkle-card blockquote {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 1.15rem;
    color: var(--color-light);
    line-height: 1.6;
    max-width: 280px;
    border: none;
    margin: 0;
    padding: 0;
}

.sparkle-card .quote-mark {
    font-family: var(--font-decorative);
    font-size: 3rem;
    line-height: 0.5;
    display: block;
    margin-bottom: 12px;
    color: rgba(247, 243, 238, 0.5);
}

.sparkle-card-diamonds {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.sparkle-card-diamonds .diamond-sparkle {
    width: 6px;
    height: 6px;
    background: rgba(247, 243, 238, 0.6);
}

/* --- Panoramic Interstitial --- */
.panoramic {
    position: relative;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--color-dark);
}

.panoramic-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(45, 125, 154, 0.5), rgba(27, 58, 75, 0.8)), linear-gradient(45deg, var(--color-dark), #2D7D9A);
    background-attachment: fixed;
    background-size: cover;
}

.panoramic-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 1;
}

.panoramic-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(45, 125, 154, 0.3), rgba(212, 165, 201, 0.2));
    z-index: 1;
}

.panoramic-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 700px;
    padding: 60px 32px;
}

.panoramic-heading {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--color-light);
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 2px 30px rgba(27, 58, 75, 0.4);
}

.panoramic-text {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(247, 243, 238, 0.8);
    line-height: 1.7;
}

/* --- About Section --- */
.about-section {
    position: relative;
    padding: 100px 32px;
    background-color: var(--color-light);
    overflow: hidden;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 60px;
    max-width: 1100px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.about-image-frame {
    flex-shrink: 0;
}

.circular-frame {
    position: relative;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--color-coral);
    box-shadow: 0 8px 40px rgba(232, 133, 122, 0.2);
}

.about-image {
    width: 100%;
    height: 100%;
    filter: sepia(15%) saturate(85%) contrast(95%) brightness(105%);
}

.circular-frame .card-grain {
    border-radius: 50%;
}

.about-text {
    flex: 1;
}

.about-text .section-heading {
    text-align: left;
    justify-content: flex-start;
    margin-bottom: 24px;
}

.about-text p {
    font-family: var(--font-body);
    font-size: 1.05rem;
    color: var(--color-dark);
    margin-bottom: 16px;
    line-height: 1.7;
}

.drop-cap {
    font-family: var(--font-decorative);
    font-size: 3.5rem;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 6px;
    color: var(--color-primary);
}

/* --- Journal Section --- */
.journal-section {
    position: relative;
    padding: 80px 32px;
    background-color: var(--color-sand);
}

.journal-entries {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.journal-entry {
    background: var(--color-light);
    border-radius: var(--radius-card);
    padding: 36px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-card);
    border-left: 4px solid var(--color-teal);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.journal-entry:hover {
    box-shadow: var(--shadow-card-hover);
    transform: translateY(-2px);
}

.journal-date {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--color-coral);
    text-transform: lowercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 8px;
}

.journal-entry h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--color-primary);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.journal-entry p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-dark);
    line-height: 1.7;
}

.journal-signature {
    text-align: center;
    margin-top: 48px;
    position: relative;
    z-index: 1;
}

.signature-text {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 16px;
}

/* --- Footer --- */
.site-footer {
    position: relative;
    background-color: var(--color-dark);
    padding: 60px 32px 40px;
}

.footer-wave {
    position: absolute;
    top: -59px;
    left: 0;
    right: 0;
    line-height: 0;
}

.footer-wave svg {
    display: block;
    width: 100%;
    height: 60px;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.footer-link {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(247, 243, 238, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--color-coral);
}

.footer-dot {
    color: var(--color-pink);
    font-size: 0.6rem;
    opacity: 0.5;
}

.footer-tagline {
    font-family: var(--font-accent);
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(247, 243, 238, 0.4);
    margin-bottom: 12px;
}

.footer-copyright {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: rgba(247, 243, 238, 0.25);
}

/* --- Scroll Reveal Animation --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Sparkle Particle (spawned by JS) --- */
.sparkle-particle {
    position: fixed;
    width: 8px;
    height: 8px;
    pointer-events: none;
    z-index: 9998;
    transform: rotate(45deg);
    animation: sparkleParticleFade 800ms ease-out forwards;
}

@keyframes sparkleParticleFade {
    0% {
        opacity: 1;
        transform: rotate(45deg) scale(1) translate(0, 0);
    }
    100% {
        opacity: 0;
        transform: rotate(45deg) scale(0.3) translate(var(--drift-x, 20px), var(--drift-y, -30px));
    }
}

/* --- Card Tilt (3D perspective set by JS) --- */
[data-tilt] {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

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

    .grid-card.featured {
        grid-column: span 2;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }

    .about-text .section-heading {
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-links {
        gap: 20px;
    }

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

    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .grid-card.featured {
        grid-column: span 1;
    }

    .hero-content {
        padding: 0 20px;
    }

    .about-content {
        gap: 40px;
    }

    .circular-frame {
        width: 200px;
        height: 200px;
    }

    .panoramic-bg {
        background-attachment: scroll;
    }
}

@media (max-width: 480px) {
    .nav-inner {
        padding: 12px 16px;
    }

    .nav-links {
        gap: 14px;
    }

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

    .portfolio-section,
    .journal-section {
        padding: 60px 16px;
    }

    .about-section {
        padding: 60px 16px;
    }

    .journal-entry {
        padding: 24px;
    }
}
