/* ============================================
   onehitekrednek.com - Construction Paper Diorama
   ============================================ */

/* --- CSS Custom Properties (Morning defaults) --- */
:root {
    --sky-top: #87CEEB;
    --sky-bottom: #B8DCF0;
    --sun-fill: #F9D71C;
    --sun-rays: #D8B020;
    --cloud-fill: #F2EDE4;
    --cloud-stroke: #DDD6C8;
    --mountain-far: #7B8FA1;
    --mountain-mid: #6A7E6A;
    --mountain-near: #7BA544;
    --lake: #5B8FA8;
    --lake-reflect-1: #7BAFCA;
    --lake-reflect-2: #A3C8D8;
    --grass-bg: #6B8F3C;
    --grass-fg: #7BA544;
    --text-primary: #2c2418;
    --text-secondary: #5c4a32;
    --card-bg: rgba(253, 250, 243, 0.92);
    --card-border: rgba(92, 74, 50, 0.16);
    --nav-text: #5c4a32;
    --tag-bg: rgba(74, 103, 65, 0.1);
    --tag-text: #3B6D11;
    --copper-accent: #b87333;
    --copper-hover: #d4894a;
    --grass-footer-text: #4A6B28;
    --moon-body: #E8E0D0;
    --moon-shadow: #A8A090;
    --snow-cap: #FAFAFA;

    /* Layout */
    --content-max: 900px;
    --content-wide: 1320px;
}

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

html {
    scroll-behavior: smooth;
    background: var(--mountain-near, #7BA544);
}

body {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    overflow-x: hidden;
    background: var(--mountain-near, #7BA544);
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
}

code, pre, .nav-link, .blog-date, .card-tag, .section-label,
.footer-link, .form-label, .content-type-badge, .blog-category {
    font-family: 'IBM Plex Mono', monospace;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Fixed Backdrop --- */
.scene-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}

/* --- Page Wrapper (scrolling content) --- */
.page-wrapper {
    position: relative;
    z-index: 2;
}

/* --- Sky Section (inside fixed backdrop) --- */
.scene-sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}

/* Stars */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 55%;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: #FAFAFA;
}

/* Sun */
.sun {
    position: absolute;
    width: 60px;
    height: 60px;
    z-index: 2;
    opacity: 0;
}

.sun-core {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--sun-fill);
    border: 2px solid rgba(216, 176, 32, 0.6);
    animation: sun-bob 6s ease-in-out infinite;
}

.sun-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    animation: sun-ray-spin 25s linear infinite;
}

.sun-rays span {
    position: absolute;
    width: 3px;
    height: 14px;
    background: var(--sun-rays);
    top: 50%;
    left: 50%;
    transform-origin: 50% 50%;
    border-radius: 1px;
}

.sun-rays span:nth-child(1)  { transform: translate(-50%, -50%) rotate(0deg) translateY(-38px); }
.sun-rays span:nth-child(2)  { transform: translate(-50%, -50%) rotate(30deg) translateY(-38px); }
.sun-rays span:nth-child(3)  { transform: translate(-50%, -50%) rotate(60deg) translateY(-38px); }
.sun-rays span:nth-child(4)  { transform: translate(-50%, -50%) rotate(90deg) translateY(-38px); }
.sun-rays span:nth-child(5)  { transform: translate(-50%, -50%) rotate(120deg) translateY(-38px); }
.sun-rays span:nth-child(6)  { transform: translate(-50%, -50%) rotate(150deg) translateY(-38px); }
.sun-rays span:nth-child(7)  { transform: translate(-50%, -50%) rotate(180deg) translateY(-38px); }
.sun-rays span:nth-child(8)  { transform: translate(-50%, -50%) rotate(210deg) translateY(-38px); }
.sun-rays span:nth-child(9)  { transform: translate(-50%, -50%) rotate(240deg) translateY(-38px); }
.sun-rays span:nth-child(10) { transform: translate(-50%, -50%) rotate(270deg) translateY(-38px); }
.sun-rays span:nth-child(11) { transform: translate(-50%, -50%) rotate(300deg) translateY(-38px); }
.sun-rays span:nth-child(12) { transform: translate(-50%, -50%) rotate(330deg) translateY(-38px); }

/* Moon */
.moon {
    position: absolute;
    width: 50px;
    height: 50px;
    z-index: 2;
    opacity: 0;
}

.moon-body {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--moon-body);
    animation: moon-bob 8s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.moon-shadow {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 50%;
    background: var(--moon-shadow);
}

/* Clouds */
.cloud {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

/* Cloud 1: Large fluffy -- slow, high */
.cloud-1 {
    width: 240px;
    top: 10%;
    left: -240px;
    animation: cloud-drift-1 240s linear infinite;
}

/* Cloud 2: Small puff -- medium, mid-height */
.cloud-2 {
    width: 80px;
    top: 22%;
    left: -80px;
    animation: cloud-drift-2 130s linear infinite;
}

/* Cloud 3: Long wisp -- very slow, low */
.cloud-3 {
    width: 260px;
    top: 42%;
    left: -260px;
    animation: cloud-drift-3 280s linear infinite;
}

/* Cloud 4: Tall cumulus -- medium, mid */
.cloud-4 {
    width: 130px;
    top: 15%;
    left: -130px;
    animation: cloud-drift-4 180s linear infinite;
}

/* Cloud 5: Tiny wisp -- faster relative, high */
.cloud-5 {
    width: 55px;
    top: 8%;
    left: -55px;
    animation: cloud-drift-5 100s linear infinite;
}

/* Cloud Navigation -- each item is its own cloud */
.cloud-nav {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    gap: 0.3rem;
    align-items: flex-start;
    white-space: nowrap;
}

.nav-cloud-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(70px, 10vw, 110px);
    animation: nav-wobble 4.5s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.nav-cloud-item:nth-child(2) { animation-delay: -0.7s; }
.nav-cloud-item:nth-child(3) { animation-delay: -1.5s; }
.nav-cloud-item:nth-child(4) { animation-delay: -2.2s; }
.nav-cloud-item:nth-child(5) { animation-delay: -3.0s; }
.nav-cloud-item:nth-child(6) { animation-delay: -3.8s; }

.nav-cloud-item svg {
    width: 100%;
    height: auto;
    display: block;
}

.nav-cloud-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.6rem, 1.2vw, 0.8rem);
    font-weight: 500;
    color: var(--nav-text);
    pointer-events: none;
    padding-top: 2px;
}

.nav-cloud-item:hover {
    transform: translateY(-3px) scale(1.05);
}

.nav-cloud-active .nav-cloud-label {
    font-weight: 600;
}

.nav-cloud-login .nav-cloud-label {
    color: var(--copper-accent);
}

/* Nav cloud size variants */
.nav-cloud-wide {
    width: clamp(90px, 12vw, 140px);
}

.nav-cloud-tall {
    width: clamp(75px, 10vw, 105px);
}

.nav-cloud-wispy {
    width: clamp(45px, 5.5vw, 65px);
}

.nav-cloud-tiny {
    width: clamp(50px, 6vw, 70px);
}

.nav-cloud-tiny .nav-cloud-label {
    font-size: clamp(0.48rem, 0.9vw, 0.62rem);
}

.nav-cloud-blog {
    /* Intentionally empty -- parent .nav-cloud-item default width applies */
}

/* Override the parent item width when it contains the blog cloud */
.nav-cloud-item:has(.nav-cloud-blog) {
    width: clamp(52px, 6.5vw, 72px);
}

.nav-cloud-item:has(.nav-cloud-blog) .nav-cloud-label {
    font-size: clamp(0.48rem, 0.9vw, 0.62rem);
}

/* Global search bar -- below cloud nav, auth-only */
.search-bar {
    position: fixed;
    top: 85px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    width: clamp(200px, 40vw, 400px);
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 3px 5px 4px 6px;
    padding: 0.2rem 0.5rem;
    box-shadow: 1px 2px 6px rgba(0,0,0,0.08);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-size: 0.82rem;
    color: var(--text-primary);
    padding: 0.3rem 0.4rem;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-submit {
    background: none;
    border: none;
    color: var(--copper-accent);
    cursor: pointer;
    padding: 0.2rem;
    display: flex;
    align-items: center;
}

/* Hero -- sits in the sky zone of the scrolling layer */
.hero {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem 1rem;
    padding-top: 12vh;
    padding-bottom: 10vh;
}

.hero-compact {
    padding-top: 8vh;
    padding-bottom: 4vh;
}

.hero-compact .hero-heading {
    font-size: clamp(1.2rem, 3vw, 2rem);
}

.hero-heading {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    line-height: 1.2;
    color: var(--text-primary);
}

.hero-line-1 {
    display: block !important;
    font-size: 0.55em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin: 0 auto 0.5rem;
    width: fit-content;
}

.hero-line-2 {
    display: block !important;
    color: var(--copper-accent);
    margin: 0 auto 0;
    width: fit-content;
}

.hero-tagline {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-top: 0.8rem;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.hero-location {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1.5px solid var(--card-border);
    border-radius: 10px 12px 8px 14px;
    padding: 2px 12px;
    margin-top: 0.6rem;
    transform: rotate(-0.5deg);
}

.blog-detail-meta {
    margin-top: 0.8rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    font-size: 0.85rem;
}

/* Mountains - layered within the fixed backdrop */
.mountains {
    position: absolute;
    left: 0;
    width: 100%;
    pointer-events: none;
}

/* Mountains positioned from bottom of sky to top of terrain */
.mountains-far-back  { z-index: 2; bottom: 45%; height: 35%; }
.mountains-far-front { z-index: 4; bottom: 45%; height: 40%; }
.mountains-mid       { z-index: 5; bottom: 42%; height: 28%; }
/* Near hills removed -- integrated into terrain-hills SVG */

/* Individual mountain peaks */
.peak {
    position: absolute;
    bottom: 0;
}

.peak svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Each peak polygon has a visible stroke for hand-cut paper feel */
.peak-shape {
    stroke-width: 1.5;
    stroke-linejoin: round;
}

/* Snow caps - consistent line across peaks above threshold */
.snow-cap {
    fill: var(--snow-cap);
    stroke: #E8E0D8;
    stroke-width: 1;
    stroke-linejoin: round;
}

/* Far-back peak color variants -- purple/dark blue-purple, most distant */
.peak-far-1 { fill: #5A5078; stroke: #4E4468; }
.peak-far-2 { fill: #635880; stroke: #574C74; }
.peak-far-3 { fill: #6B6088; stroke: #5F547C; }
.peak-far-4 { fill: #584E75; stroke: #4C4268; }
.peak-far-5 { fill: #61567E; stroke: #554A72; }

/* Far-front peak color variants -- dark blue-grey with purple undertone */
.peak-far-front-1 { fill: #4E5A72; stroke: #424E66; }
.peak-far-front-2 { fill: #566280; stroke: #4A5674; }
.peak-far-front-3 { fill: #505C78; stroke: #44506C; }

/* Mid peak color variants -- blue-green transitional */
.peak-mid-1 { fill: #4A6258; stroke: #3E564C; }
.peak-mid-2 { fill: #526A5E; stroke: #465E52; }
.peak-mid-3 { fill: #4E6658; stroke: #425A4C; }
.peak-mid-4 { fill: #566E62; stroke: #4A6256; }
.peak-mid-5 { fill: #486050; stroke: #3C5444; }

/* Near hills color variants -- greens matching terrain for seamless blend */
.peak-near-1 { fill: #4A6A3A; stroke: #3E5E2E; }
.peak-near-2 { fill: #3E5E32; stroke: #325228; }
.peak-near-3 { fill: #446438; stroke: #38582C; }
.peak-near-4 { fill: #3A5A30; stroke: #2E4E24; }

/* Treeline transition: tiny trees along hilltops */
.hill-trees {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.hill-tree {
    position: absolute;
    bottom: 0;
}

/* --- Terrain Section (inside fixed backdrop, bottom portion) --- */
.scene-terrain {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    z-index: 7;
    /* Gradient: dark near hills at top -> bright meadow green at bottom */
    background: linear-gradient(180deg, #4A6A3A 0%, #5A7A44 40%, #6B8F3C 70%, #7BA544 100%);
}

.terrain-bg {
    display: none;
}

.terrain-hills {
    position: absolute;
    top: -15%;
    left: 0;
    width: 100%;
    height: 65%;
    z-index: 1;
}

.hill-shape {
    stroke-linejoin: round;
}

.lake-svg {
    display: block;
    width: 80%;
    max-width: 900px;
    margin: 0 auto;
    height: auto;
    position: relative;
    z-index: 2;
    margin-top: 2%;
}

/* Tree layers -- JS-generated for randomness */
.trees-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}

.tree {
    position: absolute;
    transform-origin: bottom center;
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- Scrolling Content Layer --- */
.backdrop-spacer {
    height: 38vh;
    pointer-events: none;
}

body:not([data-scene="landing"]) .backdrop-spacer {
    height: 12vh;
}

.content-scroll {
    position: relative;
    z-index: 8;
}

.content-area {
    perspective: 800px;
    padding: 2rem 0;
    background: transparent;
}

.iso-content {
    transform: rotateX(1.5deg);
    transform-origin: center top;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

body[data-scene="blog_detail"] .content-area,
body[data-scene="interior"] .content-area {
    perspective: none;
}

body[data-scene="blog_detail"] .iso-content,
body[data-scene="interior"] .iso-content {
    transform: none;
}

body[data-scene="interior"] .iso-content {
    max-width: var(--content-wide);
}

/* --- Construction paper cut edge shared styles --- */
.paper-cut {
    clip-path: polygon(
        1% 4%, 3% 0%, 8% 2%, 15% 0%, 22% 3%, 30% 1%, 38% 0%, 45% 2%,
        52% 0%, 60% 1%, 68% 0%, 75% 3%, 82% 1%, 90% 0%, 95% 2%, 98% 0%, 100% 3%,
        100% 6%, 99% 15%, 100% 25%, 99% 40%, 100% 55%, 99% 70%, 100% 85%, 99% 94%,
        100% 97%, 97% 100%, 92% 98%, 85% 100%, 78% 97%, 70% 100%, 62% 98%, 55% 100%,
        48% 97%, 40% 100%, 32% 98%, 25% 100%, 18% 97%, 10% 100%, 5% 98%, 2% 100%,
        0% 97%, 1% 85%, 0% 70%, 1% 55%, 0% 40%, 1% 25%, 0% 15%, 1% 6%
    );
}

.paper-cut-alt {
    clip-path: polygon(
        0% 3%, 4% 1%, 10% 3%, 18% 0%, 25% 2%, 33% 0%, 40% 3%, 48% 1%,
        55% 0%, 63% 2%, 70% 0%, 78% 3%, 85% 1%, 92% 0%, 97% 2%, 100% 0%,
        99% 5%, 100% 18%, 99% 32%, 100% 48%, 99% 62%, 100% 78%, 99% 90%, 100% 96%,
        98% 100%, 90% 97%, 82% 100%, 74% 98%, 65% 100%, 56% 97%, 48% 100%, 38% 98%,
        30% 100%, 22% 97%, 14% 100%, 6% 98%, 0% 100%,
        1% 92%, 0% 78%, 1% 62%, 0% 48%, 1% 32%, 0% 18%, 1% 8%
    );
}

/* Apply paper-cut to buttons, labels, pills, tags */
.section-label,
.card-tag,
.form-button,
.back-link,
.category-link,
.interest-pill,
.blog-item,
.footer-link,
.page-link,
.content-type-badge,
.form-error {
    clip-path: polygon(
        1% 4%, 4% 0%, 10% 2%, 18% 0%, 26% 3%, 34% 1%, 42% 0%, 50% 2%,
        58% 0%, 66% 1%, 74% 0%, 82% 3%, 90% 1%, 96% 0%, 100% 3%,
        100% 8%, 99% 22%, 100% 40%, 99% 60%, 100% 78%, 99% 92%,
        100% 97%, 95% 100%, 86% 98%, 76% 100%, 66% 97%, 56% 100%, 46% 98%,
        36% 100%, 26% 97%, 16% 100%, 6% 98%, 0% 100%,
        0% 92%, 1% 75%, 0% 55%, 1% 35%, 0% 15%, 1% 5%
    );
}

/* Alternate cut for even-numbered siblings */
.interest-pill:nth-child(even),
.blog-item:nth-child(even),
.category-link:nth-child(even),
.footer-link:nth-child(even) {
    clip-path: polygon(
        0% 2%, 5% 0%, 12% 3%, 20% 1%, 28% 0%, 36% 2%, 44% 0%, 52% 3%,
        60% 1%, 68% 0%, 76% 2%, 84% 0%, 92% 3%, 100% 1%,
        99% 8%, 100% 25%, 99% 45%, 100% 65%, 99% 85%, 100% 95%,
        96% 100%, 88% 97%, 78% 100%, 68% 98%, 58% 100%, 48% 97%,
        38% 100%, 28% 98%, 18% 100%, 8% 97%, 0% 100%,
        1% 88%, 0% 68%, 1% 48%, 0% 28%, 1% 10%
    );
}

/* --- WCAG Text Background -- hand-cut construction paper --- */
.text-bg {
    background: var(--card-bg);
    padding: 4px 12px;
    display: inline-block;
    border: 1.5px solid var(--card-border);
    box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.08), inset 0 0 12px rgba(0, 0, 0, 0.02);
    position: relative;

    /* Irregular cut edges via polygon clip */
    clip-path: polygon(
        1% 4%, 3% 0%, 8% 2%, 15% 0%, 22% 3%, 30% 1%, 38% 0%, 45% 2%,
        52% 0%, 60% 1%, 68% 0%, 75% 3%, 82% 1%, 90% 0%, 95% 2%, 98% 0%, 100% 3%,
        100% 6%, 99% 15%, 100% 25%, 99% 40%, 100% 55%, 99% 70%, 100% 85%, 99% 94%,
        100% 97%, 97% 100%, 92% 98%, 85% 100%, 78% 97%, 70% 100%, 62% 98%, 55% 100%,
        48% 97%, 40% 100%, 32% 98%, 25% 100%, 18% 97%, 10% 100%, 5% 98%, 2% 100%,
        0% 97%, 1% 85%, 0% 70%, 1% 55%, 0% 40%, 1% 25%, 0% 15%, 1% 6%
    );
}

/* Unique irregularity per element via nth-child offsets */
.text-bg:nth-child(odd) {
    transform: rotate(-0.4deg);
    clip-path: polygon(
        0% 3%, 4% 1%, 10% 3%, 18% 0%, 25% 2%, 33% 0%, 40% 3%, 48% 1%,
        55% 0%, 63% 2%, 70% 0%, 78% 3%, 85% 1%, 92% 0%, 97% 2%, 100% 0%,
        99% 5%, 100% 18%, 99% 32%, 100% 48%, 99% 62%, 100% 78%, 99% 90%, 100% 96%,
        98% 100%, 90% 97%, 82% 100%, 74% 98%, 65% 100%, 56% 97%, 48% 100%, 38% 98%,
        30% 100%, 22% 97%, 14% 100%, 6% 98%, 0% 100%,
        1% 92%, 0% 78%, 1% 62%, 0% 48%, 1% 32%, 0% 18%, 1% 8%
    );
}

.text-bg:nth-child(even) {
    transform: rotate(0.3deg);
    clip-path: polygon(
        2% 0%, 6% 3%, 14% 1%, 22% 0%, 30% 2%, 38% 0%, 46% 3%, 54% 1%,
        62% 0%, 70% 2%, 78% 0%, 86% 3%, 94% 1%, 100% 3%,
        100% 8%, 99% 22%, 100% 38%, 99% 55%, 100% 72%, 99% 88%, 100% 95%,
        96% 100%, 88% 97%, 80% 100%, 72% 98%, 64% 100%, 55% 97%, 46% 100%,
        38% 98%, 28% 100%, 20% 97%, 12% 100%, 4% 98%, 0% 100%,
        0% 95%, 1% 80%, 0% 62%, 1% 45%, 0% 28%, 1% 12%
    );
}

.hero-location.text-bg {
    padding: 3px 14px;
}

/* Section */
.section {
    margin-bottom: 2.5rem;
}

.section-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-left: 4px;
    background: var(--card-bg);
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
}

/* Project Cards -- construction paper feel */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.project-card {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    padding: 1.2rem;
    animation: card-entrance 0.5s ease-out both;
    transition: transform 0.3s ease;
    position: relative;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.08), inset 0 0 15px rgba(0,0,0,0.02);
}

/* Rough-cut paper edges and per-card rotation */
.project-card:nth-child(1) {
    transform: rotate(-0.4deg);
    clip-path: polygon(2% 3%, 5% 0%, 12% 2%, 20% 0%, 30% 3%, 40% 1%, 50% 0%, 60% 2%, 70% 0%, 80% 3%, 90% 1%, 96% 0%, 100% 2%, 99% 12%, 100% 30%, 99% 50%, 100% 70%, 99% 88%, 100% 97%, 95% 100%, 85% 98%, 75% 100%, 65% 97%, 55% 100%, 45% 98%, 35% 100%, 25% 97%, 15% 100%, 5% 98%, 0% 100%, 1% 88%, 0% 68%, 1% 48%, 0% 28%, 1% 8%);
}
.project-card:nth-child(2) {
    transform: rotate(0.3deg);
    clip-path: polygon(0% 2%, 8% 0%, 16% 3%, 24% 1%, 34% 0%, 44% 2%, 54% 0%, 64% 3%, 74% 1%, 84% 0%, 94% 2%, 100% 0%, 100% 8%, 99% 25%, 100% 45%, 99% 65%, 100% 82%, 99% 96%, 92% 100%, 82% 97%, 72% 100%, 60% 98%, 48% 100%, 36% 97%, 24% 100%, 12% 98%, 0% 100%, 1% 82%, 0% 60%, 1% 40%, 0% 20%, 1% 5%);
}
.project-card:nth-child(3) {
    transform: rotate(-0.2deg);
    clip-path: polygon(1% 0%, 10% 3%, 20% 1%, 32% 0%, 42% 2%, 52% 0%, 62% 3%, 72% 1%, 82% 0%, 92% 2%, 100% 1%, 99% 15%, 100% 35%, 99% 55%, 100% 75%, 99% 92%, 94% 100%, 84% 98%, 72% 100%, 60% 97%, 48% 100%, 36% 98%, 22% 100%, 10% 97%, 0% 100%, 0% 90%, 1% 70%, 0% 50%, 1% 30%, 0% 10%);
}
.project-card:nth-child(4) {
    transform: rotate(0.5deg);
    clip-path: polygon(0% 1%, 6% 3%, 14% 0%, 24% 2%, 34% 0%, 46% 3%, 56% 1%, 66% 0%, 76% 2%, 88% 0%, 96% 3%, 100% 1%, 100% 10%, 99% 28%, 100% 48%, 99% 68%, 100% 85%, 100% 98%, 90% 100%, 78% 97%, 66% 100%, 54% 98%, 42% 100%, 30% 97%, 18% 100%, 6% 98%, 0% 100%, 1% 85%, 0% 65%, 1% 45%, 0% 25%, 1% 8%);
}
.project-card:nth-child(5) {
    transform: rotate(-0.35deg);
    clip-path: polygon(3% 0%, 12% 2%, 22% 0%, 32% 3%, 44% 1%, 54% 0%, 66% 2%, 76% 0%, 86% 3%, 96% 1%, 100% 3%, 99% 18%, 100% 38%, 99% 58%, 100% 78%, 99% 94%, 96% 100%, 86% 98%, 74% 100%, 62% 97%, 50% 100%, 38% 98%, 26% 100%, 14% 97%, 2% 100%, 0% 97%, 1% 78%, 0% 58%, 1% 38%, 0% 18%, 1% 4%);
}
.project-card:nth-child(6) {
    transform: rotate(0.25deg);
    clip-path: polygon(0% 3%, 8% 1%, 18% 0%, 28% 2%, 40% 0%, 50% 3%, 60% 1%, 72% 0%, 82% 2%, 92% 0%, 100% 2%, 100% 12%, 99% 32%, 100% 52%, 99% 72%, 100% 90%, 98% 100%, 88% 97%, 76% 100%, 64% 98%, 52% 100%, 40% 97%, 28% 100%, 16% 98%, 4% 100%, 0% 98%, 0% 88%, 1% 68%, 0% 48%, 1% 28%, 0% 8%);
}

.project-card:hover {
    transform: translateY(-3px) rotate(0.5deg);
}

.card-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.card-description {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.card-tag {
    display: inline-block;
    font-size: 0.72rem;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 2px 10px;
    margin-right: 4px;
}

.card-tag-repo {
    background: rgba(184, 115, 51, 0.1);
    color: var(--copper-accent);
    border: 1px solid var(--copper-accent);
    opacity: 0.7;
}

.card-tag-repo:hover {
    opacity: 1;
    border-radius: 10px;
}

/* Blog List */
.blog-list {
    border-left: 2px solid var(--card-border);
    padding-left: 1rem;
}

.blog-item {
    display: flex;
    align-items: baseline;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 2px 4px 3px 5px;
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    margin-bottom: 0.4rem;
    transition: transform 0.2s ease;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.04);
}

.blog-item:nth-child(odd) { transform: rotate(-0.15deg); }
.blog-item:nth-child(even) { transform: rotate(0.2deg); }
.blog-item:nth-child(3n) { border-radius: 4px 2px 5px 3px; }

.blog-item:hover {
    transform: translateX(3px) rotate(0.1deg);
}

.blog-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
    min-width: 60px;
}

.blog-title {
    font-size: 0.92rem;
    color: var(--text-primary);
    flex: 1;
}

.blog-category {
    font-size: 0.68rem;
    color: var(--copper-accent);
}

.blog-empty {
    color: var(--text-secondary);
    font-size: 0.88rem;
    padding: 0.6rem 1rem;
}

.blog-detail-meta .blog-date,
.blog-detail-meta .blog-category {
    background: var(--card-bg);
    padding: 2px 8px;
    border: 1px solid var(--card-border);
    border-radius: 3px 5px 4px 6px;
}

/* Blog Categories Filter */
.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    padding: 5px 14px;
    border-radius: 3px 5px 4px 6px;
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    color: var(--text-primary);
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, background 0.2s;
}

.category-link:nth-child(odd) { border-radius: 5px 3px 6px 4px; }

.category-link:hover {
    transform: translateY(-1px) rotate(0.3deg);
}

.category-active {
    background: var(--copper-accent);
    color: #fff;
    border-color: var(--copper-accent);
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
}

.page-link {
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

.page-info {
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
}

/* Interests Pills */
.interests-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.interest-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 12px 14px 10px 16px;
    padding: 6px 14px;
    animation: pill-wobble 5s ease-in-out infinite;
    color: var(--text-primary);
    box-shadow: 1px 1px 3px rgba(0,0,0,0.04);
}

.interest-pill:nth-child(2n) { animation-delay: -1.2s; border-radius: 14px 10px 16px 12px; }
.interest-pill:nth-child(3n) { animation-delay: -2.5s; border-radius: 10px 16px 12px 14px; }
.interest-pill:nth-child(4n) { border-radius: 16px 12px 14px 10px; }
.interest-pill:nth-child(odd) { transform: rotate(-0.3deg); }
.interest-pill:nth-child(even) { transform: rotate(0.4deg); }

.interest-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--copper-accent);
}

/* About page */
.prose-content {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* Block-level text-bg for multi-line content */
.text-bg-block {
    background: var(--card-bg);
    padding: 1.2rem 1.5rem;
    border: 1.5px solid var(--card-border);
    box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.08), inset 0 0 20px rgba(0, 0, 0, 0.02);
    transform: rotate(-0.25deg);
    clip-path: polygon(
        1% 2%, 4% 0%, 10% 2%, 18% 0%, 25% 1%, 33% 0%, 42% 2%, 50% 0%,
        58% 1%, 66% 0%, 75% 2%, 83% 0%, 90% 1%, 96% 0%, 100% 2%,
        100% 5%, 99% 20%, 100% 40%, 99% 60%, 100% 80%, 99% 95%,
        100% 98%, 96% 100%, 88% 98%, 80% 100%, 70% 99%, 60% 100%, 50% 98%,
        40% 100%, 30% 99%, 20% 100%, 12% 98%, 4% 100%, 0% 98%,
        0% 95%, 1% 78%, 0% 58%, 1% 38%, 0% 18%, 1% 5%
    );
}

.prose-content p {
    margin-bottom: 1rem;
}

.about-links {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.about-link-card {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 4px 6px 3px 5px;
    padding: 1.2rem;
    transition: transform 0.3s ease;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.06);
}

.about-link-card:nth-child(1) { transform: rotate(-0.4deg); border-radius: 5px 3px 6px 4px; }
.about-link-card:nth-child(2) { transform: rotate(0.3deg); border-radius: 3px 5px 4px 6px; }
.about-link-card:nth-child(3) { transform: rotate(-0.2deg); border-radius: 6px 4px 5px 3px; }

.about-link-card:hover {
    transform: translateY(-3px) rotate(0.5deg);
}

/* Blog content */
.blog-content {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    padding: 2.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 2px 3px 6px rgba(0,0,0,0.08), inset 0 0 15px rgba(0,0,0,0.02);
    transform: rotate(-0.15deg);
    border-radius: 3px 5px 4px 6px;
}

.blog-content h2, .blog-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-content pre {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 6px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
    margin: 1rem 0;
}

.blog-content code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85em;
}

.blog-content img {
    max-width: 100%;
    border-radius: 6px;
}

.blog-content blockquote {
    border-left: 3px solid var(--copper-accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
}

.blog-content a {
    color: var(--copper-accent);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}

.blog-content a:hover {
    color: var(--copper-hover);
}

.blog-nav {
    margin-top: 1.5rem;
}

.back-link {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: var(--copper-accent);
}

/* --- Footer (scrolls into view at bottom) --- */
.site-footer {
    text-align: center;
    padding: 3rem 2rem 4rem;
    background: transparent;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    padding: 1.5rem 2rem;
    box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.08), inset 0 0 20px rgba(0, 0, 0, 0.02);
    transform: rotate(-0.3deg);
    clip-path: polygon(
        1% 3%, 4% 0%, 10% 2%, 18% 0%, 26% 3%, 34% 1%, 42% 0%, 50% 2%,
        58% 0%, 66% 3%, 74% 1%, 82% 0%, 90% 2%, 96% 0%, 100% 3%,
        100% 8%, 99% 22%, 100% 42%, 99% 62%, 100% 82%, 99% 95%,
        97% 100%, 88% 97%, 78% 100%, 68% 98%, 58% 100%, 48% 97%,
        38% 100%, 28% 98%, 18% 100%, 8% 97%, 0% 100%,
        0% 92%, 1% 72%, 0% 52%, 1% 32%, 0% 12%
    );
}

.footer-brand {
    font-family: 'Fredoka', system-ui, sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--copper-accent);
    margin-bottom: 0.4rem;
}

.footer-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.footer-link {
    font-size: 0.72rem;
    color: var(--text-secondary);
    background: var(--tag-bg);
    border: 1px solid var(--card-border);
    padding: 3px 10px;
    border-radius: 3px 5px 4px 6px;
    transition: transform 0.2s;
}

.footer-link:nth-child(2) { border-radius: 5px 3px 6px 4px; transform: rotate(0.3deg); }
.footer-link:nth-child(3) { border-radius: 4px 6px 3px 5px; transform: rotate(-0.2deg); }

.footer-link:hover {
    transform: translateY(-2px) rotate(0.5deg);
}

.footer-copy {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-top: 1rem;
}

/* --- Dashboard Content --- */
.content-feed {
    display: grid;
    gap: 1.2rem;
}

.content-card {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 4px 6px 3px 5px;
    padding: 1.5rem;
    box-shadow: 1px 2px 4px rgba(0,0,0,0.06);
}

.content-card:nth-child(odd) { transform: rotate(-0.2deg); border-radius: 5px 3px 6px 4px; }
.content-card:nth-child(even) { transform: rotate(0.3deg); }

.content-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.content-type-badge {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--tag-bg);
    color: var(--tag-text);
    padding: 2px 8px;
    border-radius: 8px;
}

.content-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.photo-thumb img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
}

/* --- Forms --- */
.login-form-container,
.form-container {
    max-width: 480px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.form-input,
.form-textarea {
    width: 100%;
    font-family: 'Fredoka', system-ui, sans-serif;
    font-size: 0.92rem;
    padding: 0.6rem 0.8rem;
    border: 1.5px solid var(--card-border);
    border-radius: 3px 5px 4px 6px;
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.03);
}

.form-input:focus,
.form-textarea:focus {
    outline: 2px solid var(--copper-accent);
    outline-offset: 1px;
}

.form-textarea {
    resize: vertical;
}

.form-button {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
    font-weight: 500;
    background: var(--copper-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.6rem 1.5rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.form-button:hover {
    opacity: 0.85;
}

.form-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    background: rgba(220, 38, 38, 0.08);
    border-radius: 6px;
}



.login-back {
    text-align: center;
    margin-top: 1.5rem;
}

.preview-meta {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding-top: 0.8rem;
    border-top: 1px solid var(--card-border);
}

/* --- Animations --- */
@keyframes sun-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-4px) rotate(1deg); }
}

@keyframes sun-ray-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes moon-bob {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-3px) rotate(-1deg); }
}

@keyframes cloud-drift-1 {
    from { left: -240px; }
    to { left: calc(100% + 240px); }
}

@keyframes cloud-drift-2 {
    from { left: -80px; }
    to { left: calc(100% + 80px); }
}

@keyframes cloud-drift-3 {
    from { left: -260px; }
    to { left: calc(100% + 260px); }
}

@keyframes cloud-drift-4 {
    from { left: -130px; }
    to { left: calc(100% + 130px); }
}

@keyframes cloud-drift-5 {
    from { left: -55px; }
    to { left: calc(100% + 55px); }
}

@keyframes nav-wobble {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-1.5px) rotate(0.4deg); }
    75% { transform: translateY(1px) rotate(-0.3deg); }
}

@keyframes card-entrance {
    from {
        opacity: 0;
        transform: translateY(12px) rotate(-1deg);
    }
    to {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes pill-wobble {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    30% { transform: translateY(-1px) rotate(0.5deg); }
    70% { transform: translateY(1px) rotate(-0.3deg); }
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Breeze */
.tree.breeze-bend {
    transition: transform 4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.grass-blades path,
.wildflowers circle {
    transition: transform 3s ease-in-out;
    transform-origin: bottom center;
}

/* ============================================
   Page transitions -- fetch-swap with parallax
   ============================================ */

/* Swappable content wrapper */
.page-content {
    position: relative;
}

/* Exit animations -- content slides out */
.page-exit-left {
    animation: exit-left 0.38s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

.page-exit-right {
    animation: exit-right 0.38s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes exit-left {
    0%   { transform: translateX(0);    opacity: 1; }
    100% { transform: translateX(-40%); opacity: 0; }
}

@keyframes exit-right {
    0%   { transform: translateX(0);   opacity: 1; }
    100% { transform: translateX(40%); opacity: 0; }
}

/* Enter animations -- new content slides in */
.page-enter-right {
    animation: enter-right 0.38s cubic-bezier(0, 0, 0.2, 1) both;
}

.page-enter-left {
    animation: enter-left 0.38s cubic-bezier(0, 0, 0.2, 1) both;
}

@keyframes enter-right {
    0%   { transform: translateX(30%); opacity: 0; }
    100% { transform: translateX(0);   opacity: 1; }
}

@keyframes enter-left {
    0%   { transform: translateX(-30%); opacity: 0; }
    100% { transform: translateX(0);    opacity: 1; }
}

/* ============================================
   Backdrop parallax -- smooth layer shifting
   ============================================ */

/* During nav transitions, animate the horizontal pan smoothly.
   The .backdrop-panning class is toggled by transitions.js. */
.backdrop-panning .mountains-far-back,
.backdrop-panning .mountains-far-front,
.backdrop-panning .mountains-mid,
.backdrop-panning .scene-terrain {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Clouds shift subtly -- only during transitions */
.backdrop-panning .cloud {
    transition: transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Debug time scrubber -- transparent, top-right, above everything */
.debug-scrubber {
    position: fixed;
    top: 8px;
    right: 12px;
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 6px;
    background: transparent;
    padding: 0;
}

.debug-scrubber.active {
    display: flex;
}

.debug-scrubber input[type="range"] {
    width: 160px;
    height: 4px;
    opacity: 0.5;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    transition: opacity 0.2s;
}

.debug-scrubber input[type="range"]:hover {
    opacity: 0.9;
}

.debug-scrubber input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
}

.debug-scrubber-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    color: rgba(255,255,255,0.4);
    min-width: 36px;
}

/* "current time" reset button -- only visible when time is frozen */
.scrubber-reset {
    display: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.4);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 3px;
    padding: 1px 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, border-color 0.2s;
}

.scrubber-reset:hover {
    color: rgba(255,255,255,0.7);
    border-color: rgba(255,255,255,0.5);
}

.scrubber-reset-visible {
    display: inline-block;
}

/* Autohide scrubber on diorama pages -- revealed by JS on mouse move */
[data-scrubber-autohide] .debug-scrubber.active {
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}
[data-scrubber-autohide] .debug-scrubber.active.scrubber-visible {
    opacity: 1;
    pointer-events: auto;
}

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

/* --- Mobile --- */
@media (max-width: 640px) {
    .search-bar {
        width: 85%;
        top: 75px;
    }

    .cloud-nav-links {
        gap: 0.6rem;
    }

    .nav-link {
        font-size: 0.72rem;
        padding: 3px 6px;
    }

    .hero-heading {
        font-size: clamp(1.4rem, 8vw, 2rem);
    }

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

    .blog-item {
        flex-direction: column;
        gap: 0.2rem;
    }
}
