/* ============================================================
   亮潔清潔服務 — Fresh/Organic Design System
   Aqua blues · Crisp whites · Clean energy
   Distinctive serif (Noto Serif TC) + clean sans (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.16 200);   /* Deep aqua */
  --color-primary-light: oklch(0.72 0.12 195);   /* Medium aqua */
  --color-primary-pale:  oklch(0.88 0.05 195);   /* Pale aqua tint */
  --color-primary-dark:  oklch(0.38 0.12 200);   /* Darkest aqua */

  --color-accent:        oklch(0.62 0.18 40);    /* Warm coral */
  --color-accent-light:  oklch(0.78 0.10 40);    /* Light coral */

  --color-surface:       oklch(0.985 0.004 195); /* Crisp white w/ aqua undertone */
  --color-surface-alt:   oklch(0.96 0.02 195);   /* Light aqua tint */
  --color-surface-dark:  oklch(0.22 0.03 200);   /* Dark surface */

  --color-text:          oklch(0.28 0.04 200);   /* Dark teal text */
  --color-text-muted:    oklch(0.50 0.04 195);   /* Muted teal */
  --color-text-inverse:  oklch(0.97 0.01 200);   /* Light on dark */

  --color-border:        oklch(0.85 0.05 195);   /* Soft border */
  --color-border-light:  oklch(0.92 0.03 195);   /* Very light border */

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

  /* 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;   /*  8px */
  --space-2:  1rem;     /* 16px */
  --space-3:  1.5rem;   /* 24px */
  --space-4:  2rem;     /* 32px */
  --space-5:  3rem;     /* 48px */
  --space-6:  4rem;     /* 64px */
  --space-7:  6rem;     /* 96px */
  --space-8:  8rem;     /* 128px */

  /* 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 200 / 0.06);
  --shadow-md:  0 4px 24px oklch(0.2 0.02 200 / 0.08);
  --shadow-lg:  0 12px 48px oklch(0.2 0.02 200 / 0.12);
  --shadow-xl:  0 24px 64px oklch(0.2 0.02 200 / 0.16);
  --shadow-glow: 0 0 40px oklch(0.55 0.16 200 / 0.2);

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:   cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   500ms;

  /* Grain overlay */
  --grain-opacity: 0.015;
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-surface);
  overflow-x: hidden;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: var(--grain-opacity);
  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.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

a:hover {
  color: var(--color-primary-dark);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

.display-serif {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.btn--primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 4px 16px oklch(0.55 0.16 200 / 0.3);
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 6px 24px oklch(0.55 0.16 200 / 0.4);
  transform: translateY(-1px);
  color: white;
}

.btn--accent {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 4px 16px oklch(0.62 0.18 40 / 0.3);
}

.btn--accent:hover {
  background: oklch(0.52 0.18 40);
  box-shadow: 0 6px 24px oklch(0.62 0.18 40 / 0.4);
  transform: translateY(-1px);
  color: white;
}

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

.btn--outline:hover {
  background: var(--color-primary);
  color: white;
  transform: translateY(-1px);
}

.btn--white {
  background: white;
  color: var(--color-primary-dark);
  box-shadow: 0 4px 16px oklch(0 0 0 / 0.1);
}

.btn--white:hover {
  background: var(--color-surface);
  transform: translateY(-1px);
  color: var(--color-primary-dark);
}

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

/* --- Header / Navigation --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: oklch(0.985 0.004 195 / 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border-light);
  transition: background var(--duration-normal) var(--ease-out-expo);
}

.site-header.scrolled {
  background: oklch(0.985 0.004 195 / 0.95);
  box-shadow: var(--shadow-sm);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-primary-dark);
  text-decoration: none;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  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-sm);
  font-size: 1.25rem;
}

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

.nav-links a {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  padding: var(--space-1) 0;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

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

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

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

.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: var(--space-1);
}

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

/* --- Section Common --- */
.section {
  padding-block: var(--space-8);
}

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

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

.section--dark h2,
.section--dark h3 {
  color: var(--color-text-inverse);
}

.section-header {
  text-align: center;
  max-width: 640px;
  margin-inline: auto;
  margin-bottom: var(--space-6);
}

.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);
}

.section--dark .section-label {
  color: var(--color-primary-light);
}

.section-header h2 {
  margin-bottom: var(--space-3);
}

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

.section--dark .section-subtitle {
  color: oklch(0.7 0.03 195);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes blob {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate {
  opacity: 0;
}

.animate.visible {
  animation: fadeInUp var(--duration-slow) var(--ease-out-expo) forwards;
}

.animate--fade.visible {
  animation: fadeIn var(--duration-slow) var(--ease-out-expo) forwards;
}

.animate--scale.visible {
  animation: scaleIn var(--duration-slow) var(--ease-out-expo) forwards;
}

.stagger-1.visible  { animation-delay: 0ms; }
.stagger-2.visible  { animation-delay: 100ms; }
.stagger-3.visible  { animation-delay: 200ms; }
.stagger-4.visible  { animation-delay: 300ms; }
.stagger-5.visible  { animation-delay: 400ms; }
.stagger-6.visible  { animation-delay: 500ms; }

/* --- Footer --- */
.site-footer {
  background: var(--color-surface-dark);
  color: var(--color-text-inverse);
  padding-block: var(--space-6) var(--space-4);
}

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

.footer-brand .footer-desc {
  font-size: var(--text-sm);
  color: oklch(0.65 0.03 195);
  margin-top: var(--space-2);
  max-width: 32ch;
}

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

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

.footer-col a {
  font-size: var(--text-sm);
  color: oklch(0.65 0.03 195);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid oklch(0.35 0.03 200);
  font-size: var(--text-xs);
  color: oklch(0.5 0.03 195);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --header-height: 4rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-surface);
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-cta .btn {
    display: none;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
