/* ==========================================================================
   Aibibu LLC — company site
   Pure CSS, no frameworks, no webfonts. Apple-inspired, calm/corporate.
   Shares the design language of the SolFox product site but understated.
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* surfaces */
  --bg:          #fbfbfd;
  --bg-alt:      #f5f5f7;
  --bg-card:     #ffffff;

  /* text */
  --text:        #1d1d1f;
  --text-2:      #6e6e73;
  --text-3:      #86868b;

  /* accent — restrained, corporate slate-blue (calmer than the product site) */
  --accent:      #2f5b8f;
  --accent-600:  #244a76;
  --accent-hover:#3a6aa3;

  /* hairlines */
  --hairline:      rgba(0,0,0,.09);
  --hairline-soft: rgba(0,0,0,.06);
  --divider:       #d2d2d7;

  /* status */
  --status-green: #30d158;
  --green-text:   #1e7e34;
  --amber-text:   #92651a;
  --amber-bg:     rgba(176,132,42,.12);
  --green-bg:     rgba(30,126,52,.10);

  /* spacing (4px base) */
  --sp-1: 4px;  --sp-2: 8px;   --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px;  --sp-7: 48px;  --sp-8: 64px;
  --sp-9: 96px; --sp-10: 120px;

  /* radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-pill: 980px;

  /* shadows */
  --shadow-card-hover: 0 18px 38px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.04);
  --shadow-nav: 0 1px 0 rgba(0,0,0,.08);
  --shadow-btn: 0 1px 2px rgba(0,0,0,.12);

  /* layout */
  --content-w: 980px;
  --read-w: 720px;
  --nav-h: 48px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-padding-top: calc(var(--nav-h) + 16px); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--text);
  background: var(--bg);
  font-size: 17px;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  overflow-x: clip;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
svg { display: inline-block; vertical-align: middle; }

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

/* CJK: negative tracking looks wrong */
html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3,
html[lang="zh-CN"] .legal-body h1,
html[lang="zh-CN"] .legal-body h2 { letter-spacing: 0; }

/* skip link */
.skip {
  position: absolute; top: -48px; left: 8px; z-index: 200;
  background: #fff; color: var(--accent);
  padding: 8px 16px; border-radius: var(--r-sm);
  transition: top .2s ease;
}
.skip:focus { top: 8px; box-shadow: var(--shadow-card-hover); }

/* ---------- 3. Typography helpers ---------- */
.eyebrow {
  font-size: 13px; font-weight: 600; line-height: 1.2;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

/* ---------- 4. Navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(251,251,253,.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: box-shadow .3s ease, border-color .3s ease;
}
@supports not (backdrop-filter: blur(20px)) {
  .nav { background: rgba(251,251,253,.94); }
}
.nav.scrolled { border-bottom-color: var(--hairline); box-shadow: var(--shadow-nav); }

.nav-inner {
  max-width: 1024px; margin-inline: auto; height: 100%;
  padding-inline: 22px;
  display: flex; align-items: center; gap: var(--sp-6);
}
.nav-logo { display: flex; align-items: center; gap: 8px; }
.nav-logo img { width: 26px; height: 26px; }
.nav-logo span { font-size: 17px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }

.nav-links { display: flex; gap: var(--sp-6); margin-left: auto; }
.nav-links a {
  font-size: 13px; line-height: 1; letter-spacing: -0.01em;
  color: rgba(29,29,31,.8);
  transition: color .2s ease;
}
.nav-links a:hover { color: var(--text); }

.nav-actions { display: flex; align-items: center; gap: var(--sp-4); }
.nav-links + .nav-actions { margin-left: var(--sp-6); }

.lang-switch {
  display: flex; padding: 2px;
  border: 1px solid var(--hairline); border-radius: var(--r-pill);
}
.lang-switch a {
  font-size: 12px; line-height: 1; padding: 5px 10px;
  border-radius: var(--r-pill); color: var(--text-2);
  transition: color .2s ease;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.active { background: var(--text); color: #fff; }

/* ---------- 5. Hero (understated) ---------- */
.hero {
  padding: var(--sp-10) 22px var(--sp-8);
  text-align: center;
}
.hero-logo { width: 52px; height: 52px; margin: 0 auto var(--sp-5); }
.hero h1 {
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 700; line-height: 1.07; letter-spacing: -0.02em;
  max-width: 18ch; margin-inline: auto;
}
.hero-sub {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.4; letter-spacing: -0.01em;
  color: var(--text-2);
  max-width: 640px; margin: var(--sp-5) auto 0;
}

/* ---------- 6. Section scaffolding ---------- */
.section {
  max-width: var(--content-w); margin-inline: auto;
  padding: var(--sp-9) 22px;
}
.section-head { text-align: center; margin-bottom: var(--sp-7); }
.section-head h2 {
  font-size: clamp(28px, 3.6vw, 44px);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.015em;
}
.section-head p {
  font-size: 17px; color: var(--text-2);
  max-width: 52ch; margin: var(--sp-3) auto 0;
}

/* ---------- 7. Products matrix (the hub) ---------- */
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-5); }

.pcard {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  min-height: 240px;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s ease;
}
.pcard.live:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.pcard.soon { background: var(--bg-alt); border-style: dashed; border-color: var(--hairline); }

.pcard-head { display: flex; align-items: center; gap: 12px; margin-bottom: var(--sp-4); }
.pcard-mark {
  width: 44px; height: 44px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--hairline-soft);
}
.pcard-mark img { width: 30px; height: 30px; }
.pcard-mark.generic { background: var(--bg-card); color: var(--accent); }
.pcard-mark.generic svg { width: 24px; height: 24px; }
.pcard-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pcard-title h3 { font-size: 21px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; }

.badge {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; line-height: 1;
  letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--r-pill);
}
.badge.live { background: var(--green-bg); color: var(--green-text); }
.badge.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--status-green); }
.badge.soon { background: var(--amber-bg); color: var(--amber-text); }

.pcard p { font-size: 15px; line-height: 1.5; color: var(--text-2); }
.pcard-tag {
  margin-top: var(--sp-2);
  font-size: 14px; font-weight: 500; color: var(--text); letter-spacing: -0.01em;
}
.pcard-foot { margin-top: auto; padding-top: var(--sp-5); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500; line-height: 1;
  padding: 11px 20px; min-height: 44px;
  transition: background .2s ease;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { background: var(--accent-600); }
.btn-disabled {
  background: transparent; color: var(--text-3);
  border: 1px solid var(--hairline);
  cursor: default; pointer-events: none;
}
.btn .chev { flex: none; transition: transform .2s ease; }
.btn-primary:hover .chev { transform: translateX(3px); }
.ext { flex: none; }

.products-note {
  margin-top: var(--sp-6);
  font-size: 14px; color: var(--text-3); text-align: center;
}

/* ---------- 8. About ---------- */
.about { background: var(--bg-alt); }
.about-inner {
  max-width: var(--read-w); margin-inline: auto; text-align: center;
}
.about-inner h2 {
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 700; letter-spacing: -0.015em; line-height: 1.12;
  margin-bottom: var(--sp-5);
}
.about-inner p {
  font-size: 19px; line-height: 1.5; color: var(--text-2);
  max-width: 60ch; margin: 0 auto var(--sp-4);
}
.about-inner p:last-child { margin-bottom: 0; }

/* ---------- 9. Legal index band ---------- */
.legal-band { text-align: center; }
.legal-links {
  display: flex; flex-wrap: wrap; gap: var(--sp-4);
  justify-content: center; margin-top: var(--sp-5);
}
.legal-links a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  background: var(--bg-card);
  font-size: 15px; font-weight: 500; color: var(--text);
  transition: border-color .2s ease, background .2s ease;
}
.legal-links a:hover { border-color: var(--accent); background: #fff; }

/* ---------- 10. Footer ---------- */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--divider);
  padding: var(--sp-7) 22px;
  font-size: 12px; line-height: 1.33; letter-spacing: -0.01em;
  color: #424245;
}
.footer-inner { max-width: var(--content-w); margin-inline: auto; }
.footer-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap;
}
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-brand img { width: 20px; height: 20px; }
.footer-brand span { font-size: 14px; font-weight: 600; color: var(--text); }
.footer-links { display: flex; gap: var(--sp-5); flex-wrap: wrap; align-items: center; }
.footer-links a { color: #424245; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-lang {
  display: flex; padding: 2px;
  border: 1px solid var(--hairline); border-radius: var(--r-pill);
}
.footer-lang a { padding: 4px 9px; border-radius: var(--r-pill); color: var(--text-2); font-size: 12px; }
.footer-lang a:hover { color: var(--text); text-decoration: none; }
.footer-lang a.active { background: var(--text); color: #fff; }
.footer-bottom {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid var(--divider);
  color: var(--text-2);
}

/* ---------- 11. Legal pages ---------- */
.legal-main { max-width: var(--read-w); margin-inline: auto; padding: var(--sp-8) 22px var(--sp-9); }
.legal-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--accent); margin-bottom: var(--sp-5);
}
.legal-back:hover { text-decoration: underline; }
.legal-back .chev { flex: none; transform: rotate(180deg); }

.draft-note {
  display: block;
  background: var(--amber-bg); color: var(--amber-text);
  border: 1px solid rgba(146,101,26,.28);
  border-radius: var(--r-sm);
  padding: 10px 14px; margin-bottom: var(--sp-6);
  font-size: 13px; font-style: italic; line-height: 1.4;
}

.legal-body h1 {
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700; letter-spacing: -0.018em; line-height: 1.1;
  margin-bottom: var(--sp-3);
}
.legal-updated { font-size: 14px; color: var(--text-3); margin-bottom: var(--sp-7); }

.legal-body h2 {
  font-size: 24px; font-weight: 700; letter-spacing: -0.012em; line-height: 1.2;
  margin: var(--sp-7) 0 var(--sp-3);
}
.legal-body h3 {
  font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
  margin: var(--sp-5) 0 var(--sp-2);
}
.legal-body p { font-size: 16px; line-height: 1.6; color: #333336; margin-bottom: var(--sp-4); }
.legal-body ul { margin: 0 0 var(--sp-4) 0; padding: 0; }
.legal-body li {
  position: relative; font-size: 16px; line-height: 1.6; color: #333336;
  padding-left: 22px; margin-bottom: var(--sp-2);
}
.legal-body li::before {
  content: ""; position: absolute; left: 4px; top: 11px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body a { color: var(--accent); }
.legal-body a:hover { text-decoration: underline; }
.legal-body a[target="_blank"] .ext { margin-left: 2px; }

/* ---------- 12. Motion: scroll reveal ---------- */
.js .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- 13. Responsive ---------- */
@media (max-width: 1068px) {
  .nav-links { gap: var(--sp-4); }
}
@media (max-width: 734px) {
  .hero { padding: var(--sp-8) 16px var(--sp-7); }
  .section { padding: var(--sp-8) 16px; }
  .nav-links { display: none; }
  .nav-inner { padding-inline: 16px; }
  .nav-links + .nav-actions { margin-left: auto; }
  .products { grid-template-columns: 1fr; }
  .pcard { min-height: auto; }
  .about-inner p { font-size: 17px; }
  .legal-main { padding: var(--sp-7) 16px var(--sp-8); }
  .footer-top { flex-direction: column; align-items: flex-start; gap: var(--sp-4); }
}
