/* Joyway Infinity — main stylesheet */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--navy-600); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--accent-strong); }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.2; color: var(--navy-800); margin: 0 0 var(--sp-4); }
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.4rem); }
p { margin: 0 0 var(--sp-4); }
:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 2px; border-radius: 2px; }

/* Language toggle: hide the non-active language */
:root[data-lang="zh"] [data-lang-en] { display: none !important; }
:root[data-lang="en"] [data-lang-zh] { display: none !important; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--sp-5); }
.narrow { max-width: var(--maxw-narrow); margin-left: auto; margin-right: auto; }
.section { padding: var(--sp-9) 0; }
.section--tight { padding: var(--sp-8) 0; }
.section--alt { background: var(--bg-alt); }
.section--deep { background: var(--navy-800); color: #dce6f0; }
.section--deep h2, .section--deep h3 { color: var(--white); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: var(--sp-3);
}
.section--deep .eyebrow { color: var(--gold-400); }
.lede { font-size: 1.15rem; color: var(--text-soft); }
.section--deep .lede { color: #b6c6d8; }
.center { text-align: center; }
.gold-rule { width: 56px; height: 3px; background: var(--accent); border: 0; margin: var(--sp-4) 0; }
.center .gold-rule { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.98rem;
  padding: 0.85em 1.6em; border-radius: var(--radius); border: 1.5px solid transparent;
  cursor: pointer; transition: all 0.22s var(--ease); text-align: center;
}
.btn--primary { background: var(--accent); color: var(--navy-900); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.5); }
.btn--ghost:hover { background: rgba(255,255,255,0.1); border-color: var(--white); color: var(--white); }
.btn--dark { background: var(--navy-800); color: var(--white); border-color: var(--navy-800); }
.btn--dark:hover { background: var(--navy-700); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--sm { padding: 0.5em 1em; font-size: 0.85rem; }

/* ---------- Site nav ---------- */
.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.94); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.site-nav__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); max-width: var(--maxw); margin: 0 auto; padding: 0.7rem var(--sp-5); }
.brand { display: flex; align-items: center; gap: 0.7rem; flex-shrink: 0; }
.brand__mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-serif); font-weight: 700; font-size: 1.16rem; color: var(--navy-800); letter-spacing: 0.01em; }
.brand__sub { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--accent-strong); font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; margin: 0; padding: 0; }
.nav-links a { font-size: 0.96rem; font-weight: 500; color: var(--ink-700); padding: 0.4rem 0; position: relative; }
.nav-links a::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px; background: var(--accent); transition: width 0.25s var(--ease); }
.nav-links a:hover, .nav-links a.is-active { color: var(--navy-800); }
.nav-links a.is-active::after, .nav-links a:hover::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 0.9rem; flex-shrink: 0; }
.lang-toggle { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--white); }
.lang-toggle button { font-family: var(--font-sans); font-size: 0.8rem; font-weight: 600; padding: 0.35em 0.75em; border: 0; background: transparent; color: var(--ink-500); cursor: pointer; transition: all 0.2s var(--ease); }
.lang-toggle button.is-active { background: var(--navy-800); color: var(--white); }
.nav-toggle { display: none; background: transparent; border: 0; cursor: pointer; padding: 0.4rem; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy-800); margin: 5px 0; transition: 0.25s var(--ease); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 78vh; display: flex; align-items: center; color: var(--white); overflow: hidden; }
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(7,26,48,0.92) 0%, rgba(10,37,64,0.78) 45%, rgba(10,37,64,0.45) 100%); }
.hero__inner { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: var(--sp-9) var(--sp-5); width: 100%; }
.hero__content { max-width: 680px; }
.hero h1 { color: var(--white); margin-bottom: var(--sp-4); }
.hero__tagline { font-size: clamp(1.1rem, 2.2vw, 1.4rem); color: #d7e2ee; margin-bottom: var(--sp-6); font-weight: 300; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.hero__trust { margin-top: var(--sp-7); display: flex; flex-wrap: wrap; gap: var(--sp-6); color: #c3d2e2; font-size: 0.9rem; }
.hero__trust b { color: var(--white); font-family: var(--font-serif); font-size: 1.5rem; display: block; }

/* ---------- Pillars / cards ---------- */
.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-6); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease); height: 100%; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gold-400); }
.card__icon { width: 52px; height: 52px; color: var(--accent-strong); margin-bottom: var(--sp-4); }
.card h3 { margin-bottom: var(--sp-2); }
.card p { color: var(--text-soft); font-size: 0.97rem; margin-bottom: 0; }
.card__link { display: inline-flex; align-items: center; gap: 0.35em; margin-top: var(--sp-4); font-weight: 600; font-size: 0.92rem; color: var(--navy-600); }
.card__link::after { content: "→"; transition: transform 0.2s var(--ease); }
.card:hover .card__link::after { transform: translateX(4px); }

/* ---------- Split feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: center; }
.split__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.split--reverse .split__media { order: 2; }
.figure-caption { font-size: 0.78rem; color: var(--ink-400); margin-top: var(--sp-2); }

/* ---------- Credibility band ---------- */
.stat-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); text-align: center; }
.stat b { display: block; font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 2.8rem); color: var(--gold-400); line-height: 1; margin-bottom: var(--sp-2); }
.stat span { font-size: 0.9rem; color: #b6c6d8; letter-spacing: 0.02em; }

/* ---------- Service detail block ---------- */
.service-block { padding: var(--sp-7) 0; border-bottom: 1px solid var(--line); }
.service-block:last-child { border-bottom: 0; }
.service-block__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: var(--sp-8); align-items: center; }
.service-block:nth-child(even) .service-block__media { order: 2; }
.service-block__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); aspect-ratio: 3/2; object-fit: cover; width: 100%; }
.tick-list { list-style: none; padding: 0; margin: var(--sp-4) 0 0; }
.tick-list li { position: relative; padding-left: 1.9rem; margin-bottom: var(--sp-3); color: var(--ink-700); }
.tick-list li::before { content: ""; position: absolute; left: 0; top: 0.35em; width: 18px; height: 18px; background: var(--gold-100); border-radius: 50%; }
.tick-list li::after { content: ""; position: absolute; left: 6px; top: 0.55em; width: 5px; height: 9px; border-right: 2px solid var(--accent-strong); border-bottom: 2px solid var(--accent-strong); transform: rotate(40deg); }

/* ---------- Timeline / process ---------- */
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); counter-reset: step; }
.timeline__step { position: relative; padding-top: 3.75rem; }
.timeline__step::before { counter-increment: step; content: counter(step); position: absolute; top: 0; left: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--navy-800); color: var(--gold-400); font-family: var(--font-serif); font-size: 1.2rem; border-radius: 50%; }
.timeline__step h4 { margin: 0 0 var(--sp-2); font-size: 1.05rem; }
.timeline__step p { font-size: 0.92rem; color: var(--text-soft); margin: 0; }

/* ---------- Quote / trust statement ---------- */
.pull { border-left: 3px solid var(--accent); padding: var(--sp-3) 0 var(--sp-3) var(--sp-6); font-family: var(--font-serif); font-size: 1.4rem; color: var(--navy-800); line-height: 1.5; }

/* ---------- Logos / partners strip ---------- */
.logo-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--sp-7); opacity: 0.85; }
.logo-strip span { font-family: var(--font-serif); font-size: 1.05rem; color: var(--ink-500); letter-spacing: 0.02em; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: var(--sp-4); }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 0.88rem; font-weight: 600; color: var(--ink-700); }
.field input, .field select, .field textarea {
  font-family: var(--font-sans); font-size: 1rem; padding: 0.75em 0.9em;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(44,92,143,0.15); }
.field textarea { resize: vertical; min-height: 130px; }
.form-note { font-size: 0.85rem; color: var(--ink-400); }

/* ---------- Contact cards ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-8); align-items: start; }
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li { display: flex; gap: var(--sp-4); padding: var(--sp-4) 0; border-bottom: 1px solid var(--line); }
.info-list li:last-child { border-bottom: 0; }
.info-list .ico { width: 40px; height: 40px; flex-shrink: 0; color: var(--accent-strong); background: var(--gold-100); border-radius: 8px; padding: 8px; }
.info-list .k { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-400); }
.info-list .v { font-weight: 600; color: var(--navy-800); }
.wechat-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--sp-5); }
.wechat-card { text-align: center; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--sp-4); }
.wechat-card img, .wechat-card .qr-fallback { width: 100%; max-width: 150px; margin: 0 auto var(--sp-3); aspect-ratio: 1; }
.qr-fallback { display: flex; align-items: center; justify-content: center; background: var(--paper); border: 1px dashed var(--line); border-radius: 8px; color: var(--ink-400); font-size: 0.8rem; text-align: center; padding: var(--sp-3); }
.wechat-card .id { font-weight: 700; color: var(--navy-800); }
.wechat-card .who { font-size: 0.85rem; color: var(--ink-500); }

/* ---------- Page header ---------- */
.page-head { background: var(--navy-800); color: var(--white); padding: var(--sp-8) 0 var(--sp-7); position: relative; overflow: hidden; }
.page-head::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border: 2px solid rgba(200,162,75,0.18); border-radius: 50%; }
.page-head h1 { color: var(--white); margin-bottom: var(--sp-2); }
.page-head p { color: #b6c6d8; max-width: 620px; margin: 0; }
.breadcrumb { font-size: 0.82rem; color: rgba(200,214,230,0.7); margin-bottom: var(--sp-4); }
.breadcrumb a { color: rgba(200,214,230,0.9); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #9fb2c6; padding: var(--sp-8) 0 var(--sp-6); font-size: 0.92rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: var(--sp-6); margin-bottom: var(--sp-7); }
.site-footer h4 { color: var(--white); font-family: var(--font-sans); font-size: 0.82rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: var(--sp-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--sp-3); }
.site-footer a { color: #9fb2c6; }
.site-footer a:hover { color: var(--gold-400); }
.footer-brand__name { font-family: var(--font-serif); font-size: 1.3rem; color: var(--white); margin-bottom: var(--sp-3); }
.footer-legal { border-top: 1px solid rgba(255,255,255,0.1); padding-top: var(--sp-5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--sp-4); font-size: 0.82rem; color: #7f93a8; }
.footer-legal .abn { color: #9fb2c6; }
.footer-legal .abn b { color: var(--gold-400); font-weight: 600; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: var(--sp-4); }
.badge-row { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-4); }
.badge { display: inline-flex; align-items: center; gap: 0.45em; font-size: 0.82rem; font-weight: 600; color: var(--navy-700); background: var(--gold-100); border: 1px solid var(--gold-400); padding: 0.4em 0.85em; border-radius: 999px; }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .split, .service-block__grid, .contact-grid { grid-template-columns: 1fr; gap: var(--sp-6); }
  .split--reverse .split__media, .service-block:nth-child(even) .service-block__media { order: 0; }
  .timeline { grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
  .stat-band { grid-template-columns: repeat(2, 1fr); gap: var(--sp-6); }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links { position: fixed; inset: 62px 0 auto 0; flex-direction: column; align-items: flex-start; gap: 0; background: var(--white); border-bottom: 1px solid var(--line); padding: var(--sp-4) var(--sp-5); box-shadow: var(--shadow-md); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: 0.25s var(--ease); }
  .nav-links.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; width: 100%; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
  .nav-cta { display: none; }
  .brand__sub { display: none; }
  .hero { min-height: 72vh; }
  .hero__bg::after { background: linear-gradient(160deg, rgba(7,26,48,0.92) 0%, rgba(10,37,64,0.82) 100%); }
  .grid--2, .grid--3, .grid--4, .form-grid, .wechat-cards { grid-template-columns: 1fr; }
  .section { padding: var(--sp-8) 0; }
}
