/* ==========================================================================
   theme.css — cnj.tw v3 全站共用樣式
   來源：v3 首頁 mock（design source of truth），tokens/nav/hero 基底/footer/
   contact 橫幅/reveal 動效搬進來，並提供舊 class（.container/.section-title/
   .cta-btn/.hero/.hero-content）的相容樣式給內頁沿用，內頁專屬 CSS 仍照舊套用。
   ========================================================================== */

:root {
    --paper: #F5F2EC;
    --paper-2: #ECE8DF;
    --ink: #15181C;
    --ink-2: #3B4048;
    --ink-3: #6B717B;
    --line: #CFC9BD;
    --line-2: #B9B2A4;
    --orange: #E8702A;
    --orange-deep: #C85A17;
    --orange-soft: #FBE7DA;
    --white: #FFFFFF;
    --black: #000000;
    --on-dark: #D9D6CF;
    --on-dark-muted: #A8ADB5;
    --on-dark-text: #C9CDD3;
    --on-dark-text-2: #E4E2DC;
    --kicker: #FFB88C;
    --contact-p: #FFF1E8;
    --panel-bg: #1F2329;
    --field-bg: #15181C;
    --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
    --sans: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
    --max: 1240px;
    --r: 4px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

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

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

ul {
    list-style: none;
}

:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 3px;
}

.ico {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── layout wrap / container 相容 ── */
.wrap, .container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 24px;
}

.eyebrow {
    font-family: var(--mono);
    font-size: 16px;
    color: var(--orange);
    letter-spacing: .06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

    .eyebrow::before {
        content: "";
        width: 28px;
        height: 2px;
        background: var(--orange);
    }

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
}

h2 {
    font-size: clamp(30px,3.4vw,42px);
    margin-bottom: 12px;
}

.lead {
    color: var(--ink-2);
    font-size: 18px;
    max-width: 640px;
}

/* section-title 相容（內頁沿用這個 class 當標題） */
.section-title {
    font-size: clamp(28px,3.4vw,42px);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: var(--ink);
    text-align: left;
    margin-bottom: 40px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-2);
}

.sec {
    padding: 96px 0;
}

.sec-head {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: end;
    margin-bottom: 48px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line-2);
}

.sec-num {
    font-family: var(--mono);
    font-size: 16px;
    color: var(--ink-3);
    text-align: right;
}

/* ── 按鈕 ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    border-radius: var(--r);
    font-weight: 700;
    font-size: 17px;
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: transform .15s ease,background .2s,color .2s,border-color .2s;
}

    .btn:active {
        transform: scale(.98);
    }

.btn-primary {
    background: var(--orange);
    color: var(--white);
}

    .btn-primary:hover {
        background: var(--orange-deep);
    }

.btn-ghost {
    border-color: currentColor;
    color: var(--ink);
}

    .btn-ghost:hover {
        background: var(--ink);
        color: var(--paper);
    }

.btn-light {
    border-color: rgba(255,255,255,.55);
    color: var(--white);
}

    .btn-light:hover {
        background: var(--white);
        color: var(--ink);
    }

.btn-ink {
    background: var(--ink);
    color: var(--white);
}

    .btn-ink:hover {
        background: var(--black);
    }

.btn svg {
    width: 18px;
    height: 18px;
}

/* cta-btn 相容（內頁沿用這個 class 當 CTA 按鈕，等同 .btn.btn-primary） */
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    border-radius: var(--r);
    font-weight: 700;
    font-size: 17px;
    border: 1.5px solid transparent;
    background: var(--orange);
    color: var(--white);
    cursor: pointer;
    transition: transform .15s ease,background .2s;
}

    .cta-btn:hover {
        background: var(--orange-deep);
    }

    .cta-btn:active {
        transform: scale(.98);
    }

/* ── NAV ── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(245,242,236,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

    .nav .wrap {
        display: flex;
        align-items: center;
        justify-content: space-between;
        height: 72px;
        gap: 24px;
    }

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 22px;
    letter-spacing: .01em;
}

    .brand img {
        width: 36px;
        height: 36px;
    }

    .brand b {
        color: var(--orange);
    }

    .brand span {
        font-weight: 500;
        color: var(--ink-2);
    }

.menu {
    display: flex;
    gap: 6px;
}

    .menu a {
        display: inline-flex;
        align-items: center;
        height: 44px;
        padding: 0 14px;
        border-radius: var(--r);
        font-weight: 500;
        font-size: 17px;
        color: var(--ink-2);
    }

        .menu a:hover {
            background: var(--paper-2);
            color: var(--ink);
        }

        .menu a.cta {
            background: var(--ink);
            color: var(--paper);
            font-weight: 700;
            margin-left: 6px;
        }

            .menu a.cta:hover {
                background: var(--orange);
                color: var(--white);
            }

.burger {
    display: none;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    background: transparent;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

    .burger svg {
        width: 24px;
        height: 24px;
    }

.drawer {
    display: none;
}

/* ── HERO 基底（首頁與內頁共用；內頁高度較矮，深色疊圖效果只掛在 .hero-home） ── */
.hero {
    position: relative;
    color: var(--white);
    min-height: 380px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero .wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 56px 24px;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 56px 24px;
    max-width: var(--max);
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(42px,6vw,76px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -.02em;
    max-width: 12ch;
}

    .hero h1 em {
        font-style: normal;
        color: var(--orange);
    }

.hero p {
    margin-top: 22px;
    font-size: 20px;
    color: var(--on-dark);
    max-width: 34ch;
}

.hero-actions {
    display: flex;
    gap: 14px;
    margin-top: 36px;
    flex-wrap: wrap;
}

/* 內頁 hero-content：h1/h2/.hero-h2 用 v3 大字，偶數行 <p> 沿用原本橘色效果 */
.hero-content h1, .hero-content h2, .hero-content h3, .hero-content .hero-h2 {
    font-size: clamp(34px,5vw,58px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -.02em;
    text-shadow: none;
    padding-bottom: 10px;
}

.hero-content p {
    font-size: 19px;
    margin-bottom: 0;
    color: var(--on-dark);
    line-height: 1.5;
}

    .hero-content p:nth-child(even) {
        color: var(--orange);
    }

.hero-content .cta-btn {
    margin-top: 20px;
}

/* 首頁專屬 hero：疊圖 + 深色漸層 + 高度加大（inner hero 不套用，避免二次疊黑） */
.hero-home {
    background: var(--ink);
    min-height: 640px;
}

.hero-img {
    position: absolute;
    inset: 0;
}

    .hero-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 40%;
        opacity: .55;
    }

.hero-home::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,rgba(21,24,28,.92) 0%,rgba(21,24,28,.75) 45%,rgba(21,24,28,.25) 100%);
}

.hero-home .wrap {
    padding-top: 88px;
    padding-bottom: 88px;
}

.hero-kicker {
    font-family: var(--mono);
    font-size: 16px;
    color: var(--kicker);
    letter-spacing: .08em;
    margin-bottom: 20px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* ── CONTACT 橫幅（layout 專用，故意不叫 .contact 以免與 Contact 頁自身
     的 <section class="contact"> 撞名——那個 section 目前沒有套用任何
     section 級樣式，撞了會讓整段變橘底） ── */
.contact-banner {
    background: var(--orange);
    color: var(--white);
}

    .contact-banner .wrap {
        display: grid;
        grid-template-columns: 1.2fr 1fr;
        gap: 48px;
        align-items: center;
        padding-top: 72px;
        padding-bottom: 72px;
    }

    .contact-banner h2 {
        color: var(--white);
        font-size: clamp(30px,3.4vw,44px);
    }

    .contact-banner p {
        font-size: 18px;
        max-width: 40ch;
        color: var(--contact-p);
        margin-top: 10px;
    }

    .contact-banner .actions {
        display: flex;
        gap: 14px;
        margin-top: 28px;
        flex-wrap: wrap;
    }

.card {
    background: var(--white);
    color: var(--ink);
    border-radius: 8px;
    padding: 26px 28px;
    display: grid;
    gap: 16px;
    box-shadow: 0 30px 60px -30px rgba(0,0,0,.5);
}

    .card .row {
        display: flex;
        gap: 14px;
        align-items: flex-start;
    }

    .card .ico {
        width: 24px;
        height: 24px;
        color: var(--orange);
        flex: none;
        margin-top: 3px;
    }

    .card .k {
        font-size: 16px;
        color: var(--ink-3);
        font-family: var(--mono);
    }

    .card .v {
        font-size: 17px;
        font-weight: 500;
    }

        .card .v a:hover {
            color: var(--orange-deep);
            text-decoration: underline;
        }

/* ── FOOTER ── */
footer {
    background: var(--ink);
    color: var(--on-dark-text);
    padding: 56px 0 28px;
}

    footer .wrap {
        display: grid;
        grid-template-columns: 1.4fr 1fr 1fr auto;
        gap: 40px;
    }

    footer .brand {
        color: var(--white);
    }

        footer .brand span {
            color: var(--on-dark-text);
        }

    footer p {
        font-size: 16px;
        margin-top: 14px;
        max-width: 38ch;
    }

    footer h4 {
        font-family: var(--mono);
        font-size: 16px;
        color: var(--on-dark-muted);
        margin-bottom: 14px;
        font-weight: 500;
        letter-spacing: .06em;
    }

    footer li {
        margin-bottom: 8px;
        font-size: 16px;
    }

        footer li a:hover {
            color: var(--white);
            text-decoration: underline;
        }

.line {
    text-align: center;
}

    .line img {
        width: 112px;
        height: 112px;
        border-radius: var(--r);
        background: var(--white);
        padding: 6px;
        margin: 0 auto 8px;
    }

    .line span {
        font-size: 16px;
    }

/* footer .wrap 是 grid (0,1,1)，.copy 單 class 壓不過，這裡要 (0,2,1) 才能是 flex */
footer .wrap.copy {
    border-top: 1px solid rgba(255,255,255,.12);
    margin-top: 40px;
    padding-top: 20px;
    font-family: var(--mono);
    font-size: 16px;
    color: var(--on-dark-muted);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* ── reveal ── */
.rv {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s ease,transform .5s ease;
}

    .rv.in {
        opacity: 1;
        transform: none;
    }

@media (prefers-reduced-motion:reduce) {
    .rv {
        opacity: 1;
        transform: none;
        transition: none;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ── responsive ── */
@media (max-width:1024px) {
    footer .wrap {
        grid-template-columns: 1fr 1fr;
    }

    .contact-banner .wrap {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width:760px) {
    body {
        font-size: 16px;
    }

    .sec {
        padding: 64px 0;
    }

    .menu {
        display: none;
    }

    .burger {
        display: inline-flex;
    }

    .drawer {
        display: block;
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        /* 用 height 而非 bottom:0 —— .nav 有 backdrop-filter，會讓 .drawer 這個
           fixed 子元素的 containing block 變成 .nav 自己（72px 高)，bottom:0
           會對齊到 .nav 底部而非視窗底部，導致抽屜高度只剩幾十 px。100vh 是
           視窗單位，不受 containing block 影響，才能撐滿到畫面底部。 */
        height: calc(100vh - 72px);
        background: var(--paper);
        z-index: 99;
        padding: 16px 24px;
        overflow-y: auto;
        clip-path: inset(0 0 0 100%);
        visibility: hidden;
        transition: clip-path .25s ease,visibility 0s .25s;
    }

        .drawer.open {
            clip-path: inset(0);
            visibility: visible;
            transition: clip-path .25s ease,visibility 0s;
        }

        .drawer a {
            display: flex;
            align-items: center;
            justify-content: space-between;
            min-height: 56px;
            border-bottom: 1px solid var(--line);
            font-size: 19px;
            font-weight: 500;
        }

            .drawer a.cta {
                margin-top: 16px;
                background: var(--orange);
                color: var(--white);
                border: 0;
                border-radius: var(--r);
                padding: 0 18px;
                justify-content: center;
                font-weight: 700;
            }

    .hero {
        min-height: 0;
    }

        .hero .wrap {
            padding-top: 48px;
            padding-bottom: 40px;
        }

    .hero-content {
        padding-top: 48px;
        padding-bottom: 40px;
    }

    .hero-home {
        min-height: 0;
    }

    .hero-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .sec-head {
        grid-template-columns: 1fr;
    }

    .sec-num {
        text-align: left;
    }

    footer .wrap {
        grid-template-columns: 1fr;
    }
}

/* ── 共用區塊防滲透 ──
   內頁自己的 CSS（oem.css 的裸 h2/p/ul、oemcal.css 的 h2、game_oem.css 的 .btn/.btn-primary、
   connectorDetail.css 的 .row）在 theme.css 之後載入，會滲進每頁都有的聯絡橫幅與 footer。
   這裡用較高的 specificity 把橫幅與 footer 的樣式鎖死，內頁 CSS 不必逐一改。 */
/* oem.css 的 h2:not(.cta-content h2):not(.hero-h2) specificity 高達 (0,2,2)，
   這裡用三層 class 壓過去，不必動內頁 CSS */
.contact-banner .wrap .banner-text h2,
.contact-banner .wrap .banner-text p {
    letter-spacing: normal;
    text-transform: none;
    text-shadow: none;
    text-align: left;
    border: 0;
    padding: 0;
    margin: 0;
    font-family: var(--sans);
}

    .contact-banner .wrap .banner-text h2 {
        color: var(--white);
        font-weight: 700;
        line-height: 1.2;
        font-size: clamp(30px,3.4vw,44px);
    }

    .contact-banner .wrap .banner-text p {
        margin-top: 10px;
        line-height: 1.7;
        font-size: 18px;
        color: var(--contact-p);
    }

.contact-banner .btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 26px;
    border-radius: var(--r);
    font-family: var(--sans);
    font-weight: 700;
    font-size: 17px;
    line-height: 1.2;
    border: 1.5px solid transparent;
    box-shadow: none;
    transform: none;
}

    .contact-banner .btn-ink {
        background: var(--ink);
        color: var(--white);
    }

        .contact-banner .btn-ink:hover {
            background: var(--black);
        }

    .contact-banner .btn-light {
        background: transparent;
        border-color: rgba(255,255,255,.55);
        color: var(--white);
    }

        .contact-banner .btn-light:hover {
            background: var(--white);
            color: var(--ink);
        }

.contact-banner .eyebrow {
    color: var(--contact-p);
}

.drawer a .ico {
    width: 20px;
    height: 20px;
}

.contact-banner .card .row {
    margin: 0;
    flex-wrap: nowrap;
}

/* oem.css 的 ul li{margin:0} 是 (0,0,2)，footer li 打平會輸給後載入者，補 ul 提高到 (0,0,3) */
footer h4,
footer p,
footer ul,
footer ul li {
    letter-spacing: normal;
    text-transform: none;
    text-shadow: none;
    border: 0;
    text-align: left;
    font-family: var(--sans);
}

    footer ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    footer ul li {
        margin: 0 0 8px;
    }

    footer h4 {
        font-family: var(--mono);
        letter-spacing: .06em;
    }
