:root {
    --bg: #070814;
    --bg-deep: #050611;
    --bg-mid: #090a18;
    --bg-end: #10061f;
    --bg-soft: rgba(255, 255, 255, 0.055);
    --bg-card: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.14);

    --text: #f5f7ff;
    --text-muted: rgba(245, 247, 255, 0.68);

    --neon-pink: #ff4fd8;
    --neon-blue: #5ee7ff;
    --neon-purple: #9d6bff;

    --radius-lg: 28px;
    --radius-md: 18px;
    --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.38);
}



body.theme-night {
    --bg: #070814;
    --bg-deep: #050611;
    --bg-mid: #090a18;
    --bg-end: #10061f;

    --bg-soft: rgba(255, 255, 255, 0.055);
    --bg-card: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.14);

    --text: #f5f7ff;
    --text-muted: rgba(245, 247, 255, 0.68);

    --neon-pink: #ff4fd8;
    --neon-blue: #5ee7ff;
    --neon-purple: #9d6bff;

    --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.38);
}

body.theme-day {
    --bg: #dceee8;
    --bg-deep: #d7ebe5;
    --bg-mid: #c5e4dc;
    --bg-end: #b6d9d0;

    --bg-soft: rgba(255, 255, 255, 0.52);
    --bg-card: rgba(255, 255, 255, 0.62);
    --border: rgba(25, 130, 112, 0.28);

    --text: #10221f;
    --text-muted: rgba(16, 34, 31, 0.72);

    --neon-pink: #38c982;
    --neon-blue: #12aeb8;
    --neon-purple: #42cfa7;

    --shadow-soft: 0 24px 80px rgba(20, 110, 95, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, color-mix(in srgb, var(--neon-pink) 18%, transparent), transparent 32rem),
        radial-gradient(circle at top right, color-mix(in srgb, var(--neon-blue) 16%, transparent), transparent 30rem),
        linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-mid) 45%, var(--bg-end) 100%);
    overflow: hidden;
    transition: background 500ms ease, color 500ms ease;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 75%);
    z-index: 0;
}

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

#webgl-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.72;
}

.site-shell {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 32px));
    height: 100vh;
    margin: 0 auto;
}

.topbar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: min(1180px, calc(100% - 32px));
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.16em;
    background: linear-gradient(135deg, color-mix(in srgb, var(--neon-pink) 18%, transparent), color-mix(in srgb, var(--neon-blue) 14%, transparent));
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.94rem;
    transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.main-nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.main-nav a.is-active {
    color: var(--text);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--neon-blue) 18%, transparent),
        color-mix(in srgb, var(--neon-pink) 14%, transparent)
    );
}

/* PAGES */

.page {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 100vh;
    padding: 120px 0 72px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(28px) scale(0.985);
    filter: blur(12px);
    transition:
        opacity 480ms ease,
        transform 620ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 620ms ease,
        visibility 0ms linear 620ms;
}

.page.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    filter: blur(0);
    transition:
        opacity 520ms ease,
        transform 720ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 720ms ease,
        visibility 0ms;
}

.section-inner {
    width: 100%;
}

.hero-section {
    align-items: center;
}

.hero-content {
    width: min(760px, 100%);
    padding: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035));
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
}

.hero-kicker,
.section-heading p,
.card-tag {
    margin: 0;
    color: var(--neon-blue);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 22px;
    font-size: clamp(3rem, 8vw, 6.8rem);
    line-height: 0.88;
    letter-spacing: -0.08em;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(2.1rem, 5vw, 4.2rem);
    letter-spacing: -0.06em;
}

h3 {
    margin-bottom: 10px;
    font-size: 1.35rem;
}

.hero-text {
    width: min(620px, 100%);
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    font-weight: 750;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button.primary {
    color: #070814;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink));
    box-shadow: 0 12px 42px rgba(255, 79, 216, 0.28);
}

.button.secondary {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.card-grid,
.post-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.project-card {
    min-height: 230px;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.04)),
        rgba(255, 255, 255, 0.035);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
    transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(94, 231, 255, 0.45);
    background:
        linear-gradient(135deg, rgba(94, 231, 255, 0.13), rgba(255, 79, 216, 0.08)),
        rgba(255, 255, 255, 0.055);
}

.project-card p,
.contact-section p {
    color: var(--text-muted);
    line-height: 1.65;
}

.card-tag {
    display: inline-flex;
    margin-bottom: 46px;
    color: var(--neon-pink);
}

/* TRANSITION OVERLAY */

.page-transition {
    position: fixed;
    inset: -20%;
    z-index: 15;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-110%) skewX(-18deg);
    background:
        linear-gradient(
            90deg,
            transparent 0%,
            color-mix(in srgb, var(--neon-blue) 14%, transparent) 18%,
            color-mix(in srgb, var(--neon-pink) 70%, transparent) 42%,
            color-mix(in srgb, var(--neon-purple) 88%, transparent) 58%,
            color-mix(in srgb, var(--neon-blue) 18%, transparent) 82%,
            transparent 100%
        );
    filter: blur(2px);
}

.page-transition.is-running {
    animation: neonPageWipe 760ms cubic-bezier(0.76, 0, 0.24, 1);
}

.page-transition::before,
.page-transition::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 18px,
            rgba(255, 255, 255, 0.18) 19px,
            transparent 21px
        );
    opacity: 0.22;
    mix-blend-mode: screen;
}

.page-transition::after {
    transform: translateY(18px);
    opacity: 0.12;
}

@keyframes neonPageWipe {
    0% {
        opacity: 0;
        transform: translateX(-110%) skewX(-18deg);
    }

    18% {
        opacity: 1;
    }

    52% {
        opacity: 1;
        transform: translateX(0%) skewX(-18deg);
    }

    100% {
        opacity: 0;
        transform: translateX(110%) skewX(-18deg);
    }
}

body.is-changing-page .page.is-active {
    transform: scale(0.97);
    filter: blur(16px);
}

/* MOBILE */

@media (max-width: 800px) {
    body {
        overflow-y: auto;
    }

    .site-shell {
        height: auto;
        min-height: 100vh;
    }

    .topbar {
        align-items: flex-start;
        border-radius: 28px;
        flex-direction: column;
    }

    .main-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .page {
        position: relative;
        display: none;
        min-height: auto;
        padding: 140px 0 72px;
    }

    .page.is-active {
        display: flex;
    }

    .hero-content {
        padding: 26px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

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

/* CONTACT PAGE */

.contact-section .section-inner {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
    gap: 42px;
    align-items: center;
}

.contact-section .section-heading {
    display: block;
    margin-bottom: 0;
}

.contact-section .section-heading p {
    margin-bottom: 18px;
}

.contact-section .section-heading h2 {
    max-width: 680px;
    animation: contactTitleIn 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.contact-content {
    max-width: 760px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025));
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
    animation: contactTextIn 900ms cubic-bezier(0.16, 1, 0.3, 1) 160ms both;
}

.contact-content p {
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.75;
}

.contact-content p:last-of-type {
    margin-bottom: 22px;
}

.contact-mail {
    display: inline-flex;
    align-items: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    color: #070814;
    font-weight: 800;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-pink));
    box-shadow: 0 12px 42px rgba(255, 79, 216, 0.28);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.contact-mail:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 54px rgba(94, 231, 255, 0.24);
}

@keyframes contactTitleIn {
    from {
        opacity: 0;
        transform: translateX(-34px) scale(0.97);
        filter: blur(12px);
    }

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

@keyframes contactTextIn {
    from {
        opacity: 0;
        transform: translateX(34px) scale(0.97);
        filter: blur(12px);
    }

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

@media (max-width: 900px) {
    .contact-section .section-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .contact-content {
        padding: 22px;
    }
}

/* POST CARDS + SEARCH */

.card-tools {
    margin-bottom: 22px;
}

.card-search {
    width: min(420px, 100%);
    height: 48px;
    padding: 0 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(14px);
    font: inherit;
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.18);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.card-search::placeholder {
    color: rgba(245, 247, 255, 0.42);
}

.card-search:focus {
    border-color: rgba(94, 231, 255, 0.55);
    background: rgba(255, 255, 255, 0.105);
    box-shadow: 0 18px 52px rgba(94, 231, 255, 0.12);
}

.post-card {
    overflow: hidden;
    min-height: 340px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
        rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.24);
    cursor: pointer;
    transition:
        transform 220ms ease,
        border-color 220ms ease,
        background 220ms ease,
        opacity 220ms ease;
}

.post-card:hover {
    transform: translateY(-7px) scale(1.015);
    border-color: rgba(94, 231, 255, 0.46);
    background:
        linear-gradient(135deg, rgba(94, 231, 255, 0.12), rgba(255, 79, 216, 0.08)),
        rgba(255, 255, 255, 0.06);
}

.post-card.is-hidden {
    display: none;
}

.post-card img {
    display: block;
    width: 100%;
    height: 155px;
    object-fit: cover;
    background:
        radial-gradient(circle at top left, rgba(94, 231, 255, 0.28), transparent 55%),
        radial-gradient(circle at bottom right, rgba(255, 79, 216, 0.24), transparent 55%),
        rgba(255, 255, 255, 0.06);
}

.post-card-content {
    padding: 22px;
}

.post-card-content .card-tag {
    margin-bottom: 28px;
}

/* MODAL */

.post-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 260ms ease,
        visibility 0ms linear 260ms;
}

.post-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition:
        opacity 260ms ease,
        visibility 0ms;
}

.post-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 4, 12, 0.72);
    backdrop-filter: blur(14px);
}

.post-modal-window {
    position: relative;
    z-index: 1;
    overflow: hidden;
    width: min(860px, 100%);
    max-height: min(760px, calc(100vh - 48px));
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.045)),
        rgba(7, 8, 20, 0.9);
    box-shadow: 0 34px 100px rgba(0, 0, 0, 0.62);
    transform: translateY(20px) scale(0.96);
    filter: blur(10px);
    transition:
        transform 360ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 360ms ease;
}

.post-modal.is-open .post-modal-window {
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.post-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: rgba(7, 8, 20, 0.72);
    backdrop-filter: blur(14px);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease;
}

.post-modal-close:hover {
    transform: rotate(90deg) scale(1.05);
    background: color-mix(in srgb, var(--neon-pink) 18%, transparent);
}

.post-modal-image {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: cover;
    background:
        radial-gradient(circle at top left, rgba(94, 231, 255, 0.3), transparent 52%),
        radial-gradient(circle at bottom right, rgba(255, 79, 216, 0.26), transparent 52%),
        rgba(255, 255, 255, 0.06);
}

.post-modal-content {
    padding: 30px;
}

.post-modal-tag {
    display: inline-flex;
    margin-bottom: 18px;
    color: var(--neon-pink);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.post-modal-title {
    margin-bottom: 16px;
}

.post-modal-text {
    max-width: 680px;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

@media (max-width: 800px) {
    .post-card {
        min-height: auto;
    }

    .post-modal {
        padding: 14px;
    }

    .post-modal-image {
        height: 210px;
    }

    .post-modal-content {
        padding: 22px;
    }
}

/* GUIDE PLACEHOLDER */

.guide-placeholder {
    max-width: 720px;
    padding: 30px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
}

.guide-placeholder h3 {
    margin-bottom: 14px;
}

.guide-placeholder p {
    color: var(--text-muted);
    line-height: 1.75;
}

/* OSBAN TEXT LOGO */

.brand {
    position: relative;
    overflow: hidden;
    gap: 10px;
}

.brand-mark {
    position: relative;
    z-index: 2;
    display: inline-block;
    font-weight: 950;
    letter-spacing: 0.18em;
    background: linear-gradient(
        90deg,
        var(--neon-blue),
        #ffffff,
        var(--neon-pink),
        var(--neon-purple),
        var(--neon-blue)
    );
    background-size: 300% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    animation: osbanLogoFlow 4s linear infinite;
    text-shadow:
        0 0 18px rgba(94, 231, 255, 0.22),
        0 0 28px rgba(255, 79, 216, 0.16);
}

.brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        120deg,
        transparent 0%,
        color-mix(in srgb, var(--neon-blue) 18%, transparent) 45%,
        color-mix(in srgb, var(--neon-pink) 22%, transparent) 55%,
        transparent 100%
    );
    transform: translateX(-120%);
    transition: transform 420ms ease;
}

.brand:hover::before {
    transform: translateX(120%);
}

.brand:hover .brand-mark {
    animation-duration: 1.4s;
}

.brand-pulse {
    position: relative;
    z-index: 2;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--neon-blue);
    box-shadow:
        0 0 12px rgba(94, 231, 255, 0.95),
        0 0 28px rgba(255, 79, 216, 0.45);
    animation: osbanPulse 1.8s ease-in-out infinite;
}

@keyframes osbanLogoFlow {
    from {
        background-position: 0% 50%;
    }

    to {
        background-position: 300% 50%;
    }
}

@keyframes osbanPulse {
    0%,
    100% {
        transform: scale(0.75);
        opacity: 0.55;
    }

    50% {
        transform: scale(1.25);
        opacity: 1;
    }
}

/* RESPONSIVE CENTERED PAGE LAYOUT */

.page {
    justify-content: center;
    min-height: 100vh;
    padding: 120px 0 64px;
}

.page .section-inner,
.hero-content {
    max-height: calc(100vh - 190px);
}

.section-inner {
    width: 100%;
}

.content-section .section-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-section {
    justify-content: flex-start;
}

.hero-content {
    align-self: center;
}

/* Cards får scrolla internt om fönstret är lågt */
.post-grid,
.card-grid {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
    padding-right: 6px;
}

/* Snyggare scrollbar */
.post-grid::-webkit-scrollbar,
.card-grid::-webkit-scrollbar {
    width: 8px;
}

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

/* Mindre skärmar */
@media (max-width: 900px) {
    body {
        overflow-y: auto;
    }

    .site-shell {
        width: min(100% - 24px, 1180px);
        height: auto;
        min-height: 100vh;
    }

    .page {
        position: relative;
        display: none;
        min-height: 100vh;
        padding: 140px 0 56px;
    }

    .page.is-active {
        display: flex;
    }

    .page .section-inner,
    .hero-content {
        max-height: none;
    }

    .post-grid,
    .card-grid {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .content-section .section-inner {
        justify-content: flex-start;
    }
}

/* Väldigt låga skärmar, typ laptop med lite höjd */
@media (max-height: 760px) and (min-width: 901px) {
    .page {
        align-items: flex-start;
        padding-top: 110px;
    }

    .post-grid,
    .card-grid {
        max-height: calc(100vh - 250px);
    }

    h1 {
        font-size: clamp(2.6rem, 6vw, 5rem);
    }

    h2 {
        font-size: clamp(2rem, 4vw, 3.4rem);
    }

    .hero-content {
        padding: 28px;
    }
}

body.theme-day #webgl-bg {
    opacity: 0.22;
    filter: saturate(0.85) brightness(1.35);
}

body.theme-night #webgl-bg {
    opacity: 0.72;
    filter: none;
}

body.theme-day .topbar {
    background: rgba(255, 255, 255, 0.72);
}

body.theme-night .topbar {
    background: rgba(7, 8, 20, 0.68);
}

body.theme-day .hero-content,
body.theme-day .project-card,
body.theme-day .post-card,
body.theme-day .contact-content,
body.theme-day .guide-placeholder {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(238, 255, 249, 0.68));
}

/* GUIDES INTERFACE */

.guides-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 22px;
    align-items: stretch;
    max-height: calc(100vh - 260px);
}

.guide-categories,
.guide-content-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
        rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
}

.guide-categories {
    padding: 18px;
    overflow: hidden;
}

.guide-categories-header {
    margin-bottom: 14px;
    padding: 0 6px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.guide-category {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
    padding: 15px 16px;
    border: 1px solid transparent;
    border-radius: 18px;
    color: var(--text-muted);
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition:
        transform 180ms ease,
        color 180ms ease,
        background 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.guide-category span {
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 800;
}

.guide-category small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.guide-category:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(94, 231, 255, 0.28);
}

.guide-category.is-active {
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(94, 231, 255, 0.18), rgba(255, 79, 216, 0.12));
    border-color: rgba(94, 231, 255, 0.42);
    box-shadow: 0 14px 38px rgba(94, 231, 255, 0.12);
}

.guide-content-panel {
    padding: 22px;
    overflow: hidden;
}

.guide-panel-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.guide-panel-kicker {
    margin-bottom: 6px;
    color: var(--neon-blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.guide-panel-title {
    margin: 0;
    font-size: 1.55rem;
}

.guide-search {
    width: min(320px, 100%);
    height: 46px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.075);
    backdrop-filter: blur(14px);
    font: inherit;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.guide-search::placeholder {
    color: rgba(245, 247, 255, 0.42);
}

.guide-search:focus {
    border-color: rgba(94, 231, 255, 0.55);
    background: rgba(255, 255, 255, 0.105);
    box-shadow: 0 18px 52px rgba(94, 231, 255, 0.12);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    max-height: calc(100vh - 390px);
    overflow-y: auto;
    padding-right: 6px;
}

.guide-grid::-webkit-scrollbar {
    width: 8px;
}

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

.guide-card {
    min-height: 310px;
    animation: guideCardIn 360ms ease both;
}

.guide-card.is-hidden {
    display: none;
}

@keyframes guideCardIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
        filter: blur(8px);
    }

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

/* Day theme guides */

body.theme-day .guide-categories,
body.theme-day .guide-content-panel {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(235, 255, 248, 0.62)),
        rgba(255, 255, 255, 0.44);
}

body.theme-day .guide-category:hover {
    background: rgba(255, 255, 255, 0.42);
}

body.theme-day .guide-category.is-active {
    background:
        linear-gradient(135deg, rgba(18, 174, 184, 0.18), rgba(56, 201, 130, 0.14));
    border-color: rgba(18, 174, 184, 0.36);
}

/* Mobile guides */

@media (max-width: 900px) {
    .guides-layout {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .guide-panel-top {
        align-items: flex-start;
        flex-direction: column;
    }

    .guide-search {
        width: 100%;
    }

    .guide-grid {
        grid-template-columns: 1fr;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
}

/* BIGGER LOCKED GUIDES LAYOUT */

.guides-layout {
    height: min(720px, calc(100vh - 210px));
    min-height: 620px;
    grid-template-columns: 340px 1fr;
    gap: 26px;
}

.guide-categories {
    padding: 22px;
}

.guide-content-panel {
    padding: 28px;
}

.guide-grid {
    grid-template-columns: repeat(2, minmax(280px, 1fr));
    gap: 20px;
}

.guide-card {
    min-height: 340px;
}

.guide-card img {
    height: 170px;
}

@media (max-width: 900px) {
    .guides-layout {
        height: auto;
        min-height: 0;
        grid-template-columns: 1fr;
    }

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

/* FINAL GUIDES LOCK FIX */

.guide-content-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.guide-panel-top {
    flex: 0 0 auto;
}

.guide-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    align-content: start;
}

@media (max-width: 900px) {
    .guide-content-panel {
        display: block;
    }

    .guide-grid {
        max-height: none;
        overflow: visible;
    }
}

/* DAY THEME MODAL FIX */

body.theme-day .post-modal-backdrop {
    background: rgba(210, 230, 225, 0.72);
    backdrop-filter: blur(16px);
}

body.theme-day .post-modal-window {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 250, 245, 0.78)),
        rgba(255, 255, 255, 0.88);
    border-color: rgba(18, 174, 184, 0.28);
    box-shadow: 0 34px 100px rgba(20, 90, 80, 0.28);
}

body.theme-day .post-modal-title {
    color: #10221f;
}

body.theme-day .post-modal-text {
    color: rgba(16, 34, 31, 0.72);
}

body.theme-day .post-modal-tag {
    color: #0aa8a8;
}

body.theme-day .post-modal-close {
    color: #10221f;
    background: rgba(255, 255, 255, 0.76);
    border-color: rgba(18, 174, 184, 0.28);
}

body.theme-day .post-modal-close:hover {
    background: rgba(18, 174, 184, 0.16);
}

body.theme-day .post-modal-image {
    background:
        radial-gradient(circle at top left, rgba(18, 174, 184, 0.24), transparent 52%),
        radial-gradient(circle at bottom right, rgba(56, 201, 130, 0.22), transparent 52%),
        rgba(255, 255, 255, 0.5);
}

/* PROJECT IMAGE SHOWCASE */

.project-showcase {
    position: relative;
    overflow: hidden;
    height: 280px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035)),
        rgba(255, 255, 255, 0.04);
    box-shadow: var(--shadow-soft);
}

.project-slider {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: inherit;
}

.project-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.06) translateX(28px);
    filter: blur(10px);
    transition:
        opacity 420ms ease,
        transform 480ms cubic-bezier(0.16, 1, 0.3, 1),
        filter 480ms ease;
}

.project-slide.is-active {
    opacity: 1;
    transform: scale(1) translateX(0);
    filter: blur(0);
}

.project-showcase::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(7, 8, 20, 0.72), rgba(7, 8, 20, 0.18), rgba(7, 8, 20, 0.62)),
        linear-gradient(0deg, rgba(7, 8, 20, 0.68), transparent 58%);
}

.project-slider-info {
    position: absolute;
    left: 24px;
    bottom: 24px;
    z-index: 2;
    max-width: 420px;
}

.project-slider-info span {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--neon-blue);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.project-slider-info p {
    margin: 0;
    color: rgba(245, 247, 255, 0.82);
    font-size: 0.98rem;
    line-height: 1.55;
}

.project-slider-controls {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 3;
    display: flex;
    gap: 10px;
}

.project-slider-btn {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    background: rgba(7, 8, 20, 0.58);
    backdrop-filter: blur(12px);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition:
        transform 180ms ease,
        background 180ms ease,
        border-color 180ms ease;
}

.project-slider-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 79, 216, 0.18);
    border-color: rgba(94, 231, 255, 0.42);
}

.project-slider-dots {
    position: absolute;
    top: 18px;
    right: 20px;
    z-index: 3;
    display: flex;
    gap: 8px;
}

.project-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.38);
    cursor: pointer;
    transition:
        width 180ms ease,
        background 180ms ease,
        box-shadow 180ms ease;
}

.project-dot.is-active {
    width: 26px;
    background: var(--neon-blue);
    box-shadow:
        0 0 14px rgba(94, 231, 255, 0.72),
        0 0 24px rgba(255, 79, 216, 0.34);
}

/* Day theme slider */

body.theme-day .project-showcase {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(230, 250, 245, 0.58)),
        rgba(255, 255, 255, 0.5);
}

body.theme-day .project-showcase::after {
    background:
        linear-gradient(90deg, rgba(16, 34, 31, 0.62), rgba(16, 34, 31, 0.12), rgba(16, 34, 31, 0.42)),
        linear-gradient(0deg, rgba(16, 34, 31, 0.52), transparent 58%);
}

body.theme-day .project-slider-info p {
    color: rgba(255, 255, 255, 0.9);
}

body.theme-day .project-slider-btn {
    color: #10221f;
    background: rgba(255, 255, 255, 0.68);
}

/* Mobile */

@media (max-width: 900px) {
    .project-showcase {
        height: 240px;
    }

    .project-slider-info {
        left: 18px;
        right: 18px;
        bottom: 74px;
        max-width: none;
    }

    .project-slider-controls {
        left: 18px;
        right: auto;
        bottom: 18px;
    }

    .project-slider-dots {
        top: 16px;
        right: 18px;
    }
}

/* PROJECT BANNER POSITION */

#projects .project-showcase {
    height: min(460px, 46vh);
    margin-bottom: 34px;
}

#projects .section-heading {
    margin-bottom: 18px;
}

#projects .card-tools {
    margin-bottom: 22px;
}

/* HOME OSBAN BRAND BANNER FIX */

.hero-brand-banner {
    width: min(760px, 100%);
    height: clamp(180px, 30vh, 340px);
    margin: 0 auto 32px;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: var(--shadow-soft);
}

.hero-brand-banner img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

/* HOME HERO SIZE BALANCE */

#home .hero-content {
    max-width: 920px;
}

#home .hero-content h1 {
    font-size: clamp(3rem, 6vw, 6.2rem);
}

/* BIGGER CENTERED HOME HERO */

#home.hero-section {
    align-items: center;
    justify-content: center;
}

#home .hero-content {
    width: min(1120px, calc(100vw - 48px));
    max-width: 1120px;
    margin: 0 auto;
    padding: 38px;
}

#home .hero-brand-banner {
    width: 100%;
    height: clamp(260px, 34vh, 430px);
    margin-bottom: 34px;
}

#home .hero-content h1 {
    max-width: 900px;
    font-size: clamp(3.8rem, 6vw, 7.4rem);
}

#home .hero-text {
    max-width: 760px;
}

.post-modal {
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.post-modal-card {
    width: min(920px, 92vw);
    max-height: 88vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.post-modal-card img {
    width: 100%;
    height: clamp(220px, 32vh, 380px);
    object-fit: cover;
    flex-shrink: 0;
}

.post-modal-content {
    overflow-y: auto;
    padding: 34px;
}

.post-modal-content p {
    max-width: 70ch;
    line-height: 1.75;
}

.post-modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
}

/* MOBILE RESPONSIVE FIXES */

@media (max-width: 900px) {
    .site-shell {
        padding: 16px;
    }

    .topbar {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        padding: 12px 14px;
        gap: 14px;
    }

    .brand-mark {
        font-size: 1rem;
    }

    .main-nav {
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        white-space: nowrap;
        font-size: 0.82rem;
        padding: 8px 10px;
    }

    .page {
        padding-top: 88px;
        padding-bottom: 24px;
    }

    .section-inner,
    #home .hero-content {
        width: min(100%, calc(100vw - 32px));
        padding: 24px;
    }

    #home .hero-brand-banner {
        height: clamp(180px, 28vh, 280px);
        margin-bottom: 24px;
    }

    #home .hero-content h1 {
        font-size: clamp(2.3rem, 12vw, 4.4rem);
        line-height: 0.95;
    }

    .hero-text {
        font-size: 0.98rem;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

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

    #projects .project-showcase {
        height: clamp(220px, 34vh, 340px);
        margin-bottom: 26px;
    }

    .project-slider-info {
        left: 18px;
        right: 18px;
        bottom: 18px;
        max-width: none;
    }

    .project-slider-info p {
        font-size: 0.9rem;
    }

    .project-slider-controls {
        right: 18px;
        top: 18px;
    }

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

    .card-tools {
        width: 100%;
    }

    .card-search,
    .guide-search {
        width: 100%;
    }

    .guides-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .guide-categories {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 8px;
        scrollbar-width: none;
    }

    .guide-categories::-webkit-scrollbar {
        display: none;
    }

    .guide-category {
        min-width: 180px;
        flex-shrink: 0;
    }

    .guide-content-panel {
        min-height: 420px;
    }

    .guide-panel-top {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .contact-content {
        max-width: 100%;
    }

    .post-modal {
        padding: 14px;
    }

    .post-modal-window {
        width: 100%;
        max-height: 88vh;
    }

    .post-modal-image {
        height: clamp(180px, 28vh, 280px);
    }

    .post-modal-content {
        padding: 24px;
    }
}

@media (max-width: 520px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .brand {
        justify-content: center;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .page {
        padding-top: 132px;
    }

    .section-heading h2 {
        font-size: clamp(2.1rem, 14vw, 3.4rem);
    }

    .section-heading p,
    .hero-kicker {
        font-size: 0.75rem;
        letter-spacing: 0.14em;
    }

    #home .hero-content {
        padding: 18px;
    }

    #home .hero-brand-banner {
        height: 190px;
        border-radius: 22px;
    }

    #home .hero-content h1 {
        font-size: clamp(2rem, 14vw, 3.3rem);
    }

    .project-slider-btn {
        width: 38px;
        height: 38px;
    }

    .project-slider-dots {
        bottom: 14px;
    }

    .post-card img {
        height: 180px;
    }

    .post-card-content {
        padding: 20px;
    }

    .post-modal-content {
        padding: 20px;
    }
}

/* FINAL OVERRIDE - MODAL SCROLL FIX */

.post-modal.is-open {
    display: flex;
}

.post-modal {
    align-items: center !important;
    justify-content: center !important;
    padding: 24px !important;
    overflow: hidden !important;
}

.post-modal-window {
    width: min(920px, 92vw) !important;
    max-height: 88vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.post-modal-image {
    width: 100% !important;
    height: clamp(180px, 28vh, 340px) !important;
    object-fit: cover !important;
    flex-shrink: 0 !important;
}

.post-modal-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    padding: 34px !important;
}

.post-modal-text {
    max-width: 70ch !important;
    line-height: 1.75 !important;
}

.post-modal-text p {
    margin: 0 0 1.1em !important;
}

.post-modal-text img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 18px !important;
}
/* =========================================================
   FINAL MOBILE / TABLET OVERRIDE
   Lägg längst ner i main.css
========================================================= */

@media (max-width: 900px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    body {
        min-height: 100vh;
    }

    .site-shell {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        height: auto;
        padding: 0 16px;
        margin: 0;
    }

    /* TOP MENU */
    .topbar {
        top: 12px;
        left: 16px;
        right: 16px;
        width: auto;
        transform: none;
        padding: 12px;
        gap: 10px;
        border-radius: 24px;
        align-items: stretch;
    }

    .brand {
        min-width: 0;
        width: fit-content;
        padding: 9px 14px;
    }

    .main-nav {
        width: 100%;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        font-size: 0.82rem;
        padding: 9px 12px;
    }

    /* PAGE POSITION */
    .page {
        position: relative;
        display: none;
        width: 100%;
        min-height: 100vh;
        padding: 128px 0 36px;
        align-items: flex-start;
    }

    .page.is-active {
        display: flex;
    }

    .section-inner {
        width: 100%;
        max-width: 100%;
    }

    .content-section .section-inner {
        justify-content: flex-start;
    }

    /* HEADINGS */
    .section-heading {
        display: block;
        margin-bottom: 18px;
    }

    .section-heading h2 {
        font-size: clamp(2.2rem, 11vw, 4rem);
        line-height: 0.95;
    }

    .section-heading p {
        margin-bottom: 8px;
    }

    /* SEARCH */
    .card-tools {
        width: 100%;
        margin-bottom: 18px;
    }

    .card-search,
    .guide-search {
        width: 100%;
        max-width: 100%;
    }

    /* HOME */
    #home .hero-content {
        width: 100%;
        max-width: 100%;
        padding: 20px;
        margin: 0;
    }

    #home .hero-brand-banner {
        width: 100%;
        height: clamp(180px, 32vh, 300px);
        margin-bottom: 22px;
        border-radius: 22px;
    }

    #home .hero-content h1 {
        font-size: clamp(2.3rem, 12vw, 4.6rem);
        line-height: 0.95;
    }

    .hero-text {
        font-size: 0.98rem;
        line-height: 1.6;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .button {
        width: 100%;
    }

    /* PROJECT SLIDER */
    #projects .project-showcase,
    .project-showcase {
        width: 100%;
        height: clamp(230px, 38vh, 360px);
        margin-bottom: 22px;
        border-radius: 24px;
    }

    .project-slider-info {
        left: 16px;
        right: 16px;
        bottom: 18px;
        max-width: none;
    }

    .project-slider-info p {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .project-slider-controls {
        right: 16px;
        top: 16px;
        bottom: auto;
        left: auto;
    }

    .project-slider-dots {
        top: auto;
        bottom: 16px;
        right: 16px;
    }

    /* NORMAL POST CARDS */
    .post-grid,
    .card-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .post-card {
        width: 100%;
        min-height: auto;
        border-radius: 24px;
    }

    .post-card img {
        height: 190px;
    }

    .post-card-content {
        padding: 22px;
    }

    .post-card-content .card-tag {
        margin-bottom: 18px;
    }

    /* GUIDES */
    .guides-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .guide-categories {
        width: 100%;
        display: flex;
        gap: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 14px;
        border-radius: 24px;
        scrollbar-width: none;
    }

    .guide-categories::-webkit-scrollbar {
        display: none;
    }

    .guide-categories-header {
        display: none;
    }

    .guide-category {
        flex: 0 0 auto;
        width: 190px;
        min-width: 190px;
        margin-bottom: 0;
        padding: 14px;
        border-radius: 18px;
    }

    .guide-content-panel {
        width: 100%;
        padding: 18px;
        border-radius: 24px;
        min-height: 0;
    }

    .guide-panel-top {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-bottom: 18px;
    }

    .guide-panel-title {
        font-size: 1.35rem;
    }

    .guide-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .guide-card {
        min-height: auto;
    }

    .guide-card img {
        height: 190px;
    }

    /* MODAL - så hela texten går att scrolla */
    .post-modal {
        padding: 12px !important;
        align-items: center !important;
        justify-content: center !important;
        overflow: hidden !important;
    }

    .post-modal-window {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: calc(100vh - 24px) !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        border-radius: 24px !important;
    }

    .post-modal-image {
        height: clamp(160px, 28vh, 260px) !important;
        flex-shrink: 0 !important;
    }

    .post-modal-content {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        padding: 22px !important;
    }

    .post-modal-title {
        font-size: clamp(1.8rem, 8vw, 2.7rem);
        line-height: 1;
    }

    .post-modal-text {
        max-width: none !important;
        font-size: 1rem !important;
        line-height: 1.7 !important;
    }
}

@media (max-width: 520px) {

    .site-shell {
        padding: 0 12px;
    }

    .topbar {
        left: 12px;
        right: 12px;
        top: 10px;
        border-radius: 22px;
    }

    .page {
        padding-top: 138px;
    }

    .main-nav a {
        font-size: 0.78rem;
        padding: 8px 10px;
    }

    #home .hero-content {
        padding: 18px;
        border-radius: 24px;
    }

    #home .hero-brand-banner {
        height: 175px;
    }

    .post-card img,
    .guide-card img {
        height: 175px;
    }

    .project-slider-info span {
        font-size: 0.68rem;
    }

    .project-slider-info p {
        font-size: 0.82rem;
    }

    .guide-category {
        width: 165px;
        min-width: 165px;
    }
}

.article-load-trigger {
    grid-column: 1 / -1;
    width: 100%;
    padding: 28px 0 8px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(235, 245, 255, 0.55);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Guide back button */
.guide-back-button {
    width: 24px;
    height: 24px;
    margin: 0 8px 0 0;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(120, 210, 255, 0.45);
    border-radius: 8px;

    background: linear-gradient(
        135deg,
        rgba(110, 80, 160, 0.45),
        rgba(45, 95, 130, 0.35)
    );

    color: #dff7ff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;

    cursor: pointer;
    box-shadow:
        0 0 12px rgba(90, 210, 255, 0.18),
        inset 0 0 12px rgba(255, 255, 255, 0.05);

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.guide-back-button:hover {
    transform: translateX(-2px);
    border-color: rgba(120, 230, 255, 0.8);

    background: linear-gradient(
        135deg,
        rgba(150, 90, 210, 0.6),
        rgba(70, 150, 190, 0.45)
    );

    box-shadow:
        0 0 18px rgba(90, 210, 255, 0.32),
        inset 0 0 14px rgba(255, 255, 255, 0.08);
}

.guide-back-button:active {
    transform: translateX(-2px) scale(0.96);
}

.guide-back-button[hidden] {
    display: none !important;
}

/* Header alignment when back button is visible */
.guide-categories-header {
    display: flex;
    align-items: center;
    gap: 0;
}