:root {
    --bg-rot: 0deg;
    --bg-scale: 1.06;
    --bg-shift-x: 0px;
    --bg-shift-y: 0px;
    --overview-blur: 0px;
    --overview-bg-opacity: 0;
}

/* Import Geist for this post */
@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;600;700;900&display=swap');

/* Page-only overrides for horizontal (side) scrolling layout */
:root {
    --bg-rot: 0deg;
    --bg-scale: 1.06;
    --bg-shift-x: 0px;
    --bg-shift-y: 0px;
    --overview-blur: 0px;
    --overview-bg-opacity: 0;
}

html,
body {
    height: 100%;
}

/* Override post.css (it sets overflow-x:hidden). */
body {
    overflow: hidden;
    background: #1a1a1a;
    font-family: 'Geist', 'Geist Sans', Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

.h-scroll {
    height: 100vh;
    width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    background: transparent;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.h-scroll.gallery-active {
    transform: translateY(-100vh);
}

/* Rotating background layer (driven by horizontal scroll) */
.scroll-bg {
    position: fixed;
    inset: -10%;
    z-index: -1;
    transform: translate3d(var(--bg-shift-x), var(--bg-shift-y), 0) scale(var(--bg-scale)) rotate(var(--bg-rot));
    transform-origin: 50% 50%;
    will-change: transform;
    transition: transform 0.1s ease-out;
    background-image: url("Posts/Post_1/1.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.scroll-bg.gallery-active {
    transform: translate3d(var(--bg-shift-x), calc(var(--bg-shift-y) - 100vh), 0) scale(var(--bg-scale)) rotate(var(--bg-rot));
}

.panel {
    flex: 0 0 100vw;
    height: 100vh;
    position: relative;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow: hidden;
}

/* Keep content nicely centered while still allowing each panel to have its own scrolling if needed */
.panel-inner {
    height: 100%;
    max-width: 1150px;
    margin: 0 auto;
    padding: 90px 40px 80px;
    display: flex;
    flex-direction: column;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.panel-center {
    justify-content: center;
}

/* Fixed back button for this layout */
.back-link.is-fixed {
    position: fixed;
    top: 24px;
    left: 24px;
    margin: 0;
    backdrop-filter: blur(10px);
    color: white;
    border: 0;
    background: #00000026;
    animation: fadeInUp 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s both;
    transition: all 0.3s ease;
    z-index: 200;
    width: 44px;
}

.back-link.is-fixed:hover {
    transform: translateX(-3px);
    background: #00000040;
}

/* HERO */
.hero-panel {
    color: #fff;
}

/* Hero content should sit at the bottom, centered horizontally */
.hero-panel .panel-inner {
    justify-content: center;
    align-items: center;
    padding-bottom: clamp(42px, 7vh, 90px);
}

/* Use the global rotating background and add a legible overlay */
.hero-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgb(0 0 0 / 97%) 100%);
    pointer-events: none;
    backdrop-filter: blur(2px);
}

.hero-bg {
    display: none;
}

.hero-title {
    margin: 0 0 14px 0;
    font-size: clamp(56px, 6.2vw, 96px);
    line-height: 1.02;
    font-weight: 900;
    letter-spacing: -1.4px;
    text-align: center;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.hero-subtitle {
    margin: 0 auto;
    max-width: 840px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 19px;
    line-height: 1.9;
    text-align: center;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s both;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.hero-hint {
    margin-top: 26px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s both;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.chip {
    font-size: 12px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    transition: all 0.3s ease;
}

.chip:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.20);
    border-color: rgba(255, 255, 255, 0.35);
}

/* OVERVIEW */
.overview-panel {
    color: #fff;
    backdrop-filter: blur(var(--overview-blur));
    background: rgba(0, 0, 0, var(--overview-bg-opacity));
    overflow-y: auto;
    overflow-x: hidden;
    transition: backdrop-filter 0.1s ease-out, background 0.1s ease-out;
}

.overview-panel::-webkit-scrollbar {
    width: 10px;
}

.overview-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.overview-panel .panel-inner {
    justify-content: flex-start;
    padding-top: 90px;
    padding-bottom: 90px;
    min-height: 100%;
}

.overview-card {
    border-radius: 18px;
    padding: 28px 26px;
    animation: fadeInScale 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.overview-title {
    margin: 0 0 10px 0;
    font-size: clamp(35px, 4.2vw, 64px);
    line-height: 1.12;
    font-weight: 900;
    letter-spacing: -0.8px;
    color: #fff;
    text-align: left;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.overview-lead {
    margin: 0;
    max-width: none;
    color: rgba(255, 255, 255, 0.78);
    font-size: 19px;
    line-height: 1.9;
    text-align: left;
    text-justify: inter-word;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.meta-tabs {
    display: flex;
    gap: 10px;
    justify-content: left;
    flex-wrap: wrap;
    margin-top: 18px;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

.tab-btn {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.90);
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tab-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}

.tab-btn[aria-selected="true"] {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.32);
    color: #fff;
}

.tab-ico {
    width: 16px;
    height: 16px;
    display: inline-flex;
}

.tab-panels {
    margin-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    padding-top: 18px;
}

.tab-panel {
    display: none;
    max-width: none;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.9;
    font-size: 14.5px;
    text-align: justify;
    text-justify: inter-word;
}

.tab-panel.is-active {
    display: block;
    animation: fadeUp 380ms cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-panel h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin: 18px 0 8px 0;
    text-align: left;
}

.tab-panel p {
    margin: 8px 0;
}

.tool-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.tool-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
}

.tool-pill svg {
    width: 16px;
    height: 16px;
    opacity: 0.9;
}

.close-gallery {
    position: sticky;
    top: 20px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.close-gallery:hover {
    background: rgba(0, 0, 0, 0.65);
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateX(-50%) translateY(-2px);
}

/* GALLERY */
.gallery-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    background: transparent;
    color: #fff;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;
    overflow-y: auto;
    backdrop-filter: blur(10px) brightness(0.05);
    flex: none;
}

.gallery-panel.visible {
    transform: translateY(0);
}

.gallery-lead {
    margin: 0 0 22px 0;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.85;
    max-width: 920px;
    transition: transform 0.1s ease-out;
    will-change: transform;
    font-size: 17px;
}

.gallery-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    margin-bottom: 60px;
}

/* Center gallery vertically on desktop only (keep mobile flow unchanged) */
@media (min-width: 769px) {
    .gallery-panel .panel-inner {
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* vertical centering */
        align-items: center;
        /* keep grid centered horizontally */
        padding: 50px 40px;
        /* preserve some padding */
    }

    .gallery-panel .gallery-grid {
        width: 100%;
        max-width: 1150px;
    }
}

.gallery-item {
    border-radius: 14px;
    overflow: hidden;
    margin: 0;
    border-radius: 5px;
    opacity: 0;
    animation: fadeInScale 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.gallery-item:nth-child(1) {
    animation-delay: 0.1s;
}

.gallery-item:nth-child(2) {
    animation-delay: 0.2s;
}

.gallery-item:nth-child(3) {
    animation-delay: 0.3s;
}

.gallery-item:nth-child(4) {
    animation-delay: 0.4s;
}

.gallery-item:nth-child(5) {
    animation-delay: 0.5s;
}

.gallery-item:nth-child(6) {
    animation-delay: 0.6s;
}

.gallery-item:nth-child(7) {
    animation-delay: 0.7s;
}

.gallery-item:nth-child(8) {
    animation-delay: 0.8s;
}

.gallery-item:nth-child(9) {
    animation-delay: 0.9s;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 10;
    transform: scale(1.01);
    transition: transform 0.35s ease;
}

.gallery-item:hover img {
    transform: scale(1.06);
}

/* Keyframe Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Small helper: hide visible scrollbars but keep scrolling functional */
/* Works across WebKit, Firefox, and legacy Edge/IE */
.h-scroll,
.overview-panel,
.gallery-panel {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.h-scroll::-webkit-scrollbar,
.overview-panel::-webkit-scrollbar,
.gallery-panel::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
    width: 0;
    height: 0;
}

/* Keep specific thumb styling removed to avoid accidental visible tracks */
.h-scroll::-webkit-scrollbar-thumb {
    background: transparent;
}

.overview-panel::-webkit-scrollbar-thumb {
    background: transparent;
}

.gallery-panel::-webkit-scrollbar-thumb {
    background: transparent;
}

@media (max-width: 900px) {
    .overview-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 768px) {

    /* Disable horizontal scroll, enable vertical */
    html,
    body {
        overflow-y: auto;
        overflow-x: hidden;
        max-width: 100%;
        padding: 0;
    }

    .h-scroll {
        height: auto;
        width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
        display: block;
        scroll-snap-type: none;
        flex-direction: column;
    }

    /* Stack panels vertically */
    .panel {
        flex: none;
        width: 100%;
        height: auto;
        scroll-snap-align: none;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .panel-inner {
        height: auto;
        min-height: auto;
        padding: 60px 24px;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Disable all parallax transforms on mobile */
    .hero-panel .panel-inner,
    .hero-title,
    .hero-subtitle,
    .hero-hint,
    .overview-card,
    .post-meta-row,
    .overview-title,
    .overview-lead,
    .meta-tabs,
    .gallery-panel .post-title,
    .gallery-lead {
        transform: none !important;
    }

    /* Remove fixed background effects */
    .scroll-bg {
        position: fixed;
        inset: 0;
        transform: none !important;
    }

    /* Overview panel normal flow */
    .overview-panel {
        overflow: visible;
        backdrop-filter: none;
        background: rgba(0, 0, 0, 0.85);
    }

    .overview-panel .panel-inner {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    /* Gallery as normal section, not overlay */
    .gallery-panel {
        position: relative;
        transform: none !important;
        height: auto;
        min-height: auto;
        overflow-x: hidden;
        /* Mobile: keep gallery plain (no overlay background/blur/slide feel) */
        background: transparent !important;
        backdrop-filter: none !important;
        transition: none !important;
    }

    /* Mobile: disable gallery animations/transitions and ensure content is visible */
    .gallery-panel,
    .gallery-panel * {
        animation: none !important;
        transition: none !important;
        background: #000000;
    }

    .gallery-item {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .gallery-item img {
        transform: none !important;
        transition: none !important;
    }

    /* No close button needed on mobile (gallery is in normal flow) */
    .close-gallery {
        display: none !important;
    }

    .gallery-panel.visible {
        transform: none !important;
    }

    .h-scroll.gallery-active {
        transform: none !important;
    }

    /* Simplify hero */
    .hero-panel .panel-inner {
        /* Vertically center the title block on mobile */
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        padding-top: 0;
        padding-bottom: 0;
    }

    .hero-title {
        font-size: clamp(40px, 10vw, 56px);
        text-align: center;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .panel-inner {
        padding: 60px 20px;
    }

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

    .back-link.is-fixed {
        left: 14px;
        top: 14px;
    }

    .hero-title {
        font-size: clamp(32px, 8vw, 48px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .h-scroll {
        scroll-behavior: auto;
    }

    .gallery-item img {
        transition: none;
    }

    .gallery-panel {
        transition: none;
    }
}

.overview-panel::before {

    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgb(0 0 0 / 97%) 100%);
    pointer-events: none;
    backdrop-filter: blur(2px);

}

@media (max-width: 640px) {

    .hero-subtitle,
    .overview-lead,
    .gallery-lead {
        font-size: 16px;
        font-weight: lighter;
    }

    .chip {
        font-size: 10px;
        padding: 5px 15px;
    }

    .hero-hint {
        gap: 5px;
    }
}

@media (max-width: 768px) {
    .overview-panel .panel-inner {
        justify-content: flex-start !important;
        margin-top: -1px;
        padding-bottom: 0;
    }

    .mobile-footer .contact-form {
        display: block !important;
        margin-top: 44px;
    }

    .btn-submit {
        margin-top: 30px;
    }

    .post-meta-row {
        font-size: 13px !important;
        font-weight: lighter
    }

    /* Mobile specific gallery */
    .Gallery {
        display: none !important;
    }

    .mobile-gallery {
        display: block !important;
        padding-top: 20px;
    }

    .mobile-gallery img {
        width: 100%;
        height: auto;
        margin-bottom: 5px;
        border-radius: 2px;
        display: block;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Default state for mobile gallery */
.mobile-gallery {
    display: none;
}


@media (min-width: 769px) {
    .hide-bigger {
        display: none;
    }

    .gallery-grid img {
        max-height: 40vh;
    }

}