:root {
    --bg: #0f0f0f;
    --surface: #14141b;
    --text: #f5f5f7;
    --muted: rgba(245, 245, 247, 0.68);
    --soft: rgba(245, 245, 247, 0.44);
    --border: rgba(255, 255, 255, 0.08);
    --accent: #7c3aed;
    --tag-bg: rgba(255, 255, 255, 0.06);
    --max-width: 1320px;
    --narrow-width: 820px;
    --section-x: clamp(1.25rem, 4vw, 2rem);
}

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

html {
    font-family: "Noto Sans TC", sans-serif;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--bg);
    background-image: radial-gradient(
        circle at 50% -20%,
        rgba(122, 60, 255, 0.22),
        transparent 42%
    );
    background-repeat: no-repeat;
    color: var(--text);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

.site {
    min-height: 100vh;
}

.site-main {
    min-height: 50vh;
    padding-top: 5rem;
}

/* Navbar — ArnoLee */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    pointer-events: none;
}

.nav-bar__panel {
    pointer-events: auto;
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid transparent;
    overflow: hidden;
    transition:
        backdrop-filter 0.32s ease,
        border-color 0.32s ease,
        background 0.32s ease;
}

.nav-bar__panel[data-expanded="true"] {
    background: rgba(15, 15, 15, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom-color: rgba(255, 255, 255, 0.12);
}

.nav-bar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.75rem var(--section-x) 1rem;
    color: #fff;
}

.nav-bar__logo,
.nav-bar__end {
    display: flex;
    align-items: center;
}

.nav-bar__logo {
    min-width: 0;
}

.nav-bar__logo-img {
    height: clamp(36px, 4.2vw, 48px);
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 2.8vw, 2.75rem);
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-links__item {
    position: relative;
}

.nav-links__link {
    display: inline-block;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.92rem;
    letter-spacing: 0.1em;
    padding: 0.35rem 0;
    transition: color 0.2s ease;
}

.nav-links__link:hover,
.nav-links__link[data-active="true"] {
    color: #fff;
}

.nav-bar__end {
    gap: 0.75rem;
    margin-left: auto;
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 148px;
    padding: 0.72rem 1.35rem;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.nav-cta:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}

.nav-mega {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.nav-bar__panel[data-expanded="true"] .nav-mega {
    pointer-events: auto;
}

.nav-mega[data-open="true"] {
    grid-template-rows: 1fr;
}

.nav-mega__inner {
    overflow: hidden;
    min-height: 0;
}

.nav-mega__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(0.85rem, 1.8vw, 1.35rem);
    padding: 0.35rem var(--section-x) 1.65rem;
    opacity: 0;
    transform: translateY(-10px);
    transition:
        opacity 0.28s ease,
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-mega[data-open="true"] .nav-mega__grid {
    opacity: 1;
    transform: translateY(0);
}

.nav-mega__card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
    color: #fff;
}

.nav-mega__image-wrap {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    overflow: hidden;
    line-height: 0;
    transition: transform 0.25s ease;
}

.nav-mega__image-wrap img {
    width: 100%;
    height: auto;
    border-radius: 15px;
}

.nav-mega__card:hover .nav-mega__image-wrap {
    transform: translateY(-3px);
}

.nav-mega__label {
    width: 100%;
    font-size: 0.92rem;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.92);
    text-align: left;
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.burger {
    position: relative;
    width: 18px;
    height: 12px;
    display: block;
}

.burger::before,
.burger::after,
.burger > span {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
    transition:
        transform 0.22s ease,
        top 0.22s ease,
        opacity 0.18s ease;
}

.burger::before {
    top: 0;
}
.burger > span {
    top: 5px;
}
.burger::after {
    top: 10px;
}

.burger[data-open="true"]::before {
    top: 5px;
    transform: rotate(45deg);
}

.burger[data-open="true"] > span {
    opacity: 0;
}

.burger[data-open="true"]::after {
    top: 5px;
    transform: rotate(-45deg);
}

.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 99;
    background-color: #484444;
    background-image: url("../images/hero-bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 5.5rem var(--section-x) 2rem;
    overflow-y: auto;
    pointer-events: auto;
}

.menu-overlay[hidden] {
    display: none !important;
}

.menu-inner {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.menu-panel {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.menu-nav-link {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    letter-spacing: 0.1em;
}

.menu-nav-link--cta {
    margin-top: 0.5rem;
    border-bottom: none;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.9rem 1.25rem;
}

.menu-mega__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    padding: 0.5rem 0 1.25rem;
}

/* Home hero — Juniper layout */
.home-hero,
.content-area,
.site-footer {
    padding-left: var(--section-x);
    padding-right: var(--section-x);
}

.home-hero {
    padding-top: 1.5rem;
    padding-bottom: 2rem;
}

.home-hero__grid,
.content-area__inner,
.site-footer__inner {
    width: min(100%, var(--max-width));
    margin: 0 auto;
}

.home-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 6fr) minmax(280px, 4fr);
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
}

.hero-feature__link,
.sidebar-story__link,
.post-card__link {
    display: block;
}

.hero-feature__media {
    width: 100%;
    aspect-ratio: 16 / 10.5;
    border-radius: 28px;
    overflow: hidden;
}

.hero-feature__media img,
.post-card__image img,
.sidebar-story__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-feature__placeholder,
.sidebar-story__placeholder {
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: rgba(255, 255, 255, 0.06);
}

.hero-feature__content {
    padding-top: 1.1rem;
}

.hero-feature__tag,
.sidebar-story__tag,
.post-card__tag,
.post-single__tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.15rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--tag-bg);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.76rem;
    line-height: 1;
}

.hero-feature__title {
    margin: 0.85rem 0 0;
    font-size: clamp(2rem, 4.5vw, 3.75rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.hero-sidebar__list {
    display: grid;
    gap: 1.35rem;
}

.sidebar-story__link {
    display: grid;
    grid-template-columns: 158px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
}

.sidebar-story__media {
    aspect-ratio: 1.1 / 1;
    border-radius: 22px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-story__content {
    min-width: 0;
}

.sidebar-story__title {
    margin: 0.55rem 0 0.35rem;
    font-size: 1.35rem;
    line-height: 1.18;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.sidebar-story__date,
.post-card__meta,
.post-single__meta {
    color: var(--soft);
    font-size: 0.88rem;
}

/* Content area */
.content-area {
    padding-top: 2rem;
    padding-bottom: 4.5rem;
}

.section-heading {
    margin-bottom: 1.4rem;
}

.section-heading__eyebrow {
    margin: 0 0 0.35rem;
    color: var(--soft);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.76rem;
}

.section-heading__title {
    margin: 0;
    font-size: 1.7rem;
    letter-spacing: -0.03em;
}

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

.post-card {
    border-radius: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition:
        transform 0.22s ease,
        border-color 0.22s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.14);
}

.post-card__image {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.post-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.2rem 1.2rem 1.35rem;
}

.post-card__title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.post-card__excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.65;
}

.content-area__inner--narrow {
    max-width: var(--narrow-width);
}

.tag-description,
.empty-state {
    padding: 1.2rem 1.4rem;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--muted);
}

/* Single post — Juniper layout */
.post-single .content-area {
    padding: 0;
}

.post-hero {
    padding: 1.5rem var(--section-x) 2.5rem;
}

.post-hero__inner,
.post-body__inner {
    width: min(100%, var(--max-width));
    margin: 0 auto;
}

.post-hero__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.92fr);
    gap: clamp(1.5rem, 3vw, 3rem);
    align-items: center;
}

.post-hero__tag {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.15rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #f0a8b8;
    font-size: 0.76rem;
    line-height: 1;
    transition: border-color 0.2s ease;
}

.post-hero__tag:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.post-hero__title {
    margin: 1rem 0 0.85rem;
    font-size: clamp(2rem, 4.2vw, 3.5rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
    font-weight: 800;
}

.post-hero__excerpt {
    margin: 0 0 1.5rem;
    max-width: 36rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
}

.post-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    color: var(--soft);
    font-size: 0.9rem;
}

.post-hero__avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
}

.post-hero__author {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
}

.post-hero__meta-dot {
    opacity: 0.5;
}

.post-hero__media {
    margin: 0;
    aspect-ratio: 1.05 / 1;
    border-radius: 28px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.post-hero__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-body {
    padding: 0 var(--section-x) 4.5rem;
}

.post-body__inner {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.post-share {
    position: sticky;
    top: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
}

.post-share__label {
    color: var(--soft);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.post-share__links {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.post-share__link {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.72rem;
    font-weight: 700;
    transition:
        border-color 0.2s ease,
        background 0.2s ease;
}

.post-share__link:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.post-body__content {
    max-width: 52rem;
}

.post-body__content img,
.gh-content img,
.gh-content .kg-image-card img {
    border-radius: 24px;
}

.gh-content {
    color: rgba(245, 245, 247, 0.84);
    font-size: 1.04rem;
}

.gh-content h2,
.gh-content h3 {
    color: #fff;
    margin: 2rem 0 0.75rem;
    letter-spacing: -0.03em;
}

.gh-content a {
    color: #b995ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 2.5rem;
}

.pagination a,
.pagination .page-number {
    padding: 0.7rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: #fff;
}

.site-footer {
    padding-top: 2rem;
    padding-bottom: 2.6rem;
    border-top: 1px solid var(--border);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 2rem;
    color: var(--muted);
}

.site-footer__brand,
.site-footer__copy {
    margin: 0;
}

.site-footer__brand {
    color: #fff;
    font-weight: 700;
}

.site-footer__tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-left: auto;
}

.site-footer__tag {
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.84rem;
}

.site-footer__tag:hover,
.site-footer__tag.is-active {
    color: #fff;
}

.gh-content .kg-card {
    margin: 2rem 0;
}

.gh-content figure.kg-card {
    margin-left: 0;
    margin-right: 0;
}

.gh-content .kg-width-wide {
    position: relative;
    width: min(100vw - 2rem, calc(100% + 12rem));
    max-width: var(--max-width);
    margin-left: 50%;
    transform: translateX(-50%);
}

.gh-content .kg-width-full {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.gh-content .kg-width-full img {
    width: 100%;
}

@media (max-width: 1100px) {
    .home-hero__grid {
        grid-template-columns: 1fr;
    }

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

    .post-hero__media {
        order: -1;
        aspect-ratio: 16 / 10;
    }

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

@media (max-width: 768px) {
    .site-main {
        padding-top: 4.5rem;
    }

    .nav-bar__row {
        padding: 1.25rem var(--section-x);
    }

    .nav-links,
    .nav-cta,
    .nav-mega {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .hero-feature__media {
        aspect-ratio: 1.15 / 1;
        border-radius: 24px;
    }

    .hero-feature__title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

    .sidebar-story__link {
        grid-template-columns: 128px minmax(0, 1fr);
    }

    .sidebar-story__title {
        font-size: 1.05rem;
    }

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

    .post-share {
        position: static;
        flex-direction: row;
        justify-content: flex-start;
        margin-bottom: 1rem;
    }

    .post-share__links {
        flex-direction: row;
    }

    .post-hero__title {
        font-size: clamp(1.75rem, 8vw, 2.5rem);
    }

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

    .site-footer__inner,
    .site-footer__tags {
        justify-content: flex-start;
    }

    .site-footer__tags {
        margin-left: 0;
    }
}
