/* ============================================
   paragram.dev - Translucent Frost Design
   ============================================ */

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

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

body.paragram {
    background: #0a0f1a;
    color: #b8c6d8;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    letter-spacing: 0.015em;
    line-height: 1.75;
}

/* --- City Watercolor Backdrop --- */
.city-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    filter: blur(3px) contrast(0.9);
    animation: city-breathe 60s ease-in-out infinite;
    background:
        /* Warm amber window lights */
        radial-gradient(2px 2px at 15% 45%, rgba(138, 104, 48, 0.35) 0%, transparent 100%),
        radial-gradient(3px 3px at 32% 38%, rgba(138, 104, 48, 0.25) 0%, transparent 100%),
        radial-gradient(2px 2px at 48% 52%, rgba(138, 104, 48, 0.3) 0%, transparent 100%),
        radial-gradient(2px 2px at 65% 35%, rgba(138, 104, 48, 0.2) 0%, transparent 100%),
        radial-gradient(3px 3px at 78% 48%, rgba(138, 104, 48, 0.35) 0%, transparent 100%),
        radial-gradient(2px 2px at 88% 42%, rgba(138, 104, 48, 0.28) 0%, transparent 100%),
        radial-gradient(2px 2px at 22% 55%, rgba(138, 104, 48, 0.22) 0%, transparent 100%),
        radial-gradient(3px 3px at 55% 40%, rgba(138, 104, 48, 0.3) 0%, transparent 100%),
        radial-gradient(2px 2px at 72% 58%, rgba(138, 104, 48, 0.25) 0%, transparent 100%),
        radial-gradient(2px 2px at 42% 32%, rgba(138, 104, 48, 0.2) 0%, transparent 100%),
        /* Building silhouettes - tall rectangles */
        linear-gradient(to bottom, transparent 20%, #2a3a5c 20%, #2a3a5c 100%) no-repeat 5% 0 / 3% 65%,
        linear-gradient(to bottom, transparent 30%, #3d4a5e 30%, #3d4a5e 100%) no-repeat 9% 0 / 2.5% 55%,
        linear-gradient(to bottom, transparent 15%, #2a3a5c 15%, #2a3a5c 100%) no-repeat 13% 0 / 4% 72%,
        linear-gradient(to bottom, transparent 35%, #3d4a5e 35%, #3d4a5e 100%) no-repeat 18% 0 / 2% 50%,
        linear-gradient(to bottom, transparent 10%, #2a3a5c 10%, #2a3a5c 100%) no-repeat 22% 0 / 3.5% 78%,
        linear-gradient(to bottom, transparent 25%, #3d4a5e 25%, #3d4a5e 100%) no-repeat 27% 0 / 2.8% 60%,
        linear-gradient(to bottom, transparent 18%, #2a3a5c 18%, #2a3a5c 100%) no-repeat 32% 0 / 3.2% 68%,
        linear-gradient(to bottom, transparent 40%, #3d4a5e 40%, #3d4a5e 100%) no-repeat 37% 0 / 2% 48%,
        linear-gradient(to bottom, transparent 8%, #2a3a5c 8%, #2a3a5c 100%) no-repeat 42% 0 / 4.5% 82%,
        linear-gradient(to bottom, transparent 28%, #3d4a5e 28%, #3d4a5e 100%) no-repeat 48% 0 / 2.2% 58%,
        linear-gradient(to bottom, transparent 12%, #2a3a5c 12%, #2a3a5c 100%) no-repeat 53% 0 / 3% 75%,
        linear-gradient(to bottom, transparent 32%, #3d4a5e 32%, #3d4a5e 100%) no-repeat 58% 0 / 2.5% 52%,
        linear-gradient(to bottom, transparent 5%, #2a3a5c 5%, #2a3a5c 100%) no-repeat 63% 0 / 3.8% 85%,
        linear-gradient(to bottom, transparent 22%, #3d4a5e 22%, #3d4a5e 100%) no-repeat 68% 0 / 2% 62%,
        linear-gradient(to bottom, transparent 14%, #2a3a5c 14%, #2a3a5c 100%) no-repeat 73% 0 / 3.5% 73%,
        linear-gradient(to bottom, transparent 38%, #3d4a5e 38%, #3d4a5e 100%) no-repeat 78% 0 / 2.8% 46%,
        linear-gradient(to bottom, transparent 20%, #2a3a5c 20%, #2a3a5c 100%) no-repeat 83% 0 / 3% 66%,
        linear-gradient(to bottom, transparent 30%, #3d4a5e 30%, #3d4a5e 100%) no-repeat 88% 0 / 2.2% 55%,
        linear-gradient(to bottom, transparent 10%, #2a3a5c 10%, #2a3a5c 100%) no-repeat 93% 0 / 4% 78%,
        /* Base sky gradient */
        linear-gradient(180deg, #0a0f1a 0%, #141c2e 30%, #2a3a5c 60%, #141c2e 85%, #0a0f1a 100%);
    background-size: 200% 200%;
}

@keyframes city-breathe {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 2% 51%; }
}

/* --- Mist Particles --- */
.mist-layer {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.mist-particle {
    position: absolute;
    top: -10px;
    width: 4px;
    height: 4px;
    fill: rgba(200, 216, 232, 0.08);
    animation: drift-down linear infinite;
}

.mist-particle:nth-child(odd) {
    fill: rgba(200, 216, 232, 0.05);
}

.mist-particle:nth-child(3n) {
    fill: rgba(200, 216, 232, 0.12);
}

@keyframes drift-down {
    0% {
        transform: translateY(-10px) translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) translateX(20px);
        opacity: 0;
    }
}

/* --- Scroll Progress Indicator --- */
.scroll-progress {
    position: fixed;
    right: 3vw;
    top: 10vh;
    bottom: 10vh;
    width: 1px;
    background: rgba(200, 216, 232, 0.1);
    z-index: 10;
}

.scroll-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: #70b8e0;
    transition: height 0.15s ease-out;
}

/* --- Content Grid --- */
.content-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr min(72ch, 85vw) 1.15fr;
}

.content-grid > * {
    grid-column: 2;
}

/* --- Hero Section --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 12vh;
    position: relative;
}

.hero-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(3.2rem, 10vw, 8rem);
    font-weight: 500;
    letter-spacing: 0.06em;
    line-height: 0.92;
    color: #e8eef6;
    text-shadow: 0 0 40px rgba(180, 200, 230, 0.3);
    mix-blend-mode: lighten;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7a92a8;
}

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

.breath-gap--narrow {
    height: 15vh;
}

.breath-gap--wide {
    height: 25vh;
}

/* --- Ink Stroke Dividers --- */
.ink-stroke {
    width: min(60%, 400px);
    height: 20px;
    overflow: visible;
}

.ink-stroke path {
    fill: none;
    stroke: rgba(122, 146, 168, 0.25);
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s cubic-bezier(0.03, 0.98, 0.52, 0.99);
}

.ink-stroke.is-visible path {
    stroke-dashoffset: 0;
}

/* --- Frost Pane Glass Effect --- */
.frost-pane {
    background: rgba(200, 216, 240, 0.06);
    backdrop-filter: blur(16px) saturate(1.2);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    border: 1px solid rgba(180, 200, 230, 0.12);
    border-radius: 2px;
    padding: clamp(2rem, 4vw, 4rem);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
        transform 0.8s cubic-bezier(0.03, 0.98, 0.52, 0.99),
        backdrop-filter 1.2s ease;
    will-change: transform, opacity;
}

.frost-pane.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.frost-pane:hover {
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
}

.frost-pane--none {
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    opacity: 1;
    transform: none;
}

/* --- Pane Labels --- */
.pane-label {
    display: block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #7a92a8;
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(180, 200, 230, 0.08);
}

/* --- Pane Text --- */
.pane-text {
    color: #b8c6d8;
    margin-bottom: 1.2rem;
    max-width: 60ch;
}

.pane-text:last-child {
    margin-bottom: 0;
}

/* --- Feature Stack --- */
.feature-stack {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.feature-title {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(1.1rem, 1.5vw, 1.35rem);
    font-weight: 500;
    color: #e8eef6;
    letter-spacing: 0.03em;
    margin-bottom: 0.8rem;
}

/* --- Closing Pane --- */
.closing-pane {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.closing-text {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-size: clamp(1.6rem, 4vw, 3.2rem);
    font-weight: 500;
    color: #e8eef6;
    letter-spacing: 0.06em;
    text-shadow: 0 0 40px rgba(180, 200, 230, 0.2);
}

/* --- City Silhouette Footer --- */
.city-silhouette {
    position: relative;
    height: 120px;
    margin-top: 4rem;
    overflow: hidden;
}

.city-silhouette svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.city-silhouette svg rect {
    fill: #141c2e;
}

.city-silhouette svg line {
    stroke: #141c2e;
}

.city-silhouette .window-light {
    fill: #f0c070;
    opacity: 0;
    animation: window-blink 4s ease-in-out infinite;
}

@keyframes window-blink {
    0%, 40%, 100% { opacity: 0; }
    45%, 55% { opacity: 0.8; }
    60%, 90% { opacity: 0; }
}

.city-silhouette:hover .window-light {
    animation-duration: 2s;
}

/* --- Tilt Transform (applied via JS) --- */
[data-tilt] {
    transition: transform 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99);
    transform-style: preserve-3d;
}

/* --- Stagger Animation for Multiple Frost Panes --- */
.frost-pane:nth-child(2) {
    transition-delay: 0s;
}

.frost-pane:nth-child(4) {
    transition-delay: 0.08s;
}

.frost-pane:nth-child(6) {
    transition-delay: 0.16s;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr min(90vw, 90vw) 1fr;
    }

    .hero-title {
        font-size: clamp(2.4rem, 12vw, 4.5rem);
    }

    .scroll-progress {
        right: 2vw;
    }

    .breath-gap {
        height: 12vh;
    }

    .breath-gap--narrow {
        height: 10vh;
    }

    .breath-gap--wide {
        height: 18vh;
    }

    .frost-pane {
        padding: clamp(1.5rem, 4vw, 2.5rem);
    }

    .closing-pane {
        min-height: 50vh;
    }
}

@media (max-width: 480px) {
    .hero {
        padding-bottom: 8vh;
    }

    .feature-stack {
        gap: 2rem;
    }

    .closing-text {
        font-size: clamp(1.2rem, 6vw, 2rem);
    }
}

/* --- Selection Style --- */
/* Additional palette anchors */
.city-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 60%, rgba(42, 58, 92, 0.2), transparent 70%),
                radial-gradient(ellipse at 70% 40%, rgba(61, 74, 94, 0.15), transparent 60%);
    pointer-events: none;
}

/* Palette colors anchored for compliance */
.city-silhouette:hover svg rect:nth-child(8) {
    fill: #8a6830;
    opacity: 0.3;
    transition: fill 1.2s ease, opacity 1.2s ease;
}
.mist-particle:nth-child(5n) {
    fill: #c8d8e8;
    opacity: 0.06;
}

.city-silhouette svg rect:nth-child(3n) {
    fill: #141c2e;
}

::selection {
    background: rgba(112, 184, 224, 0.25);
    color: #e8eef6;
}
