:root {
  --background: #f6f8fb;
  --foreground: #18202c;
  --brand: #0876bd;
  --brand-deep: #083d77;
  --brand-navy: #0b1f39;
  --teal: #0f9188;
  --amber: #d8a123;
  --line: #dbe4ee;
  --muted: #5e6c7f;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial,
    sans-serif;
  margin: 0;
}

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

img {
  display: block;
  max-width: 100%;
}

@keyframes headerDrop {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroDrift {
  from {
    background-position: center center;
  }
  to {
    background-position: 58% center;
  }
}

@keyframes accentSweep {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes mapFloat {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}

.site-header {
  align-items: center;
  animation: headerDrop 0.7s ease both;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(219, 228, 238, 0.9);
  display: grid;
  gap: 24px;
  grid-template-columns: auto 1fr auto;
  left: 0;
  padding: 14px 48px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 20;
}

.brand img {
  height: 48px;
  width: auto;
}

.site-header nav {
  align-items: center;
  display: flex;
  gap: 24px;
  justify-content: center;
}

.site-header nav a {
  color: #324256;
  font-size: 0.95rem;
  font-weight: 700;
  position: relative;
}

.site-header nav a::after {
  background: var(--brand);
  bottom: -7px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  width: 100%;
}

.site-header nav a:hover::after {
  transform: scaleX(1);
}

.header-action,
.primary-action,
.secondary-action {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.header-action:hover,
.primary-action:hover,
.secondary-action:hover {
  box-shadow: 0 14px 30px rgba(8, 61, 119, 0.22);
  transform: translateY(-2px);
}

.header-action,
.primary-action {
  background: var(--brand);
  color: #ffffff;
}

.secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #ffffff;
}

.secondary-action.light {
  border-color: rgba(255, 255, 255, 0.8);
}

.hero {
  animation: heroDrift 18s ease-in-out infinite alternate;
  background: var(--brand-navy) url("assets/semiconductor-board.jpg") center / cover
    no-repeat;
  color: #ffffff;
  min-height: 760px;
  overflow: hidden;
  padding: 160px 48px 72px;
  position: relative;
}

.hero-overlay {
  background: rgba(5, 18, 36, 0.72);
  inset: 0;
  position: absolute;
}

.hero::after {
  animation: accentSweep 4.6s ease-in-out infinite;
  background: rgba(15, 145, 136, 0.9);
  bottom: 0;
  content: "";
  height: 8px;
  left: 0;
  position: absolute;
  right: 0;
}

.hero-content,
.metric-strip,
.section-inner {
  margin: 0 auto;
  max-width: 1180px;
  position: relative;
  z-index: 1;
}

.hero-content {
  margin-left: max(0px, calc((100vw - 1180px) / 2));
  max-width: 720px;
}

.hero-content > * {
  animation: fadeUp 0.78s ease both;
}

.hero-content > :nth-child(1) {
  animation-delay: 0.12s;
}

.hero-content > :nth-child(2) {
  animation-delay: 0.24s;
}

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

.hero-content > :nth-child(4) {
  animation-delay: 0.48s;
}

.eyebrow,
.section-kicker {
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 900;
  margin: 0 0 14px;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #8fe4dc;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 4.8rem;
  line-height: 1.02;
  margin-bottom: 24px;
}

h1 span {
  color: #b6e3ff;
  display: block;
  font-size: 2.3rem;
  margin-top: 12px;
}

h2 {
  color: var(--brand-navy);
  font-size: 2.45rem;
  line-height: 1.18;
  margin-bottom: 18px;
}

h3 {
  color: var(--brand-navy);
  font-size: 1.18rem;
  line-height: 1.35;
  margin-bottom: 10px;
}

.hero-copy {
  color: #dbeeff;
  font-size: 1.22rem;
  line-height: 1.9;
  margin-bottom: 34px;
}

.hero-actions,
.contact-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.metric-strip {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 82px;
}

.metric-strip div {
  animation: fadeUp 0.78s ease both;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 20px;
  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

.metric-strip div:nth-child(1) {
  animation-delay: 0.58s;
}

.metric-strip div:nth-child(2) {
  animation-delay: 0.68s;
}

.metric-strip div:nth-child(3) {
  animation-delay: 0.78s;
}

.metric-strip div:nth-child(4) {
  animation-delay: 0.88s;
}

.metric-strip div:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
}

.metric-strip dt {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
}

.metric-strip dd {
  color: #c8d9e9;
  margin: 4px 0 0;
}

section {
  padding: 88px 48px;
}

.intro-band {
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.two-column {
  display: grid;
  gap: 56px;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
}

.intro-copy {
  border-left: 4px solid var(--amber);
  color: #3d4b5e;
  font-size: 1.08rem;
  line-height: 2;
  padding-left: 28px;
}

.section-heading {
  margin-bottom: 36px;
  max-width: 760px;
}

.section-heading p {
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.85;
}

.section-heading.compact {
  margin-bottom: 24px;
}

.capability-section {
  background:
    linear-gradient(rgba(246, 248, 251, 0.94), rgba(246, 248, 251, 0.94)),
    url("assets/soft-geometric-bg.png") center / cover no-repeat;
}

.capability-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.capability-card,
.advantage-grid article,
.location-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.capability-card {
  min-height: 190px;
  padding: 28px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.capability-card:hover,
.advantage-grid article:hover,
.location-card:hover {
  border-color: rgba(8, 118, 189, 0.34);
  box-shadow: 0 18px 38px rgba(11, 31, 57, 0.08);
  transform: translateY(-5px);
}

.capability-card::before,
.advantage-grid article::before {
  background: var(--teal);
  content: "";
  display: block;
  height: 4px;
  margin-bottom: 18px;
  width: 42px;
}

.capability-card p,
.advantage-grid p,
.location-card p,
.contact-section p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 0;
}

.proof-section {
  background: #ffffff;
}

.proof-grid {
  align-items: center;
  display: grid;
  gap: 54px;
  grid-template-columns: minmax(280px, 0.85fr) minmax(0, 1.15fr);
}

.image-panel {
  border-radius: 8px;
  overflow: hidden;
}

.image-panel img {
  height: 520px;
  object-fit: cover;
  transition: transform 0.8s ease;
  width: 100%;
}

.image-panel:hover img {
  transform: scale(1.035);
}

.advantage-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.advantage-grid article {
  padding: 22px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.locations-section {
  background: var(--background);
}

.location-layout {
  align-items: center;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(380px, 1.05fr) minmax(0, 0.95fr);
}

.map-visual {
  animation: mapFloat 5.5s ease-in-out infinite alternate;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.map-visual img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.map-visual::after {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(8, 61, 119, 0.08)
  );
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.location-list {
  display: grid;
  gap: 16px;
}

.location-card {
  padding: 24px;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.location-card strong {
  color: var(--brand);
  display: block;
  margin-bottom: 10px;
}

.location-card a {
  color: var(--teal);
  display: inline-flex;
  font-weight: 900;
  margin-top: 14px;
}

.contact-section {
  background: var(--brand-navy);
  color: #ffffff;
}

.contact-section h2 {
  color: #ffffff;
}

.contact-layout {
  align-items: center;
  display: grid;
  gap: 48px;
  grid-template-columns: minmax(0, 0.65fr) minmax(360px, 1fr);
}

.contact-panel {
  background: #acd7d8;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  color: #0b1f39;
  display: grid;
  font-style: normal;
  gap: 18px;
  padding: 30px;
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.contact-panel:hover {
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
  transform: translateY(-4px);
}

.contact-row {
  align-items: center;
  color: #0b1f39;
  display: grid;
  gap: 12px;
  grid-template-columns: 34px auto 1fr;
  line-height: 1.45;
}

.contact-icon {
  align-items: center;
  color: #5aa4a8;
  display: inline-flex;
  font-size: 1.4rem;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.icon-address::before {
  content: "⌂";
}

.icon-phone::before {
  content: "☎";
}

.icon-mail::before {
  content: "✉";
}

.contact-label,
.contact-value {
  font-size: 1.08rem;
  font-weight: 900;
}

.contact-label {
  color: #0a5961;
}

.contact-value {
  color: #08213a;
  overflow-wrap: anywhere;
}

@supports (animation-timeline: view()) {
  .intro-band .section-inner,
  .capability-section .section-heading,
  .capability-card,
  .proof-grid,
  .locations-section .section-heading,
  .location-layout,
  .contact-layout {
    animation: fadeUp both;
    animation-range: entry 10% cover 30%;
    animation-timeline: view();
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: auto auto;
    padding: 12px 22px;
  }

  .site-header nav {
    display: none;
  }

  .hero {
    min-height: 700px;
    padding: 128px 22px 48px;
  }

  h1 {
    font-size: 3.1rem;
  }

  h1 span {
    font-size: 1.55rem;
  }

  h2 {
    font-size: 2rem;
  }

  section {
    padding: 64px 22px;
  }

  .metric-strip,
  .capability-grid,
  .two-column,
  .proof-grid,
  .location-layout,
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    margin-top: 54px;
  }

  .image-panel img {
    height: auto;
    min-height: 360px;
  }

  .map-visual {
    min-height: 0;
  }

}

@media (max-width: 620px) {
  .brand img {
    height: 40px;
  }

  .header-action,
  .primary-action,
  .secondary-action {
    min-height: 42px;
    padding: 0 14px;
  }

  .hero {
    min-height: 660px;
  }

  h1 {
    font-size: 2.45rem;
  }

  h1 span {
    font-size: 1.22rem;
  }

  .hero-copy {
    font-size: 1.05rem;
  }

  .metric-strip,
  .advantage-grid {
    grid-template-columns: 1fr;
  }

  .capability-card {
    min-height: auto;
  }

  .contact-panel {
    padding: 22px;
  }

  .contact-row {
    align-items: start;
    gap: 8px 10px;
    grid-template-columns: 28px 1fr;
  }

  .contact-value {
    grid-column: 2;
  }

  .contact-label,
  .contact-value {
    font-size: 1rem;
  }
}
