/*
Theme Name: CarLights Pro
Theme URI: https://rnstudio.tw
Description: 專業車燈改裝介紹網站主題
Version: 3.0.0
Author: CarLights
Text Domain: carlights
*/

/* 版面概念：夜間道路。深柏油底、頭燈白字、方向燈琥珀色重點；以色溫與明暗截止線作為視覺語言 */
:root {
    --asphalt: #0F1215;
    --asphalt-2: #151A1F;
    --asphalt-3: #1C232A;
    --line: #2A323B;
    --beam: #F2F0EA;
    --dim: #8E98A2;
    --amber: #FFB020;
    --amber-ink: #1A1300;
    --kelvin: linear-gradient(90deg, #FF9F3D 0%, #FFD9A0 22%, #FFF6E8 42%, #FFFFFF 55%, #D6E6FF 75%, #8DB4FF 100%);
    --f-display: "Chakra Petch", "Noto Sans TC", sans-serif;
    --f-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
    --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
    --radius: 4px;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--asphalt);
    color: var(--beam);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--amber-ink); }

.container {
    max-width: 1160px;
    margin: 0 auto;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.spec {
    font-family: var(--f-mono);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--dim);
}
.spec b { color: var(--amber); font-weight: 500; }

/* ===== Header ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 18, 21, .82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 68px;
}
.site-logo { display: flex; align-items: center; gap: 12px; }
.site-logo .logo-mark {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .04em;
    background: var(--amber);
    color: var(--amber-ink);
    padding: 3px 8px;
    border-radius: 2px;
}
.site-logo .logo-name { font-weight: 700; font-size: 19px; letter-spacing: .08em; }
.site-logo .logo-sub { font-family: var(--f-mono); font-size: 10px; letter-spacing: .16em; color: var(--dim); display: block; line-height: 1.2; }
.site-logo img, .site-logo-img { height: 46px; width: auto; max-width: 100%; display: block; }
.footer-about .site-logo-img { height: 56px; }
@media (max-width: 600px) { .site-header .site-logo-img { height: 36px; } }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 32px; }
.main-nav a { font-size: 15px; color: var(--dim); transition: color .2s; position: relative; padding-block: 6px; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--beam); }
.main-nav a::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: var(--amber); transform: scaleX(0); transform-origin: left; transition: transform .25s;
}
.main-nav a:hover::after { transform: scaleX(1); }

.menu-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-toggle span { display: block; width: 22px; height: 2px; background: var(--beam); margin: 5px 0; transition: transform .25s, opacity .25s; }
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 13px 26px;
    font-family: var(--f-body); font-size: 15px; font-weight: 700; letter-spacing: .04em;
    border-radius: var(--radius);
    border: 1.5px solid var(--beam);
    transition: background .2s, color .2s, border-color .2s, transform .2s;
    cursor: pointer;
}
.btn-primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); }
.btn-primary:hover { background: var(--beam); border-color: var(--beam); }
.btn-outline { background: transparent; color: var(--beam); }
.btn-outline:hover { background: var(--beam); color: var(--asphalt); }
.btn .arrow { transition: transform .2s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding-block: 96px 80px; border-bottom: 1px solid var(--line); }
.hero .container { display: block; }
.hero-content { max-width: 760px; }
.hero-content { min-width: 0; }
.hero h1 {
    font-size: clamp(38px, 6vw, 68px);
    font-weight: 900;
    letter-spacing: .02em;
    line-height: 1.18;
    margin: 18px 0 22px;
}
.hero h1 em { font-style: normal; color: var(--amber); }
.hero-lead { color: var(--dim); font-size: 17px; max-width: 30em; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.aim-wall { position: relative; min-width: 0; }
.aim-wall svg { width: 100%; height: auto; display: block; }
.aim-caption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ===== Stats ===== */
.stats-section { border-bottom: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat-item { padding: 28px 24px; border-left: 1px solid var(--line); }
.stat-item:first-child { border-left: 0; padding-left: 0; }
.stat-number {
    font-family: var(--f-display); font-weight: 600;
    font-size: clamp(34px, 4.5vw, 52px); line-height: 1;
    font-variant-numeric: tabular-nums;
}
.stat-number small { font-size: .5em; color: var(--amber); margin-left: 4px; }
.stat-label { color: var(--dim); font-size: 14px; margin-top: 8px; }

/* ===== Sections ===== */
.section { padding-block: 96px; }
.section-alt { background: var(--asphalt-2); }
.section-head { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end; margin-bottom: 48px; }
.section-head h2, .section-title { font-size: clamp(30px, 4vw, 44px); font-weight: 900; letter-spacing: .02em; margin-top: 10px; }
.section-head p, .section-subtitle { color: var(--dim); max-width: 32em; }
.kelvin-rule { height: 3px; border-radius: 2px; background: var(--kelvin); width: 120px; margin-top: 18px; }

/* ===== Services ===== */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.service-card { background: var(--asphalt); padding: 36px 30px 32px; display: flex; flex-direction: column; gap: 14px; min-width: 0; transition: background .25s; }
.service-card:hover { background: var(--asphalt-3); }
.service-icon { width: 48px; height: 48px; color: var(--amber); }
.service-icon svg { width: 100%; height: 100%; }
.service-card h3 { font-size: 22px; }
.service-card p { color: var(--dim); font-size: 15px; flex: 1; }

/* ===== Kelvin guide ===== */
.kelvin-bar { height: 14px; border-radius: 3px; background: var(--kelvin); margin: 8px 0 0; }
.kelvin-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 0; position: relative; }
.kelvin-stop { padding-top: 22px; position: relative; min-width: 0; }
.kelvin-stop::before { content: ""; position: absolute; top: 0; left: 0; width: 1px; height: 14px; background: var(--dim); }
.kelvin-stop .k { font-family: var(--f-display); font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.kelvin-stop .k small { font-size: 15px; color: var(--dim); margin-left: 2px; }
.kelvin-stop h3 { font-size: 17px; margin: 10px 0 6px; }
.kelvin-stop p { color: var(--dim); font-size: 14px; }
.kelvin-stop.pick .k { color: var(--amber); }
.kelvin-note { margin-top: 36px; padding: 18px 22px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--dim); font-size: 14px; }
.kelvin-note strong { color: var(--beam); }

/* ===== Cases ===== */
.cases-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.case-card { display: flex; flex-direction: column; background: var(--asphalt-2); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color .25s, transform .25s; min-width: 0; }
.section-alt .case-card { background: var(--asphalt); }
.case-card:hover { border-color: var(--amber); transform: translateY(-3px); }
.case-card-image { aspect-ratio: 3 / 2; overflow: hidden; background: var(--asphalt-3); max-width: 100%; }
.case-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.case-card:hover .case-card-image img { transform: scale(1.05); }
.case-card-image.no-image { display: grid; place-items: center; color: var(--line); }
.case-card-image.no-image svg { width: 56px; height: 56px; }
.case-card-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.case-card-body h3 { font-size: 19px; }
.case-card-meta { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; color: var(--amber); }
.case-card-body p { color: var(--dim); font-size: 14px; }
.read-more { margin-top: auto; padding-top: 8px; font-size: 14px; font-weight: 700; }

.cases-empty { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; padding: 36px; border: 1px dashed var(--line); border-radius: var(--radius); }
.cases-empty svg { width: 56px; height: 56px; color: var(--amber); }
.cases-empty h3 { font-size: 20px; margin-bottom: 4px; }
.cases-empty p { color: var(--dim); }
.cases-more { margin-top: 40px; display: flex; justify-content: center; }

/* ===== Process ===== */
.process-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; counter-reset: step; }
.process-step { position: relative; padding: 0 28px 0 0; min-width: 0; }
.process-step::before { content: ""; position: absolute; top: 21px; left: 44px; right: 0; height: 1px; background: var(--line); }
.process-step:last-child::before { display: none; }
.process-step-number {
    width: 44px; height: 44px; display: grid; place-items: center;
    border: 1.5px solid var(--amber); color: var(--amber); border-radius: 50%;
    font-family: var(--f-display); font-weight: 600; font-size: 18px; margin-bottom: 22px; background: var(--asphalt);
    position: relative;
}
.process-step h3 { font-size: 19px; margin-bottom: 8px; }
.process-step p { color: var(--dim); font-size: 15px; }

/* ===== CTA ===== */
.cta-section { background: var(--amber); color: var(--amber-ink); }
.cta-section .container { display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-section h2 { font-size: clamp(28px, 4vw, 42px); font-weight: 900; }
.cta-section p { margin-top: 8px; font-size: 17px; }
.cta-section .btn { background: var(--amber-ink); border-color: var(--amber-ink); color: var(--amber); }
.cta-section .btn:hover { background: transparent; color: var(--amber-ink); }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); padding-block: 64px 32px; color: var(--dim); font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr; gap: 48px; }
.site-footer h3 { color: var(--beam); font-size: 15px; letter-spacing: .1em; margin-bottom: 16px; }
.footer-about .site-logo { margin-bottom: 16px; }
.footer-about p { max-width: 26em; }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-links a:hover, .footer-contact a:hover { color: var(--amber); }
.footer-contact p + p { margin-top: 12px; }
.footer-contact a { color: var(--beam); text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 4px; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.footer-bottom .kelvin-rule { margin: 0; align-self: center; }

/* ===== Archive / single / page ===== */
.archive-header, .page-hero { padding-block: 72px 48px; border-bottom: 1px solid var(--line); }
.archive-header h1, .page-content h1, .single-mod-header h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 900; letter-spacing: .02em; }
.archive-header p { color: var(--dim); margin-top: 14px; }
.neon-divider { height: 3px; width: 120px; border-radius: 2px; background: var(--kelvin); margin: 18px 0; }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.filter-tab { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--dim); transition: all .2s; }
.filter-tab:hover { color: var(--beam); border-color: var(--dim); }
.filter-tab.active { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-weight: 700; }

.single-mod, .page-content { padding-block: 72px 96px; }
.single-mod .container, .page-content .container { max-width: 880px; }
.single-mod-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--dim); font-size: 14px; margin-top: 14px; font-family: var(--f-mono); }
.single-mod-meta a { color: var(--amber); }
.mod-info-box { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 36px 0; }
.mod-info-item { background: var(--asphalt-2); padding: 18px 20px; }
.mod-info-item label { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; color: var(--dim); margin-bottom: 4px; }
.mod-info-item span { font-size: 17px; font-weight: 700; }
.single-mod-featured { width: 100%; border-radius: var(--radius); margin-bottom: 36px; }
.single-mod-content, .entry-content { font-size: 17px; line-height: 1.9; color: #D5D8DC; }
.single-mod-content > * + *, .entry-content > * + * { margin-top: 1.2em; }
.single-mod-content h2, .entry-content h2 { font-size: 26px; color: var(--beam); margin-top: 1.8em; }
.single-mod-content h3, .entry-content h3 { font-size: 21px; color: var(--beam); margin-top: 1.6em; }
.single-mod-content a, .entry-content a { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }
.page-content h1 { margin-bottom: 36px; }
.single-mod-back { margin-top: 56px; }

/* Reveal: 內容在載入時即完整可見，只加入輕微的位移動畫 */
.reveal, .reveal-left, .reveal-right { opacity: 1; }

/* ===== Responsive ===== */
@media (max-width: 960px) {
    .hero .container { grid-template-columns: 1fr; gap: 40px; }
    .section-head { grid-template-columns: 1fr; gap: 12px; }
    .services-grid { grid-template-columns: 1fr; }
    .cases-grid { grid-template-columns: repeat(2, 1fr); }
    .kelvin-scale { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
    .process-timeline { grid-template-columns: repeat(2, 1fr); row-gap: 40px; }
    .process-step:nth-child(2)::before { display: none; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .main-nav {
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--asphalt-2); border-bottom: 1px solid var(--line);
        display: none;
    }
    .main-nav.active { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; padding: 8px max(20px, env(safe-area-inset-left, 0px)); }
    .main-nav li a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .main-nav li:last-child a { border-bottom: 0; }
    .section { padding-block: 72px; }
    .hero { padding-block: 48px 40px; }
}
@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-item { border-left: 0; border-top: 1px solid var(--line); padding: 20px 0; }
    .stat-item:first-child { border-top: 0; }
    .cases-grid, .kelvin-scale, .process-timeline, .footer-grid { grid-template-columns: 1fr; }
    .process-step::before { display: none; }
    .cases-empty { grid-template-columns: 1fr; text-align: left; padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
