/* ppuzzl.bar - Puzzle Bar Duotone Design */

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

html {
    scroll-behavior: smooth;
}

body {
    background: #1e1410;
    color: #f0e4d4;
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Leather Texture */
.leather-texture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(58, 42, 30, 0.8) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(58, 42, 30, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(58, 42, 30, 0.7) 0%, transparent 40%),
        repeating-conic-gradient(rgba(58, 42, 30, 0.04) 0deg, transparent 1deg, transparent 3deg) 0 0 / 4px 4px;
    background-color: #3a2a1e;
    z-index: 0;
}

/* Geometric Overlay */
.geo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(60deg, transparent 48%, rgba(42, 107, 124, 0.06) 50%, transparent 52%),
        linear-gradient(-60deg, transparent 48%, rgba(42, 107, 124, 0.06) 50%, transparent 52%);
    background-size: 80px 80px;
    z-index: 1;
    pointer-events: none;
    opacity: 0.08;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1100px;
    padding: 60px 40px;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.z-start {
    align-self: flex-start;
    opacity: 0;
    transform: rotate(-3deg);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.z-start.visible {
    opacity: 1;
    transform: rotate(0deg);
}

.wordmark {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #f4e8d8;
    letter-spacing: 0.03em;
    line-height: 1;
}

.wordmark-sub {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(1.5rem, 4vw, 3rem);
    color: #c47832;
}

.z-diagonal {
    align-self: center;
    display: flex;
    gap: 30px;
    padding: 40px 0;
}

.puzzle-icon {
    width: 45px;
    height: 45px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.puzzle-icon.visible {
    opacity: 0.6;
    transform: translateY(0);
}

.pi1 { transform: rotate(15deg) translateY(20px); }
.pi2 { transform: rotate(-25deg) translateY(20px); }
.pi3 { transform: rotate(40deg) translateY(20px); }

.pi1.visible { transform: rotate(15deg) translateY(0); }
.pi2.visible { transform: rotate(-25deg) translateY(0); }
.pi3.visible { transform: rotate(40deg) translateY(0); }

.z-end {
    align-self: flex-end;
    text-align: right;
}

.tagline {
    font-family: 'Karla', sans-serif;
    font-size: 1.15rem;
    color: #e8a44a;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.tagline.visible {
    opacity: 1;
}

/* Puzzle Connectors */
.puzzle-connector {
    width: 100%;
    height: 40px;
    position: relative;
    z-index: 2;
}

.conn-1 { background: #1e1410; clip-path: ellipse(30px 20px at 40% 100%); }
.conn-2 { background: #f4e8d8; clip-path: ellipse(30px 20px at 60% 0%); }
.conn-3 { background: #1e1410; clip-path: ellipse(30px 20px at 35% 100%); }
.conn-4 { background: #f4e8d8; clip-path: ellipse(30px 20px at 55% 0%); }

/* Section Base */
.section {
    position: relative;
    overflow: hidden;
}

/* Menu Sections */
.menu-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 40px;
}

.menu-section:nth-child(odd) {
    background: #1e1410;
    color: #f0e4d4;
}

.menu-section:nth-child(even) {
    background: #f4e8d8;
    color: #1e1410;
}

.section-split {
    display: flex;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    align-items: center;
}

.z-rl .section-split {
    flex-direction: row-reverse;
}

.split-deco {
    flex: 55;
    display: flex;
    align-items: center;
    justify-content: center;
}

.split-text {
    flex: 45;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.split-text.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-label {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #c47832;
    display: block;
    margin-bottom: 12px;
}

.section-title {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    margin-bottom: 16px;
}

.section-body {
    font-family: 'Karla', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    max-width: 55ch;
    margin-bottom: 20px;
}

.difficulty-badge {
    font-family: 'Righteous', cursive;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #4a9aab;
}

.mono {
    font-family: 'Inconsolata', monospace;
    font-weight: 400;
    font-size: 13px;
}

/* Slider Puzzle */
.slider-grid {
    display: grid;
    grid-template-columns: repeat(3, 70px);
    grid-template-rows: repeat(3, 70px);
    gap: 4px;
    background: rgba(42, 107, 124, 0.15);
    padding: 8px;
    border-radius: 4px;
}

.tile {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Righteous', cursive;
    font-size: 24px;
    color: #f4e8d8;
    background: #c47832;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    border-radius: 2px;
}

.tile:hover {
    background: #e8a44a;
    transform: scale(0.95);
}

.tile.empty {
    background: transparent;
    cursor: default;
}

/* Pattern Game */
.pattern-grid {
    display: grid;
    grid-template-columns: repeat(3, 60px);
    grid-template-rows: repeat(3, 60px);
    gap: 6px;
}

.pgrid-cell {
    background: rgba(196, 120, 50, 0.15);
    border: 1px solid rgba(196, 120, 50, 0.3);
    border-radius: 2px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.pgrid-cell.active {
    background: #2a6b7c;
    border-color: #4a9aab;
}

.pgrid-cell.clickable {
    cursor: pointer;
    animation: cell-hint 2s ease-in-out infinite;
}

.pgrid-cell.clickable:hover {
    background: rgba(42, 107, 124, 0.4);
    border-color: #4a9aab;
}

.pgrid-cell.clickable.solved {
    background: #2a6b7c;
    border-color: #4a9aab;
    animation: none;
}

@keyframes cell-hint {
    0%, 100% { border-color: rgba(196, 120, 50, 0.3); }
    50% { border-color: #4a9aab; }
}

/* Hex SVG */
.hex-svg {
    width: 200px;
    height: 200px;
    animation: hex-spin 25s linear infinite;
}

@keyframes hex-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Futuristic Flash */
.flash-overlay {
    opacity: 0.08;
    transition: opacity 0.5s ease;
}

.futuristic-flash.flash-active .flash-overlay {
    opacity: 0.25;
}

/* Impossible Shape */
.impossible-shape {
    width: 120px;
    height: 120px;
    position: relative;
}

.impossible-shape::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 12px solid #c47832;
    transform: rotate(45deg);
}

.impossible-shape::after {
    content: '';
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    border: 8px solid #2a6b7c;
    transform: rotate(22.5deg);
}

/* Deco Graphics */
.deco-graphic {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.menu-section.visible .deco-graphic {
    opacity: 1;
    transform: scale(1);
}

/* Footer */
.footer-section {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e1410;
}

.footer-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 164, 74, 0.15) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: 0;
}

.footer-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.footer-wordmark {
    font-family: 'Righteous', cursive;
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #f4e8d8;
    display: block;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 1s ease, transform 1s ease;
}

.footer-section.visible .footer-wordmark {
    opacity: 1;
    transform: scale(1);
}

.footer-domain {
    font-family: 'Karla', sans-serif;
    font-size: 14px;
    color: #c47832;
    margin-top: 12px;
}

/* Responsive */
@media (max-width: 700px) {
    .section-split {
        flex-direction: column;
    }

    .z-rl .section-split {
        flex-direction: column;
    }

    .hero-content {
        padding: 40px 20px;
    }

    .menu-section {
        padding: 60px 20px;
    }

    .slider-grid {
        grid-template-columns: repeat(3, 55px);
        grid-template-rows: repeat(3, 55px);
    }
}
