/* ===================================================
   SocialDebug.Org - Styles
   Dopamine maximalist hexagonal honeycomb experience
   =================================================== */

/* CSS Custom Properties */
:root {
    --primary-blaze: #FF6B35;
    --secondary-burn: #D72660;
    --tertiary-ember: #FFBA08;
    --bg-void: #1A0A2E;
    --bg-warm: #2D1B4E;
    --text-light: #FFECD2;
    --text-dark: #0D0514;
    --crystal-accent: #7B2FBE;

    --gradient-sunset: linear-gradient(135deg, #FF6B35 0%, #D72660 45%, #7B2FBE 100%);
    --gradient-ember: radial-gradient(circle at center, #FFBA08 0%, #FF6B35 60%, transparent 100%);
    --gradient-crystal: linear-gradient(270deg, #7B2FBE 0%, #1A0A2E 100%);

    --hex-clip: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    --hex-clip-soft: polygon(27% 2%, 73% 2%, 98% 50%, 73% 98%, 27% 98%, 2% 50%);

    --hex-size: 180px;
    --hex-gap: 6px;
    --hex-width: calc(var(--hex-size) * 1.732);
    --hex-height: calc(var(--hex-size) * 2);

    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);

    --font-headline: 'Libre Baskerville', Georgia, serif;
    --font-body: 'Libre Baskerville', Georgia, serif;
    --font-accent: 'Fira Code', monospace;
    --font-collage: 'Permanent Marker', cursive;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-blaze) var(--bg-void);
}

html::-webkit-scrollbar {
    width: 4px;
}

html::-webkit-scrollbar-track {
    background: var(--bg-void);
}

html::-webkit-scrollbar-thumb {
    background: var(--primary-blaze);
}

body {
    background: var(--bg-void);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    overflow-x: hidden;
}

/* Selection styling */
::selection {
    background: var(--secondary-burn);
    color: var(--text-light);
}

/* Link styling */
a {
    color: var(--text-light);
    text-decoration: none;
    border-bottom: 2px solid var(--tertiary-ember);
    transition: background 0.2s ease, border-color 0.2s ease;
    padding: 0 2px;
}

a:hover {
    background: var(--tertiary-ember);
    color: var(--text-dark);
    border-bottom-color: var(--tertiary-ember);
}

/* SVG filters container */
.svg-filters,
.svg-defs {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* ===================================================
   Hexagonal Navigation
   =================================================== */
#hex-nav {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}

.hex-nav-btn {
    width: 62px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-void);
    clip-path: var(--hex-clip);
    border: none;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    border-bottom: none;
    transition: transform 0.3s var(--spring-ease);
}

.hex-nav-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: var(--primary-blaze);
    clip-path: var(--hex-clip);
    z-index: -1;
}

.hex-nav-btn:hover {
    transform: scale(1.1);
    background: var(--bg-warm);
    border-bottom: none;
}

.hex-nav-label {
    font-family: var(--font-accent);
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-blaze);
    text-align: center;
    line-height: 1.2;
}

/* ===================================================
   Hero Zone
   =================================================== */
.section-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--bg-void);
}

/* Background hexagon field */
.hero-hex-field {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.hero-bg-hex {
    position: absolute;
    clip-path: var(--hex-clip);
    opacity: 0.08;
    animation: bgHexFloat 20s ease-in-out infinite;
}

@keyframes bgHexFloat {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(0.5deg) scale(1.02); }
}

/* Crystal layer */
.crystal-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.prism-shard {
    position: absolute;
    transition: transform 0.15s ease-out;
}

.shard-1 {
    width: 180px;
    height: 180px;
    top: 10%;
    left: 8%;
}

.shard-2 {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 12%;
}

.shard-3 {
    width: 150px;
    height: 150px;
    bottom: 15%;
    left: 15%;
}

.shard-4 {
    width: 200px;
    height: 200px;
    top: 5%;
    right: 5%;
}

.shard-footer {
    width: 140px;
    height: 140px;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
}

/* Refraction lines */
.refraction-line {
    position: absolute;
    width: 1px;
    height: 200px;
    background: var(--crystal-accent);
    opacity: 0.4;
    transform-origin: top center;
    animation: refractionSpin 60s linear infinite;
}

.line-1 { top: 20%; left: 30%; }
.line-2 { top: 40%; right: 25%; animation-delay: -15s; }
.line-3 { bottom: 20%; left: 60%; animation-delay: -30s; }
.line-4 { top: 15%; left: 20%; animation-delay: -10s; }
.line-5 { top: 50%; right: 15%; animation-delay: -40s; }

@keyframes refractionSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Hero hexagon */
.hero-hex-container {
    position: relative;
    z-index: 10;
    width: 80vmin;
    height: 80vmin;
    max-width: 700px;
    max-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-hex {
    width: 100%;
    height: 100%;
    clip-path: var(--hex-clip);
    background: var(--gradient-sunset);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15%;
    text-align: center;
    position: relative;
    animation: heroHexPulse 4s ease-in-out infinite;
}

@keyframes heroHexPulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.08); }
}

.hero-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 9rem);
    letter-spacing: -0.02em;
    color: var(--text-light);
    line-height: 0.95;
    text-shadow: 2px 2px 20px rgba(13, 5, 20, 0.5);
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: 1.5rem;
    opacity: 0.9;
}

/* Collage fragments */
.collage-fragment {
    position: absolute;
    z-index: 5;
    animation: collageFloat 7s ease-in-out infinite;
}

.fragment-inner {
    width: 100%;
    height: 100%;
    border-radius: 2px;
}

.collage-annotation {
    font-family: var(--font-collage);
    color: var(--text-light);
    position: absolute;
    white-space: nowrap;
    font-size: 22px;
    pointer-events: none;
}

.fragment-hero-1 {
    width: 160px;
    height: 120px;
    top: 8%;
    right: 5%;
    animation-delay: -1s;
}

.fragment-hero-1 .collage-annotation {
    bottom: -25px;
    left: 10px;
}

.fragment-hero-2 {
    width: 140px;
    height: 100px;
    bottom: 12%;
    left: 3%;
    animation-delay: -3s;
}

.fragment-hero-2 .collage-annotation {
    top: -25px;
    right: 10px;
}

.fragment-hero-3 {
    width: 120px;
    height: 90px;
    top: 65%;
    right: 8%;
    animation-delay: -5s;
}

.fragment-hero-3 .collage-annotation {
    bottom: -25px;
    right: 5px;
}

@keyframes collageFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Collage fragment hover tilt */
.collage-fragment:hover {
    transform: perspective(400px) rotateX(2deg) rotateY(2deg);
}

/* ===================================================
   Torn-edge Dividers
   =================================================== */
.torn-divider {
    position: relative;
    z-index: 20;
    margin-top: -30px;
    pointer-events: none;
}

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

.torn-divider-1 svg path {
    fill: var(--bg-void);
}

.torn-divider-2 svg path {
    fill: var(--bg-void);
}

/* ===================================================
   Content Honeycomb Section
   =================================================== */
.section-content {
    position: relative;
    padding: 80px 0 120px;
    background: var(--bg-void);
    overflow: hidden;
}

.section-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(2rem, 4vw, 4.5rem);
    letter-spacing: -0.02em;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 60px;
    position: relative;
    z-index: 5;
}

/* Honeycomb Grid */
.honeycomb-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: var(--hex-gap);
    margin-bottom: calc(var(--hex-gap) - var(--hex-size) * 0.25);
}

.hex-row-odd {
    margin-left: calc(var(--hex-size) * 0.866 / 2 + var(--hex-gap) / 2);
}

/* Individual hex cells */
.hex-cell {
    width: calc(var(--hex-size) * 1.732);
    height: calc(var(--hex-size) * 2);
    flex-shrink: 0;
    clip-path: var(--hex-clip);
    position: relative;
    cursor: pointer;
    transition: transform 0.3s var(--spring-ease), clip-path 0.3s ease;
    will-change: transform, opacity;
    opacity: 0;
    transform: scale(0.6);
}

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

.hex-cell:hover {
    transform: scale(1.08);
    clip-path: var(--hex-clip-soft);
    z-index: 10;
}

.hex-cell::before {
    content: '';
    position: absolute;
    inset: -3px;
    clip-path: var(--hex-clip);
    background: transparent;
    transition: background 0.3s ease;
    z-index: -1;
}

.hex-cell:hover::before {
    background: var(--secondary-burn);
}

.hex-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Content cells */
.hex-cell-content {
    background: var(--bg-warm);
}

.hex-cell-content:nth-child(even) {
    background: var(--bg-void);
    border: 1px solid rgba(123, 47, 190, 0.2);
}

.hex-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(1.2rem, 2vw, 2rem);
    letter-spacing: -0.02em;
    color: var(--primary-blaze);
    margin-bottom: 8px;
}

.hex-text {
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-light);
    opacity: 0.9;
}

/* Breathing/gradient cells */
.hex-cell-gradient {
    background: var(--bg-warm);
}

.hex-breathing {
    background: var(--gradient-sunset);
    opacity: 0.3;
    animation: hexBreathe 4s ease-in-out infinite;
}

@keyframes hexBreathe {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

/* Collage cells */
.hex-cell-collage {
    background: var(--bg-void);
}

.hex-collage-inner {
    position: relative;
    padding: 10%;
}

.hex-collage-fragment {
    width: 80%;
    height: 60%;
    position: absolute;
    top: 20%;
    left: 10%;
    box-shadow: 4px 4px 12px rgba(13, 5, 20, 0.6);
}

.hex-collage-inner .collage-annotation {
    font-size: 14px;
    bottom: 15%;
    left: 15%;
}

/* Crystal cells */
.hex-cell-crystal {
    background: var(--bg-void);
}

.hex-crystal-inner {
    padding: 15%;
}

.crystal-motif {
    width: 100%;
    height: 100%;
    animation: crystalPulse 6s ease-in-out infinite;
}

@keyframes crystalPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* Glow between hexagons */
.hex-row::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: var(--gradient-ember);
    opacity: 0;
    animation: glowPulse 4s ease-in-out infinite;
    z-index: -1;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Click flash effect */
.hex-click-flash {
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-ember);
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0);
    animation: clickFlash 200ms ease-out forwards;
    z-index: 100;
}

@keyframes clickFlash {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
}

/* Facet highlights */
.facet-highlight {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--text-light);
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.facet-highlight.facet-flash {
    opacity: 0.8;
    animation: facetGlint 0.6s ease-out forwards;
}

@keyframes facetGlint {
    0% { opacity: 0; transform: scale(0.5); }
    50% { opacity: 0.8; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.8); }
}

/* ===================================================
   Shatter Zone
   =================================================== */
.section-shatter {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--gradient-crystal);
}

.shatter-background {
    position: absolute;
    inset: 0;
    z-index: 1;
}

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

.shatter-fragment {
    position: absolute;
    box-shadow: 4px 4px 12px rgba(13, 5, 20, 0.6);
}

.shatter-fragment .fragment-inner {
    width: 100%;
    height: 100%;
}

.shatter-fragment .collage-annotation {
    font-size: 20px;
    bottom: -30px;
    left: 10px;
}

.sf-1 {
    width: 300px;
    height: 200px;
    top: 10%;
    left: 5%;
    animation: collageFloat 6s ease-in-out infinite;
}

.sf-2 {
    width: 250px;
    height: 180px;
    top: 20%;
    right: 8%;
    animation: collageFloat 7s ease-in-out infinite;
    animation-delay: -2s;
}

.sf-3 {
    width: 220px;
    height: 160px;
    bottom: 25%;
    left: 15%;
    animation: collageFloat 8s ease-in-out infinite;
    animation-delay: -4s;
}

.sf-4 {
    width: 280px;
    height: 190px;
    bottom: 15%;
    right: 12%;
    animation: collageFloat 6.5s ease-in-out infinite;
    animation-delay: -1s;
}

.sf-5 {
    width: 200px;
    height: 150px;
    top: 50%;
    left: 40%;
    transform: translateX(-50%);
    animation: collageFloat 7.5s ease-in-out infinite;
    animation-delay: -3s;
}

/* Shatter hex overlay */
.shatter-hex-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.shatter-hex {
    position: absolute;
    width: 150px;
    height: 173px;
    clip-path: var(--hex-clip);
    background: var(--bg-void);
    opacity: 0.85;
    will-change: transform, opacity;
    transition: transform 1.2s cubic-bezier(0.55, 0, 1, 0.45), opacity 1.2s ease;
}

.sh-1 { top: 5%; left: 10%; transition-delay: 0.24s; }
.sh-2 { top: 5%; left: 35%; transition-delay: 0.2s; }
.sh-3 { top: 5%; right: 25%; transition-delay: 0.22s; }
.sh-4 { top: 30%; left: 5%; transition-delay: 0.16s; }
.sh-5 { top: 30%; left: 30%; transition-delay: 0.08s; }
.sh-6 { top: 30%; right: 20%; transition-delay: 0.12s; }
.sh-7 { top: 55%; left: 15%; transition-delay: 0.14s; }
.sh-8 { top: 55%; left: 45%; transition-delay: 0.04s; }
.sh-9 { top: 55%; right: 15%; transition-delay: 0.1s; }
.sh-10 { top: 80%; left: 8%; transition-delay: 0.18s; }
.sh-11 { top: 80%; left: 40%; transition-delay: 0.06s; }
.sh-12 { top: 80%; right: 20%; transition-delay: 0.2s; }

.sh-inner {
    width: 100%;
    height: 100%;
    background: var(--gradient-sunset);
    opacity: 0.15;
}

/* Shattered state */
.shatter-hex.shattered {
    opacity: 0;
}

.sh-1.shattered { transform: translate(-120vw, -80vh) rotate(-150deg); }
.sh-2.shattered { transform: translate(30vw, -100vh) rotate(120deg); }
.sh-3.shattered { transform: translate(130vw, -60vh) rotate(-90deg); }
.sh-4.shattered { transform: translate(-150vw, 20vh) rotate(170deg); }
.sh-5.shattered { transform: translate(-60vw, -90vh) rotate(-130deg); }
.sh-6.shattered { transform: translate(140vw, 40vh) rotate(80deg); }
.sh-7.shattered { transform: translate(-110vw, 70vh) rotate(-160deg); }
.sh-8.shattered { transform: translate(50vw, 110vh) rotate(140deg); }
.sh-9.shattered { transform: translate(120vw, 80vh) rotate(-70deg); }
.sh-10.shattered { transform: translate(-130vw, 100vh) rotate(110deg); }
.sh-11.shattered { transform: translate(20vw, 120vh) rotate(-100deg); }
.sh-12.shattered { transform: translate(100vw, 110vh) rotate(160deg); }

/* Shatter text overlay */
.shatter-text-overlay {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 40px;
}

.shatter-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 6rem);
    letter-spacing: -0.02em;
    color: var(--text-light);
    text-shadow: 0 0 40px rgba(255, 107, 53, 0.5);
    margin-bottom: 24px;
}

.shatter-subtitle {
    font-family: var(--font-body);
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: var(--text-light);
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ===================================================
   Reassembly Footer
   =================================================== */
.section-footer {
    position: relative;
    padding: 100px 0 60px;
    background: var(--bg-void);
    overflow: hidden;
}

.footer-honeycomb {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 5;
}

.footer-hex-row {
    display: flex;
    justify-content: center;
    gap: var(--hex-gap);
    margin-bottom: calc(var(--hex-gap) - 60px);
}

.footer-hex-row-offset {
    margin-left: calc(var(--hex-size) * 0.866 / 2 + var(--hex-gap) / 2);
}

.footer-hex {
    width: calc(var(--hex-size) * 1.5);
    height: calc(var(--hex-size) * 1.732);
    flex-shrink: 0;
    clip-path: var(--hex-clip);
    background: var(--bg-warm);
    position: relative;
    will-change: transform, opacity;
    opacity: 0;
    transform: scale(0.5) translate(var(--fx, 0px), var(--fy, 0px));
    transition: transform 1.5s var(--spring-ease), opacity 1.5s ease;
}

.footer-hex.footer-visible {
    opacity: 1;
    transform: scale(1) translate(0, 0);
}

.footer-hex:hover {
    background: var(--bg-void);
}

.fh-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18%;
    text-align: center;
}

.fh-title {
    font-family: var(--font-headline);
    font-weight: 700;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    letter-spacing: -0.02em;
    color: var(--primary-blaze);
    margin-bottom: 8px;
}

.fh-text {
    font-family: var(--font-body);
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-light);
    opacity: 0.85;
}

.fh-text a {
    font-size: 12px;
    display: inline-block;
    margin: 2px 0;
}

.fh-label {
    font-family: var(--font-accent);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--tertiary-ember);
}

.footer-crystal-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* ===================================================
   Responsive Design
   =================================================== */
@media (max-width: 1024px) {
    :root {
        --hex-size: 120px;
    }

    .hero-hex-container {
        width: 70vmin;
        height: 70vmin;
    }

    .shatter-hex {
        width: 100px;
        height: 115px;
    }

    .sf-1, .sf-2, .sf-3, .sf-4, .sf-5 {
        width: 180px;
        height: 130px;
    }
}

@media (max-width: 768px) {
    :root {
        --hex-size: 90px;
    }

    #hex-nav {
        top: 12px;
        right: 12px;
        gap: 4px;
    }

    .hex-nav-btn {
        width: 48px;
        height: 56px;
    }

    .hex-nav-label {
        font-size: 7px;
    }

    .hero-hex-container {
        width: 85vmin;
        height: 85vmin;
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .hex-row-odd {
        margin-left: calc(var(--hex-size) * 0.433 + var(--hex-gap) / 2);
    }

    .hex-text {
        font-size: 11px;
    }

    .hex-title {
        font-size: clamp(0.9rem, 2vw, 1.2rem);
    }

    .collage-fragment {
        display: none;
    }

    .section-content {
        padding: 40px 0 60px;
    }

    .section-title {
        margin-bottom: 30px;
    }

    .shatter-hex {
        width: 70px;
        height: 80px;
    }

    .shatter-title {
        font-size: clamp(2rem, 8vw, 3.5rem);
    }

    .footer-hex {
        width: calc(var(--hex-size) * 1.3);
        height: calc(var(--hex-size) * 1.5);
    }

    .footer-hex-row-offset {
        margin-left: calc(var(--hex-size) * 0.55);
    }

    .sf-1, .sf-2, .sf-3, .sf-4, .sf-5 {
        width: 120px;
        height: 90px;
    }

    .shatter-fragment .collage-annotation {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    :root {
        --hex-size: 70px;
    }

    .hex-row {
        flex-wrap: wrap;
    }

    .footer-hex-row {
        flex-wrap: wrap;
        gap: 4px;
    }
}
