/* ============================================
   砼箴科技 — Shared Foundation
   Common: reset, nav, footer, typography, utilities
   ============================================ */

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

:root{
  /* Brand */
  --purple-300:#c4b5fd;
  --purple-400:#a78bfa;
  --purple-500:#8b5cf6;
  --purple-600:#7c3aed;
  --purple-700:#6d28d9;
  --purple-800:#5b21b6;

  /* Dark theme (homepage) */
  --bg-deep:#0a0012;
  --bg-dark:#0f001c;
  --bg-card-dark:rgba(255,255,255,0.025);
  --bg-card-hover-dark:rgba(255,255,255,0.05);
  --border-dark:rgba(255,255,255,0.06);
  --text-primary-dark:#ffffff;
  --text-secondary-dark:rgba(255,255,255,0.55);
  --text-tertiary-dark:rgba(255,255,255,0.33);

  /* Light theme (sub-pages) */
  --bg-light:#ffffff;
  --bg-warm:#f8f7f4;
  --bg-card-light:#f5f3f0;
  --border-light:rgba(0,0,0,0.08);
  --text-primary-light:#1a1a1a;
  --text-secondary-light:rgba(0,0,0,0.55);
  --text-tertiary-light:rgba(0,0,0,0.35);

  /* Spacing scale */
  --space-xs:8px;
  --space-sm:16px;
  --space-md:32px;
  --space-lg:64px;
  --space-xl:96px;
  --space-2xl:140px;

  /* Layout */
  --max-width:1400px;
  --content-max:900px;
  --radius-lg:24px;
  --radius-md:16px;
  --radius-sm:12px;

  /* Motion */
  --ease-out:cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
}

html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}

body{
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","PingFang SC","Helvetica Neue",sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;
  line-height:1.7;
}

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

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

/* ======== Navigation ======== */
.nav{
  position:fixed;top:0;left:0;right:0;
  z-index:100;
  padding:20px clamp(20px, 4vw, 48px);
  transition:background 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease;
}
.nav.scrolled{
  background:rgba(10,0,18,0.82);
  backdrop-filter:blur(28px) saturate(180%);
  -webkit-backdrop-filter:blur(28px) saturate(180%);
  border-bottom:1px solid rgba(255,255,255,0.06);
}
/* Nav on white pages */
body.white-page .nav{background:transparent}
body.white-page .nav.scrolled{
  background:rgba(255,255,255,0.85);
  backdrop-filter:blur(28px) saturate(180%);
  -webkit-backdrop-filter:blur(28px) saturate(180%);
  border-bottom:1px solid rgba(0,0,0,0.06);
  box-shadow:0 1px 0 rgba(0,0,0,0.04);
}
body.white-page .nav-logo img{filter:invert(1);opacity:0.85}
body.white-page .nav-links a{color:var(--text-secondary-light)}
body.white-page .nav-links a:hover{color:var(--text-primary-light)}
body.white-page .nav-links a.active{color:var(--purple-600)}
.nav-inner{
  max-width:var(--max-width);
  margin:0 auto;
  display:flex;align-items:center;justify-content:space-between;
}
.nav-logo img{height:28px;width:auto;display:block}
.nav-links{display:flex;gap:clamp(24px, 4vw, 56px);align-items:center}
.nav-links a{
  font-size:14px;font-weight:450;
  letter-spacing:0.03em;
  transition:color 0.3s;
}
.nav-links a.active{color:var(--purple-400)}

/* ======== Footer ======== */
.footer{
  padding:clamp(48px, 6vw, 80px) clamp(20px, 4vw, 48px) clamp(32px, 4vw, 56px);
  text-align:center;
  border-top:1px solid var(--border-dark);
}
body.white-page .footer{
  border-top:1px solid var(--border-light);
}
body.white-page .footer-text,
body.white-page .footer-copy{color:var(--text-tertiary-light)}
.footer-logo{
  height:26px;width:auto;margin:0 auto 20px;
  opacity:0.55;
}
body.white-page .footer-logo{opacity:0.55;filter:invert(1)}
.footer-text{font-size:13px;color:var(--text-tertiary-dark);margin-bottom:10px}
.footer-copy{font-size:12px;color:var(--text-tertiary-dark);opacity:0.5}

/* ======== Scrollbar ======== */
::-webkit-scrollbar{width:6px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:rgba(139,92,246,0.25);border-radius:3px}
body.white-page ::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.15)}

/* ======== Animations ======== */
.fade-up{
  opacity:0;transform:translateY(40px);
  transition:opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}
.fade-up.visible{opacity:1;transform:translateY(0)}

.fade-in{
  opacity:0;
  transition:opacity 0.7s ease-out;
}
.fade-in.visible{opacity:1}

@media(prefers-reduced-motion:reduce){
  .fade-up,.fade-in{transition:none}
}

/* ======== Responsive Helpers ======== */
.hide-mobile{}
@media(max-width:640px){
  .hide-mobile{display:none!important}
}
@media(min-width:641px){
  .hide-desktop{display:none!important}
}
