*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scrollbar-gutter: stable;
  background-color: #0c1222;
  /* Align text scaling with Chromium; mobile Safari also respects -webkit- prefix */
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

:root {
  --bg: #0c1222;
  --surface: #152238;
  --text: #e8ecf4;
  --text-muted: #94a8c7;
  --accent: #60a5fa;
  --accent-bright: #93c5fd;
  --accent-dim: rgba(96, 165, 250, 0.2);
  --accent-glow: rgba(96, 165, 250, 0.4);
  --border: #1e3a5f;
  /* 繁中站：僅系統字型（無 Google Fonts） */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang TC', 'Microsoft JhengHei', 'Heiti TC', 'Noto Sans TC', sans-serif;
  --font-nav: var(--font-sans);
  --font-mono: ui-monospace, 'Cascadia Code', 'Segoe UI Mono', 'Roboto Mono', Menlo, Monaco, Consolas, monospace;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: linear-gradient(180deg, #0c1222 0%, #0f1829 30%, #0c1222 100%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* iPhone/iPod only (iphone-viewport.js): kill horizontal rubber-band; keep vertical for scroll + pull-to-refresh */
html.is-iphone {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
}

html.is-iphone body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
  /* Vertical scroll + pinch zoom; block whole-page horizontal drag */
  touch-action: pan-y pinch-zoom;
}

html.preloader-lock,
body.preloader-lock {
  overflow: hidden;
}

/* iPhone/iPod only (class set from preloader.js via userAgent) — stop horizontal rubber-band during load */
html.preloader-lock-ios {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  overflow: hidden !important;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

.site-preloader {
  position: fixed;
  inset: 0;
  /* iOS: explicit height avoids occasional 0-height fixed layer before layout settles */
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Dark blue, 5% transparent → 95% opaque */
  background: rgba(10, 26, 52, 0.95);
  transition: opacity 0.38s ease, visibility 0.38s ease;
  /* Promote own compositor layer (WebKit often delays painting fixed overlays until idle) */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.site-preloader--hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-preloader--done {
  display: none !important;
}

.site-preloader-spinner {
  --spinner-size: 72px;
  --spinner-dot-size: 12px;
  --spinner-duration: 1.6s;
  position: relative;
  width: var(--spinner-size);
  height: var(--spinner-size);
  animation: site-preloader-spin var(--spinner-duration) linear infinite;
}

.site-preloader-spinner .dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--spinner-dot-size);
  height: var(--spinner-dot-size);
  margin: calc(var(--spinner-dot-size) / -2);
  border-radius: 50%;
  background: #fff;
  transform: rotate(var(--angle)) translateY(calc(var(--spinner-size) / -2 + 6px));
  transform-origin: center;
  opacity: var(--alpha);
  animation: site-preloader-pulse var(--spinner-duration) ease-in-out infinite;
  animation-delay: var(--delay);
}

@keyframes site-preloader-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes site-preloader-pulse {
  0%,
  100% {
    opacity: calc(var(--alpha) * 0.62);
    scale: 0.88;
  }
  50% {
    opacity: 1;
    scale: 1.1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-preloader-spinner,
  .site-preloader-spinner .dot {
    animation: none;
  }
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, var(--surface) 0%, rgba(21, 34, 56, 0.95) 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 5px 30px rgba(96, 165, 250, 0.05),
    inset 0 0 80px rgba(96, 165, 250, 0.05);
}

main {
  margin-top: 0;
  padding-top: 0.75rem;
}

.nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.7rem 1.5rem;
  min-height: 3.25rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.logo {
  font-weight: 700;
  font-size: inherit;
  font-family: var(--font-nav);
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo:hover {
  color: var(--accent);
  text-decoration: none;
}

.logo:hover .logo-brand {
  color: inherit;
}

.logo-icon {
  height: 3.35rem;
  width: auto;
  aspect-ratio: 1;
  margin-right: 0.7rem;
  flex-shrink: 0;
  display: block;
  overflow: visible;
}

.logo-wordmark {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  gap: 0.14rem;
  line-height: 1.05;
  min-width: 0;
}

.logo-brand {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: inherit;
  display: block;
  text-align: left;
}

.logo-tagline {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-transform: none;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  display: block;
  text-align: left;
  margin: 0;
  text-indent: 0;
  /* Optical: W sits left of T at same inset — nudge tagline right slightly */
  padding-left: 0.19em;
}

/* Inline logo SVG animations (We Fix For You mark) */
@-webkit-keyframes logo-r1pulse {
  0%,
  100% {
    stroke-opacity: 0.95;
  }
  50% {
    stroke-opacity: 0.62;
  }
}
@keyframes logo-r1pulse {
  0%,
  100% {
    stroke-opacity: 0.95;
  }
  50% {
    stroke-opacity: 0.62;
  }
}
@-webkit-keyframes logo-r2pulse {
  0%,
  100% {
    stroke-opacity: 0.82;
  }
  50% {
    stroke-opacity: 0.48;
  }
}
@keyframes logo-r2pulse {
  0%,
  100% {
    stroke-opacity: 0.82;
  }
  50% {
    stroke-opacity: 0.48;
  }
}
@-webkit-keyframes logo-boltflash {
  0%,
  78%,
  100% {
    opacity: 1;
  }
  83% {
    opacity: 0.35;
  }
  90% {
    opacity: 1;
  }
  95% {
    opacity: 0.2;
  }
  97% {
    opacity: 1;
  }
}
@keyframes logo-boltflash {
  0%,
  78%,
  100% {
    opacity: 1;
  }
  83% {
    opacity: 0.35;
  }
  90% {
    opacity: 1;
  }
  95% {
    opacity: 0.2;
  }
  97% {
    opacity: 1;
  }
}
@-webkit-keyframes logo-sparkle {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
@keyframes logo-sparkle {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
}
@-webkit-keyframes logo-bgpulse {
  0%,
  100% {
    fill: #ffffff;
  }
  50% {
    fill: #eef3ff;
  }
}
@keyframes logo-bgpulse {
  0%,
  100% {
    fill: #ffffff;
  }
  50% {
    fill: #eef3ff;
  }
}

.logo-icon .logo-ring1 {
  fill: none;
  stroke: #ffffff;
  -webkit-animation: logo-r1pulse 3.5s ease-in-out infinite;
  animation: logo-r1pulse 3.5s ease-in-out infinite;
}
.logo-icon .logo-ring2 {
  fill: none;
  stroke: #ffffff;
  -webkit-animation: logo-r2pulse 4.8s ease-in-out infinite 0.9s;
  animation: logo-r2pulse 4.8s ease-in-out infinite 0.9s;
}
.logo-icon .logo-inner-ring {
  fill: none;
  stroke: #ffffff;
  stroke-opacity: 0.92;
}
.logo-icon .logo-bolt {
  -webkit-animation: logo-boltflash 5s ease-in-out infinite;
  animation: logo-boltflash 5s ease-in-out infinite;
}
.logo-icon .logo-sp1 {
  -webkit-animation: logo-sparkle 2s ease-in-out infinite;
  animation: logo-sparkle 2s ease-in-out infinite;
}
.logo-icon .logo-sp2 {
  -webkit-animation: logo-sparkle 2s ease-in-out infinite 0.55s;
  animation: logo-sparkle 2s ease-in-out infinite 0.55s;
}
.logo-icon .logo-sp3 {
  -webkit-animation: logo-sparkle 2s ease-in-out infinite 1.1s;
  animation: logo-sparkle 2s ease-in-out infinite 1.1s;
}
.logo-icon .logo-sp4 {
  -webkit-animation: logo-sparkle 2s ease-in-out infinite 1.65s;
  animation: logo-sparkle 2s ease-in-out infinite 1.65s;
}
.logo-icon .logo-bgc {
  -webkit-animation: logo-bgpulse 4s ease-in-out infinite;
  animation: logo-bgpulse 4s ease-in-out infinite;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1.5rem;
  flex-shrink: 0;
}

.nav-links > li {
  display: flex;
  align-items: center;
}

.nav-links > li > a {
  color: #fff;
  font-weight: 500;
  font-size: 1rem;
  font-family: var(--font-nav);
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}

@media (min-width: 769px) {
  .nav-links > li > a {
    white-space: nowrap;
  }
}

.nav-links > li > a:hover {
  color: var(--accent);
}

/* Language switcher — inline links beside globe (no dropdown) */
.lang-switcher--inline {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-left: 0.5rem;
}

.lang-switcher-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  color: #fff;
  opacity: 0.9;
}

.globe-icon {
  width: 0.95rem;
  height: 0.95rem;
}

.lang-switcher-links {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
}

.lang-switcher--inline .lang-link {
  font-family: var(--font-nav);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.15rem 0.2rem;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.lang-switcher--inline .lang-link:hover {
  color: var(--accent-bright);
  text-decoration: none;
}

.lang-switcher--inline .lang-link[aria-current='page'] {
  color: var(--accent);
}

.lang-sep {
  color: var(--text-muted);
  opacity: 0.55;
  font-size: 0.72rem;
  font-weight: 500;
  user-select: none;
  padding: 0 0.15rem;
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 1rem;
    right: 1rem;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 150;
  }

  .nav.open .nav-links {
    display: flex;
  }

  .nav-links > li {
    display: block;
  }

  .nav-links li {
    border-bottom: 1px solid var(--border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links > li > a {
    display: block;
    padding: 0.85rem 1rem;
    white-space: normal;
    line-height: inherit;
  }

  .nav-links .lang-switcher--inline {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.85rem 1rem;
    gap: 0.5rem;
  }

  .logo-brand {
    font-size: 1.25rem;
  }

  .logo-tagline {
    font-size: 0.52rem;
    letter-spacing: 0.1em;
  }

  .logo-icon {
    height: 2.7rem;
    margin-right: 0.6rem;
  }
}

/* Hero */
.hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 2.5rem;
  }
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-nav);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 15px rgba(96, 165, 250, 0.2);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.hero .highlight {
  color: #fff;
}

.hero-text {
  color: #fff;
  font-size: 1.1rem;
  max-width: 420px;
  margin: 0 0 1.75rem;
}

@media (max-width: 768px) {
  .hero-text {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

@media (min-width: 769px) {
  .hero-actions {
    margin-left: -0.2rem;
  }
}

@media (max-width: 768px) {
  .hero-actions {
    justify-content: flex-start;
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
  }
}

/* Phone / iPhone — center Book + Call CTAs */
@media (max-width: 480px) {
  .hero-actions {
    justify-content: center;
  }
}

.hero-actions .btn {
  padding: 0.62rem 1.2rem;
  font-size: 0.875rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.3);
}

.btn-primary:hover {
  background: var(--accent-bright);
  text-decoration: none;
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  text-decoration: none;
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.2);
}

/* Hero visual */
.hero-visual {
  display: flex;
  justify-content: center;
}

.screen-mockup {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 40px rgba(96, 165, 250, 0.1);
}

.screen-bar {
  height: 28px;
  background: #252525;
  border-bottom: 1px solid var(--border);
}

.screen-content {
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.code-line {
  display: block;
  color: var(--text-muted);
}

.code-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  margin-right: 0.35rem;
}

.code-line.success {
  color: var(--accent);
  margin-top: 0.5rem;
}

.hero-system-check {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* System check line: list-style heading */
.hero-system-check > .code-line:first-child {
  font-size: 0.9375rem;
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

/* Success line: paragraph close — slightly larger + separated from list */
.hero-system-check .code-line.success {
  font-size: 0.9375rem;
  line-height: 1.45;
  margin-top: 0.55rem;
  margin-bottom: 0.3rem;
}

.hero-system-check .code-line--hero-item {
  font-size: 0.8125rem;
  line-height: 1.35;
  padding-left: 0.15rem;
}

.hero-system-check .code-line--hero-item .code-icon--hero-line {
  stroke-width: 1.5;
  vertical-align: -0.14em;
  margin-right: 0.32rem;
}

.hero-status-dots {
  display: inline-block;
  margin-left: 0.06em;
  white-space: nowrap;
}

.hero-status-dot {
  display: inline-block;
  animation: hero-status-dot-wave 1.05s ease-in-out infinite;
  opacity: 0.28;
}

.hero-status-dot:nth-child(1) {
  animation-delay: 0s;
}

.hero-status-dot:nth-child(2) {
  animation-delay: 0.18s;
}

.hero-status-dot:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes hero-status-dot-wave {
  0%,
  100%,
  55% {
    opacity: 0.28;
  }
  27% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-status-dot {
    animation: none;
    opacity: 0.9;
  }
}

/* Hero Banner */
.hero-banner {
  position: relative;
  width: 100%;
  height: clamp(220px, 45vw, 420px);
  overflow: hidden;
  margin: 2rem 0 3rem;
  box-shadow:
    0 0 100px rgba(96, 165, 250, 0.35),
    0 0 180px rgba(96, 165, 250, 0.15),
    inset 0 60px 80px -40px rgba(96, 165, 250, 0.15),
    inset 0 -60px 80px -40px rgba(96, 165, 250, 0.15);
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(96, 165, 250, 0.15) 0%, transparent 15%, transparent 85%, rgba(96, 165, 250, 0.15) 100%),
    linear-gradient(to bottom, rgba(96, 165, 250, 0.2) 0%, transparent 20%, transparent 80%, rgba(96, 165, 250, 0.2) 100%),
    linear-gradient(to bottom, rgba(12, 18, 34, 0.3) 0%, rgba(15, 25, 45, 0.5) 100%);
  z-index: 1;
}

.hero-banner-slideshow {
  position: absolute;
  inset: 0;
}

.hero-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(1.1) contrast(1.05);
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
}

.hero-banner-img.active {
  opacity: 1;
  z-index: 0;
}

/* Hero arrows */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.hero-arrow:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  box-shadow: 0 0 25px var(--accent-glow);
}
.hero-arrow svg {
  width: 24px;
  height: 24px;
}
.hero-arrow-prev {
  left: 0.5rem;
}
.hero-arrow-next {
  right: 0.5rem;
}

@media (max-width: 768px) {
  .hero-banner {
    margin: 1.5rem 0 2.5rem;
    height: clamp(200px, 50vw, 320px);
  }

  .hero-arrow {
    width: 40px;
    height: 40px;
  }

  .hero-arrow svg {
    width: 20px;
    height: 20px;
  }

  .hero-arrow-prev {
    left: 0.5rem;
  }

  .hero-arrow-next {
    right: 0.5rem;
  }
}

/* Stats */
.stats {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(21, 34, 56, 0.95) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem;
  box-shadow: inset 0 0 80px rgba(96, 165, 250, 0.05);
}

.stats-grid {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: center;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.stat-value--count {
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: #fff;
  font-size: 0.95rem;
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Services */
.services {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.services h2 {
  font-size: 1.75rem;
  margin: 0 0 2rem;
  text-align: center;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .service-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .services {
    padding: 3rem 1rem;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }

  .service-card {
    padding: 1.25rem;
  }
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s ease;
}

.service-card:hover {
  border-color: var(--accent-bright);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 40px rgba(96, 165, 250, 0.35),
    0 0 80px rgba(96, 165, 250, 0.15),
    inset 0 0 30px rgba(96, 165, 250, 0.05);
  transform: translateY(-12px);
}

.service-icon {
  margin-bottom: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--accent);
}

.service-icon svg {
  width: 100%;
  height: 100%;
}

.service-card h3 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* 3D flip — 服務區塊 (.services--3d-flip only) */
.services--3d-flip .service-card--flip {
  background: transparent;
  border: none;
  padding: 0;
  perspective: 1200px;
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.services--3d-flip .service-card--flip:hover {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.services--3d-flip:not(.services--in-view) .service-card--flip {
  opacity: 0;
  transform: translateY(28px);
}

.services--3d-flip.services--in-view .service-card--flip:nth-child(1) {
  transition-delay: 0.02s;
}
.services--3d-flip.services--in-view .service-card--flip:nth-child(2) {
  transition-delay: 0.08s;
}
.services--3d-flip.services--in-view .service-card--flip:nth-child(3) {
  transition-delay: 0.14s;
}
.services--3d-flip.services--in-view .service-card--flip:nth-child(4) {
  transition-delay: 0.2s;
}
.services--3d-flip.services--in-view .service-card--flip:nth-child(5) {
  transition-delay: 0.26s;
}
.services--3d-flip.services--in-view .service-card--flip:nth-child(6) {
  transition-delay: 0.32s;
}
.services--3d-flip.services--in-view .service-card--flip:nth-child(7) {
  transition-delay: 0.38s;
}
.services--3d-flip.services--in-view .service-card--flip:nth-child(8) {
  transition-delay: 0.44s;
}

.services--3d-flip .service-flip-inner {
  position: relative;
  width: 100%;
  min-height: 256px;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0.2, 0.2, 1);
  border-radius: 10px;
}

.services--3d-flip .service-flip-inner:focus {
  outline: none;
}

.services--3d-flip .service-flip-inner:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

.services--3d-flip .service-flip-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  -moz-backface-visibility: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
  /* overflow:auto breaks preserve-3d in Firefox; Chromium is more forgiving */
  overflow: hidden;
}

.services--3d-flip .service-flip-back {
  transform: rotateY(180deg);
  background: linear-gradient(
    165deg,
    var(--surface) 0%,
    rgba(25, 40, 64, 0.98) 100%
  );
}

@media (hover: hover) and (pointer: fine) {
  .services--3d-flip.services--in-view .service-card--flip:hover .service-flip-inner,
  .services--3d-flip.services--in-view .service-card--flip:focus-within .service-flip-inner {
    transform: rotateY(180deg);
  }

  .services--3d-flip.services--in-view .service-card--flip:hover .service-flip-face,
  .services--3d-flip.services--in-view .service-card--flip:focus-within .service-flip-face {
    border-color: var(--accent-bright);
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.35),
      0 0 40px rgba(96, 165, 250, 0.35),
      0 0 80px rgba(96, 165, 250, 0.12),
      inset 0 0 30px rgba(96, 165, 250, 0.05);
  }
}

.services--3d-flip .service-card--flip.is-flipped .service-flip-inner {
  transform: rotateY(180deg);
}

.services--3d-flip .service-card--flip.is-flipped .service-flip-face {
  border-color: var(--accent-bright);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.35),
    0 0 40px rgba(96, 165, 250, 0.35),
    0 0 80px rgba(96, 165, 250, 0.12),
    inset 0 0 30px rgba(96, 165, 250, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .services--3d-flip .service-flip-inner {
    transition-duration: 0.01ms;
  }

  .services--3d-flip:not(.services--in-view) .service-card--flip,
  .services--3d-flip.services--in-view .service-card--flip {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .services--3d-flip.services--in-view .service-card--flip:nth-child(n) {
    transition-delay: 0s;
  }
}

@media (max-width: 480px) {
  .services--3d-flip .service-card--flip {
    padding: 0;
  }

  .services--3d-flip .service-flip-inner {
    min-height: 272px;
  }

  .services--3d-flip .service-flip-face {
    padding: 1.25rem;
  }
}

/* About */
.about {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(21, 34, 56, 0.95) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 0 80px rgba(96, 165, 250, 0.05);
}

.about-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  text-align: center;
}

.about h2 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.about p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.about-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem 2rem;
}

.about-list li {
  position: relative;
  padding-left: 1.25rem;
}

.about-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

/* Contact */
.contact {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.contact h2 {
  font-size: 1.75rem;
  margin: 0 0 2rem;
  text-align: center;
}

.contact-lead-links {
  text-align: center;
  margin: -0.5rem 0 2rem;
}

.contact-lead-links p {
  margin: 0 0 0.55rem;
}

.contact-lead-links p:last-child {
  margin-bottom: 0;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.contact-card {
  text-align: center;
}

.contact-card strong {
  display: block;
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.contact-card p {
  color: #fff;
  margin: 0;
}

.contact-card a {
  color: #fff;
}

.contact-card a:hover {
  color: var(--accent);
}

/* Contact Page */
.contact-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}

.contact-body .header,
.contact-body .footer {
  width: 100%;
}

.contact-body main {
  flex: 1;
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.contact-main {
  width: 100%;
}

.contact-page {
  width: 100%;
  text-align: center;
}

.contact-page-title {
  font-size: 2.25rem;
  margin: 0 0 0.5rem;
  text-align: center;
}

.contact-page-subtitle {
  color: var(--text-muted);
  text-align: center;
  margin: 0 auto 2rem;
  max-width: 480px;
}

.contact-page-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 0 50px rgba(96, 165, 250, 0.15);
}

@media (max-width: 768px) {
  .contact-page-inner {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.5rem;
  }

  .contact-page-title {
    font-size: 1.75rem;
  }

  .contact-page-subtitle {
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 480px) {
  .contact-page-inner {
    padding: 1rem;
  }

  .contact-page-image {
    margin: 0.5rem 0;
  }

  .contact-body main {
    padding: 2rem 1rem;
  }
}

.contact-page-image {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  width: 100%;
  margin: 1.5rem;
  box-shadow: 0 0 30px rgba(96, 165, 250, 0.1);
}

.contact-page-img {
  width: 100%;
  height: 100%;
  min-height: 280px;
  display: block;
  object-fit: cover;
  object-position: center;
}

.contact-page-info {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.contact-info-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  transition: box-shadow 0.2s;
}

.contact-info-card:hover {
  box-shadow: 0 0 20px rgba(96, 165, 250, 0.1);
}

.contact-info-card:first-child {
  margin-top: 1.5rem;
}

.contact-info-card strong {
  display: block;
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.contact-info-card p {
  color: var(--text-muted);
  margin: 0;
}

.contact-info-card a {
  color: var(--text);
}

.contact-info-card a:hover {
  color: var(--accent);
}

.contact-page .contact-page-info .contact-info-card:nth-child(1) p,
.contact-page .contact-page-info .contact-info-card:nth-child(4) p {
  color: #fff;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 -5px 30px rgba(96, 165, 250, 0.05);
}

.footer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* particles.js backdrop — z-index:-1 keeps canvas under content even if main CSS is briefly stale */
#particles-js {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: #0c1222;
}

body.has-particles {
  background: transparent;
  --hero-fold-header-h: 3.25rem;
  --hero-fold-main-pad-top: 0.75rem;
  --hero-fold-banner-margin-top: 2rem;
  --hero-fold-banner-h: clamp(220px, 45vw, 420px);
}

@media (max-width: 768px) {
  body.has-particles {
    --hero-fold-banner-margin-top: 1.5rem;
  }
}

body.has-particles .hero-stage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  min-height: max(
    0px,
    calc(
      100svh - var(--hero-fold-header-h) - var(--hero-fold-main-pad-top) -
        var(--hero-fold-banner-margin-top) - var(--hero-fold-banner-h)
    )
  );
}

body.has-particles .hero {
  width: 100%;
  padding-block: clamp(1.5rem, 3vw, 2.75rem);
  padding-inline: 1.5rem;
  align-items: center;
}

@media (max-width: 768px) {
  body.has-particles .hero {
    padding-block: clamp(1.25rem, 4vw, 2rem);
    padding-inline: 1rem;
  }
}

body.has-particles > .header {
  z-index: 100;
}

body.has-particles > main,
body.has-particles > footer {
  position: relative;
  z-index: 1;
}

body.has-particles > .footer {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(21, 34, 56, 0.95) 100%);
  box-shadow: 0 -5px 30px rgba(96, 165, 250, 0.05),
    inset 0 0 80px rgba(96, 165, 250, 0.05);
}
