/* =============================================
   ppuzzl.in — Light-Academia Chrome Honeycomb
   ============================================= */

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

:root {
    --chrome-navy: #1A2030;
    --slate-grey: #3A4050;
    --chrome-steel: #708090;
    --chrome-highlight: #B0C0D0;
    --library-cream: #F8F6F2;
    --cell-white: #FFFFFF;
    --leaf-sage: #607848;
    --diagram-line: rgba(112, 128, 144, 0.12);
    --hex-size: clamp(200px, 25vw, 320px);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 400;
    background-color: var(--library-cream);
    color: var(--slate-grey);
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.85;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Leaf-Organic Background SVGs --- */
.leaf-bg-motif {
    position: fixed;
    top: 0;
    width: 150px;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}

.leaf-bg-motif--left {
    left: 0;
}

.leaf-bg-motif--right {
    right: 0;
}

/* --- Section Headings --- */
.section-heading {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    color: var(--chrome-navy);
    text-align: center;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

/* =============================================
   HERO SECTION
   ============================================= */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--library-cream);
    overflow: hidden;
    z-index: 1;
}

.hero-chrome-accent--top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--chrome-highlight) 20%,
        var(--chrome-steel) 50%,
        var(--chrome-highlight) 80%,
        transparent 100%
    );
    opacity: 0.6;
}

/* Hero honeycomb background pattern */
.hero-honeycomb-bg {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 0;
}

.hero-honeycomb-svg {
    width: 100%;
    max-width: 800px;
    height: auto;
    opacity: 0;
    animation: honeycombFadeIn 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
}

@keyframes honeycombFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.hero-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--chrome-navy);
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    position: relative;
    background: linear-gradient(
        180deg,
        var(--chrome-navy) 0%,
        var(--chrome-steel) 60%,
        var(--chrome-highlight) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.15rem);
    color: var(--chrome-steel);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
}

.hero-diagram {
    margin: 0 auto;
    max-width: 340px;
    opacity: 0.5;
}

.hero-schematic {
    width: 100%;
    height: auto;
}

/* Scroll indicator */
.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: scrollPulse 2.5s ease-in-out infinite;
}

.scroll-indicator-text {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--chrome-steel);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.6;
}

.scroll-indicator-line {
    width: 1px;
    height: 30px;
    background: linear-gradient(to bottom, var(--chrome-steel), transparent);
    opacity: 0.4;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.6; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(5px); }
}

/* =============================================
   HONEYCOMB SECTION
   ============================================= */
#honeycomb-section {
    position: relative;
    padding: 6rem 2rem;
    z-index: 1;
}

.honeycomb-leaf-decoration {
    max-width: 400px;
    margin: -1.5rem auto 2.5rem;
    text-align: center;
}

.honeycomb-leaf-decoration svg {
    width: 100%;
    height: auto;
}

.honeycomb-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hex-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.hex-row--offset {
    margin-top: calc(var(--hex-size) * -0.13);
}

/* --- Hexagonal Cell --- */
.hex-cell {
    width: var(--hex-size);
    height: calc(var(--hex-size) * 1.1547);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: var(--cell-white);
    position: relative;
    cursor: default;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --light-x: 50%;
    --light-y: 50%;
}

.hex-cell:hover {
    transform: scale(1.04);
    z-index: 5;
}

.hex-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20%;
    text-align: center;
    z-index: 2;
}

.hex-bg-diagram {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
    pointer-events: none;
}

.hex-bg-diagram svg {
    width: 70%;
    height: 70%;
}

.hex-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.65rem;
    color: var(--chrome-steel);
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 2;
}

.hex-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(0.8rem, 1.2vw, 1rem);
    color: var(--chrome-navy);
    margin-bottom: 0.3rem;
    position: relative;
    z-index: 2;
}

.hex-text {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.65rem, 0.8vw, 0.78rem);
    color: var(--slate-grey);
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* Hex cell chrome sheen — follows mouse for metallic light catching */
.hex-chrome-sheen {
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: radial-gradient(
        circle at var(--light-x) var(--light-y),
        rgba(176, 192, 208, 0.18) 0%,
        rgba(176, 192, 208, 0.04) 40%,
        transparent 70%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 3;
}

.hex-cell:hover .hex-chrome-sheen {
    opacity: 1;
}

/* Hex cell chrome hover overlay */
.hex-cell::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(176, 192, 208, 0.06) 30%,
        rgba(176, 192, 208, 0.12) 50%,
        rgba(176, 192, 208, 0.06) 70%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.hex-cell:hover::before {
    opacity: 1;
}

/* Hex cell border effect */
.hex-cell::after {
    content: '';
    position: absolute;
    inset: -1px;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: linear-gradient(135deg, var(--chrome-highlight), transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.hex-cell:hover::after {
    opacity: 0.5;
}

/* =============================================
   RESEARCH SECTION
   ============================================= */
#research-section {
    position: relative;
    padding: 6rem 2rem;
    background: linear-gradient(180deg, var(--library-cream) 0%, var(--cell-white) 50%, var(--library-cream) 100%);
    z-index: 1;
}

.research-content {
    max-width: 1100px;
    margin: 0 auto;
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.research-card {
    position: relative;
    background: var(--cell-white);
    border: 1px solid rgba(176, 192, 208, 0.3);
    padding: 2.5rem 2rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.research-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(26, 32, 48, 0.06);
}

.research-card-chrome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--chrome-highlight), var(--chrome-steel), var(--chrome-highlight));
    opacity: 0.5;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.research-card:hover .research-card-chrome {
    opacity: 1;
    height: 3px;
}

/* Leaf growth motif in research cards */
.research-card-leaf {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.research-card-leaf svg {
    width: 100%;
    height: 100%;
}

.research-card:hover .research-card-leaf {
    opacity: 1;
}

.research-label {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.7rem;
    color: var(--chrome-steel);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.8rem;
}

.research-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    color: var(--chrome-navy);
    margin-bottom: 0.8rem;
}

.research-text {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    color: var(--slate-grey);
    line-height: 1.85;
}

/* =============================================
   SPECIMEN SECTION
   ============================================= */
#specimen-section {
    position: relative;
    padding: 6rem 2rem;
    z-index: 1;
}

.specimen-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
}

.specimen-card {
    text-align: center;
    padding: 2rem 1.5rem;
    position: relative;
    transition: transform 0.3s ease;
}

.specimen-card:hover {
    transform: translateY(-3px);
}

.specimen-hex-badge {
    width: 60px;
    height: 70px;
    margin: 0 auto 1.2rem;
}

.specimen-hex-badge svg {
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.specimen-card:hover .specimen-hex-badge svg {
    transform: rotate(30deg);
}

.specimen-title {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: var(--chrome-navy);
    margin-bottom: 0.6rem;
}

.specimen-text {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    color: var(--slate-grey);
    line-height: 1.85;
    margin-bottom: 1rem;
}

.specimen-tag {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.6rem;
    color: var(--leaf-sage);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border: 1px solid rgba(96, 120, 72, 0.25);
    padding: 0.25rem 0.75rem;
    display: inline-block;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.specimen-card:hover .specimen-tag {
    background-color: rgba(96, 120, 72, 0.06);
}

/* =============================================
   FOOTER
   ============================================= */
#footer {
    position: relative;
    padding: 4rem 2rem;
    text-align: center;
    z-index: 1;
}

.footer-chrome-line {
    width: 100%;
    max-width: 600px;
    height: 1px;
    margin: 0 auto 2.5rem;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--chrome-highlight) 30%,
        var(--chrome-steel) 50%,
        var(--chrome-highlight) 70%,
        transparent 100%
    );
    opacity: 0.4;
}

.footer-hex {
    width: 40px;
    height: 46px;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

.footer-hex svg {
    width: 100%;
    height: 100%;
}

.footer-text {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--chrome-navy);
    letter-spacing: 0.1em;
    margin-bottom: 0.3rem;
}

.footer-subtext {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 300;
    font-size: 0.8rem;
    color: var(--chrome-steel);
}

/* =============================================
   SCROLL-TRIGGERED REVEAL ANIMATION
   ============================================= */
.hex-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hex-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay for hex cells */
.hex-row .hex-cell:nth-child(1) { transition-delay: 0s; }
.hex-row .hex-cell:nth-child(2) { transition-delay: 0.1s; }
.hex-row .hex-cell:nth-child(3) { transition-delay: 0.2s; }
.hex-row .hex-cell:nth-child(4) { transition-delay: 0.3s; }

/* Staggered delay for research cards */
.research-grid .research-card:nth-child(1) { transition-delay: 0s; }
.research-grid .research-card:nth-child(2) { transition-delay: 0.15s; }
.research-grid .research-card:nth-child(3) { transition-delay: 0.3s; }

/* Staggered delay for specimen cards */
.specimen-grid .specimen-card:nth-child(1) { transition-delay: 0s; }
.specimen-grid .specimen-card:nth-child(2) { transition-delay: 0.15s; }
.specimen-grid .specimen-card:nth-child(3) { transition-delay: 0.3s; }

/* =============================================
   HERO ENTRANCE ANIMATION
   ============================================= */
.hero-title {
    animation: heroFadeIn 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.hero-subtitle {
    opacity: 0;
    animation: heroFadeIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
}

.hero-diagram {
    opacity: 0;
    animation: heroDiagramIn 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.7s forwards;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes heroDiagramIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 0.5;
        transform: translateY(0);
    }
}

/* =============================================
   CHROME METALLIC ACCENTS — ambient sheen
   ============================================= */
#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(
        ellipse at 30% 30%,
        rgba(176, 192, 208, 0.06) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 0;
}

#hero::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 140%;
    height: 200%;
    background: radial-gradient(
        ellipse at 70% 60%,
        rgba(176, 192, 208, 0.04) 0%,
        transparent 50%
    );
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
    .research-grid,
    .specimen-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

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

    .hex-row--offset {
        margin-top: 4px;
    }

    :root {
        --hex-size: clamp(160px, 40vw, 260px);
    }

    .leaf-bg-motif {
        display: none;
    }

    .hero-honeycomb-bg {
        opacity: 0.5;
    }
}

@media (max-width: 600px) {
    :root {
        --hex-size: clamp(140px, 55vw, 220px);
    }

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

    .hex-row--offset {
        margin-top: 4px;
    }

    #honeycomb-section,
    #research-section,
    #specimen-section {
        padding: 4rem 1rem;
    }

    .section-heading {
        margin-bottom: 2rem;
    }

    .research-card {
        padding: 2rem 1.5rem;
    }

    .honeycomb-leaf-decoration {
        display: none;
    }

    .hero-honeycomb-bg {
        display: none;
    }
}
