/* ===== Design tokens ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --ink: #15171c;
  --ink-soft: #565b66;
  --line: #e8eaf0;
  --brand: #4f46e5;       /* 靛藍主色 */
  --brand-2: #7c6cf6;
  --accent: #f59e0b;      /* 暖橘點綴 */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px -12px rgba(40, 44, 80, .18);
  --shadow-lg: 0 24px 60px -20px rgba(40, 44, 80, .28);
  --max: 1120px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans TC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 760px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  cursor: pointer; border: none; transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .6);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 30px -8px rgba(79, 70, 229, .65); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-3px); }
.btn-block { width: 100%; }

/* ===== Header ===== */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s, box-shadow .3s, padding .3s;
  padding: 18px 0;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 var(--line);
  padding: 12px 0;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; }
.logo-dot { color: var(--brand); }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { font-weight: 500; color: var(--ink-soft); font-size: .96rem; transition: color .2s; position: relative; }
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--brand); transition: width .25s var(--ease);
}
.nav a:not(.nav-cta):hover { color: var(--ink); }
.nav a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  background: var(--ink); color: #fff; padding: 9px 20px; border-radius: 999px;
  font-weight: 700; transition: transform .2s, background .2s;
}
.nav-cta:hover { background: var(--brand); transform: translateY(-2px); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: .3s var(--ease); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; padding: 160px 0 90px; overflow: hidden; }
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600;
  color: var(--brand); background: rgba(79, 70, 229, .08); padding: 7px 16px; border-radius: 999px; margin-bottom: 22px;
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); } 70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

.hero h1 { font-size: clamp(2.4rem, 5vw, 3.7rem); line-height: 1.15; font-weight: 900; letter-spacing: -.02em; margin-bottom: 22px; }
.grad { background: linear-gradient(120deg, var(--brand), var(--brand-2) 60%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 480px; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 44px; }

.hero-stats { display: flex; gap: 36px; list-style: none; }
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.7rem; font-weight: 900; font-family: "Space Grotesk", sans-serif; }
.hero-stats span { font-size: .85rem; color: var(--ink-soft); }

/* Hero card */
.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 34px 30px; text-align: center;
  box-shadow: var(--shadow-lg); position: relative;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.avatar {
  width: 116px; height: 116px; margin: 0 auto 18px; border-radius: 50%; overflow: hidden;
  padding: 4px; background: linear-gradient(135deg, var(--brand), var(--accent));
}
.avatar img { width: 100%; height: 100%; border-radius: 50%; background: #fff; object-fit: cover; object-position: center; image-rendering: -webkit-optimize-contrast; }
.hero-card-name { font-weight: 900; font-size: 1.3rem; }
.hero-card-role { color: var(--ink-soft); font-size: .95rem; margin-bottom: 18px; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.hero-tags span { font-size: .8rem; background: var(--bg-alt); color: var(--ink-soft); padding: 5px 12px; border-radius: 999px; font-weight: 500; }
.hero-card-line {
  display: inline-flex; align-items: center; gap: 8px; width: 100%; justify-content: center;
  background: #06c755; color: #fff; padding: 12px; border-radius: 12px; font-weight: 700; transition: transform .2s, filter .2s;
}
.hero-card-line:hover { transform: translateY(-2px); filter: brightness(1.05); }

.hero-glow {
  position: absolute; top: -10%; right: -5%; width: 600px; height: 600px; z-index: -1;
  background: radial-gradient(circle, rgba(124, 108, 246, .22), transparent 65%); filter: blur(20px);
}

/* ===== Sections ===== */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 56px; }
.eyebrow { font-family: "Space Grotesk", sans-serif; font-size: .8rem; font-weight: 700; letter-spacing: .18em; color: var(--brand); }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: -.02em; margin: 12px 0 14px; }
.section-head p { color: var(--ink-soft); font-size: 1.05rem; }

/* ===== Service cards ===== */
.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.service-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 28px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.service-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: transparent; }
.service-icon {
  width: 60px; height: 60px; display: grid; place-items: center; font-size: 1.7rem; border-radius: 16px;
  background: linear-gradient(135deg, rgba(79, 70, 229, .1), rgba(124, 108, 246, .14)); margin-bottom: 20px;
}
.service-card h3 { font-size: 1.25rem; margin-bottom: 12px; }
.service-card > p { color: var(--ink-soft); margin-bottom: 18px; }
.ticks { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.ticks li { position: relative; padding-left: 26px; font-size: .94rem; color: var(--ink-soft); }
.ticks li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--brand); font-weight: 900;
  background: rgba(79, 70, 229, .1); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem;
}

/* ===== Work grid ===== */
.work-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.work-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.work-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.work-cover {
  height: 170px; display: grid; place-items: center; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--c1, #6366f1), var(--c2, #8b5cf6));
}
/* 截圖封面：填滿並從頂部裁切，hover 微放大 */
.work-cover img {
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  transition: transform .5s var(--ease);
}
.work-card:hover .work-cover img { transform: scale(1.05); }
/* emoji 封面才加上反光高光，避免蓋在截圖上 */
.work-cover:has(.work-emoji)::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 50%);
}
.work-emoji { font-size: 3.2rem; filter: drop-shadow(0 6px 12px rgba(0,0,0,.2)); transition: transform .4s var(--ease); z-index: 1; }
.work-card:hover .work-emoji { transform: scale(1.18) rotate(-6deg); }
.work-body { padding: 24px 24px 26px; }
.work-tag { font-size: .78rem; font-weight: 700; color: var(--brand); letter-spacing: .04em; margin-bottom: 8px; }
.work-body h3 { font-size: 1.2rem; margin-bottom: 10px; }
.work-body p { color: var(--ink-soft); font-size: .94rem; margin-bottom: 16px; }
.work-stack { display: flex; flex-wrap: wrap; gap: 7px; }
.work-stack span { font-size: .76rem; background: var(--bg-alt); color: var(--ink-soft); padding: 4px 11px; border-radius: 999px; font-weight: 500; }
.work-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 24px; padding: 8px 16px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; color: var(--brand);
  background: rgba(79, 70, 229, .04);
  border: 1px solid rgba(79, 70, 229, .15);
  transition: all .25s var(--ease);
}
.work-link svg {
  transition: transform .25s var(--ease);
}
a.work-card:hover .work-link {
  background: var(--brand); color: #fff; border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px -4px rgba(79, 70, 229, .3);
}
a.work-card:hover .work-link svg {
  transform: translateX(4px);
}

/* ===== Steps ===== */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; position: relative;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.step:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.step-no {
  font-family: "Space Grotesk", sans-serif; font-size: 2.4rem; font-weight: 700; line-height: 1;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 14px;
}
.step h3 { font-size: 1.15rem; margin-bottom: 8px; }
.step p { color: var(--ink-soft); font-size: .93rem; }

/* ===== FAQ ===== */
.faq { display: flex; flex-direction: column; gap: 14px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; transition: box-shadow .3s, border-color .3s; }
.faq-item.active { box-shadow: var(--shadow); border-color: rgba(79, 70, 229, .4); }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 20px 22px; font-size: 1.05rem; font-weight: 700; font-family: inherit; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-icon { flex-shrink: 0; font-weight: 400; font-size: 1.5rem; color: var(--brand); transition: transform .3s var(--ease); }
.faq-item.active .faq-icon { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s var(--ease); }
.faq-a p { padding: 0 22px 22px; color: var(--ink-soft); }

/* ===== Contact ===== */
.contact-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center;
  background: linear-gradient(135deg, #1b1d2e, #25264a); color: #fff;
  border-radius: 28px; padding: 56px 50px; box-shadow: var(--shadow-lg);
}
.contact-left .eyebrow { color: #a5b4fc; }
.contact-left h2 { color: #fff; font-size: clamp(1.8rem, 3.5vw, 2.5rem); font-weight: 900; margin: 12px 0 16px; }
.contact-left > p { color: #c4c7d8; margin-bottom: 30px; }
.contact-methods { display: flex; flex-direction: column; gap: 12px; }
.contact-btn {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
  transition: transform .25s var(--ease), background .25s;
}
.contact-btn:hover { transform: translateX(6px); background: rgba(255, 255, 255, .13); }
.contact-btn .ci { font-size: 1.4rem; }
.contact-btn strong { display: block; font-size: 1rem; }
.contact-btn small { color: #b9bcd0; font-size: .82rem; }

.contact-form { background: #fff; border-radius: 20px; padding: 30px; }
.contact-form label { display: block; margin-bottom: 16px; }
.contact-form label span { display: block; font-size: .88rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: .96rem; color: var(--ink); transition: border-color .2s, box-shadow .2s; resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(79, 70, 229, .12); }
.form-note { font-size: .8rem; color: var(--ink-soft); text-align: center; margin-top: 12px; }

/* ===== Footer ===== */
.site-footer { background: #0f1018; color: #fff; padding: 50px 0 40px; text-align: center; }
.site-footer .logo { font-size: 1.4rem; margin-bottom: 8px; display: inline-block; }
.site-footer p { color: #8b8fa3; font-size: .92rem; }
.site-footer .copy { margin-top: 14px; font-size: .82rem; color: #5d6175; }

/* ===== To-top ===== */
.to-top {
  position: fixed; bottom: 28px; right: 28px; width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.3rem; z-index: 90;
  box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .3s, transform .3s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { filter: brightness(1.1); transform: translateY(-3px); }

/* ===== Reveal animation ===== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-card { max-width: 360px; margin: 0 auto; }
  .cards-3, .work-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; padding: 40px 30px; }

  .nav {
    position: fixed; top: 0; right: 0; height: 100vh; width: 78%; max-width: 320px;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 22px;
    background: #fff; padding: 0 40px; box-shadow: -10px 0 40px rgba(0,0,0,.12);
    transform: translateX(100%); transition: transform .35s var(--ease);
  }
  .nav.open { transform: translateX(0); }
  .nav a { font-size: 1.2rem; }
  .nav-toggle { display: flex; z-index: 110; }
}

@media (max-width: 560px) {
  .hero { padding: 130px 0 70px; }
  .section { padding: 70px 0; }
  .cards-3, .work-grid, .steps { grid-template-columns: 1fr; }
  .hero-stats { gap: 24px; }
  .contact-wrap { padding: 32px 22px; }
  .contact-form { padding: 22px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, .reveal { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
