/* ============================================
   GGOGGL.com - Crystalline Optics Design System
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --bg-deep: #1a1020;
    --bg-warm: #2d1b2e;
    --surface: #3a2a1f;
    --primary: #f5875f;
    --secondary: #e85d4a;
    --tertiary: #f4a842;
    --highlight: #ffe066;
    --text-primary: #faf0e6;
    --text-secondary: #c9a89a;
    --border-glow: #d4845e;

    --font-heading: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Space Grotesk', 'Helvetica Neue', sans-serif;
    --font-accent: 'Instrument Serif', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    --hex-clip: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    --ease-crystal: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --grid-tilt: rotate(3deg);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Noise Overlay --- */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
}

/* --- Crystal Lattice Background --- */
#crystal-lattice {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 3s ease;
}

#crystal-lattice.visible {
    opacity: 1;
}

#lattice-svg {
    width: 100%;
    height: 100%;
}

#lattice-lines path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: lattice-draw 3s ease-out forwards;
}

@keyframes lattice-draw {
    to {
        stroke-dashoffset: 0;
    }
}

/* --- Radial Navigation --- */
#radial-nav {
    position: fixed;
    top: 28px;
    right: 28px;
    z-index: 1000;
}

#nav-pill {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(212, 132, 94, 0.4);
    background: rgba(26, 16, 32, 0.85);
    backdrop-filter: blur(12px);
    clip-path: var(--hex-clip);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 400ms var(--ease-crystal);
    position: relative;
    z-index: 10;
}

#nav-pill:hover {
    border-color: rgba(212, 132, 94, 0.8);
    background: rgba(58, 42, 31, 0.9);
}

#nav-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 400ms var(--ease-crystal);
}

#radial-nav.open #nav-ring {
    opacity: 1;
    pointer-events: auto;
}

.nav-node {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    clip-path: var(--hex-clip);
    background: rgba(26, 16, 32, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 132, 94, 0.35);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-decoration: none;
    transition: all 400ms var(--ease-crystal);
    transform: translate(-50%, -50%) scale(0);
}

#radial-nav.open .nav-node {
    transform: translate(-50%, -50%) scale(1);
}

.nav-node[data-angle="0"] {
    top: -90px;
    left: 0;
}

.nav-node[data-angle="90"] {
    top: 0;
    left: 90px;
}

.nav-node[data-angle="180"] {
    top: 90px;
    left: 0;
}

.nav-node[data-angle="270"] {
    top: 0;
    left: -90px;
}

.nav-node:hover {
    color: var(--text-primary);
    border-color: rgba(245, 135, 95, 0.8);
    background: rgba(58, 42, 31, 0.95);
}

/* --- Viewport Sections --- */
.viewport-section {
    min-height: 100vh;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
}

.section-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Section Headings --- */
.section-heading {
    font-family: var(--font-heading);
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: 60px;
    text-align: center;
}

.section-heading .mono-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* --- Mono Labels --- */
.mono-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* --- Hero Section --- */
.hero-hexagon {
    width: min(90vw, 800px);
    height: min(80vh, 700px);
    clip-path: var(--hex-clip);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-gradient-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 40%, #2d1b2e 0%, #1a1020 60%),
                linear-gradient(135deg, rgba(245, 135, 95, 0.08) 0%, rgba(244, 168, 66, 0.05) 50%, rgba(255, 224, 102, 0.03) 100%);
    animation: hero-pan 20s ease-in-out infinite alternate;
}

@keyframes hero-pan {
    0% {
        background-position: 30% 40%;
    }
    100% {
        background-position: 70% 60%;
    }
}

.hero-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 2px;
    height: 140%;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 224, 102, 0.4) 40%, rgba(255, 224, 102, 0.4) 60%, transparent 100%);
    transform: rotate(-35deg);
    pointer-events: none;
    opacity: 0;
}

@keyframes shimmer-sweep {
    0% {
        left: -10%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        left: 110%;
        opacity: 0;
    }
}

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

.hero-logotype {
    position: relative;
    display: inline-block;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(64px, 12vw, 120px);
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1;
    position: relative;
}

.hero-refraction-layer {
    position: absolute;
    top: 0;
    left: 1.5px;
    font-family: var(--font-heading);
    font-size: clamp(64px, 12vw, 120px);
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--primary);
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms var(--ease-crystal);
    mix-blend-mode: screen;
}

.hero-logotype:hover .hero-refraction-layer {
    opacity: 0.6;
}

.hero-tagline {
    font-family: var(--font-accent);
    font-size: clamp(14px, 2vw, 18px);
    color: var(--text-secondary);
    margin-top: 24px;
    font-style: italic;
    letter-spacing: 0.02em;
}

.hero-tagline .mono-label {
    font-style: normal;
    font-size: 10px;
    color: var(--border-glow);
}

/* --- Hexagonal border effect for hero --- */
.hero-hexagon::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: var(--hex-clip);
    border: 1px solid rgba(212, 132, 94, 0.3);
    pointer-events: none;
    z-index: 3;
}

.hero-hexagon::after {
    content: '';
    position: absolute;
    inset: 2px;
    clip-path: var(--hex-clip);
    box-shadow: inset 0 0 80px rgba(26, 16, 32, 0.8);
    pointer-events: none;
    z-index: 3;
}

/* --- Faceted Dividers --- */
.faceted-divider {
    width: 100%;
    height: 40px;
    margin: 20px 0;
    display: block;
}

/* --- Discovery: Honeycomb Strip --- */
.honeycomb-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    transform: var(--grid-tilt);
    padding: 20px 0;
}

.hex-cell {
    width: 180px;
    height: 200px;
    clip-path: var(--hex-clip);
    background: rgba(58, 42, 31, 0.3);
    border: 1px solid rgba(212, 132, 94, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 400ms var(--ease-crystal);
    animation: hex-pulse 4s ease-in-out infinite;
}

.hex-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: var(--hex-clip);
    background: linear-gradient(135deg, rgba(245, 135, 95, 0.05) 0%, rgba(244, 168, 66, 0.02) 100%);
    transition: all 400ms var(--ease-crystal);
}

.hex-cell:nth-child(2) { animation-delay: 0.5s; }
.hex-cell:nth-child(3) { animation-delay: 1s; }
.hex-cell:nth-child(4) { animation-delay: 1.5s; }
.hex-cell:nth-child(5) { animation-delay: 2s; }
.hex-cell:nth-child(6) { animation-delay: 2.5s; }

@keyframes hex-pulse {
    0%, 100% {
        border-color: rgba(212, 132, 94, 0.3);
    }
    50% {
        border-color: rgba(212, 132, 94, 0.5);
    }
}

.hex-cell:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(245, 135, 95, 0.15);
    border-color: rgba(212, 132, 94, 0.8);
}

.hex-cell:hover::before {
    background: linear-gradient(135deg, rgba(245, 135, 95, 0.12) 0%, rgba(244, 168, 66, 0.06) 100%);
}

.hex-cell-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px 16px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.iso-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 10px;
    transition: transform 400ms var(--ease-crystal);
}

.hex-cell:hover .iso-icon {
    transform: scale(1.08);
}

.hex-word {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    transition: color 400ms var(--ease-crystal);
}

.hex-desc {
    font-family: var(--font-body);
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
    opacity: 0;
    transform: translateY(6px);
    transition: all 400ms var(--ease-crystal);
    line-height: 1.4;
}

.hex-cell:hover .hex-desc {
    opacity: 1;
    transform: translateY(0);
}

.hex-cell:hover .hex-word {
    color: var(--primary);
}

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

/* --- Narrative Section --- */
.narrative-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.narrative-column {
    max-width: 680px;
    width: 100%;
}

.body-text {
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 32px;
}

.hex-pullquote {
    clip-path: var(--hex-clip);
    background: rgba(45, 27, 46, 0.6);
    backdrop-filter: blur(12px) saturate(1.4);
    padding: 60px 40px;
    margin: 48px -20px;
    text-align: center;
    position: relative;
    border: 1px solid rgba(212, 132, 94, 0.2);
}

.hex-pullquote::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: var(--hex-clip);
    background: linear-gradient(135deg, rgba(245, 135, 95, 0.04) 0%, rgba(255, 224, 102, 0.02) 100%);
}

.hex-pullquote blockquote {
    font-family: var(--font-accent);
    font-size: clamp(18px, 2.5vw, 24px);
    font-style: italic;
    color: var(--primary);
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* --- Showcase Mosaic --- */
.showcase-mosaic {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform: var(--grid-tilt);
}

.mosaic-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.mosaic-row-offset {
    margin-left: 100px;
}

.mosaic-hex {
    width: 200px;
    height: 220px;
    clip-path: var(--hex-clip);
    background: rgba(58, 42, 31, 0.25);
    border: 1px solid rgba(212, 132, 94, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 400ms var(--ease-crystal);
}

.mosaic-hex:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(245, 135, 95, 0.15);
    border-color: rgba(212, 132, 94, 0.8);
}

.mosaic-hex-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.mosaic-label {
    margin-top: 10px;
    font-size: 9px;
}

/* Gradient swatches */
.mosaic-gradient-swatch {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    clip-path: var(--hex-clip);
}

.swatch-sunset {
    background: linear-gradient(135deg, #f5875f, #f4a842, #ffe066);
}

.swatch-coral {
    background: linear-gradient(135deg, #e85d4a, #f5875f, #d4845e);
}

/* Typography specimens */
.mosaic-type-specimen {
    font-size: 48px;
    line-height: 1;
    color: var(--text-primary);
}

.mosaic-type-specimen.heading-font {
    font-family: var(--font-heading);
    font-weight: 300;
}

.mosaic-type-specimen.body-font {
    font-family: var(--font-body);
    font-weight: 300;
}

.mosaic-type-specimen.mono-font {
    font-family: var(--font-mono);
    font-weight: 300;
    color: var(--highlight);
}

/* Mosaic isometric icons */
.mosaic-iso-icon {
    width: 70px;
    height: 70px;
}

/* Palette dots */
.mosaic-palette {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-content: center;
}

.palette-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: transform 300ms var(--ease-crystal);
}

.palette-dot:hover {
    transform: scale(1.2);
}

.mosaic-palette .mosaic-label {
    width: 100%;
    margin-top: 8px;
}

/* --- Footer Crystal --- */
#footer-crystal {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 24px 40px;
}

.footer-hex {
    width: 320px;
    height: 350px;
    clip-path: var(--hex-clip);
    background: rgba(45, 27, 46, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 132, 94, 0.25);
    position: relative;
    transition: border-color 400ms var(--ease-crystal);
}

.footer-hex:hover {
    border-color: rgba(212, 132, 94, 0.5);
}

.footer-hex-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px 24px;
    text-align: center;
    gap: 20px;
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-links a {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 300ms var(--ease-crystal);
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-copy {
    font-size: 9px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.footer-edge-glow {
    width: 320px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 132, 94, 0.4) 30%, rgba(245, 135, 95, 0.6) 50%, rgba(212, 132, 94, 0.4) 70%, transparent 100%);
    margin-top: -1px;
    animation: footer-glow 3s ease-in-out infinite alternate;
}

@keyframes footer-glow {
    0% { opacity: 0.4; }
    100% { opacity: 0.8; }
}

/* --- Scroll Reveal --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 700ms var(--ease-crystal), transform 700ms var(--ease-crystal);
}

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

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .scroll-reveal {
        opacity: 1;
        transform: none;
    }

    .hero-shimmer {
        display: none;
    }
}

/* --- Responsive --- */
@media (max-width: 900px) {
    .honeycomb-strip {
        transform: none;
    }

    .hex-cell {
        width: 150px;
        height: 170px;
    }

    .showcase-mosaic {
        transform: none;
    }

    .mosaic-row-offset {
        margin-left: 0;
    }

    .mosaic-hex {
        width: 160px;
        height: 180px;
    }
}

@media (max-width: 600px) {
    .honeycomb-strip {
        flex-direction: column;
        align-items: center;
    }

    .hex-cell {
        width: 200px;
        height: 220px;
    }

    .mosaic-row {
        flex-direction: column;
        align-items: center;
    }

    .mosaic-hex {
        width: 200px;
        height: 220px;
    }

    .hex-pullquote {
        margin: 32px 0;
        padding: 48px 24px;
    }

    .hero-hexagon {
        width: 95vw;
        height: 70vh;
    }

    .footer-hex {
        width: 260px;
        height: 290px;
    }

    .footer-edge-glow {
        width: 260px;
    }

    .nav-node {
        width: 64px;
        height: 64px;
        font-size: 8px;
    }

    .nav-node[data-angle="0"] { top: -72px; }
    .nav-node[data-angle="90"] { left: 72px; }
    .nav-node[data-angle="180"] { top: 72px; }
    .nav-node[data-angle="270"] { left: -72px; }
}
