/* ============================================================
   MacAI HK — Global Stylesheet
   Shared CSS extracted from all hkmac.ai pages.
   Page-specific styles remain in each page's inline <style>.
   ============================================================ */

/* ----- CSS Variables ----- */
:root {
  --black: #1d1d1f;
  --gray-text: #86868b;
  --gray-bg: #f5f5f7;
  --white: #ffffff;
  --blue-link: #0071e3;
  --blue-hover: #0077ed;
  --dark-bg: #000000;
  --dark-surface: #1d1d1f;
  --border: rgba(0,0,0,0.08);
  --nav-height: 48px;
  --section-padding: 60px;
  --max-width: 1024px;
  --max-width-wide: 1200px;
}

/* ----- Reset ----- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--black);
  line-height: 1.5;
  overflow-x: hidden;
  background: var(--white);
}
html[lang="zh-TW"] body {
  font-family: 'Noto Sans TC', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ----- Global Nav ----- */
.globalnav {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--border);
  z-index: 9999;
  transition: background 0.3s;
}
.globalnav.dark {
  background: rgba(29,29,31,0.72);
  border-bottom-color: rgba(255,255,255,0.08);
}
.globalnav-inner {
  max-width: var(--max-width);
  margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
}
.nav-logo {
  font-size: 18px; font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--black);
  transition: color 0.3s;
}
.globalnav.dark .nav-logo { color: var(--white); }
.nav-logo span { color: var(--blue-link); }

.nav-links {
  display: flex; gap: 20px;
  list-style: none; align-items: center;
}
.nav-links a {
  font-size: 12px; font-weight: 400;
  color: var(--black); opacity: 0.8;
  transition: opacity 0.2s, color 0.3s;
  white-space: nowrap;
}
.globalnav.dark .nav-links a { color: var(--white); }
.nav-links a:hover { opacity: 1; }
.nav-links a.active-link { opacity: 1; font-weight: 600; }

.nav-cta {
  font-size: 12px !important;
  font-weight: 500 !important;
  background: var(--blue-link);
  color: var(--white) !important;
  opacity: 1 !important;
  padding: 6px 16px;
  border-radius: 980px;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--blue-hover); }

/* ----- Language Switch ----- */
.lang-switch {
  display: flex; align-items: center; gap: 0;
  background: rgba(128,128,128,0.12);
  border-radius: 980px; padding: 2px; margin-left: 4px;
}
.lang-btn {
  font-size: 11px; font-weight: 500;
  padding: 4px 12px; border-radius: 980px;
  border: none; cursor: pointer;
  background: transparent; color: var(--gray-text);
  transition: all 0.25s; white-space: nowrap;
}
.lang-btn.active {
  background: var(--white); color: var(--black);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.globalnav.dark .lang-btn { color: rgba(255,255,255,0.5); }
.globalnav.dark .lang-btn.active {
  background: rgba(255,255,255,0.15);
  color: var(--white); box-shadow: none;
}

/* ----- Mobile Nav Toggle ----- */
.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 8px;
}
.nav-toggle span {
  display: block; width: 18px; height: 1.5px;
  background: var(--black); margin: 4px 0;
  transition: all 0.3s;
}
.globalnav.dark .nav-toggle span { background: var(--white); }

/* ----- Skip to Content (Accessibility) ----- */
.skip-to-content {
  position: absolute; top: -100%; left: 50%;
  transform: translateX(-50%);
  background: var(--blue-link); color: #fff;
  padding: 8px 24px; border-radius: 0 0 8px 8px;
  z-index: 99999; font-size: 14px; font-weight: 500;
  transition: top 0.2s;
}
.skip-to-content:focus { top: 0; outline: 2px solid #fff; }

/* ----- Typography Classes ----- */
.headline-super {
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 700; letter-spacing: -0.04em; line-height: 1.05;
}
.headline-large {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700; letter-spacing: -0.035em; line-height: 1.1;
}
.headline-section {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 600; letter-spacing: -0.025em; line-height: 1.15;
}
.body-large {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  font-weight: 400; line-height: 1.5; color: var(--gray-text);
}
.body-regular {
  font-size: 17px; font-weight: 400;
  line-height: 1.55; color: var(--gray-text);
}
.eyebrow {
  font-size: 14px; font-weight: 600;
  letter-spacing: -0.01em; text-transform: uppercase;
  color: var(--gray-text); margin-bottom: 12px;
}

/* Chinese typography overrides */
html[lang="zh-TW"] .headline-super { letter-spacing: 0; line-height: 1.15; }
html[lang="zh-TW"] .headline-large  { letter-spacing: 0; line-height: 1.2; }
html[lang="zh-TW"] .headline-section { letter-spacing: 0; line-height: 1.25; }
html[lang="zh-TW"] .eyebrow { letter-spacing: 0.05em; }

/* ----- Common Buttons ----- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 17px; font-weight: 400;
  background: var(--blue-link); color: var(--white);
  padding: 12px 28px; border-radius: 980px;
  border: none; cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: var(--blue-hover); }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 17px; font-weight: 400;
  background: transparent; color: var(--blue-link);
  padding: 12px 28px; border-radius: 980px;
  border: 1.5px solid var(--blue-link);
  cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--blue-link); color: var(--white); }

.link-arrow {
  font-size: 17px; color: var(--blue-link);
  display: inline-flex; align-items: center; gap: 4px;
  transition: gap 0.2s;
}
.link-arrow:hover { gap: 8px; }
.link-arrow::after { content: '\203A'; font-size: 1.3em; }

.cta-buttons {
  display: flex; gap: 16px;
  justify-content: center; flex-wrap: wrap;
}

/* ----- Section Layout ----- */
.section { padding: var(--section-padding) 24px; }
.section-dark { background: var(--dark-bg); color: var(--white); }
.section-dark .body-large,
.section-dark .body-regular { color: rgba(255,255,255,0.6); }
.section-dark .eyebrow { color: rgba(255,255,255,0.5); }
.section-gray { background: var(--gray-bg); }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-inner-wide { max-width: var(--max-width-wide); margin: 0 auto; }
.section-center { text-align: center; }

/* ----- Fade-in Animation ----- */
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ----- Footer ----- */
.footer {
  background: var(--gray-bg);
  padding: 32px 24px 24px;
  border-top: 0.5px solid var(--border);
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; margin-bottom: 24px;
}
.footer-col h4 {
  font-size: 12px; font-weight: 600;
  color: var(--black); margin-bottom: 12px;
}
.footer-col a {
  display: block; font-size: 12px;
  color: var(--gray-text); padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--blue-link); }
.footer-bottom {
  border-top: 0.5px solid var(--border);
  padding-top: 20px;
}
.footer-legal {
  font-size: 11px; color: var(--gray-text);
  line-height: 1.8;
}

/* ----- Responsive: Tablet (768px) ----- */
@media (max-width: 768px) {
  :root { --section-padding: 48px; }

  .nav-toggle {
    display: block; min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
  }
  .nav-links {
    display: none; position: absolute;
    top: var(--nav-height); left: 0; right: 0;
    background: var(--white);
    flex-direction: column; gap: 0;
    padding: 12px 24px;
    border-bottom: 0.5px solid var(--border);
  }
  .globalnav.dark .nav-links { background: var(--dark-surface); }
  .nav-links.show { display: flex; }
  .nav-links li { padding: 8px 0; }
  .nav-links a {
    font-size: 15px; min-height: 44px;
    display: flex; align-items: center;
  }
  .nav-cta {
    display: block; text-align: center; width: 100%;
    padding: 12px 16px !important; font-size: 15px !important;
    min-height: 44px;
  }
  .lang-switch { margin-left: 0; margin-top: 4px; }

  .section { padding: var(--section-padding) 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .footer { padding: 24px 16px 20px; }
}

/* ----- Responsive: Mobile (480px) ----- */
@media (max-width: 480px) {
  .section { padding: var(--section-padding) 12px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer { padding: 20px 12px 16px; }
}
