/* SAJJ Global — brand tokens, resets and the few rules that cannot be inline
   (media queries, pseudo-elements, transitions). Everything else is inline. */

:root {
  --navy: #2b2f86;
  --navy-deep: #1e2160;
  --navy-mid: #6a6fc0;
  --navy-pale: #b9bdea;
  --navy-faint: #c3c7ee;
  --red: #8e1c24;
  --ink: #171a2b;
  --body-text: #40465c;
  --muted: #6b7189;
  --paper: #ffffff;
  --paper-2: #f7f8fc;
  --tint: #eff1f9;
  --line: #e2e5f0;
  --line-strong: #c9cee1;
  --font-body: Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-heading: Inter, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
::selection { background: #d9dcf2; }

.fade-rule {
  height: 1px; border: 0;
  background: linear-gradient(90deg, transparent 0, var(--line) 48px, var(--line) calc(100% - 48px), transparent 100%);
}

/* Hero — full-bleed photograph, sharp at the right, blurring and dissolving
   into the page toward the left so dark text keeps full contrast. */
/* Hero — sits inside the same 1660px measure as every other section, at the
   photograph's own 2.25:1 ratio, so nothing is ever cropped. */
/* Hero — full-bleed at the photograph's own 3.5:1 ratio, so nothing is cropped. */
.hero {
  position: relative; padding: 0; display: block;
}
.hero-frame {
  position: relative; width: 100%;
  height: min(28.57vw, 780px);
  min-height: fit-content;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-inner {
  position: relative; z-index: 3; width: 100%;
  max-width: 1660px; margin: 0 auto;
  padding: clamp(18px, 2.6vw, 56px) clamp(20px, 3vw, 40px);
}
.hero-photo { position: absolute; inset: 0; z-index: 0; }
.hero-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
}
.hero-photo img.hero-photo-blur { display: none; }
.hero-photo img.hero-photo-sharp { z-index: 1; }
.hero-photo img.hero-photo-blur {
  filter: blur(26px) saturate(.9); transform: scale(1.08);
}
.hero-fade {
  position: absolute; inset: 0; display: block; z-index: 2;
  background: linear-gradient(90deg,
    rgba(255,255,255,.97) 0%, rgba(255,255,255,.93) 22%,
    rgba(255,255,255,.8) 38%, rgba(255,255,255,.58) 54%,
    rgba(255,255,255,.46) 68%, rgba(255,255,255,.46) 84%,
    rgba(255,255,255,.48) 94%, rgba(255,255,255,.5) 100%);
}
@media (max-width: 1300px) {
  .hero-fade {
    background: linear-gradient(90deg,
      rgba(255,255,255,.97) 0%, rgba(255,255,255,.95) 26%,
      rgba(255,255,255,.86) 42%, rgba(255,255,255,.64) 58%,
      rgba(255,255,255,.48) 74%, rgba(255,255,255,.46) 88%,
      rgba(255,255,255,.5) 100%);
  }
}
@media (max-width: 900px) {
  .hero { padding: 0; }
  .hero-frame { aspect-ratio: auto; min-height: 440px; }
  .hero-photo img { object-position: 64% 50%; }
  .hero-photo img.hero-photo-sharp { max-width: 100%; }
  .hero-fade {
    background: linear-gradient(180deg,
      rgba(255,255,255,.96) 0%, rgba(255,255,255,.9) 44%, rgba(255,255,255,.62) 72%, rgba(255,255,255,.4) 100%);
  }
}

/* Contact page header — the same treatment, held back further so the
   photograph reads as atmosphere rather than subject. */
.contact-photo { position: absolute; inset: 0; z-index: 0; }
.contact-photo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 70% 50%;
  filter: saturate(.55);
}
.contact-photo span {
  position: absolute; inset: 0; display: block;
  background: linear-gradient(90deg,
    var(--paper) 0%, var(--paper) 30%,
    rgba(255,255,255,.95) 46%, rgba(255,255,255,.8) 62%,
    rgba(255,255,255,.55) 80%, rgba(255,255,255,.42) 100%);
}
@media (max-width: 900px) {
  .contact-photo span {
    background: linear-gradient(180deg, var(--paper) 0%, rgba(255,255,255,.94) 55%, rgba(255,255,255,.8) 100%);
  }
}

/* Statistics band — the skyline is pinned to the viewport, so the figures
   travel across a still photograph as the page scrolls. */
.counters {
  position: relative;
  background: url('assets/taipei-skyline.jpg') center 40% / cover no-repeat fixed, var(--navy);
}
.counters::before {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(23,26,60,.34) 0%, rgba(23,26,60,.12) 42%, rgba(23,26,60,.34) 100%);
}
/* First figure flush left, last flush right, the middle two evenly between. */
.counters-inner > div:last-child { text-align: left; }
@media (max-width: 760px) {
  .counters-inner { justify-content: flex-start !important; }
  .counters-inner > div { flex: 1 1 40%; }
}
.counters-inner { position: relative; z-index: 1; text-shadow: 0 1px 14px rgba(12,14,38,.85), 0 1px 3px rgba(12,14,38,.7); }
/* iOS and most touch browsers ignore fixed attachment; scroll it there instead. */
@media (hover: none), (max-width: 900px) {
  .counters { background-attachment: scroll; }
}

/* Hero type — the headline scales fluidly (it is a graphic element); the
   paragraph and buttons are fixed and step at breakpoints, as elsewhere. */
@media (max-width: 1240px) {
  .hero-inner p { font-size: 16px; }
}
@media (max-width: 1040px) {
  .hero-inner p { font-size: 15.5px; max-width: 30em; }
  .hero-actions a { font-size: 14px !important; padding: 12px 20px !important; }
}
@media (max-width: 900px) {
  .hero-inner p { font-size: 16px; }
  .hero-actions a { font-size: 15px !important; padding: 13px 22px !important; }
}

.navlink {
  position: relative;
  border-radius: 8px; padding: 12px 13px;
  transition: background .16s ease, color .18s ease;
}
.navlink:hover { background: var(--tint); }
.navlink::after {
  content: ""; position: absolute; left: 13px; right: 100%; bottom: 5px;
  height: 2px; background: var(--red); transition: right .22s ease;
}
.navlink[data-active="true"]::after { right: 13px; }

.card-lift { transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
.card-lift:hover {
  transform: translateY(-3px); border-color: var(--line-strong);
  box-shadow: 0 12px 28px rgba(23, 26, 43, .09);
}

/* Header — Apollo-style: one row on desktop, logo then nav, actions anchored right. */
.nav-inner {
  max-width: 1660px; margin: 0 auto;
  padding: 14px clamp(20px, 3vw, 40px);
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 14px clamp(14px, 1.8vw, 24px);
  min-height: 78px;
}
.nav-links {
  display: flex; flex-wrap: wrap; align-items: center; min-width: 0;
  gap: 2px clamp(2px, .5vw, 10px);
  margin-left: clamp(2px, 1vw, 14px);
  font-size: 15.5px; font-weight: 400;
}
.nav-actions {
  display: flex; flex-wrap: nowrap; align-items: center; gap: 10px;
  margin-left: auto; flex-shrink: 0;
}

@media (max-width: 1500px) {
  .nav-links { font-size: 14.5px; }
  .nav-links .navlink { padding: 11px 9px; }
  .nav-lang > summary { padding: 11px 9px; font-size: 14.5px; }
  .nav-actions { gap: 8px; }
}
@media (max-width: 1320px) {
  .nav-links { font-size: 13.5px; }
  .nav-links .navlink { padding: 10px 7px; }
  .nav-lang > summary { padding: 10px 8px; font-size: 13.5px; }
  .nav-inner { padding-left: 20px; padding-right: 20px; gap: 10px; }
}
@media (max-width: 1140px) {
  .nav-links { font-size: 13px; }
  .nav-links .navlink { padding: 9px 6px; }
  .nav-lang-label { display: none; }        /* flag only, name hidden */
  .nav-lang > summary { gap: 0; }
}
.grid-cert-4 { }
@media (max-width: 380px) { .grid-cert-4 { gap: 12px !important; } }
.facts-wrap { container-type: inline-size; }
@container (max-width: 560px) { .facts-wrap .grid-facts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px 20px !important; } }
@media (max-width: 620px) { .grid-facts-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px 20px !important; } }
.nav-cta { white-space: nowrap; }
.cta-actions { container-type: inline-size; }
@container (max-width: 480px) { .cta-actions a { font-size: 13px !important; padding: 11px 16px !important; } .cta-actions { gap: 14px !important; } }
@container (max-width: 360px) { .cta-actions { flex-direction: column; align-items: stretch; } .cta-actions a { text-align: center; } }
@media (max-width: 1500px) { .nav-cta { font-size: 14px !important; padding: 10px 16px !important; } }
@media (max-width: 1320px) { .nav-cta { font-size: 13px !important; padding: 9px 14px !important; } .nav-inner { gap: 8px; } }
@media (max-width: 1180px) { .nav-cta { padding: 9px 11px !important; } .nav-actions { gap: 6px; } }

/* Even grids — rows stay equal in length rather than leaving a short last row. */
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1180px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-4 { grid-template-columns: minmax(0, 1fr); } }

/* Eight categories — hold one row down to small laptops by shrinking the
   cards and their type, rather than wrapping to a second row. */
.grid-8 { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1500px) { .grid-8 { gap: 9px; } .grid-8 h3 { font-size: 13px; } }
@media (max-width: 1240px) { .grid-8 { gap: 7px; } .grid-8 h3 { font-size: 12px; } .grid-8 > a > div:last-child { padding: 9px 9px 11px; } }
@media (max-width: 1040px) { .grid-8 { gap: 6px; } .grid-8 h3 { font-size: 11px; line-height: 1.25; } .grid-8 > a > div:last-child { padding: 7px 7px 9px; } }
@media (max-width: 880px) { .grid-8 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } .grid-8 h3 { font-size: 13px; } }
@media (max-width: 560px) { .grid-8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Five workflow steps — shrink the cards' gap, padding and type before wrapping. */
.grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1240px) { .grid-5 { gap: 12px; } .grid-5 > div { padding: 18px 16px 20px; } }
@media (max-width: 1040px) { .grid-5 { gap: 9px; } .grid-5 > div { padding: 15px 13px 17px; } .grid-5 > div > div:nth-child(2) { font-size: 14.5px; } .grid-5 > div > p { font-size: 12.5px; } }
@media (max-width: 760px) { .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } .grid-5 > div { padding: 18px 16px 20px; } .grid-5 > div > div:nth-child(2) { font-size: 16px; } .grid-5 > div > p { font-size: 13.5px; } }
@media (max-width: 520px) { .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Certification cards — shrink gap and padding before wrapping to a second row. */
.grid-cert { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1240px) { .grid-cert { gap: 13px; } .grid-cert > a, .grid-cert > div { padding: 20px 18px 22px; } }
@media (max-width: 1040px) { .grid-cert { gap: 9px; } .grid-cert > a, .grid-cert > div { padding: 16px 14px 18px; } .grid-cert > a > div:first-child, .grid-cert > div > div:first-child { font-size: 16px; } .grid-cert > a > div:nth-child(2), .grid-cert > div > div:nth-child(2) { font-size: 12.5px; } }
@media (max-width: 760px) { .grid-cert { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } .grid-cert > a, .grid-cert > div { padding: 22px 20px 24px; } .grid-cert > a > div:first-child, .grid-cert > div > div:first-child { font-size: 19px; } .grid-cert > a > div:nth-child(2), .grid-cert > div > div:nth-child(2) { font-size: 13.5px; } }
@media (max-width: 480px) { .grid-cert { grid-template-columns: 1fr; } }

.grid-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .grid-chips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 780px) { .grid-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .grid-chips { grid-template-columns: minmax(0, 1fr); } }

/* Language selector — round country flags, opens on click, no script. */
.nav-lang { position: relative; }
.nav-lang > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 8px;
  padding: 12px 13px; font-size: 15px; font-weight: 500; color: var(--ink);
  transition: background .16s ease;
}
.nav-lang > summary::-webkit-details-marker { display: none; }
.nav-lang > summary:hover,
.nav-lang[open] > summary { background: var(--tint); }
.nav-lang > summary:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.flag { display: block; width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex-shrink: 0; box-shadow: inset 0 0 0 1px rgba(23,26,43,.16), 0 0 0 1px #d7dae1; }
.flag svg { display: block; width: 100%; height: 100%; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 190px; padding: 6px;
  background: var(--paper); border: 1px solid var(--line-strong);
  border-radius: 10px; box-shadow: 0 16px 40px rgba(23,26,43,.14);
  display: flex; flex-direction: column; gap: 2px;
  isolation: isolate; backdrop-filter: none;
}
.lang-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  font-size: 14.5px; color: var(--ink); white-space: nowrap;
}
.lang-menu a:hover { background: var(--tint); }
.lang-menu a[aria-current="true"] { font-weight: 500; background: var(--tint); }
@media (max-width: 1040px) {
  .nav-links { order: 3; width: 100%; margin-left: 0; font-size: 15px; }
  .nav-links .navlink { padding: 10px 10px; }
  .nav-lang-label { display: inline; }
}
@media (max-width: 620px) {
  .nav-email { display: none; }
  .nav-links { font-size: 14px; }
}
@media (max-width: 920px) {
  .nav-inner { padding-top: 12px; padding-bottom: 12px; }
}


/* Products sub-nav — same treatment as the header links, at a smaller scale. */
.sublink {
  position: relative;
  border-radius: 8px; padding: 7px 11px;
  transition: background .16s ease, color .18s ease;
}
.sublink:hover { background: var(--tint); color: var(--navy); }
.sublink::after {
  content: ""; position: absolute; left: 11px; right: 100%; bottom: 1px;
  height: 2px; background: var(--red); transition: right .22s ease;
}
.sublink[data-active="true"]::after { right: 11px; }


/* Product-section image rows — shrink the tiles before wrapping to a new row,
   the same behaviour as the eight category cards on the home page. */
.grid-imgs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1240px) { .grid-imgs { gap: 10px; } }
@media (max-width: 1040px) { .grid-imgs { gap: 8px; } }
@media (max-width: 560px)  { .grid-imgs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.grid-imgs-6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 1240px) { .grid-imgs-6 { gap: 10px; } }
@media (max-width: 1040px) { .grid-imgs-6 { gap: 8px; } }
@media (max-width: 760px)  { .grid-imgs-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } }
@media (max-width: 480px)  { .grid-imgs-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }


/* Products page header — image left, headline stacked above the paragraph. */
.pr-header { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
@media (max-width: 860px) { .pr-header { grid-template-columns: 1fr; gap: 20px; } .pr-header img { max-width: 220px; } }
.pr-header-420 { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
@media (max-width: 860px) { .pr-header-420 { grid-template-columns: 1fr; } }

@media (max-width: 560px) {
  .nav-cta:not(.nav-email) { display: none; }
}


/* Quote CTA photograph — feathered on every edge so it dissolves into the
   navy panel instead of reading as a pasted rectangle. */
.cta-photo img {
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 34%, #000 84%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 34%, #000 84%, transparent 100%),
    linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-composite: intersect;
}


/* Company "Where we ship" photo strip — stays 2x2 (or 4x1 above 720px), never 3+1. */
.grid-ship { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .grid-ship { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.nav-cta, .scroll-btn { overflow: hidden; white-space: nowrap; }
.cf-select-btn { overflow: hidden; white-space: nowrap; box-sizing: border-box; }
.scroll-text { display: inline-block; white-space: nowrap; transition: transform .9s linear; }
