/* ============================
   ppuzzle.net - Neomorphic Puzzle Network
   Chrome-metallic palette with pastoral warmth
   ============================ */

/* --- CSS Custom Properties --- */
:root {
    --soft-silver: #F0F0F0;
    --brushed-chrome: #C0C0C8;
    --deep-graphite: #2A2A2A;
    --warm-copper: #B87333;
    --rose-gold: #E8B4B8;
    --pearl: #F8F6F0;
    --white: #ffffff;
    --shadow-dark: #d1d1d1;
    --shadow-light: #ffffff;

    --font-display: 'Lora', serif;
    --font-body: 'Inter', sans-serif;

    --neo-shadow: 8px 8px 16px #d1d1d1, -8px -8px 16px #ffffff;
    --neo-shadow-hover: 6px 6px 12px #d1d1d1, -6px -6px 12px #ffffff;
    --neo-shadow-inset: inset 4px 4px 8px #d1d1d1, inset -4px -4px 8px #ffffff;
    --neo-shadow-inset-deep: inset 6px 6px 12px #d1d1d1, inset -6px -6px 12px #ffffff;
}

/* --- 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);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--deep-graphite);
    background-color: var(--soft-silver);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--deep-graphite);
}

h1 {
    font-size: clamp(2rem, 4vw, 3.5rem);
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
}

h3 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
}

.accent {
    color: var(--warm-copper);
}

.section-title {
    text-align: center;
    margin-bottom: 0.5em;
}

.section-description {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2.5rem;
    color: var(--brushed-chrome);
    font-size: 1.05rem;
}

/* --- Sections --- */
.section {
    position: relative;
    padding: 5rem 2rem;
}

/* --- Hero --- */
.section--hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--soft-silver);
    text-align: center;
    padding-bottom: 8rem;
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--brushed-chrome);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

/* Puzzle Assembly Animation */
.hero-puzzle-assembly {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100px;
    height: 100px;
    margin: 0 auto 2rem;
}

.puzzle-piece {
    border-radius: 8px;
    background: var(--pearl);
    box-shadow: var(--neo-shadow);
    animation: puzzleAssemble 2.5s ease-out forwards;
    opacity: 0;
}

.piece-1 {
    background: var(--warm-copper);
    animation-delay: 0.2s;
}

.piece-2 {
    background: var(--rose-gold);
    animation-delay: 0.5s;
}

.piece-3 {
    background: var(--rose-gold);
    animation-delay: 0.8s;
}

.piece-4 {
    background: var(--warm-copper);
    animation-delay: 1.1s;
}

@keyframes puzzleAssemble {
    0% {
        opacity: 0;
        transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg)) scale(0.5);
    }
    60% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1.08);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
}

.piece-1 { --tx: -40px; --ty: -40px; --rot: -15deg; }
.piece-2 { --tx: 40px; --ty: -40px; --rot: 15deg; }
.piece-3 { --tx: -40px; --ty: 40px; --rot: 15deg; }
.piece-4 { --tx: 40px; --ty: 40px; --rot: -15deg; }

/* --- Neomorphic Button --- */
.neo-button {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--deep-graphite);
    background: var(--soft-silver);
    border: none;
    border-radius: 12px;
    box-shadow: var(--neo-shadow);
    cursor: pointer;
    text-decoration: none;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.neo-button:hover {
    box-shadow: var(--neo-shadow-hover);
    transform: translateY(-1px);
}

.neo-button:active {
    box-shadow: var(--neo-shadow-inset);
    transform: translateY(0);
}

.neo-button--accent {
    background: var(--warm-copper);
    color: var(--white);
    box-shadow: 6px 6px 14px rgba(184, 115, 51, 0.3), -4px -4px 10px rgba(255, 255, 255, 0.7);
}

.neo-button--accent:hover {
    box-shadow: 4px 4px 10px rgba(184, 115, 51, 0.35), -3px -3px 8px rgba(255, 255, 255, 0.7);
}

.neo-button--accent:active {
    box-shadow: inset 3px 3px 6px rgba(140, 85, 30, 0.4), inset -3px -3px 6px rgba(255, 200, 160, 0.3);
}

/* --- Diagonal Cuts --- */
.diagonal-cut {
    position: absolute;
    left: 0;
    right: 0;
    height: 80px;
    z-index: 1;
    overflow: hidden;
}

.diagonal-cut--bottom {
    bottom: -1px;
}

.diagonal-cut--top {
    top: -1px;
}

.diagonal-cut--bottom::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5%;
    width: 110%;
    height: 100%;
    background: var(--soft-silver);
    clip-path: polygon(0 60%, 100% 0, 100% 100%, 0 100%);
}

.diagonal-cut--top::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5%;
    width: 110%;
    height: 100%;
    background: var(--soft-silver);
    clip-path: polygon(0 0, 100% 0, 100% 40%, 0 100%);
}

.diagonal-cut--reverse::before {
    clip-path: polygon(0 0, 100% 60%, 100% 100%, 0 100%);
}

.diagonal-cut--top.diagonal-cut--reverse::before {
    clip-path: polygon(0 0, 100% 0, 0 40%, 0 0);
}

/* --- Botanical Dividers --- */
.botanical-divider {
    padding: 0.5rem 0;
    text-align: center;
    overflow: hidden;
}

.botanical-svg {
    width: 100%;
    max-height: 80px;
}

.vine-line {
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    animation: drawVine 3s ease-out forwards;
}

@keyframes drawVine {
    to {
        stroke-dashoffset: 0;
    }
}

.botanical-divider--alt .vine-line {
    animation-delay: 0.5s;
}

/* --- Neomorphic Cards --- */
.neo-card {
    background: var(--pearl);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--neo-shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.neo-card:hover {
    box-shadow: 10px 10px 20px #d1d1d1, -10px -10px 20px #ffffff;
    transform: translateY(-4px);
}

.neo-card--inset {
    box-shadow: var(--neo-shadow-inset);
}

.neo-card--inset:hover {
    box-shadow: var(--neo-shadow-inset-deep);
    transform: translateY(0);
}

.neo-card--large {
    padding: 3rem;
}

/* --- Categories Section --- */
.section--categories {
    background: var(--soft-silver);
    padding-bottom: 8rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

.card-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

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

.card-title {
    margin-bottom: 0.5rem;
    color: var(--deep-graphite);
}

.card-text {
    color: var(--brushed-chrome);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.card-count {
    display: inline-block;
    padding: 0.3rem 0.9rem;
    background: var(--soft-silver);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--warm-copper);
    box-shadow: inset 2px 2px 4px #d1d1d1, inset -2px -2px 4px #ffffff;
}

/* --- Featured Section --- */
.section--featured {
    background: var(--pearl);
    padding: 8rem 2rem 5rem;
}

.featured-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.featured-card {
    text-align: center;
    position: relative;
}

.featured-badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: var(--warm-copper);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.featured-puzzle-visual {
    margin: 1.5rem auto;
    display: flex;
    justify-content: center;
}

.puzzle-grid-demo {
    display: grid;
    grid-template-columns: repeat(4, 48px);
    grid-template-rows: repeat(4, 48px);
    gap: 6px;
}

.grid-cell {
    border-radius: 8px;
    background: var(--soft-silver);
    box-shadow: inset 2px 2px 4px #d1d1d1, inset -2px -2px 4px #ffffff;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

.gc-filled {
    background: var(--brushed-chrome);
    box-shadow: 3px 3px 6px #d1d1d1, -3px -3px 6px #ffffff;
}

.gc-accent {
    background: var(--warm-copper);
    box-shadow: 3px 3px 6px rgba(184, 115, 51, 0.3), -3px -3px 6px #ffffff;
}

.featured-title {
    font-size: clamp(1.4rem, 3vw, 2rem);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.featured-text {
    color: var(--brushed-chrome);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.featured-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.meta-item {
    padding: 0.35rem 0.9rem;
    background: var(--soft-silver);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--deep-graphite);
    box-shadow: inset 2px 2px 4px #d1d1d1, inset -2px -2px 4px #ffffff;
}

/* --- How It Works --- */
.section--how {
    background: var(--soft-silver);
    padding-bottom: 8rem;
}

.steps-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 1000px;
    margin: 2rem auto 0;
    flex-wrap: wrap;
}

.step-card {
    flex: 0 1 260px;
    text-align: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--warm-copper);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    box-shadow: 4px 4px 8px rgba(184, 115, 51, 0.3), -3px -3px 6px rgba(255, 255, 255, 0.7);
}

.step-title {
    margin-bottom: 0.5rem;
}

.step-text {
    font-size: 0.95rem;
    color: var(--brushed-chrome);
    line-height: 1.7;
}

.step-connector {
    flex: 0 0 60px;
}

.connector-svg {
    width: 60px;
    height: 8px;
}

/* --- Stats Section --- */
.section--stats {
    background: var(--pearl);
    padding: 8rem 2rem 5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.stat-item {
    text-align: center;
    padding: 2rem 1.5rem;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--warm-copper);
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--brushed-chrome);
    font-weight: 500;
}

/* --- CTA Section --- */
.section--cta {
    background: var(--soft-silver);
    padding: 5rem 2rem;
    text-align: center;
}

.cta-content {
    max-width: 550px;
    margin: 0 auto;
}

.cta-text {
    color: var(--brushed-chrome);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.cta-form {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.neo-input {
    flex: 1 1 250px;
    padding: 0.9rem 1.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--deep-graphite);
    background: var(--soft-silver);
    border: none;
    border-radius: 12px;
    box-shadow: var(--neo-shadow-inset);
    outline: none;
    transition: box-shadow 0.3s ease;
}

.neo-input::placeholder {
    color: var(--brushed-chrome);
}

.neo-input:focus {
    box-shadow: var(--neo-shadow-inset-deep);
}

/* --- Footer --- */
.site-footer {
    background: var(--deep-graphite);
    color: var(--brushed-chrome);
    padding: 3rem 2rem;
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-brand {
    flex: 1 1 200px;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.footer-logo .accent {
    color: var(--warm-copper);
}

.footer-tagline {
    font-size: 0.85rem;
    margin-top: 0.3rem;
    color: var(--brushed-chrome);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--brushed-chrome);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

.footer-copy {
    flex: 1 1 100%;
    text-align: center;
    font-size: 0.8rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(192, 192, 200, 0.2);
}

/* --- Scroll Reveal --- */
.section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero always visible */
.section--hero {
    opacity: 1;
    transform: translateY(0);
}

/* --- Puzzle Assembly Keyframe for Featured Grid --- */
@keyframes cellPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.gc-accent {
    animation: cellPulse 3s ease-in-out infinite;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section {
        padding: 3rem 1.25rem;
    }

    .section--hero {
        padding-bottom: 6rem;
    }

    .section--featured {
        padding: 6rem 1.25rem 3rem;
    }

    .section--stats {
        padding: 6rem 1.25rem 3rem;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .steps-row {
        flex-direction: column;
    }

    .step-connector {
        transform: rotate(90deg);
    }

    .puzzle-grid-demo {
        grid-template-columns: repeat(4, 40px);
        grid-template-rows: repeat(4, 40px);
    }

    .neo-card--large {
        padding: 2rem 1.5rem;
    }

    .featured-meta {
        flex-direction: column;
        align-items: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .diagonal-cut {
        height: 50px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .cta-form {
        flex-direction: column;
    }

    .neo-button {
        width: 100%;
        text-align: center;
    }
}