/* =========================================================
   Xinbang HR — style.css (Clean, Sectioned)
   Notes:
   - Keep Tailwind CDN; this file only adds custom components.
   - Avoid global !important and avoid overriding Tailwind utilities.
   ========================================================= */

/* =========================
   1) Base / Reset
   ========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  font-family: "Noto Sans TC", "Noto Sans", "PingFang TC", "Microsoft JhengHei",
    system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  scroll-padding-top: var(--header-offset);
  scroll-behavior: smooth; /* 取代 .smooth-scroll */
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Noto Sans", "PingFang TC", "Microsoft JhengHei",
    system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #1f2937;
  line-height: 1.6;
}

/* =========================
   2) Theme Tokens
   ========================= */
:root {
  --header-offset: 96px; /* will be updated by JS */
  --section-pt: 50px;
  --section-pb: 10px;

  --hero-min: 70vh;
  --hero-pt-extra: 12px;
  --hero-pb-extra: 8px;

  --brand-blue: #14568d;
  --brand-blue-hover: #1a66a6;
  --btn-radius: 12px;

  --text-dark: #1f2937;
}

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --section-pt: 44px;
    --section-pb: 10px;
    --hero-pt-extra: 10px;
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --section-pt: 38px;
    --section-pb: 4px;
    --hero-pt-extra: 8px;
  }
}

/* =========================
   3) Layout System
   ========================= */
.section-base {
  padding-top: var(--section-pt);
  padding-bottom: var(--section-pb);
}

.section-hero {
  min-height: calc(var(--hero-min) - var(--header-offset));
  display: flex;
  align-items: center;
  padding-top: calc(var(--section-pt) + var(--hero-pt-extra));
  padding-bottom: calc(var(--section-pb) + var(--hero-pb-extra));
}

@media (max-width: 640px) {
  .section-hero {
    min-height: calc(74vh - var(--header-offset));
    align-items: flex-start;
  }
}

.section-inner {
  width: 100%;
}

.section-normal {
  min-height: auto;
  display: block;
}

/* =========================
   4) Header Brand
   ========================= */
.brand-link {
  border-radius: 16px;
  padding: 4px 8px;
  transition: transform 220ms ease, filter 220ms ease;
  text-decoration: none;
}

.brand-link:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 10px 18px rgba(17, 24, 39, 0.1));
}

.brand-link:active {
  transform: translateY(0);
  filter: drop-shadow(0 6px 12px rgba(17, 24, 39, 0.08));
}

.brand-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand-title {
  color: var(--brand-blue);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.004em;
  font-size: clamp(20px, 1.6vw, 22px);
  margin: 0;
}

.brand-subtitle {
  color: var(--text-dark);
  opacity: 0.88;
  line-height: 1.35;
  letter-spacing: 0.16em;
  font-weight: 500;
  font-size: clamp(13px, 1vw, 14px);
  margin: 0;
}

/* =========================
   5) Navigation
   ========================= */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  transition: color 180ms ease, transform 180ms ease;
}

.nav-link:hover {
  color: var(--brand-blue);
  transform: translateY(-1px);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: var(--brand-blue);
  opacity: 0.35;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.nav-link:hover::after {
  transform: scaleX(1);
}

.nav-link.is-active {
  color: var(--brand-blue);
}

.nav-link.is-active::after {
  transform: scaleX(1);
  opacity: 0.55;
}

.nav-link:focus-visible::after {
  transform: scaleX(1);
}

.nav-link:focus:not(:focus-visible)::after {
  transform: scaleX(0);
}

/* CTA */
.nav-cta {
  transition: transform 200ms ease, box-shadow 200ms ease, filter 200ms ease;
  box-shadow: 0 8px 18px rgba(20, 86, 141, 0.18);
}

.nav-cta.is-active {
  box-shadow: 0 16px 34px rgba(20, 86, 141, 0.28);
  filter: brightness(1.04);
}

.nav-cta.is-active:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(20, 86, 141, 0.28);
}

.nav-cta.is-active:focus-visible {
  outline: 3px solid rgba(242, 146, 0, 0.28);
  outline-offset: 3px;
}

.nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(20, 86, 141, 0.24);
  filter: brightness(1.03);
}

.nav-cta:active {
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(20, 86, 141, 0.2);
}

.nav-cta:focus-visible {
  outline: 3px solid rgba(242, 146, 0, 0.28);
  outline-offset: 3px;
}

/* =========================
   6) Hero
   ========================= */
.hero-title {
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-size: clamp(36px, 4.6vw, 48px);
  margin: 0;
}

/* 重點：不要在這裡寫 margin-top/bottom
   讓 HTML 的 mb-8 繼續有效（避免你覺得「太擠/太怪」） */
.hero-subtitle {
  color: #1f2937;
  opacity: 0.9;
  font-size: clamp(18px, 1.6vw, 20px);
  font-weight: 500;
  line-height: 1.9; /* 你要的舊版鬆度 */
  letter-spacing: 0; /* 中文不要負字距 */
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

/* metric hover */
.hero-metric {
  transition: box-shadow 160ms ease;
}

.hero-metric:hover,
.hero-metric:focus-visible {
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.06);
}

/* =========================
   7) Gradient Text + Sweep
   ========================= */
.gradient-text {
  background: linear-gradient(135deg, #14568d 0%, #f29200 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text.flow-once {
  position: relative;
  display: inline-block;
}

.gradient-text.flow-once::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;

  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;

  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 43%,
    rgba(255, 255, 255, 0.1) 46%,
    rgba(255, 255, 255, 0.32) 48.4%,
    rgba(255, 220, 160, 0.4) 49.4%,
    rgba(242, 146, 0, 0.62) 50%,
    rgba(255, 220, 160, 0.4) 50.6%,
    rgba(255, 255, 255, 0.32) 51.6%,
    rgba(255, 255, 255, 0.1) 54%,
    rgba(255, 255, 255, 0) 58%,
    rgba(255, 255, 255, 0) 100%
  );

  background-size: 260% 100%;
  background-position: 130% 50%;

  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  opacity: 0;
  pointer-events: none;
  transform: translateZ(0);
  will-change: background-position, opacity;
  filter: brightness(1.18) contrast(1.06);
}

.gradient-text.flow-once.is-animating::after {
  opacity: 1;
  animation: sweep-consultant 3.1s cubic-bezier(0.2, 0.85, 0.2, 1) both,
    sweep-fade 0.55s ease-out 2.55s both;
}

@keyframes sweep-consultant {
  from {
    background-position: 135% 50%;
  }
  to {
    background-position: -35% 50%;
  }
}

@keyframes sweep-fade {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* =========================
   8) Buttons
   ========================= */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 14px 32px;
  border-radius: var(--btn-radius);

  font-weight: 700;
  font-size: 18px;
  line-height: 1;

  color: #fff;
  background-color: var(--brand-blue);

  text-decoration: none;
  cursor: pointer;
  border: none;

  box-shadow: 0 10px 22px rgba(20, 86, 141, 0.22);

  transition: transform 180ms ease, box-shadow 180ms ease,
    background-color 180ms ease, filter 180ms ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.btn:hover {
  background-color: var(--brand-blue-hover);
  box-shadow: 0 16px 34px rgba(20, 86, 141, 0.28);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(20, 86, 141, 0.2);
}

.btn-arrow {
  display: inline-block;
  margin-left: 10px;
  transition: transform 180ms ease;
  opacity: 0.9;
}

.btn:hover .btn-arrow,
.btn:focus-visible .btn-arrow {
  transform: translateX(3px);
  opacity: 1;
}

/* =========================
   9) Cards / Services
   ========================= */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* =========================
   10) Steps (Process)
   ========================= */
.step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 96px;
  padding: 4px 16px;

  font-size: 0.75rem;
  font-weight: 600;

  border-radius: 9999px;
  white-space: nowrap;

  background-color: rgba(242, 146, 0, 0.12);
  color: #f29200;
}

.step-subtitle {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #6b7280;
}

.step-card {
  position: relative;
  background: #fff;
  transform: translateZ(0);

  transition: box-shadow 420ms ease, filter 420ms ease, border-color 420ms ease,
    transform 260ms ease, opacity 260ms ease;
  will-change: transform;
}

.step-card.is-dim {
  filter: saturate(0.85) brightness(0.98);
  opacity: 0.85;
}

.step-card.is-active {
  transform: translateY(-4px);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.14);
}

.step-card .step-outcome {
  transition: background-color 320ms ease, border-color 320ms ease;
}

.step-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 86, 141, 0.04);
  opacity: 0;
  transition: opacity 320ms ease;
  pointer-events: none;
}

.step-card.is-active::after {
  opacity: 1;
}

/* progress */
.step-progress {
  --pad-top: 8px;
  --rail-h: 2px;

  --label-h: 14px;
  --label-gap: 10px;
  --dot: 12px;
  --glow: 6px;

  --rail: rgba(17, 24, 39, 0.12);
  --active: rgba(20, 86, 141, 0.45);
  --inactive-dot: rgba(17, 24, 39, 0.18);
  --inactive-text: rgba(17, 24, 39, 0.55);

  position: relative;
  max-width: 980px;
  margin: 0 auto;
  padding: var(--pad-top) 8px 12px;
  isolation: isolate;

  margin-bottom: 40px; /* 你要的高度 */
}

.step-progress::before,
.step-progress::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(
    var(--pad-top) + var(--label-h) + var(--label-gap) + (var(--dot) / 2)
  );
  height: var(--rail-h);
  border-radius: 9999px;
  z-index: 1;
}

.step-progress::before {
  background: var(--rail);
}

.step-progress::after {
  background: var(--active);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.step-progress .step-nodes {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  z-index: 2;
}

.step-progress .step-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.step-progress .step-label {
  height: var(--label-h);
  line-height: var(--label-h);
  font-size: 12px;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--inactive-text);
  white-space: nowrap;
  user-select: none;
  margin: 0;
}

.step-progress .step-dot {
  margin-top: var(--label-gap);
  width: var(--dot);
  height: var(--dot);
  border-radius: 9999px;
  background: var(--inactive-dot);
  box-shadow: 0 0 0 0 rgba(20, 86, 141, 0);
  transition: background 260ms ease, box-shadow 360ms ease, transform 260ms ease;
}

.step-progress[data-active="1"]::after {
  transform: scaleX(0);
}
.step-progress[data-active="2"]::after {
  transform: scaleX(0.5);
}
.step-progress[data-active="3"]::after {
  transform: scaleX(1);
}

/* active nodes */
.step-progress[data-active="1"] .step-node[data-node="1"] .step-dot,
.step-progress[data-active="2"] .step-node[data-node="1"] .step-dot,
.step-progress[data-active="3"] .step-node[data-node="1"] .step-dot,
.step-progress[data-active="2"] .step-node[data-node="2"] .step-dot,
.step-progress[data-active="3"] .step-node[data-node="2"] .step-dot,
.step-progress[data-active="3"] .step-node[data-node="3"] .step-dot {
  background: var(--active);
  box-shadow: 0 0 0 var(--glow) rgba(20, 86, 141, 0.12);
  transform: translateY(-1px);
}

.step-progress[data-active="1"] .step-node[data-node="1"] .step-label,
.step-progress[data-active="2"] .step-node[data-node="1"] .step-label,
.step-progress[data-active="3"] .step-node[data-node="1"] .step-label,
.step-progress[data-active="2"] .step-node[data-node="2"] .step-label,
.step-progress[data-active="3"] .step-node[data-node="2"] .step-label,
.step-progress[data-active="3"] .step-node[data-node="3"] .step-label {
  color: var(--active);
}

@media (max-width: 640px) {
  .step-progress {
    max-width: 520px;
    padding: 6px 6px 10px;
    --label-h: 13px;
    --label-gap: 9px;
  }

  .step-progress .step-label {
    font-size: 11px;
  }

  .step-progress::before,
  .step-progress::after {
    left: 10px;
    right: 10px;
  }
}

/* =========================
   11) Jobs
   ========================= */
.jobs-container {
  background-color: #ffffff;
}

.job-card {
  background-color: #f3f4f6;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 0.75rem;
  transition: transform 180ms ease, box-shadow 180ms ease,
    border-color 180ms ease;
  will-change: transform;
}

.job-header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.job-icon {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.85;
  transition: transform 180ms ease, opacity 180ms ease;
}

.job-title {
  color: var(--brand-blue);
  position: relative;
}

.job-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 2px;
  background-color: rgba(20, 86, 141, 0.6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}

.job-desc {
  color: #374151;
}

.job-badge {
  background-color: #f29200;
  color: #ffffff;
  border-radius: 0.375rem;
  transition: filter 160ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .job-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px rgba(17, 24, 39, 0.1);
    border-color: rgba(20, 86, 141, 0.25);
  }

  .job-card:hover .job-icon {
    transform: translateY(-2px);
    opacity: 1;
  }

  .job-card:hover .job-badge {
    filter: brightness(1.05);
  }

  .job-card:hover .job-title::after {
    transform: scaleX(1);
  }
}

.job-card:focus-within {
  outline: 2px solid rgba(20, 86, 141, 0.25);
  outline-offset: 2px;
}

/* =========================
   12) Form Notice
   ========================= */
.form-notice {
  display: flex;
  gap: 6px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #6b7280;
  margin-top: 8px;
  margin-bottom: -8px;
}

.form-notice-icon {
  line-height: 1.4;
  opacity: 0.8;
}

/* =========================
   13) Footer
   ========================= */
.site-footer {
  background-color: #f3f4f6;
  padding: 28px 16px;
}

.site-footer .site-container {
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  text-align: center;
}

.footer-copy {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.5;
}

.footer-en {
  font-size: 13px;
  color: #374151;
  margin-top: 4px;
  line-height: 1.4;
}

.footer-rights {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.footer-tagline {
  font-size: 12px;
  color: #6b7280;
  margin-top: 10px;
  line-height: 1.6;
}

/* =========================
   14) Accessibility / Reduced Motion
   (不要用全域 * 砍 transition，會害你之後一直「看起來怪」)
   ========================= */
@media (prefers-reduced-motion: reduce) {
  .gradient-text.flow-once::after,
  .gradient-text.flow-once.is-animating::after {
    animation: none !important;
    opacity: 0 !important;
  }

  .brand-link,
  .nav-link,
  .nav-cta,
  .btn,
  .btn-arrow,
  .card-hover,
  .hero-metric,
  .step-card,
  .step-progress::after,
  .job-card,
  .job-icon,
  .job-title::after {
    transition: none !important;
  }
}
