/* Body background/font come from the shared theme; the hero paints its own. */

/* ============================================================
   Main Banner — full viewport hero with background image
   ============================================================ */
.main-banner {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--navbar-height));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.5)), url('../photo/background.jpg') center/cover no-repeat;
    z-index: 0;
}

.main-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(29, 26, 57, 0.25) 0%,
        transparent 20%,
        transparent 48%,
        rgba(0, 0, 0, 0.5) 75%,
        rgba(0, 0, 0, 0.88) 100%
    );
    z-index: 1;
}

/* ============================================================
   Hero Title
   ============================================================ */
.hero-title {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
    user-select: none;
    padding-top: 42vh;
}

.hero-logo-row {
    display: flex;
    align-items: center;
    gap: 22px;
    margin-bottom: 10px;
}

.hero-logo {
    width: clamp(3rem, 5vw, 5.5rem);
    height: clamp(3rem, 5vw, 5.5rem);
    object-fit: contain;
    filter: drop-shadow(0 2px 20px rgba(0, 0, 0, 0.35));
}

.hero-title h1 {
    font-size: clamp(4rem, 7vw, 7.5rem);
    font-weight: 200;
    letter-spacing: 10px;
    color: #fff;
    margin: 0;
    line-height: 1;
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.35);
}

.hero-title .kl {
    display: inline-block;
    animation: kl-float 2.5s ease-in-out infinite;
}
.hero-title .kl:nth-child(1) { animation-delay: 0s; }
.hero-title .kl:nth-child(2) { animation-delay: 0.15s; }
.hero-title .kl:nth-child(3) { animation-delay: 0.3s; }

@keyframes kl-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.hero-title h2 {
    font-size: clamp(0.85rem, 1.5vw, 1.3rem);
    font-weight: 300;
    letter-spacing: 6px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
}

.hero-subtitle {
    font-size: clamp(0.65rem, 1vw, 0.85rem);
    font-weight: 300;
    letter-spacing: 4px;
    color: rgba(255, 255, 255, 0.35);
    margin: 6px 0 0;
    text-transform: uppercase;
}

/* ============================================================
   Home Controls (top-right theme + lang toggles)
   ============================================================ */
.home-controls {
    position: absolute;
    top: 24px;
    right: 72px;
    z-index: 10;
    display: flex;
    gap: 6px;
}

.home-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    font-family: "TASA Explorer", system-ui, sans-serif;
}

.home-ctrl-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.home-ctrl-btn svg {
    width: 16px;
    height: 16px;
}

.home-ctrl-btn.lang-toggle-btn {
    width: 34px;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ============================================================
   Hamburger (mobile only)
   ============================================================ */
.home-hamburger {
    display: none;
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 10;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.home-hamburger span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
    transition: all 0.25s ease;
}

/* ============================================================
   Mobile Nav Overlay
   ============================================================ */
.home-mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: min(280px, 80vw);
    height: 100%;
    z-index: 100;
    background: rgba(14, 11, 31, 0.96);
    backdrop-filter: blur(24px);
    padding: 72px 28px 28px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.home-mobile-nav.open {
    transform: translateX(0);
}

.home-mobile-nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px;
}

.home-mobile-nav-close:hover {
    color: #fff;
}

.home-mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-mobile-nav-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.home-mobile-nav-links a:hover {
    color: #fff;
    background: rgba(243, 159, 90, 0.1);
}

.home-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.home-mobile-backdrop.open {
    opacity: 1;
}

/* ============================================================
   Bottom Bar (nav strip + info row)
   ============================================================ */
.bottom-bar {
    position: relative;
    z-index: 2;
    padding: 0 72px 26px;
    display: flex;
    flex-direction: column;
    color: rgba(255, 255, 255, 0.75);
}

.home-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 12px 0 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    margin-bottom: 16px;
    gap: 6px;
}

.home-nav a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    padding: 5px 14px;
    border-radius: 6px;
    transition: all 0.25s ease;
}

.home-nav a:hover {
    color: #fff;
    background: rgba(243, 159, 90, 0.12);
}

.home-nav-sep {
    color: rgba(255, 255, 255, 0.2);
    font-size: 0.7rem;
    user-select: none;
}

/* Info row */
.bottom-info {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 30px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
}

.bottom-bar-left .institution {
    margin: 0;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.5px;
}

.bottom-bar-left .lab-link {
    margin: 2px 0 0;
    font-size: 0.68rem;
    letter-spacing: 1px;
}

.bottom-bar-center {
    text-align: center;
    flex: 1;
}

.bottom-bar-center .bg-caption {
    margin: 0;
    font-style: italic;
}

.photo-credit-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.5);
}

.photo-credit-line svg {
    opacity: 0.6;
}

.bottom-bar-right {
    text-align: right;
}

.copyright {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.5px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
    .home-hamburger {
        display: flex;
    }

    .home-mobile-nav {
        display: block;
    }

    .home-mobile-backdrop {
        display: block;
        pointer-events: none;
    }

    .home-mobile-backdrop.open {
        pointer-events: auto;
    }

    .home-controls {
        right: 68px;
    }

    .home-nav {
        display: none;
    }

    .bottom-bar {
        padding: 0 20px 20px;
    }

    .bottom-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .bottom-bar-left,
    .bottom-bar-right {
        text-align: center;
    }

    .hero-title {
        padding-top: 35vh;
    }

    .hero-logo-row {
        gap: 14px;
    }
}

/* ============================================================
   Hero scroll hint
   ============================================================ */
.hero-scroll {
    position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%);
    z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: rgba(255,255,255,0.55); font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
    transition: color var(--transition-fast);
}
.hero-scroll:hover { color: #fff; }
.hero-scroll svg { width: 18px; height: 18px; animation: scroll-bob 1.8s ease-in-out infinite; }
@keyframes scroll-bob { 0%, 100% { transform: translateY(0); opacity: 0.6; } 50% { transform: translateY(5px); opacity: 1; } }
@media (max-width: 768px) { .hero-scroll { bottom: 150px; } }

/* ============================================================
   Below-the-fold content
   ============================================================ */
.home-content { padding: var(--space-3xl) 0 0; }
.home-section { margin-bottom: var(--space-3xl); }
.home-section-head {
    display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md);
    margin-bottom: var(--space-lg); flex-wrap: wrap;
}
.home-section-title { font-size: 1.3rem; font-weight: var(--font-weight-bold); letter-spacing: -0.02em; line-height: 1.2; }
.home-more {
    display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: var(--font-weight-medium);
    color: var(--color-text-muted); transition: color var(--transition-fast), gap var(--transition-fast);
}
.home-more:hover { color: var(--color-accent); gap: 7px; }
.home-more svg { width: 14px; height: 14px; }
.home-blank { font-size: 0.82rem; color: var(--color-text-muted); padding: var(--space-lg); border: 1px dashed var(--color-border); border-radius: var(--radius-lg); text-align: center; }
.home-two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--space-2xl); }

/* ── 今晚天氣 ── */
.hw-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.hw-card {
    position: relative; overflow: hidden; display: block; min-height: 132px;
    padding: var(--space-md) var(--space-lg); border-radius: var(--radius-xl);
    background: var(--color-surface); border: 1px solid var(--color-border); box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-fast);
}
.hw-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--color-text-muted); }
.hw-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--hw-color, var(--color-text-muted)); }
.hw-skel { height: 100%; min-height: 100px; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--color-surface-elevated) 25%, var(--color-surface) 50%, var(--color-surface-elevated) 75%); background-size: 200% 100%; animation: hw-shimmer 1.4s infinite; }
@keyframes hw-shimmer { to { background-position: -200% 0; } }
.hw-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.hw-site { font-size: 0.82rem; font-weight: var(--font-weight-semibold); display: flex; align-items: center; gap: 5px; }
.hw-site svg { width: 13px; height: 13px; color: var(--color-text-muted); }
.hw-elev { font-size: 0.66rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.hw-main { display: flex; align-items: center; gap: var(--space-md); }
.hw-score { display: flex; flex-direction: column; align-items: flex-start; }
.hw-score-num { font-size: 2rem; font-weight: var(--font-weight-bold); letter-spacing: -0.03em; line-height: 1; color: var(--hw-color); font-variant-numeric: tabular-nums; }
.hw-score-lbl { font-size: 0.64rem; color: var(--color-text-muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }
.hw-verdict { font-size: 0.85rem; font-weight: var(--font-weight-semibold); color: var(--hw-color); }
.hw-cond { font-size: 0.72rem; color: var(--color-text-secondary); margin-top: 2px; }
.hw-facts { display: flex; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--color-border-subtle); font-size: 0.7rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.hw-fact { display: inline-flex; align-items: center; gap: 4px; }
.hw-fact svg { width: 11px; height: 11px; opacity: 0.7; }
.hw-fact b { color: var(--color-text); font-weight: var(--font-weight-medium); }
.hw-note { font-size: 0.68rem; color: var(--color-text-muted); margin-top: var(--space-sm); }
.hw-card.is-error { color: var(--color-text-muted); font-size: 0.8rem; display: flex; align-items: center; justify-content: center; }

/* ── 最新公告 ── */
.hn-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.hn-item {
    display: flex; gap: var(--space-md); padding: var(--space-md);
    border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-border);
    transition: border-color var(--transition-fast), transform var(--transition-base), box-shadow var(--transition-base);
}
.hn-item:hover { border-color: var(--color-text-muted); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hn-thumb { width: 96px; height: 72px; flex-shrink: 0; border-radius: var(--radius-md); overflow: hidden; background: var(--color-surface-elevated); }
.hn-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hn-body { flex: 1; min-width: 0; }
.hn-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hn-date { font-size: 0.7rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.hn-title { font-size: 0.92rem; font-weight: var(--font-weight-semibold); line-height: 1.4; margin-bottom: 3px; }
.hn-excerpt { font-size: 0.76rem; color: var(--color-text-secondary); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ── 近期天文事件 ── */
.he-list { display: flex; flex-direction: column; gap: 6px; }
.he-item {
    display: flex; align-items: center; gap: var(--space-md); padding: 10px 12px;
    border-radius: var(--radius-lg); background: var(--color-surface); border: 1px solid var(--color-border);
    transition: border-color var(--transition-fast), transform var(--transition-base);
}
.he-item:hover { border-color: var(--color-text-muted); transform: translateX(3px); }
.he-item.is-today { border-color: var(--color-accent); }
.he-date { display: flex; flex-direction: column; align-items: center; width: 44px; flex-shrink: 0; line-height: 1; }
.he-month { font-size: 0.6rem; color: var(--color-text-muted); letter-spacing: 0.04em; }
.he-day { font-size: 1.35rem; font-weight: var(--font-weight-bold); letter-spacing: -0.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.he-item.is-today .he-day { color: var(--color-accent); }
.he-body { flex: 1; min-width: 0; }
.he-title { font-size: 0.86rem; font-weight: var(--font-weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.he-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.he-left { font-size: 0.68rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }

/* ── 精選作品 ── */
.hg-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 180px; gap: var(--space-md); }
.hg-item { position: relative; display: block; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface-elevated); }
.hg-item.is-lead { grid-column: span 2; grid-row: span 2; }
.hg-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(.2,.7,.2,1); }
.hg-item:hover img { transform: scale(1.05); }
.hg-overlay {
    position: absolute; inset: auto 0 0 0; padding: 28px 14px 12px;
    background: linear-gradient(to top, rgba(5,4,10,0.85), rgba(5,4,10,0)); color: #fff;
    opacity: 0.92; transition: opacity var(--transition-fast);
}
.hg-item:hover .hg-overlay { opacity: 1; }
.hg-title { font-size: 0.82rem; font-weight: var(--font-weight-semibold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hg-item.is-lead .hg-title { font-size: 1rem; }
.hg-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.68rem; color: rgba(255,255,255,0.7); margin-top: 2px; }
.hg-likes { display: inline-flex; align-items: center; gap: 3px; }
.hg-likes svg { width: 11px; height: 11px; }

/* ── 加入我們 ── */
.home-cta { position: relative; overflow: hidden; border-radius: var(--radius-xl); margin-bottom: 0; border: 1px solid var(--color-border); }
.home-cta-bg {
    position: absolute; inset: 0;
    background:
        radial-gradient(700px 300px at 0% 0%, rgba(243,159,90,0.22), transparent 65%),
        radial-gradient(600px 300px at 100% 100%, rgba(102,37,73,0.5), transparent 65%),
        var(--color-surface);
}
:root[data-theme="light"] .home-cta-bg {
    background:
        radial-gradient(700px 300px at 0% 0%, rgba(243,159,90,0.25), transparent 65%),
        radial-gradient(600px 300px at 100% 100%, rgba(232,188,185,0.55), transparent 65%),
        var(--color-surface);
}
.home-cta-inner { position: relative; display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--space-xl); align-items: center; padding: var(--space-2xl) var(--space-xl); }
.home-cta h2 { font-size: 1.6rem; font-weight: var(--font-weight-bold); letter-spacing: -0.02em; margin: 4px 0 8px; }
.home-cta p { font-size: 0.88rem; line-height: 1.7; color: var(--color-text-secondary); max-width: 46ch; margin-bottom: var(--space-lg); }
.home-cta-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.home-cta .btn { padding: 10px 20px; font-size: 0.85rem; }
.home-cta-stats { display: flex; justify-content: space-around; gap: var(--space-md); }
.home-cta-stat { display: flex; flex-direction: column; align-items: center; }
.home-cta-num { font-size: 2.2rem; font-weight: var(--font-weight-bold); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.home-cta-lbl { font-size: 0.66rem; color: var(--color-text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 6px; }

@media (max-width: 960px) {
    .home-two-col { grid-template-columns: 1fr; gap: 0; }
    .hg-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 150px; }
    .home-cta-inner { grid-template-columns: 1fr; }
    .home-cta-stats { justify-content: flex-start; gap: var(--space-2xl); }
}
@media (max-width: 640px) {
    .home-content { padding-top: var(--space-2xl); }
    .hw-grid { grid-template-columns: 1fr; }
    .hg-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
    .hg-item.is-lead { grid-column: span 2; grid-row: span 1; }
    .hn-thumb { display: none; }
    .home-cta-inner { padding: var(--space-xl) var(--space-lg); }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-title .kl, .hero-scroll svg {
        animation: none;
    }
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) .home-cta-bg {
        background:
            radial-gradient(700px 300px at 0% 0%, rgba(243,159,90,0.25), transparent 65%),
            radial-gradient(600px 300px at 100% 100%, rgba(232,188,185,0.55), transparent 65%),
            var(--color-surface);
    }
}
