/* ==========================================================================
   Neurophin Technology — 全站樣式
   設計語彙：深黑 (#050505) + 螢光綠 (#bfff50) + 細線框 + 科技感掃描線
   ========================================================================== */

/* 品牌英文字型 Satoshi（Fontshare 免費商用授權，woff2 隨站台自行提供） */
@font-face {
    font-family: "Satoshi";
    src: url("../fonts/Satoshi-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Satoshi";
    src: url("../fonts/Satoshi-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Satoshi";
    src: url("../fonts/Satoshi-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Satoshi";
    src: url("../fonts/Satoshi-Black.woff2") format("woff2");
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --neon-green: #bfff50;
    --neon-dim: rgba(191, 255, 80, 0.5);
    --neon-faint: rgba(191, 255, 80, 0.15);
    --deep-black: #050505;
    --panel: #0a0a0a;
    --nav-height: 5rem;
}

html {
    scroll-behavior: smooth;
    /* 錨點跳轉時不要被固定導覽列蓋住標題 */
    scroll-padding-top: var(--nav-height);
    /* 【重要】把水平溢出鎖在 html 層級。
       只鎖 body 在手機瀏覽器上不保證生效：一旦任何元素撐出水平溢出，
       手機會放大「佈局視口」，所有 position:fixed 元素（右下角諮詢鈕等）
       的定位基準跟著位移，看起來就像跑版。
       clip 不會產生捲動容器（不影響 sticky），舊瀏覽器退回 hidden。 */
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    background-color: var(--deep-black);
    color: #aaa;
    /* 拉丁字母用品牌字型 Satoshi，中文落到 Noto Sans TC（源樣黑體同家族） */
    font-family: "Satoshi", "Noto Sans TC", -apple-system, BlinkMacSystemFont,
        "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Helvetica Neue",
        sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    background: var(--neon-green);
    color: #000;
}

/* 自訂捲軸 ------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--neon-green);
}
* {
    scrollbar-color: #2a2a2a #0a0a0a;
    scrollbar-width: thin;
}

/* 導覽與互動 ----------------------------------------------------------- */
.nav-active {
    color: var(--neon-green) !important;
    text-shadow: 0 0 10px var(--neon-dim);
}
.hover-neon:hover {
    color: var(--neon-green);
    text-shadow: 0 0 8px rgba(191, 255, 80, 0.3);
}
.mix-blend-mode-screen {
    mix-blend-mode: screen;
}

/* 鍵盤操作可見的焦點框（無障礙必要） */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--neon-green);
    outline-offset: 3px;
    border-radius: 2px;
}

/* 跳至主要內容（螢幕閱讀器 / Tab 使用者） */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 200;
    background: var(--neon-green);
    color: #000;
    padding: 0.75rem 1.25rem;
    font-weight: 700;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* 背景粒子 Canvas 固定在最底層 --------------------------------------- */
#canvas-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* 捲動進度條 ----------------------------------------------------------- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: linear-gradient(90deg, var(--neon-green), #ffffff);
    box-shadow: 0 0 10px var(--neon-dim);
    z-index: 60;
    transition: width 0.1s linear;
}

/* 浮動元件（回到頂端＋首頁諮詢鈕） --------------------------------------
   手機：兩顆都靠右下角疊成一直欄（首頁：諮詢鈕在下、回到頂端在上），
   桌機：回到頂端回到左下、諮詢鈕在右下。
   所有定位刻意寫死在這裡而不用 Tailwind utility——
   這份 CSS 是同步載入的，Tailwind CDN 還沒跑完之前位置也不會錯。 */
#back-to-top {
    position: fixed;
    right: 1rem;
    left: auto;
    bottom: 1.25rem;
    z-index: 70;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(191, 255, 80, 0.35);
    background: rgba(0, 0, 0, 0.6);
    color: var(--neon-green);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
/* 首頁手機版有諮詢鈕佔住右下角，回到頂端往上疊 */
.page-home #back-to-top {
    bottom: 5.25rem;
}
#back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#back-to-top:hover {
    background: var(--neon-green);
    color: #000;
}
@media (min-width: 768px) {
    #back-to-top,
    .page-home #back-to-top {
        left: 1.5rem;
        right: auto;
        bottom: 2rem;
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* 首頁浮動諮詢鈕：整顆元件自給自足，不依賴任何 CDN ------------------- */
#floating-contact {
    position: fixed;
    right: 1rem;
    left: auto;
    bottom: 1.25rem;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#floating-contact.fc-hidden {
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
}
#floating-contact .fc-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: var(--neon-green);
    color: #000;
    box-shadow: 0 0 20px rgba(191, 255, 80, 0.4);
    transition: transform 0.3s ease;
}
#floating-contact:hover .fc-pill {
    transform: scale(1.05);
}
#floating-contact .fc-pill i {
    font-size: 1.125rem;
}
#floating-contact .fc-label {
    display: none;
    font-weight: 700;
}
#floating-contact .fc-ping {
    display: none;
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    background: var(--neon-green);
    opacity: 0.2;
    animation: fc-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes fc-ping {
    75%, 100% { transform: scale(1.8); opacity: 0; }
}
@media (min-width: 768px) {
    #floating-contact {
        right: 1.5rem;
        bottom: 2rem;
    }
    #floating-contact .fc-pill {
        width: auto;
        height: auto;
        padding: 0.75rem 1.5rem;
    }
    #floating-contact .fc-pill i {
        font-size: 1.25rem;
    }
    #floating-contact .fc-label {
        display: block;
    }
    #floating-contact .fc-ping {
        display: block;
    }
}

/* 玻璃感面板（團隊頁等使用） ------------------------------------------ */
.bg-glass {
    background: rgba(17, 17, 17, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
}

/* 區塊標題左側的螢光短線 ---------------------------------------------- */
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--neon-green);
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 0.75rem;
}
.section-eyebrow::before {
    content: "";
    width: 2rem;
    height: 1px;
    background: var(--neon-green);
}

/* 掃描線疊層（沿用首頁 neural box 的視覺語彙） ------------------------ */
.scanlines {
    background-image: linear-gradient(
            rgba(18, 16, 11, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%
        ),
        linear-gradient(
            90deg,
            rgba(255, 0, 0, 0.06),
            rgba(0, 255, 0, 0.02),
            rgba(0, 0, 255, 0.06)
        );
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

/* FAQ 手風琴 ----------------------------------------------------------- */
.faq-item summary {
    list-style: none;
    cursor: pointer;
}
.faq-item summary::-webkit-details-marker {
    display: none;
}
.faq-item summary .faq-icon {
    transition: transform 0.3s ease, color 0.3s ease;
}
.faq-item[open] summary .faq-icon {
    transform: rotate(45deg);
    color: var(--neon-green);
}
.faq-item[open] {
    border-color: rgba(191, 255, 80, 0.4);
}
.faq-body {
    animation: faq-reveal 0.35s ease;
}
@keyframes faq-reveal {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 服務流程時間軸 ------------------------------------------------------- */
.process-step {
    position: relative;
    padding-left: 3rem;
}
.process-step::before {
    content: "";
    position: absolute;
    left: 1.05rem;
    top: 2.75rem;
    bottom: -2.5rem;
    width: 1px;
    background: linear-gradient(
        to bottom,
        rgba(191, 255, 80, 0.5),
        rgba(191, 255, 80, 0)
    );
}
.process-step:last-child::before {
    display: none;
}
.process-step .step-dot {
    position: absolute;
    left: 0;
    top: 0.25rem;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(191, 255, 80, 0.4);
    color: var(--neon-green);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    background: var(--deep-black);
}
@media (min-width: 768px) {
    .process-step {
        padding-left: 4.5rem;
    }
}

/* 表單 ----------------------------------------------------------------- */
.form-field {
    width: 100%;
    background: #111;
    border: 1px solid #262626;
    color: #fff;
    padding: 1rem;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-field::placeholder {
    color: #555;
}
.form-field:focus {
    outline: none;
    border-color: var(--neon-green);
    box-shadow: 0 0 0 3px rgba(191, 255, 80, 0.12);
}
.form-field:user-invalid {
    border-color: #ef4444;
}
.form-label {
    display: block;
    color: #6b7280;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
/* 蜜罐欄位：對人類完全隱形，機器人才會填 */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* 動態載入按鈕狀態 */
button[data-loading="true"] {
    opacity: 0.6;
    pointer-events: none;
}

/* 手機版節奏調整 --------------------------------------------------------
   桌機版的大字級與 96px 區塊留白直接搬到手機會顯得壅擠。
   這裡統一把「區塊上下留白」與「大標題字級」在小螢幕降一級，
   全站頁面一次生效，模板不用逐一改 class。
   （!important 是必要的：Tailwind CDN 的樣式在執行期注入、順序在本檔之後） */
@media (max-width: 767px) {
    .py-24 { padding-top: 4rem !important; padding-bottom: 4rem !important; }
    .py-20 { padding-top: 3.5rem !important; padding-bottom: 3.5rem !important; }
    .py-28 { padding-top: 4.5rem !important; padding-bottom: 4.5rem !important; }
    .py-32 { padding-top: 5rem !important; padding-bottom: 5rem !important; }
    /* 內頁 hero 的上緣：導覽列 80px + 一小段呼吸 */
    .pt-32 { padding-top: 7rem !important; }
}

@media (max-width: 639px) {
    /* 大標題降一級：text-4xl(36px)→30px、text-5xl(48px)→36px。
       md:/lg: 前綴的字級在斷點以上不受影響 */
    .text-4xl { font-size: 1.875rem !important; line-height: 2.3rem !important; }
    .text-5xl { font-size: 2.25rem !important; line-height: 2.75rem !important; }
    .text-6xl { font-size: 2.5rem !important; line-height: 2.9rem !important; }

    /* 卡片內距收一點，內容寬度多一些 */
    .p-10 { padding: 1.75rem !important; }
    .p-8 { padding: 1.5rem !important; }
}

/* 尊重使用者的「減少動態效果」系統設定 -------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    #canvas-bg {
        display: none;
    }
}

/* 列印時去掉黑底，省墨並保持可讀 -------------------------------------- */
@media print {
    body {
        background: #fff;
        color: #000;
    }
    nav,
    #canvas-bg,
    #back-to-top,
    #scroll-progress,
    .no-print {
        display: none !important;
    }
}
