/* ==========================================================================
   BASE -- engineering layer, use as-is. This file should not need brand-
   specific edits; it only ever reads var(--token) values from tokens.css.
   ========================================================================== */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
::selection { background: var(--accent); color: var(--ink-deep); }
:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 3px; }

/* Skip link: first focusable element on every page (ui-craft SOP 4).
   Off-screen until focused, then pinned above the sticky header. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  background: var(--ink);
  color: var(--surface);
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }
@media (prefers-reduced-motion: reduce) { .skip-link { transition: none; } }
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--accent-light); border: 3px solid var(--surface); border-radius: 8px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 32px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--ink);
}
/* Hero H1 should be "压倒性的大" (overwhelmingly large) -- see SKILL.md
   typography rule. Don't shrink this without a real reason. */
h1 { font-size: clamp(2.8rem, 6vw, 4.6rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; color: var(--ink); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-dark);
  margin-bottom: 1.1em;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46em; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.bg-surface { background: var(--surface); }
.bg-surface-alt { background: var(--surface-alt); }
.bg-ink { background: var(--ink); }

/* `.on-dark` scopes text color for any block sitting on --ink/--ink-deep.
   IMPORTANT gotcha (hit for real on aurelia-jewellery): a bare `p { color }`
   rule above will otherwise beat a dark section's inherited color, making
   plain paragraphs invisible on a dark background even though headings and
   links look fine. Always test dark sections' plain <p> tags specifically,
   not just headings/links, during screenshot self-review. */
.on-dark, .on-dark h1, .on-dark h2, .on-dark h3, .on-dark p { color: var(--surface); }
.on-dark .eyebrow { color: var(--accent-light); }
.on-dark .lede { color: var(--on-dark-muted); }

/* Buttons -- hover fill is a transform:scaleX sweep on a negative z-index
   pseudo-element, NOT an animated background-color, so it stays inside the
   "transform/opacity only" motion rule. The pseudo paints behind the
   button's own text purely by stacking order (negative z-index within the
   button's own isolated stacking context) -- no wrapping <span> needed
   around the label. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 16px 30px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--surface);
  border-radius: var(--radius-sm);
  isolation: isolate;
  transition: color 0.35s ease, border-color 0.35s ease;
  cursor: pointer;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(.65, 0, .35, 1);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); }
.btn:hover, .btn:focus-visible { color: var(--ink-deep); }
.btn-gold, .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--ink-deep); }
.btn-gold::before, .btn-primary::before { background: var(--ink); }
.btn-gold:hover, .btn-primary:hover, .btn-gold:focus-visible, .btn-primary:focus-visible { color: var(--surface); }
.btn-ghost { background: transparent; border-color: currentColor; color: inherit; }
.btn-ghost::before { background: var(--ink); }
.btn-ghost:hover, .btn-ghost:focus-visible { color: var(--surface); }
.on-dark .btn-ghost::before { background: var(--surface); }
.on-dark .btn-ghost:hover, .on-dark .btn-ghost:focus-visible { color: var(--ink); }
@media (prefers-reduced-motion: reduce) {
  .btn::before { transition: none; }
}

/* Header. Scroll-aware: main.js adds .scrolled past a small threshold so the
   header compacts and its translucent backdrop firms up (ui-craft SOP 1
   "滚动感知" rule) -- background colour derives from --surface via
   color-mix rather than a hardcoded rgba() that could drift from the token. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}
.site-header.scrolled { background: color-mix(in srgb, var(--surface) 97%, transparent); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 84px; transition: height 0.3s ease; }
.site-header.scrolled .header-row { height: 68px; }
@media (prefers-reduced-motion: reduce) {
  .site-header, .header-row { transition: none; }
}
.brand-mark { display: flex; align-items: center; gap: 10px; }
.brand-word { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: 0.02em; }
.nav { display: flex; align-items: center; gap: 34px; }
.nav a {
  position: relative;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 0;
}
/* Underline-grows-from-left hover, transform only (see SKILL.md motion menu
   item 5). Excludes .nav-cta since that's a button, not a text link. */
.nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}
/* :not(.nav-cta) matters here, not just style preference: without it this
   rule's specificity beats .btn-gold:hover's intended white-on-dark hover
   text colour on the CTA button, silently dropping its hover contrast below
   WCAG AA (accent-dark on the button's ink hover-fill measured ~2.07:1,
   needs 4.5:1) -- a real bug caught during fernsite-studio's build. */
.nav a:not(.nav-cta):hover, .nav a:not(.nav-cta)[aria-current="page"] { color: var(--accent-dark); }
.nav a:hover:not(.nav-cta)::after, .nav a[aria-current="page"]:not(.nav-cta)::after { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .nav a::after { transition: none; }
}
.nav-cta { padding: 13px 22px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav-toggle span { width: 24px; height: 1.5px; background: var(--ink); display: block; transition: transform 0.25s ease, opacity 0.25s ease; }
/* Hamburger -> X when the mobile menu is open. */
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .nav-toggle span { transition: none; } }
/* Body-scroll lock while the full-screen mobile menu is open. */
body.nav-open { overflow: hidden; }

/* Footer */
.site-footer { background: var(--ink-deep); color: var(--on-dark-muted); padding: 80px 0 30px; }
/* Same gotcha as .on-dark above: force plain <p> to inherit, don't let the
   global `p { color }` rule win. */
.site-footer p { color: inherit; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 56px; border-bottom: 1px solid var(--line-on-dark); }
.footer-brand .brand-word { color: var(--surface); }
.footer-tagline { margin: 16px 0 20px; max-width: 30ch; }
.footer-social { display: flex; gap: 18px; }
.footer-social a, .footer-col a {
  position: relative;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-block;
}
.footer-social a::after, .footer-col a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: var(--accent-light);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
}
.footer-social a:hover, .footer-col a:hover { color: var(--accent-light); }
.footer-social a:hover::after, .footer-col a:hover::after { transform: scaleX(1); }
.footer-col h3 { font-family: var(--font-body); font-size: 0.76rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--surface); font-weight: 600; margin-bottom: 18px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
address { font-style: normal; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 26px; font-size: 0.78rem; }
@media (prefers-reduced-motion: reduce) {
  .footer-social a::after, .footer-col a::after { transition: none; }
}

/* ==========================================================================
   MOTION ARCHITECTURE -- progressive enhancement + reduced-motion +
   CSS kill-switch fallback. Read this whole block before adding any new
   motion-hidden element; see main.js for the JS half and README.md's
   "Motion architecture" section for the full rationale.

   The pattern in one sentence: an element is only ever hidden by CSS when
   BOTH `.js` (JS ran) AND `.motion-ready` (GSAP loaded + reduced-motion
   allows it) are present on <html> -- so no-JS and reduced-motion visitors
   never see a hidden element, by construction, not by best effort.
   ========================================================================== */

/* Simple single-element fade/rise, no GSAP needed -- IntersectionObserver
   in main.js just toggles .in-view. Transform ONLY (never opacity) is
   deliberate: if the observer is slow, unsupported, or a screenshot tool
   catches it mid-transition, a stuck transform is a harmless few-pixel
   offset, never invisible content. */
.reveal { transform: translateY(20px); transition: transform 0.7s ease; }
.reveal.in-view { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { transition: none !important; }
}

/* GSAP-driven hero entrance + .stagger-group reveals hide behind these
   rules ONLY when motion is confirmed safe to run (see main.js). */
@media (prefers-reduced-motion: no-preference) {
  .js.motion-ready .hero-title .line-inner { transform: translateY(110%); }
  .js.motion-ready .hero .eyebrow,
  .js.motion-ready .hero .lede,
  .js.motion-ready .hero-cta-row > * {
    opacity: 0;
    transform: translateY(14px);
  }
  .js.motion-ready .hero-media img,
  .js.motion-ready .hero-photo { transform: scale(1.08); }
  .js.motion-ready .stagger-group > * {
    opacity: 0;
    transform: translateY(24px);
  }
}

/* Kill switch: if GSAP hasn't finished the entrance/reveal within a couple
   of seconds (starved requestAnimationFrame, script failure, etc.) main.js
   adds this class and every motion-hidden element is forced fully visible,
   no matter what GSAP's internal tween state claims. This was a REAL bug on
   aurelia-jewellery, not a hypothetical: chrome-headless-shell's one-shot
   screenshot mode starves rAF, and GSAP's own tween.progress(1) force-
   complete silently failed to resolve transform-based properties in that
   exact situation (opacity-only tweens were fine). Don't "simplify" this
   away by trusting GSAP alone to self-heal. */
.motion-fallback .hero-title .line-inner,
.motion-fallback .hero-media img,
.motion-fallback .hero-photo,
.motion-fallback .hero .eyebrow,
.motion-fallback .hero .lede,
.motion-fallback .hero-cta-row > *,
.motion-fallback .stagger-group > * {
  opacity: 1 !important;
  transform: none !important;
}

/* Line-reveal mask for hero-fullbleed.html's title treatment. */
.line-mask { display: block; overflow: hidden; }
.hero-title .line-inner { display: block; }

/* Mobile sticky bottom action bar (ui-craft SOP 2). Desktop: never rendered.
   Mobile: fixed off-screen until main.js adds .is-visible after the visitor
   scrolls past the first screen -- see main.js. Transform-only so it's safe
   under the motion hard rule, and unaffected by reduced-motion (this is a
   utility appearance, not a decorative entrance animation). */
.mobile-cta-bar { display: none; }
@media (max-width: 760px) {
  .mobile-cta-bar {
    display: flex;
    gap: 10px;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface-card);
    border-top: 1px solid var(--line);
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }
  .mobile-cta-bar.is-visible { transform: translateY(0); }
  .mobile-cta-bar .btn { flex: 1; justify-content: center; padding: 14px 12px; }
}

/* Responsive nav (shared by both hero variants' header) */
@media (max-width: 760px) {
  .wrap { padding: 0 22px; }
  .nav {
    position: fixed;
    inset: 84px 0 0 0;
    background: var(--surface);
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 22px;
    gap: 22px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .nav.open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 34px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}
@media (max-width: 1000px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Print: hide chrome that means nothing on paper (nav, sticky header
   backdrop, mobile CTA bar, decorative footer wordmark, skip link). */
@media print {
  .site-header, .mobile-cta-bar, .skip-link, .footer-ghost, .nav-toggle { display: none !important; }
  body { background: #fff; }
}
