/* ==========================================================================
   Qavixtech — shared stylesheet
   ========================================================================== */

:root {
  /* Brand */
  --ink:          #0F2430;  /* body text, dark ground */
  --ink-2:        #42586A;  /* secondary text */
  --accent:       #0B7A6B;
  --accent-deep:  #075F54;  /* hover */
  --ground:       #F6F8F9;  /* page ground */
  --surface:      #FFFFFF;  /* cards */
  --line:         #D9E1E6;  /* rules */

  /* On dark sections */
  --on-dark:      #EAF0F3;
  --on-dark-2:    #9FB2BF;
  --on-dark-3:    #8DA2B0;
  --on-dark-4:    #7E93A2;

  /* Layout */
  --container: 1120px;
  --gutter: 32px;

  /* Type. CJK stack is added under html[lang^="zh"] below. */
  --font-display: "Archivo", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
}

/* Latin and digits keep the brand faces; CJK falls through to Noto Sans TC.
   Order matters: a CJK face listed first would restyle Latin text as well. */
html[lang^="zh"] {
  --font-display: "Archivo", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

img, svg { max-width: 100%; }

/* Visible keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Skip link */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 18px;
  z-index: 100;
}
.skip:focus { left: 8px; top: 8px; color: #fff; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* --- Header ------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 248, 249, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 0 var(--accent);
  flex-shrink: 0;
}

.nav {
  display: flex;
  gap: 32px;
  margin-left: auto;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.nav a { color: var(--ink-2); }
.nav a:hover { color: var(--ink); }

/* Language switch */
.lang {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-display);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  flex-shrink: 0;
}
.lang a {
  padding: 6px 10px;
  color: var(--ink-2);
  line-height: 1.2;
}
.lang a:hover { background: var(--ground); color: var(--ink); }
.lang a[aria-current="true"] {
  background: var(--ink);
  color: #fff;
}

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-block;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn--solid {
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  padding: 14px 28px;
}
.btn--solid:hover { background: var(--accent-deep); color: #fff; }

.btn--outline {
  color: var(--ink);
  font-size: 15px;
  padding: 13px 22px;
  border: 1.5px solid var(--ink);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent-deep); }

.btn--sm {
  background: var(--ink);
  color: #fff;
  font-size: 14.5px;
  padding: 10px 20px;
}
.btn--sm:hover { background: var(--accent-deep); color: #fff; }

/* --- Hero --------------------------------------------------------------- */

.hero {
  padding: 104px 0 88px;
  position: relative;
  overflow: hidden;
}
/* Decorative grid, masked to fade out from the top right */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 75% 90% at 85% 0%, black 0%, transparent 68%);
  mask-image: radial-gradient(ellipse 75% 90% at 85% 0%, black 0%, transparent 68%);
  opacity: 0.7;
}
.hero .container { position: relative; z-index: 1; }

.eyebrow {
  margin: 0 0 22px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-size: clamp(34px, 6.4vw, 76px);
  font-weight: 800;
  max-width: 15ch;
  text-wrap: balance;
}
.rule {
  display: block;
  width: 72px;
  height: 5px;
  background: var(--accent);
  margin: 26px 0 0;
  border-radius: 2px;
}

.hero-lede {
  margin: 28px 0 0;
  max-width: 56ch;
  font-size: 19px;
  color: var(--ink-2);
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.stats {
  margin-top: 72px;
  display: flex;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
}
.stats > div {
  padding: 20px 40px 0 0;
  margin-right: 40px;
  font-size: 14.5px;
  color: var(--ink-2);
}
.stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* --- Sections ----------------------------------------------------------- */

.section { padding: 96px 0; }
.section--boxed {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-head {
  max-width: 62ch;
  margin-bottom: 56px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  text-wrap: balance;
}
.section-head p {
  margin: 16px 0 0;
  font-size: 17.5px;
  color: var(--ink-2);
}

/* --- Services ----------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
.card {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 36px 32px 40px;
  background: var(--surface);
  transition: background 0.15s ease;
}
.card:hover { background: var(--ground); }

.card-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 22px;
  color: var(--accent);
}
.card h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-size: 19.5px;
  font-weight: 700;
}
.card p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}
.card ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
  color: var(--ink-2);
}
.card li {
  padding: 5px 0 5px 18px;
  position: relative;
}
/* Short dash bullet */
.card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 2px;
  background: var(--accent);
}

/* --- Process ------------------------------------------------------------ */

.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}
.step { border-top: 3px solid var(--ink); padding-top: 20px; }
.step:first-child { border-top-color: var(--accent); }
.step .when {
  display: block;
  font-style: normal;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--accent);
  margin-bottom: 10px;
}
.step h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-size: 18px;
  font-weight: 700;
}
.step p { margin: 0; font-size: 14.5px; color: var(--ink-2); }

/* --- Contact ------------------------------------------------------------ */

.contact {
  background: var(--ink);
  color: var(--on-dark);
  padding: 110px 0;
}
.contact .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 72px;
  align-items: start;
}
.contact h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}
.contact-lede {
  margin: 20px 0 0;
  font-size: 17px;
  color: var(--on-dark-2);
  max-width: 46ch;
}

/* Contact details are the only action on this page, so they are set larger */
.reach {
  margin: 40px 0 0;
  display: grid;
  gap: 24px;
}
.reach > div { display: grid; gap: 4px; }
.reach dt,
.reach .label {
  font-size: 13px;
  color: var(--on-dark-3);
  letter-spacing: 0.02em;
}
.reach a {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  border-bottom: 2px solid rgba(255, 255, 255, 0.22);
  padding-bottom: 2px;
  transition: border-color 0.15s ease, color 0.15s ease;
  overflow-wrap: anywhere;
}
.reach a:hover { color: #fff; border-bottom-color: var(--accent); }
.reach .plain { font-size: 16px; color: var(--on-dark); }
/* Reserved slot: renders the row without publishing a value */
.reach .pending,
.info-panel dd.pending { font-size: 16px; color: var(--on-dark-3); }

.info-panel {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 36px;
}
.info-panel h3 {
  margin: 0 0 24px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.info-panel dl {
  margin: 0;
  display: grid;
  gap: 22px;
}
.info-panel dt {
  font-size: 13px;
  color: var(--on-dark-3);
  margin-bottom: 4px;
}
.info-panel dd {
  margin: 0;
  font-size: 15.5px;
  color: var(--on-dark);
  line-height: 1.55;
}
.info-panel dd.strong {
  font-size: 17px;
  font-weight: 600;
}
.info-panel dd.sub { color: var(--on-dark-3); }

/* --- Footer ------------------------------------------------------------- */

.site-footer {
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 28px 0;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--on-dark-4);
}
.site-footer a { color: var(--on-dark-4); text-decoration: underline; }
.site-footer a:hover { color: var(--on-dark); }

/* ==========================================================================
   Responsive. Breakpoints sit where this layout actually breaks, not at
   device sizes: 1024 three-column cards tighten / 860 contact columns
   tighten / 720 the nav no longer fits / 520 one-handed reach.
   ========================================================================== */

@media (max-width: 1024px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .hero { padding: 80px 0 72px; }
  .section { padding: 80px 0; }
}

@media (max-width: 860px) {
  .contact { padding: 88px 0; }
  .contact .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .info-panel { padding: 28px; }
}

@media (max-width: 720px) {
  :root { --gutter: 20px; }

  /* Single-page site: everything is reachable by scrolling, so the nav is
     dropped on narrow screens rather than hidden behind a JS menu. */
  .nav { display: none; }
  .site-header .container { gap: 12px; }
  .lang { margin-left: auto; }

  .hero { padding: 64px 0 56px; }
  .hero h1 { max-width: none; }
  .hero-lede { font-size: 17px; }
  .hero-actions { margin-top: 32px; }
  .hero-actions .btn { flex: 1 1 auto; text-align: center; }

  .stats {
    margin-top: 48px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }
  .stats > div {
    padding: 18px 0;
    margin-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .stats > div:last-child { border-bottom: none; }
  .stats strong { font-size: 22px; }

  .section { padding: 64px 0; }
  .section-head { margin-bottom: 36px; }
  .section-head p { font-size: 16.5px; }

  .cards { grid-template-columns: 1fr; }
  .card { padding: 28px 24px 32px; }

  .steps { grid-template-columns: 1fr; gap: 28px; }

  .contact { padding: 64px 0; }
  .reach { margin-top: 32px; gap: 20px; }
}

@media (max-width: 520px) {
  /* Brand and language switch take priority; the hero already carries a CTA. */
  .site-header .btn--sm { display: none; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .site-footer .container { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
