/* =========================
   變數與基礎
   ========================= */
:root {
    --bg: #f6faf8;
    --white: #fff;
    --ink: #10231d;
    --soft: #4c635b;
    --muted: #789089;
    --teal: #1d9e75;
    --teal-dark: #147a5c;
    --green-soft: #e9f8f2;
    --line: #e2e8f0;
    --shadow: 0 18px 60px rgba(15, 35, 29, .08);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f8fafc;
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

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

.container {
    width: min(1240px, calc(100% - 40px));
    margin: auto;
}

/* =========================
   Header
   ========================= */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 950;
}

.brand img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand span {
    font-size: 18px;
}

.brand b,
.hero em,
.section-head em,
.footer em {
    color: var(--teal);
    font-style: normal;
}

.nav {
    display: flex;
    align-items: center;
    gap: 32px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
}

.nav a:hover {
    color: var(--teal);
}

.nav-cta {
    background: var(--teal);
    color: #fff !important;
    border-radius: 999px;
    padding: 10px 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.menu-btn {
    display: none;
    border: 0;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
}

.mobile-nav {
    display: none;
    background: #fff;
    padding: 0 20px 18px;
}

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

.mobile-nav a {
    display: block;
    padding: 13px 0;
    border-top: 1px solid var(--line);
    color: #334155;
    font-weight: 700;
}

/* =========================
   Hero
   ========================= */
.hero {
    min-height: 820px;
    color: #fff;
    background-image:
        linear-gradient(90deg, rgba(4, 12, 9, .94), rgba(4, 12, 9, .76) 42%, rgba(4, 12, 9, .18) 70%, rgba(4, 12, 9, 0)),
        url("../images/hero-bg.png");
    background-size: cover;
    background-position: center right;
    overflow: hidden;
}

.hero-inner {
    min-height: 820px;
    padding-top: 90px;
    display: flex;
    align-items: center;
}

.hero-copy {
    max-width: 660px;
}

.label {
    display: inline-flex;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: rgba(255, 255, 255, .82);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
}

.hero h1 {
    margin: 28px 0 0;
    font-size: clamp(40px, 5.5vw, 74px);
    line-height: 1.12;
    letter-spacing: -.055em;
    font-weight: 950;
}

.hero h1 span {
    display: block;
}

.hero p {
    max-width: 560px;
    margin: 28px 0 0;
    color: rgba(255, 255, 255, .78);
    font-size: 16px;
    line-height: 1.9;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 13px;
    margin-top: 40px;
}

/* =========================
   Buttons
   ========================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 14px 23px;
    border: 1px solid transparent;
    font-weight: 900;
    cursor: pointer;
}

.primary {
    background: var(--teal);
    color: #fff;
    box-shadow: 0 18px 40px rgba(29, 158, 117, .28);
}

.primary:hover {
    background: var(--teal-dark);
}

.outline {
    border-color: rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

/* =========================
   Sections
   ========================= */
.section {
    padding: 96px 0;
}

.white {
    background: #fff;
}

.section-head {
    max-width: 780px;
    margin: 0 auto 48px;
    text-align: center;
}

.section-head > span {
    display: inline-flex;
    padding: 8px 13px;
    border-radius: 999px;
    border: 1px solid rgba(29, 158, 117, .2);
    background: rgba(29, 158, 117, .1);
    color: var(--teal);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .16em;
}

.section-head h2 {
    margin: 18px 0 0;
    font-size: clamp(30px, 4vw, 50px);
    line-height: 1.18;
    letter-spacing: -.045em;
}

.section-head p {
    margin: 16px auto 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.8;
}

/* =========================
   Grids / Cards / Stats
   ========================= */
.grid-3,
.grid-2,
.stats,
.process-grid {
    display: grid;
    gap: 22px;
}

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

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

.card,
.stats > div,
.process-grid > div,
.contact-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    padding: 28px;
}

.card b {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: var(--teal);
    color: #fff;
}

.card h3 {
    margin: 18px 0 8px;
    font-size: 22px;
}

.card p,
.card li,
.process-grid p {
    color: #334155;
    line-height: 1.75;
}

.card ul {
    padding-left: 20px;
}

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

.stats > div {
    padding: 24px;
    text-align: center;
}

.stats b {
    display: block;
    color: var(--teal);
    font-size: 36px;
    font-weight: 950;
}

/* =========================
   Case Video Card
   ========================= */
.case-grid {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 20px;
}

@media (min-width: 640px) {
    .case-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .case-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }
}

.case-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .1);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.case-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 6px rgba(15, 23, 42, .05), 0 20px 40px -16px rgba(15, 23, 42, .18);
    border-color: rgba(29, 158, 117, .35);
}

.case-media {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: linear-gradient(135deg, #1A2F3A, #0F1419);
}

.case-thumb {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

.case-thumb img {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.case-fallback-thumb {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 50%, rgba(29, 158, 117, .22), transparent 60%),
        linear-gradient(135deg, #1A2F3A, #0F1419);
}

.case-hover {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .10);
    transition: background .2s ease;
}

.case-card:hover .case-hover {
    background: rgba(0, 0, 0, .30);
}

.case-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, .95);
    filter: drop-shadow(0 0 14px rgba(29, 158, 117, .75));
    transition: transform .2s ease;
}

.case-card:hover .case-play {
    transform: translate(-50%, -50%) scale(1.10);
}

.case-media:after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    height: 64px;
    background: linear-gradient(to top, rgba(0, 0, 0, .70), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.case-platform-badge {
    pointer-events: none;
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    padding: 2px 8px;
    color: #fff;
    font-size: 10px;
    line-height: 1.4;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .16);
}

.platform-facebook {
    background: #1877F2;
}

.platform-instagram {
    background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF);
}

.platform-drive {
    background: #1FA463;
}

.case-platform-icon,
.case-platform-icon svg {
    display: inline-flex;
    width: 12px;
    height: 12px;
}

.case-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    background: #fff;
}

.case-body h3 {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.case-action {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--teal);
    padding: 6px 12px;
    color: #fff !important;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s ease;
}

.case-action:hover {
    background: var(--teal-dark);
}

.arrow-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---------- 播放中狀態 ---------- */
.case-card.is-playing .case-play,
.case-card.is-playing .case-hover,
.case-card.is-playing .case-platform-badge {
    display: none;
}

.case-card.is-playing .case-media:after {
    display: none;
}

.case-card.is-playing .case-media iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

/* Google Drive：放大裁切
   FIND返雖然前台標示 Instagram，
   但實際預覽來源也是 Google Drive，
   因此使用相同播放模式
*/
.case-card.is-playing[data-platform="Google Drive"] .case-media iframe,
.case-card.is-playing[data-preview-url] .case-media iframe {
    width: 200%;
    height: 200%;
    transform: scale(.5);
    transform-origin: top left;
}

/* Facebook：SDK fb-video 撐滿卡片 */
.case-media .fb-video,
.case-media .fb-video span,
.case-media .fb-video iframe {
    display: block;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    background: #000;
}

.case-card.is-playing[data-platform="Facebook"] .case-media {
    background: #000;
}

/* =========================
   Instagram 彈窗
   ========================= */
body.ig-dialog-open {
    overflow: hidden;
}

.ig-dialog {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.ig-dialog.is-open {
    display: block;
}

.ig-dialog-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .72);
}

.ig-dialog-panel {
    position: relative;
    z-index: 2;
    width: calc(100vw - 1.5rem);
    max-width: 560px;
    margin: 12px auto;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}

@media (min-width: 640px) {
    .ig-dialog-panel {
        width: 100%;
        margin: 32px auto;
    }
}

.ig-dialog-head {
    padding: 12px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ig-dialog-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.5;
    font-weight: 700;
}

.ig-dialog-close {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 0;
    background: #f1f5f9;
    color: #334155;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.ig-dialog-body {
    max-height: 80vh;
    overflow-y: auto;
    background: #fafafa;
}

.ig-embed-holder {
    min-height: 520px;
}

.ig-loading {
    height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 12px;
}

.ig-embed-loaded {
    padding: 12px;
}

.ig-embed-holder .instagram-media {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.ig-fallback {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 16px;
    text-align: center;
}

.ig-fallback.is-show {
    display: flex;
}

.ig-fallback p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;
}

.ig-fallback a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #F58529, #DD2A7B, #8134AF);
    padding: 8px 16px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}

/* =========================
   Process / FAQ / Contact
   ========================= */
.process-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.process-grid > div {
    padding: 24px;
    text-align: center;
}

.process-grid b {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
}

.faq-list {
    max-width: 820px;
    margin: auto;
}

.faq-item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-item button {
    width: 100%;
    border: 0;
    background: #fff;
    padding: 20px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    font-weight: 900;
    font-size: 16px;
    cursor: pointer;
}

.faq-item div {
    display: none;
    border-top: 1px solid var(--line);
    padding: 18px 20px;
    color: #334155;
    line-height: 1.8;
}

.faq-item.open div {
    display: block;
}

.contact-form {
    max-width: 560px;
    margin: auto;
    padding: 30px;
}

.contact-form label {
    display: block;
    margin-bottom: 14px;
}

.contact-form span {
    display: block;
    color: #334155;
    font-size: 13px;
    font-weight: 900;
    margin-bottom: 7px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 14px;
    background: #fbfdfc;
    font: inherit;
}

.contact-form textarea {
    min-height: 120px;
}

.contact-form .btn {
    width: 100%;
}

.consult-msg {
    margin-top: 14px;
    min-height: 24px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.6;
}

.consult-msg.success {
    color: #147a5c;
}

.consult-msg.error {
    color: #c0392b;
}

.contact-form button[disabled] {
    opacity: .65;
    cursor: not-allowed;
}

/* =========================
   Reveal 動畫
   ========================= */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .8s ease, transform .8s ease;
}

.reveal.on {
    opacity: 1;
    transform: none;
}

/* =========================
   RWD 基礎
   ========================= */
@media (max-width: 1180px) {
    .nav {
        gap: 16px;
        font-size: 13px;
    }
}

@media (max-width: 900px) {
    .nav {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    .hero,
    .hero-inner {
        min-height: 720px;
    }

    .hero {
        background-image:
            linear-gradient(90deg, rgba(4, 12, 9, .94), rgba(4, 12, 9, .72)),
            url("../images/hero-bg.png");
        background-position: center;
    }

    .grid-3,
    .grid-2,
    .stats,
    .process-grid,
    .footer-inner {
        grid-template-columns: 1fr;
    }

    .section {
        padding: 72px 0;
    }
}

@media (max-width: 560px) {
    .container {
        width: min(100% - 28px, 1240px);
    }

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

    .hero h1 {
        font-size: 36px;
    }
}

/* =========================
   Mobile Header Fixed Top - Not Floating
   ========================= */
@media (max-width: 900px) {
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 9999;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
        background: #ffffff;
        border-bottom: 1px solid var(--line);
    }

    .header-inner {
        height: 72px;
        margin: 0;
        border-radius: 0;
    }

    .mobile-nav {
        position: fixed;
        top: 72px;
        left: 0;
        right: 0;
        z-index: 9998;
        margin: 0;
        border-radius: 0;
        box-shadow: 0 12px 30px rgba(15, 23, 42, .08);
    }

    .hero {
        padding-top: 72px;
    }

    .hero-inner {
        padding-top: 0;
    }
}

/* =========================
   Mobile Hero Top Space Adjust
   ========================= */
@media (max-width: 900px) {
    .hero {
        min-height: auto;
        padding-top: 100px;
    }

    .hero-inner {
        min-height: auto;
        padding-top: 54px;
        padding-bottom: 70px;
        align-items: flex-start;
    }

    .hero-copy {
        padding-top: 0;
    }
}

/* =========================
   Mobile Header Logo Left Space
   ========================= */
@media (max-width: 900px) {
    .site-header .container {
        width: 100%;
        padding-left: 22px;
        padding-right: 22px;
    }
}

/* =========================
   Mobile Brand Text Bigger
   ========================= */
@media (max-width: 900px) {
    .brand span {
        font-size: 20px;
        font-weight: 950;
        letter-spacing: -0.04em;
    }
}

/* =========================
   Footer
   ========================= */
.footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    padding-top: 56px;
}

.footer .container.footer-inner {
    width: min(1200px, calc(100% - 40px));
    display: grid;
    grid-template-columns: 1.15fr .9fr 1fr;
    gap: 72px;
    align-items: flex-start;
    padding-bottom: 54px;
}

.footer-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo-row img {
    width: 44px !important;
    height: 44px !important;
    object-fit: contain;
    margin: 0 !important;
}

.footer-logo-row strong {
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    color: #071b16;
    font-size: 21px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -0.045em;
}

.footer-logo-row strong em {
    color: var(--teal);
    font-style: normal;
    font-size: 20px;
    font-weight: 950;
    letter-spacing: -0.055em;
}

.footer-company {
    margin: 22px 0 0;
    color: #334155;
    font-size: 16px;
    line-height: 1.65;
    font-weight: 500;
}

.footer-desc {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
    font-weight: 500;
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 28px;
}

.footer-social a {
    width: 42px;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #64748b;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
    box-shadow: none;
    transition: all .2s ease;
}

.footer-social a:hover {
    color: var(--teal);
    border-color: rgba(29, 158, 117, .35);
    background: rgba(29, 158, 117, .05);
}

.footer-social a svg {
    width: 20px;
    height: 20px;
    display: block;
    fill: currentColor;
}

.footer-social a[aria-label="LINE"] svg {
    width: 22px;
    height: 22px;
}

.footer-social a[aria-label="Threads"] svg {
    width: 21px;
    height: 21px;
}

.footer-links h4,
.footer-contact h4 {
    margin: 0 0 22px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 950;
    letter-spacing: .13em;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-links a {
    display: block;
    margin-bottom: 12px;
    color: #334155;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--teal);
}

.footer-contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 17px;
    color: #334155;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 500;
}

.footer-contact-item span {
    width: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #52a37d;
    font-size: 18px;
    line-height: 1;
}

.footer-contact-item a {
    color: #334155;
    font-weight: 500;
}

.footer-contact-item a:hover {
    color: var(--teal);
}

.copyright {
    border-top: 1px solid #e5e7eb;
    padding: 18px 20px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

/* Mobile Footer */
@media (max-width: 900px) {
    .footer {
        padding-top: 44px;
    }

    .footer .container.footer-inner {
        width: min(100% - 36px, 1200px);
        grid-template-columns: 1fr;
        gap: 38px;
        padding-bottom: 44px;
    }

    .footer-logo-row img {
        width: 42px !important;
        height: 42px !important;
    }

    .footer-logo-row strong {
        font-size: 20px;
    }

    .footer-logo-row strong em {
        font-size: 19px;
    }

    .footer-company {
        margin-top: 18px;
        font-size: 15px;
    }

    .footer-desc {
        font-size: 14px;
    }

    .footer-social {
        gap: 12px;
        margin-top: 24px;
        flex-wrap: wrap;
    }

    .footer-social a {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .footer-links h4,
    .footer-contact h4 {
        margin-bottom: 16px;
        font-size: 12px;
    }

    .footer-links a,
    .footer-contact-item {
        font-size: 15px;
    }
}