/* ==========================================================
   ppzz.lu -- Minimalist Puzzle Gallery
   Palette (Sunset-Warm):
     Gallery White  #FAFAF8
     Warm Black     #1A1814
     Soft Charcoal  #4A4640
     Sunset Orange  #E8734A
     Blush Pink     #F4B4A0
     Deep Brown     #3A2818
   Fonts: Inter (display), Lato (body)
   ========================================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    color: #4A4640;
    background-color: #FAFAF8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---- Generative Geometric Background ---- */
.geo-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.geo-dot {
    position: absolute;
    border-radius: 50%;
    background-color: #F4B4A0;
    opacity: 0.12;
}

.geo-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid #E8734A;
    opacity: 0.07;
}

.geo-line {
    position: absolute;
    background-color: #F4B4A0;
    opacity: 0.06;
    transform-origin: 0 0;
}

/* ---- Sections ---- */
.section {
    position: relative;
    z-index: 1;
    padding: 8vh 0;
    width: 100%;
}

.section-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

/* ---- Measurement Marks (Tech Motif) ---- */
.measurement-mark {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #E8734A;
    opacity: 0.18;
}

.measurement-mark--top {
    top: 0;
}

.measurement-mark--top::before,
.measurement-mark--top::after {
    content: '';
    position: absolute;
    top: -2px;
    width: 1px;
    height: 5px;
    background-color: #E8734A;
    opacity: 0.4;
}

.measurement-mark--top::before {
    left: 0;
}

.measurement-mark--top::after {
    right: 0;
}

.measurement-mark--bottom {
    bottom: 0;
}

.measurement-mark--bottom::before,
.measurement-mark--bottom::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 1px;
    height: 5px;
    background-color: #E8734A;
    opacity: 0.4;
}

.measurement-mark--bottom::before {
    left: 0;
}

.measurement-mark--bottom::after {
    right: 0;
}

/* ---- Mono Labels ---- */
.mono-label {
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: #4A4640;
    opacity: 0.45;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

/* ---- Hero Section ---- */
.section-hero {
    padding: 16vh 0 10vh;
    text-align: center;
}

.hero-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 600;
    color: #1A1814;
    line-height: 1.15;
    margin-bottom: 0.6rem;
    letter-spacing: -0.02em;
}

.hero-title .accent {
    color: #E8734A;
}

.hero-subtitle {
    font-family: 'Lato', sans-serif;
    font-size: 1.1rem;
    color: #4A4640;
    font-weight: 400;
    opacity: 0.7;
}

/* ---- Puzzle Cards ---- */
.puzzle-card {
    background: #FAFAF8;
    border: 1px solid rgba(74, 70, 64, 0.1);
    border-radius: 4px;
    padding: 2.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
    transform-style: preserve-3d;
    perspective: 800px;
}

.puzzle-card:hover {
    box-shadow: 0 12px 40px rgba(26, 24, 20, 0.06);
}

.puzzle-card-inner {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.puzzle-visual {
    flex-shrink: 0;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.puzzle-info {
    flex: 1;
}

.puzzle-title {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.5rem);
    font-weight: 600;
    color: #1A1814;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.puzzle-description {
    font-size: 0.95rem;
    color: #4A4640;
    line-height: 1.7;
    margin-bottom: 0.8rem;
}

.puzzle-tag {
    display: inline-block;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #E8734A;
    border: 1px solid rgba(232, 115, 74, 0.3);
    padding: 0.2em 0.7em;
    border-radius: 2px;
}

/* ---- Puzzle Visual: Grid ---- */
.puzzle-visual--grid {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    grid-template-rows: repeat(3, 40px);
    gap: 6px;
    width: auto;
    height: auto;
}

.grid-cell {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(74, 70, 64, 0.15);
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.grid-cell.active {
    background-color: #F4B4A0;
}

.puzzle-card:hover .grid-cell.active {
    background-color: #E8734A;
}

/* ---- Puzzle Visual: Circles ---- */
.puzzle-visual--circles {
    position: relative;
}

.circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid #4A4640;
    opacity: 0.25;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: border-color 0.3s ease, opacity 0.3s ease;
}

.circle-outer {
    width: 140px;
    height: 140px;
}

.circle-mid {
    width: 90px;
    height: 90px;
}

.circle-inner {
    width: 46px;
    height: 46px;
}

.circle-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #E8734A;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: transform 0.3s ease;
}

.puzzle-card:hover .circle {
    border-color: #E8734A;
    opacity: 0.4;
}

.puzzle-card:hover .circle-dot {
    transform: translate(-50%, -50%) scale(1.5);
}

/* ---- Puzzle Visual: Lines ---- */
.puzzle-visual--lines {
    display: flex;
    align-items: center;
    justify-content: center;
}

.line-set {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    height: 120px;
}

.v-line {
    width: 2px;
    height: 80px;
    background-color: #4A4640;
    opacity: 0.15;
    border-radius: 1px;
    transition: height 0.4s ease, opacity 0.3s ease;
}

.v-line.accent-line {
    background-color: #E8734A;
    opacity: 0.7;
    height: 110px;
}

.puzzle-card:hover .v-line {
    opacity: 0.3;
}

.puzzle-card:hover .v-line.accent-line {
    opacity: 1;
}

/* ---- Puzzle Visual: Matrix ---- */
.puzzle-visual--matrix {
    flex-direction: column;
    gap: 4px;
}

.matrix-row {
    display: flex;
    gap: 14px;
}

.matrix-char {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.3rem;
    color: #4A4640;
    opacity: 0.25;
    transition: color 0.3s ease, opacity 0.3s ease;
    width: 1.3rem;
    text-align: center;
}

.matrix-char.highlight {
    color: #E8734A;
    opacity: 0.7;
}

.puzzle-card:hover .matrix-char {
    opacity: 0.4;
}

.puzzle-card:hover .matrix-char.highlight {
    opacity: 1;
}

/* ---- Puzzle Visual: Tessellation ---- */
.puzzle-visual--tessellation {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hex-grid {
    display: grid;
    grid-template-columns: repeat(4, 32px);
    grid-template-rows: repeat(2, 32px);
    gap: 6px;
}

.hex {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(74, 70, 64, 0.15);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    transition: background-color 0.3s ease;
}

.hex.filled {
    background-color: #F4B4A0;
}

.puzzle-card:hover .hex.filled {
    background-color: #E8734A;
}

/* ---- Breathing Sections ---- */
.section-breath {
    padding: 4vh 0;
}

.dot-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.dot {
    width: 4px;
    height: 4px;
    background-color: #4A4640;
    border-radius: 50%;
    opacity: 0.2;
}

.thin-rule {
    height: 1px;
    background-color: #4A4640;
    opacity: 0.1;
    width: 100%;
}

/* ---- Footer ---- */
.section-footer {
    padding: 6vh 0 4vh;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 1.5rem 0;
}

.footer-sep {
    color: #4A4640;
    opacity: 0.3;
}

/* ---- Fade-In Animation ---- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .puzzle-card-inner {
        flex-direction: column;
        text-align: center;
    }

    .puzzle-visual {
        width: 120px;
        height: 120px;
        margin: 0 auto;
    }

    .puzzle-visual--grid {
        grid-template-columns: repeat(3, 30px);
        grid-template-rows: repeat(3, 30px);
    }

    .grid-cell {
        width: 30px;
        height: 30px;
    }

    .circle-outer {
        width: 100px;
        height: 100px;
    }

    .circle-mid {
        width: 65px;
        height: 65px;
    }

    .circle-inner {
        width: 34px;
        height: 34px;
    }

    .line-set {
        height: 90px;
        gap: 8px;
    }

    .v-line {
        height: 60px;
    }

    .v-line.accent-line {
        height: 82px;
    }

    .puzzle-card {
        padding: 1.5rem;
    }

    .section-hero {
        padding: 12vh 0 8vh;
    }
}
