/* ============================================================
   活力營養中心 — Fresh/Organic Design System
   Vibrant greens · Natural textures · Warm energy
   Instrument Serif + Noto Serif TC + Noto Sans TC
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Noto+Sans+TC:wght@300;400;500;600;700&family=Noto+Serif+TC:wght@400;500;600;700;900&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors — OKLCH-based, Fresh/Organic palette */
  --color-primary:       oklch(0.55 0.18 145);   /* Vibrant green */
  --color-primary-light: oklch(0.70 0.15 140);   /* Fresh leaf */
  --color-primary-pale:  oklch(0.90 0.06 140);   /* Pale mint */
  --color-primary-dark:  oklch(0.35 0.12 145);   /* Deep forest */

  --color-accent:        oklch(0.62 0.19 55);    /* Warm amber/gold */
  --color-accent-light:  oklch(0.80 0.12 55);    /* Light warm */
  --color-accent-dark:   oklch(0.45 0.16 45);    /* Deep amber */

  --color-surface:       oklch(0.985 0.003 145); /* Almost white w/ green undertone */
  --color-surface-alt:   oklch(0.96 0.03 140);   /* Light mint tint */
  --color-surface-dark:  oklch(0.20 0.04 145);   /* Dark forest surface */

  --color-text:          oklch(0.25 0.04 145);   /* Dark green text */
  --color-text-muted:    oklch(0.48 0.05 140);   /* Muted green */
  --color-text-inverse:  oklch(0.97 0.01 145);   /* Light on dark */
  --color-text-light:    oklch(0.90 0.02 140);   /* Very light green text */

  --color-border:        oklch(0.85 0.05 140);   /* Soft green border */
  --color-border-light:  oklch(0.93 0.03 140);   /* Very light border */

  --color-success:       oklch(0.55 0.17 155);   /* Green success */
  --color-warning:       oklch(0.72 0.18 85);    /* Amber warning */

  /* Typography */
  --font-display:        'Instrument Serif', 'Noto Serif TC', serif;
  --font-heading:        'Noto Serif TC', serif;
  --font-body:           'Noto Sans TC', sans-serif;

  --text-scale-ratio: 1.25;
  --text-xs:    clamp(0.64rem, 0.06vw + 0.63rem, 0.70rem);
  --text-sm:    clamp(0.80rem, 0.08vw + 0.78rem, 0.88rem);
  --text-base:  clamp(1.00rem, 0.10vw + 0.98rem, 1.10rem);
  --text-md:    clamp(1.25rem, 0.12vw + 1.22rem, 1.37rem);
  --text-lg:    clamp(1.56rem, 0.15vw + 1.53rem, 1.71rem);
  --text-xl:    clamp(1.95rem, 0.19vw + 1.91rem, 2.14rem);
  --text-2xl:   clamp(2.44rem, 0.24vw + 2.38rem, 2.68rem);
  --text-3xl:   clamp(3.05rem, 0.30vw + 2.98rem, 3.35rem);
  --text-4xl:   clamp(3.81rem, 0.38vw + 3.72rem, 4.19rem);

  /* Spacing — 8px base grid */
  --space-1:  0.5rem;
  --space-2:  1rem;
  --space-3:  1.5rem;
  --space-4:  2rem;
  --space-5:  3rem;
  --space-6:  4rem;
  --space-7:  6rem;
  --space-8:  8rem;

  /* Layout */
  --max-width:        1280px;
  --content-width:    65ch;
  --header-height:    4.5rem;

  /* Borders & Radii */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px oklch(0.2 0.02 145 / 0.06);
  --shadow-md:  0 4px 24px oklch(0.2 0.02 145 / 0.08);
  --shadow-lg:  0 12px 48px oklch(0.2 0.02 145 / 0.12);
  --shadow-xl:  0 24px 64px oklch(0.2 0.02 145 / 0.16);
  --shadow-glow: 0 0 40px oklch(0.55 0.18 145 / 0.25);

  /* Motion */
  --duration-fast:  0.15s;
  --duration-normal:0.3s;
  --duration-slow:  0.6s;
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-back:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-spring:    cubic-bezier(0.22, 1.2, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  line-height: 1.7;
  overflow-x: hidden;
  animation: bodyFadeIn 0.4s var(--ease-out-expo);
}

@keyframes bodyFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* --- Noise Texture Overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Mesh Gradient Background Glow --- */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 20%, oklch(0.70 0.15 140 / 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 60%, oklch(0.62 0.19 55 / 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 90%, oklch(0.55 0.18 145 / 0.06) 0%, transparent 40%);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
}

/* --- Section --- */
.section {
  padding-block: var(--space-7);
  position: relative;
}

.section--alt {
  background: var(--color-surface-alt);
}

.section--dark {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
}

.section-header {
  text-align: left;
  margin-bottom: var(--space-5);
  max-width: 600px;
}

.section-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-style: italic;
  color: var(--color-primary-light);
  margin-bottom: var(--space-2);
  position: relative;
}

.section-label::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--color-accent);
  margin-top: var(--space-1);
  border-radius: 1px;
}

.section-header h2 {
  font-size: var(--text-2xl);
  font-weight: 900;
  color: inherit;
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 50ch;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-expo);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.btn--primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-surface-dark);
  border-color: var(--color-accent);
}

.btn--accent:hover {
  background: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 0 30px oklch(0.62 0.19 55 / 0.3);
}

.btn--outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary-pale);
}

.btn--outline:hover {
  background: var(--color-primary-pale);
  border-color: var(--color-primary-light);
  transform: translateY(-2px);
}

.btn--white {
  background: white;
  color: var(--color-primary-dark);
  border-color: white;
}

.btn--white:hover {
  background: oklch(0.95 0.01 145);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px oklch(0 0 0 / 0.15);
}

.btn--lg {
  padding: 1rem 2.25rem;
  font-size: var(--text-base);
}

.btn--sm {
  padding: 0.5rem 1.25rem;
  font-size: var(--text-xs);
}

/* --- Header / Nav --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  transition: all var(--duration-normal) var(--ease-out-expo);
  background: transparent;
}

.site-header.scrolled {
  background: oklch(0.985 0.003 145 / 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text);
  z-index: 2;
}

.logo-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  color: white;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--duration-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transform: scaleX(0);
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-text);
}

.nav-links a.active::after,
.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 2;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all var(--duration-normal) var(--ease-out-expo);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-surface-dark);
  color: var(--color-text-light);
  padding: var(--space-7) var(--space-3) var(--space-4);
}

.footer-grid {
  max-width: var(--max-width);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.footer-brand .logo {
  margin-bottom: var(--space-3);
  color: white;
}

.footer-desc {
  color: var(--color-text-light);
  font-size: var(--text-sm);
  line-height: 1.7;
  opacity: 0.8;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: white;
  margin-bottom: var(--space-3);
  letter-spacing: 0.02em;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-col ul li {
  font-size: var(--text-sm);
  color: var(--color-text-light);
  opacity: 0.7;
  transition: opacity var(--duration-fast);
  line-height: 1.6;
}

.footer-col a:hover {
  opacity: 1;
  color: var(--color-primary-light);
}

.footer-bottom {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-top: var(--space-4);
  border-top: 1px solid oklch(1 0 0 / 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-xs);
  opacity: 0.5;
}

/* --- Intersection Observer Animations --- */
.animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-slow) var(--ease-out-expo);
}

.animate.visible {
  opacity: 1;
  transform: translateY(0);
}

.animate--scale {
  transform: scale(0.95);
  opacity: 0;
}

.animate--scale.visible {
  transform: scale(1);
  opacity: 1;
}

.animate--left {
  transform: translateX(-40px);
  opacity: 0;
}

.animate--left.visible {
  transform: translateX(0);
  opacity: 1;
}

.animate--right {
  transform: translateX(40px);
  opacity: 0;
}

.animate--right.visible {
  transform: translateX(0);
  opacity: 1;
}

/* Stagger delays */
.stagger-1 { transition-delay: 0s; }
.stagger-2 { transition-delay: 0.08s; }
.stagger-3 { transition-delay: 0.16s; }
.stagger-4 { transition-delay: 0.24s; }
.stagger-5 { transition-delay: 0.32s; }
.stagger-6 { transition-delay: 0.40s; }
.stagger-7 { transition-delay: 0.48s; }
.stagger-8 { transition-delay: 0.56s; }

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  body { animation: none; }
  .animate, .animate--scale, .animate--left, .animate--right {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Responsive --- */
@media (max-width: 968px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-surface);
    flex-direction: column;
    justify-content: center;
    gap: var(--space-4);
    padding: var(--space-5);
    transition: right var(--duration-normal) var(--ease-out-expo);
    box-shadow: var(--shadow-xl);
    z-index: 1;
  }

  .nav-links.open { right: 0; }

  .mobile-menu-btn { display: flex; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .section { padding-block: var(--space-5); }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* --- Page Header (about/services/blog/contact) --- */
.page-header {
  position: relative;
  padding-block: var(--space-8);
  background: linear-gradient(180deg, var(--color-surface-alt) 0%, var(--color-surface) 100%);
  text-align: left;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 60%;
  height: 160%;
  background: radial-gradient(ellipse at center, oklch(0.70 0.15 140 / 0.15), transparent 70%);
  z-index: 0;
}

.page-header .container {
  position: relative;
  z-index: 1;
}

.page-header h1 {
  font-size: var(--text-3xl);
  font-weight: 900;
  margin-bottom: var(--space-3);
}

.page-header p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 48ch;
  line-height: 1.8;
}

.breadcrumb {
  display: flex;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.breadcrumb a { color: var(--color-primary); }
.breadcrumb a:hover { text-decoration: underline; }

/* --- Generic Card --- */
.card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out-expo);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-slow) var(--ease-out-expo);
}

.card:hover .card-image img {
  transform: scale(1.04);
}

.card-body {
  padding: var(--space-3);
}
