/* ============================================================
   SSETTL.com - Monochrome Grain & Hexagonal Honeycomb
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-black: #0d0d0d;
    --near-black: #1a1a1a;
    --dark-grey: #333333;
    --mid-grey: #666666;
    --light-mid-grey: #999999;
    --silver: #b0b0b0;
    --near-white: #e8e8e8;
    --off-white: #f5f5f5;

    --grain-opacity: 0.06;
    --hex-border-color: #4a4a4a;
    --cell-gap: 2px;
    --curve-stroke-width: 2px;

    --font-heading: 'Bebas Neue', sans-serif;
    --font-subheading: 'Barlow Condensed', sans-serif;
    --font-body: 'IBM Plex Mono', monospace;
}

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
    background-color: var(--deep-black);
}

body {
    font-family: var(--font-body);
    background-color: var(--deep-black);
    color: var(--light-mid-grey);
    overflow-x: hidden;
    line-height: 1.75;
    font-size: 0.95rem;
    cursor: default;
}

/* --- Film Grain Overlay --- */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 9999;
    pointer-events: none;
    opacity: var(--grain-opacity);
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    animation: grain-flicker 0.72s steps(6) infinite;
    will-change: transform;
}

@keyframes grain-flicker {
    0%   { transform: translate(0, 0); }
    16%  { transform: translate(-2px, 1px); }
    33%  { transform: translate(1px, -2px); }
    50%  { transform: translate(-1px, -1px); }
    66%  { transform: translate(2px, 2px); }
    83%  { transform: translate(-2px, -2px); }
    100% { transform: translate(0, 0); }
}

/* --- Hexagonal Clip Path Utility --- */
.hex {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

/* --- Viewport Sections --- */
.viewport-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
    overflow: hidden;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
#main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 40px;
    background: transparent;
    transition: background 0.3s ease;
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--near-white);
}

#nav-hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 28px;
    height: 2px;
    background-color: var(--near-white);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#nav-hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

#nav-hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Navigation Overlay --- */
#nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 13, 13, 0.95);
    z-index: 999;
    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: all;
}

.nav-honeycomb {
    display: grid;
    grid-template-columns: repeat(2, 160px);
    grid-template-rows: repeat(3, 140px);
    gap: 8px;
    justify-content: center;
    align-content: center;
}

.nav-hex-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--near-black);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    width: 160px;
    height: 140px;
}

.nav-hex-cell span {
    font-family: var(--font-subheading);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--silver);
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-hex-cell:hover {
    background: var(--dark-grey);
    transform: translateY(-2px);
}

.nav-hex-cell:hover span {
    color: var(--off-white);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
#hero {
    flex-direction: column;
    background: var(--deep-black);
}

.hero-hex-frame {
    position: relative;
    width: min(70vw, 70vh);
    height: min(70vw, 70vh);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-hex-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.hex-border-path {
    stroke-dasharray: 12 4;
    animation: dash-crawl 8s linear infinite;
}

@keyframes dash-crawl {
    to {
        stroke-dashoffset: -64;
    }
}

.hero-hex-content {
    position: relative;
    width: 85%;
    height: 85%;
    background: var(--near-black);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 1;
}

.hero-collage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.collage-layer {
    position: absolute;
    width: 120%;
    height: 120%;
    top: -10%;
    left: -10%;
    mix-blend-mode: multiply;
    filter: grayscale(100%) contrast(1.3);
    opacity: 0.35;
}

.collage-layer-1 {
    background: repeating-conic-gradient(var(--dark-grey) 0% 25%, transparent 0% 50%) 0 0 / 40px 40px;
    animation: collage-drift-1 30s linear infinite;
}

.collage-layer-2 {
    background: radial-gradient(circle at 30% 40%, var(--mid-grey) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, var(--dark-grey) 0%, transparent 40%);
    animation: collage-drift-2 40s linear infinite;
    opacity: 0.25;
}

.collage-layer-3 {
    background:
        repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(102,102,102,0.3) 3px, rgba(102,102,102,0.3) 4px),
        repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(74,74,74,0.2) 3px, rgba(74,74,74,0.2) 4px);
    animation: collage-drift-3 25s linear infinite;
    opacity: 0.2;
}

@keyframes collage-drift-1 {
    0%   { transform: translate(0, 0) rotate(0deg); }
    50%  { transform: translate(15px, -10px) rotate(0.5deg); }
    100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes collage-drift-2 {
    0%   { transform: translate(0, 0); }
    50%  { transform: translate(-10px, 8px); }
    100% { transform: translate(0, 0); }
}

@keyframes collage-drift-3 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(5px, -5px) scale(1.02); }
    100% { transform: translate(0, 0) scale(1); }
}

.hero-text {
    position: relative;
    z-index: 1;
    text-align: center;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 8rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--near-white);
    text-shadow: 0 0 40px rgba(232, 232, 232, 0.15);
    line-height: 1;
}

.hero-subtitle {
    font-family: var(--font-subheading);
    font-size: clamp(1rem, 2vw, 1.5rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--silver);
    margin-top: 0.5em;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: scroll-pulse 2s ease-in-out infinite;
}

.scroll-hex-icon {
    width: 20px;
    height: 22px;
    background: var(--hex-border-color);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.scroll-indicator span {
    font-family: var(--font-subheading);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mid-grey);
}

@keyframes scroll-pulse {
    0%, 100% { opacity: 0.4; transform: translateY(0); }
    50%      { opacity: 1; transform: translateY(6px); }
}

/* ============================================================
   FLOWING CURVE DIVIDERS
   ============================================================ */
.curve-divider {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.curve-divider svg {
    width: 100%;
    height: 100%;
}

.flowing-curve {
    stroke-linecap: round;
    stroke-linejoin: round;
}

.curve-draw {
    stroke-dasharray: var(--curve-length, 2000);
    stroke-dashoffset: var(--curve-length, 2000);
    transition: stroke-dashoffset 6s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.curve-draw.drawn {
    stroke-dashoffset: 0;
}

/* ============================================================
   CONTENT GRID - HONEYCOMB
   ============================================================ */
#content-grid {
    padding: 80px 20px;
    min-height: 100vh;
    align-items: center;
}

.honeycomb-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--cell-gap);
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

.hex-cell {
    aspect-ratio: 1 / 1.1;
    background: var(--near-black);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0;
    transform: scale(0.92);
    filter: blur(4px);
    transition:
        opacity 0.6s ease,
        transform 0.6s ease,
        filter 0.6s ease,
        box-shadow 0.3s ease;
    transition-delay: calc(var(--cell-index) * 80ms);
}

.hex-cell.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.hex-cell:hover {
    box-shadow: inset 0 0 30px rgba(245, 245, 245, 0.06);
    transform: scale(1) translateY(-2px);
}

.hex-cell-inner {
    padding: 25%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.hex-cell-title {
    font-family: var(--font-heading);
    font-size: clamp(1.2rem, 2vw, 2rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--near-white);
    text-shadow: 0 0 40px rgba(232, 232, 232, 0.15);
    margin-bottom: 0.5em;
}

.hex-cell-text {
    font-family: var(--font-body);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--light-mid-grey);
    max-width: 55ch;
}

/* --- Collage Mini (Image Cells) --- */
.hex-cell--image .hex-cell-inner {
    padding: 0;
    overflow: hidden;
}

.collage-mini {
    position: relative;
    width: 100%;
    height: 100%;
}

.collage-fragment {
    position: absolute;
    width: 80%;
    height: 80%;
    mix-blend-mode: multiply;
    filter: grayscale(100%) contrast(1.3);
    opacity: 0.6;
}

.frag-1 {
    top: 5%;
    left: 5%;
    background: repeating-linear-gradient(45deg, var(--dark-grey) 0px, var(--dark-grey) 2px, transparent 2px, transparent 8px);
}

.frag-2 {
    bottom: 5%;
    right: 5%;
    background: radial-gradient(ellipse at center, var(--mid-grey) 0%, transparent 70%);
    opacity: 0.4;
}

.frag-3 {
    top: 10%;
    left: 0;
    background: repeating-conic-gradient(var(--dark-grey) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px;
}

.frag-4 {
    bottom: 0;
    right: 10%;
    background: linear-gradient(135deg, var(--mid-grey) 25%, transparent 25%, transparent 50%, var(--mid-grey) 50%, var(--mid-grey) 75%, transparent 75%);
    background-size: 12px 12px;
    opacity: 0.45;
}

.frag-5 {
    top: 0;
    left: 10%;
    background: radial-gradient(circle at 50% 50%, var(--dark-grey) 0%, transparent 50%);
}

.frag-6 {
    bottom: 10%;
    right: 0;
    background: repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(102,102,102,0.3) 4px, rgba(102,102,102,0.3) 5px);
    opacity: 0.5;
}

.frag-7 {
    top: 5%;
    left: 5%;
    background: repeating-linear-gradient(-45deg, var(--mid-grey) 0px, var(--mid-grey) 1px, transparent 1px, transparent 6px);
}

.frag-8 {
    bottom: 5%;
    right: 5%;
    background: radial-gradient(circle at 30% 70%, var(--dark-grey) 0%, transparent 60%);
    opacity: 0.4;
}

/* ============================================================
   LOTTIE / ANIMATION VIEWPORTS
   ============================================================ */
.lottie-viewport {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--deep-black);
}

.lottie-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.lottie-overlay-text {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
}

.lottie-word {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--near-white);
    text-shadow: 0 0 40px rgba(232, 232, 232, 0.15);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.lottie-word.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   NARRATIVE SECTION
   ============================================================ */
#narrative {
    padding: 60px 20px;
    position: relative;
    min-height: 100vh;
}

.narrative-container {
    position: relative;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.narrative-flowing-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.narrative-curves {
    width: 100%;
    height: 100%;
}

.narrative-hex-cluster {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
}

.narrative-hex {
    width: min(400px, 80vw);
    aspect-ratio: 1 / 1.1;
    background: var(--near-black);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.92);
    filter: blur(4px);
    transition:
        opacity 0.7s ease,
        transform 0.7s ease,
        filter 0.7s ease,
        box-shadow 0.3s ease;
    transition-delay: calc(var(--cell-index) * 120ms);
}

.narrative-hex.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.narrative-hex:hover {
    box-shadow: inset 0 0 30px rgba(245, 245, 245, 0.06);
    transform: scale(1) translateY(-2px);
}

.narrative-hex-inner {
    padding: 25%;
    text-align: center;
}

.narrative-hex-inner h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 4rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--near-white);
    text-shadow: 0 0 40px rgba(232, 232, 232, 0.15);
    margin-bottom: 0.5em;
}

.narrative-hex-inner p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    line-height: 1.75;
    color: var(--light-mid-grey);
    max-width: 55ch;
}

/* ============================================================
   CLOSING SECTION
   ============================================================ */
#closing {
    background: var(--deep-black);
}

.closing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.closing-hex {
    width: min(280px, 60vw);
    aspect-ratio: 1 / 1.1;
    background: var(--near-black);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.85);
    filter: blur(6px);
    transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease;
}

.closing-hex.visible {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

.closing-hex-inner {
    text-align: center;
    padding: 20%;
}

.closing-text {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3.5rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--near-white);
    text-shadow: 0 0 40px rgba(232, 232, 232, 0.15);
    margin-bottom: 0.3em;
}

.closing-subtext {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--mid-grey);
    line-height: 1.75;
}

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

/* Tablet */
@media (max-width: 900px) {
    .honeycomb-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-honeycomb {
        grid-template-columns: repeat(2, 140px);
        grid-template-rows: repeat(3, 120px);
    }

    .narrative-hex-cluster {
        gap: 30px;
    }

    .narrative-hex {
        width: min(320px, 80vw);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .honeycomb-grid {
        grid-template-columns: 1fr;
        max-width: 300px;
    }

    .hex-cell {
        clip-path: none;
        border-radius: 4px;
        aspect-ratio: auto;
        min-height: 200px;
    }

    .hex-cell-inner {
        padding: 30px;
    }

    .hero-hex-frame {
        width: 85vw;
        height: 85vw;
    }

    #main-nav {
        padding: 16px 20px;
    }

    .nav-honeycomb {
        grid-template-columns: repeat(2, 120px);
        grid-template-rows: repeat(3, 105px);
        gap: 6px;
    }

    .nav-hex-cell {
        width: 120px;
        height: 105px;
    }

    .narrative-hex {
        width: 80vw;
        clip-path: none;
        border-radius: 4px;
        aspect-ratio: auto;
        min-height: 250px;
    }

    .closing-hex {
        width: 70vw;
    }

    .curve-divider {
        height: 120px;
    }
}
