:root {
  --ink: #0b0d10;
  --ink-2: #16181c;
  --paper: #f3efe8;
  --paper-2: #e7e1d6;
  --cream: #faf7f2;
  --muted: #6f6a63;
  --line: rgba(11, 13, 16, 0.12);
  --line-strong: rgba(11, 13, 16, 0.28);
  --blue: #0072bc;
  --orange: #e85d04;
  --ic: #f08a2a;
  --pass: #9a9a9a;
  --con: #efd24a;
  --sen: #5eb3e4;
  --mod: #6cbf4a;
  --header-h: 4.25rem;
  --wrap: 72rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font-display: "Rajdhani", "Noto Sans TC", sans-serif;
  --font-body: "Noto Sans TC", "Rajdhani", sans-serif;
}

.fx {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--orange);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  cursor: pointer;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin: 0;
}

p,
ul,
dl {
  margin: 0;
}

.wrap {
  width: min(calc(100% - 2.5rem), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 80;
  background: var(--orange);
  color: #fff;
  padding: 0.5rem 0.8rem;
}

.skip-link:focus {
  top: 1rem;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--orange);
  z-index: 70;
}

/* Header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--header-h);
  color: #f4f1ec;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-scrolled,
.site-header.menu-open {
  background: rgba(243, 239, 232, 0.92);
  color: var(--ink);
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(calc(100% - 2.5rem), var(--wrap));
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-zh {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
}

.brand-en {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  opacity: 0.72;
}

.nav-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
}

.nav-toggle span {
  display: block;
  width: 1.25rem;
  height: 1px;
  margin: 5px auto;
  background: currentColor;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.site-header.menu-open .nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.site-header.menu-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.menu-open .nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.site-nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}

.site-nav a {
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  position: relative;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 1px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

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

.lang-btn {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.28rem 0.8rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
}

.lang-btn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.site-header:not(.is-scrolled):not(.menu-open) .lang-btn:hover {
  background: #f4f1ec;
  color: var(--ink);
  border-color: #f4f1ec;
}

/* Hero */

.hero {
  position: relative;
  min-height: 36rem;
  height: 100svh;
  max-height: 58rem;
  display: grid;
  place-items: center;
  color: #f4f1ec;
  overflow: hidden;
  background: var(--ink);
}

.hero-media,
.hero-veil {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 42%;
}

.hero-veil {
  background:
    linear-gradient(90deg, rgba(11, 13, 16, 0.2) 0%, rgba(11, 13, 16, 0.35) 42%, rgba(11, 13, 16, 0.82) 100%),
    linear-gradient(180deg, rgba(11, 13, 16, 0.28) 0%, rgba(11, 13, 16, 0.62) 48%, rgba(11, 13, 16, 0.96) 100%),
    radial-gradient(ellipse at 30% 40%, rgba(232, 93, 4, 0.16), transparent 46%);
}

.hero-inner {
  position: relative;
  width: min(calc(100% - 2.5rem), 52rem);
  text-align: center;
  padding-top: 3rem;
}

.hero-kicker {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-display);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: rgba(244, 241, 236, 0.78);
}

.dot-row {
  display: flex;
  gap: 0.35rem;
}

.dot-row i {
  width: 0.55rem;
  height: 0.55rem;
  display: block;
  box-shadow: 0 0 0 1px rgba(244, 241, 236, 0.4);
}

.c-ic { background: var(--ic); }
.c-pass { background: var(--pass); }
.c-con { background: var(--con); }
.c-sen { background: var(--sen); }
.c-mod { background: var(--mod); }

.hero-title {
  margin-top: 1.25rem;
  font-size: clamp(3.4rem, 10vw, 7.5rem);
  letter-spacing: 0.12em;
  font-weight: 700;
}

html[lang="en"] .hero-title {
  letter-spacing: 0.04em;
  font-size: clamp(2.6rem, 8vw, 6.2rem);
}

.hero-sub {
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--orange);
}

.hero-sub:empty {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2.25rem;
  min-width: 10.5rem;
  padding: 0.85rem 1.4rem;
  border: 1px solid #f4f1ec;
  font-size: 0.92rem;
  letter-spacing: 0.16em;
}

.btn-primary {
  background: transparent;
  color: #f4f1ec;
}

.btn-primary:hover {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  width: 1px;
  height: 3.2rem;
  background: rgba(244, 241, 236, 0.25);
}

.scroll-cue span {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 0.9rem;
  background: var(--orange);
  animation: cue 1.8s var(--ease) infinite;
}

@keyframes cue {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(2.2rem); opacity: 0; }
}

/* Sections */

.section {
  padding: clamp(4.5rem, 9vw, 7.5rem) 0;
  scroll-margin-top: 4.5rem;
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 1.2rem;
  margin-bottom: 3rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line-strong);
}

.section-index {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--orange);
}

.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.14em;
}

html[lang="en"] .section-head h2 {
  letter-spacing: 0.06em;
}

/* Company */

.company {
  background: var(--paper);
}

.company-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3rem;
  align-items: center;
}

.lead {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.85;
  font-weight: 500;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
}

.facts dd {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.frame {
  position: relative;
  padding: 1rem;
  background-image:
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange)),
    linear-gradient(var(--orange), var(--orange));
  background-repeat: no-repeat;
  background-size: 14px 1px, 1px 14px, 14px 1px, 1px 14px, 14px 1px, 1px 14px, 14px 1px, 1px 14px;
  background-position: top left, top left, top right, top right, bottom left, bottom left, bottom right, bottom right;
}

.dark-frame {
  background-color: var(--ink);
}

.dark-frame img {
  width: 100%;
  object-fit: contain;
}

.pie-mount svg {
  display: block;
  width: 100%;
  height: auto;
}

.industry-board {
  display: grid;
  gap: 0.7rem;
  padding: 1.5rem 1.15rem 1.7rem;
}

.industry-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.industry-chip {
  min-width: 7.4rem;
  padding: 0.72rem 1rem;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(0.82rem, 1.4vw, 1rem);
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.35), inset 0 -1px 0 rgba(255, 255, 255, 0.2);
}

@media (max-width: 700px) {
  .industry-chip {
    min-width: 6.2rem;
    font-size: 0.86rem;
  }
}

.frame-caption {
  color: rgba(244, 241, 236, 0.72);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-align: center;
  margin-top: 0.75rem;
}

.industries {
  margin-top: 4rem;
}

.industries-hint {
  margin-bottom: 1.1rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Services */

.services {
  background: var(--cream);
}

.service-bento {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
}

.service-card {
  position: relative;
  display: grid;
  grid-template-rows: 12.5rem auto;
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
  padding: 0;
  color: inherit;
  appearance: none;
  border-radius: 0;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

.service-card:first-child {
  grid-row: span 2;
  min-height: 32rem;
  grid-template-rows: 1fr auto;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(11, 13, 16, 0.08);
}

.service-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.service-card:hover img {
  transform: scale(1.05);
}

.service-body {
  padding: 1.15rem 1.2rem 1.25rem;
}

.service-body h3 {
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.service-sub {
  margin-top: 0.35rem;
  color: var(--blue);
  font-size: 0.92rem;
}

.image-source {
  margin-top: 0.55rem;
  font-size: 0.68rem;
  color: var(--muted);
}

/* Products */

.products {
  background: var(--paper);
}

.product-viewer {
  display: grid;
  gap: 1.25rem;
}

.product-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

@media (max-width: 700px) {
  .product-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.35rem;
  }

  .product-tabs button {
    white-space: nowrap;
    flex: 0 0 auto;
  }
}

.product-tabs button {
  border: 1px solid var(--line-strong);
  background: transparent;
  padding: 0.55rem 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.product-tabs button[aria-selected="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.product-stage {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  padding: 1.25rem;
  display: block;
  width: 100%;
}

.product-stage img {
  width: 100%;
  max-height: 38rem;
  object-fit: contain;
  margin-inline: auto;
}

.product-zoom-hint {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.3rem 0.55rem;
}

/* Contact */

.contact {
  background: var(--ink);
  color: #f4f1ec;
}

.contact .section-head {
  border-bottom-color: rgba(244, 241, 236, 0.18);
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 2rem;
  align-items: stretch;
}

.contact-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: rgba(244, 241, 236, 0.12);
  border: 1px solid rgba(244, 241, 236, 0.12);
}

.contact-card {
  background: var(--ink-2);
  padding: 1.4rem 1.3rem;
}

.contact-card h3 {
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  color: var(--orange);
  margin-bottom: 0.7rem;
}

.contact-card p + p {
  margin-top: 0.2rem;
}

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

.contact-card a,
.contact-card p {
  overflow-wrap: anywhere;
}

.map-frame {
  min-height: 22rem;
  border: 1px solid rgba(244, 241, 236, 0.12);
  overflow: hidden;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  min-height: 22rem;
  border: 0;
  filter: grayscale(0.35) contrast(1.05);
}

.site-footer {
  background: #07080a;
  color: rgba(244, 241, 236, 0.62);
  padding: 1.4rem 0;
  font-size: 0.88rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  letter-spacing: 0.12em;
}

/* Chrome */

.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 13, 16, 0.8);
  color: #fff;
  font-size: 1.1rem;
  z-index: 40;
}

.back-to-top:hover {
  background: var(--orange);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(11, 13, 16, 0.72);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  border: 0;
  background: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-card {
  background: #fff;
  max-width: min(52rem, 100%);
  max-height: calc(100svh - 3rem);
  overflow: auto;
  padding: 1.25rem;
  cursor: default;
}

.lightbox-card img {
  width: 100%;
  max-height: 28rem;
  object-fit: contain;
  background: #f6f3ee;
}

.lightbox-card h3 {
  margin-top: 1rem;
  font-size: 1.3rem;
}

.lightbox-source {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: rise 0.8s var(--ease) forwards;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .scroll-cue span,
  .service-card,
  .service-card img {
    animation: none;
    transition: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 900px) {
  .company-grid,
  .contact-grid,
  .service-bento {
    grid-template-columns: 1fr;
  }

  .service-card:first-child {
    grid-row: auto;
    min-height: 0;
    grid-template-rows: 14rem auto;
  }

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

  .nav-toggle {
    display: block;
    z-index: 60;
  }

  .site-nav {
    position: fixed;
    inset: 0;
    background: var(--paper);
    color: var(--ink);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    transform: translateY(-110%);
    transition: transform 0.4s var(--ease);
  }

  .site-header.menu-open .site-nav {
    transform: none;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: center;
    font-size: 1.4rem;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .hero-title {
    letter-spacing: 0.08em;
  }
}
