/* ============================================================
   衛保專業滅蟲 — Industrial / Dark Tech Design System
   Deep greens · Safety amber · Bold typography · ISO badges
   Fonts: Bebas Neue (display) + Noto Sans TC (body)
   ============================================================ */

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

/* --- CSS Custom Properties --- */
:root {
  /* Colors — Industrial Dark palette */
  --color-primary:       oklch(0.52 0.18 155);   /* Deep green */
  --color-primary-light: oklch(0.65 0.15 150);   /* Medium green */
  --color-primary-pale:  oklch(0.82 0.08 150);   /* Pale green tint */
  --color-primary-dark:  oklch(0.35 0.12 150);   /* Darkest green */

  --color-accent:        oklch(0.72 0.18 90);    /* Safety amber/yellow */
  --color-accent-light:  oklch(0.82 0.15 90);    /* Light amber */
  --color-accent-dark:   oklch(0.58 0.18 85);    /* Dark amber */

  --color-danger:        oklch(0.52 0.19 25);    /* Alert red */

  --color-surface:       oklch(0.12 0.01 145);   /* Deep charcoal green */
  --color-surface-alt:   oklch(0.16 0.02 145);   /* Slightly lighter */
  --color-surface-card:  oklch(0.19 0.02 145);   /* Card surface */
  --color-surface-dark:  oklch(0.08 0.01 145);   /* Almost black green */
  --color-surface-light: oklch(0.22 0.02 145);   /* Lighter surface */

  --color-text:          oklch(0.90 0.01 145);   /* Near-white text */
  --color-text-muted:    oklch(0.65 0.02 145);   /* Muted green-gray */
  --color-text-inverse:  oklch(0.12 0.01 145);   /* Dark on light */

  --color-border:        oklch(0.25 0.03 150);   /* Greenish border */
  --color-border-light:  oklch(0.18 0.02 145);   /* Subtle border */

  --color-success:       oklch(0.55 0.16 160);   /* Green */
  --color-warning:       oklch(0.72 0.18 90);    /* Amber */

  /* Typography */
  --font-display:        'Bebas Neue', sans-serif;
  --font-heading:        'Noto Sans TC', sans-serif;
  --font-body:           'Noto Sans TC', sans-serif;
  --font-serif:          'Noto Serif TC', 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:    5rem;

  /* Borders & Radii */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px oklch(0 0 0 / 0.3);
  --shadow-md:  0 4px 20px oklch(0 0 0 / 0.4);
  --shadow-lg:  0 8px 40px oklch(0 0 0 / 0.5);
  --shadow-xl:  0 16px 60px oklch(0 0 0 / 0.6);
  --shadow-glow: 0 0 40px oklch(0.52 0.18 155 / 0.25);
  --shadow-accent: 0 0 30px oklch(0.72 0.18 90 / 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 */
  --grain-opacity: 0.03;
}

/* --- 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-light);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-expo);
}

a:hover {
  color: var(--color-accent);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  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 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 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-heading);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-expo);
  white-space: nowrap;
  text-transform: uppercase;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 16px oklch(0.52 0.18 155 / 0.3);
  border-color: var(--color-primary-light);
}

.btn--primary:hover {
  background: var(--color-primary-light);
  box-shadow: 0 6px 24px oklch(0.52 0.18 155 / 0.5), var(--shadow-glow);
  transform: translateY(-2px);
  color: #fff;
}

.btn--accent {
  background: var(--color-accent);
  color: var(--color-surface-dark);
  box-shadow: 0 4px 16px oklch(0.72 0.18 90 / 0.3);
  border-color: var(--color-accent-light);
}

.btn--accent:hover {
  background: var(--color-accent-light);
  box-shadow: 0 6px 24px oklch(0.72 0.18 90 / 0.5), var(--shadow-accent);
  transform: translateY(-2px);
  color: var(--color-surface-dark);
}

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

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

.btn--white {
  background: #fff;
  color: var(--color-surface-dark);
  box-shadow: 0 4px 16px oklch(0 0 0 / 0.2);
}

.btn--white:hover {
  background: var(--color-accent-light);
  transform: translateY(-2px);
  color: var(--color-surface-dark);
}

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

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

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

.site-header.scrolled {
  background: oklch(0.08 0.01 145 / 0.98);
  box-shadow: var(--shadow-md);
  border-bottom-color: var(--color-primary);
}

.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);
  text-decoration: none;
  color: var(--color-text);
}

.logo-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.4rem;
  position: relative;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 1;
  color: var(--color-text);
}

.logo-text small {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  text-transform: none;
}

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

.nav-links a {
  position: relative;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-muted);
  padding: var(--space-1) 0;
  transition: color var(--duration-fast) var(--ease-out-expo);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  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-text);
}

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

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

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

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-md);
  letter-spacing: 0.08em;
  color: var(--color-accent);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-accent);
}

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

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

/* --- Page Header (for subpages) --- */
.page-header {
  padding-block: var(--space-7) var(--space-5);
  text-align: center;
  background: var(--color-surface-dark);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 30% 50%, oklch(0.52 0.18 155 / 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 50%, oklch(0.72 0.18 90 / 0.05) 0%, transparent 50%);
  z-index: 0;
  animation: blob 20s ease-in-out infinite;
}

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

.page-header h1 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}

.page-header .breadcrumb {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.page-header .breadcrumb a {
  color: var(--color-text-muted);
}

.page-header .breadcrumb a:hover {
  color: var(--color-accent);
}

/* --- 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 pulse-glow {
  0%, 100% { box-shadow: 0 0 20px oklch(0.72 0.18 90 / 0.3); }
  50% { box-shadow: 0 0 40px oklch(0.72 0.18 90 / 0.6); }
}

@keyframes caution-stripe {
  0% { background-position: 0 0; }
  100% { background-position: 40px 0; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Scroll animation classes */
.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;
}

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

.animate--right.visible {
  animation: slideInRight 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; }
.stagger-7.visible  { animation-delay: 600ms; }
.stagger-8.visible  { animation-delay: 700ms; }

/* --- Caution Stripe Divider --- */
.caution-divider {
  height: 8px;
  background: repeating-linear-gradient(
    45deg,
    var(--color-accent) 0px,
    var(--color-accent) 8px,
    var(--color-surface-dark) 8px,
    var(--color-surface-dark) 16px
  );
  animation: caution-stripe 2s linear infinite;
}

/* --- Safety Badge --- */
.safety-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  background: oklch(0.15 0.02 145);
  border: 1px solid var(--color-primary);
  padding: 0.5rem 1rem;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--color-primary-light);
  text-transform: uppercase;
}

.safety-badge::before {
  content: '✓';
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: var(--color-success);
  color: var(--color-surface-dark);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
}

/* --- Card Base --- */
.card {
  background: var(--color-surface-card);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all var(--duration-normal) var(--ease-out-expo);
}

.card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow), var(--shadow-md);
  transform: translateY(-4px);
}

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

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

/* --- Footer --- */
.site-footer {
  background: var(--color-surface-dark);
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-6) var(--space-4);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.footer-brand p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
  max-width: 32ch;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--space-1);
}

.footer-col a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color var(--duration-fast) var(--ease-out-expo);
}

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

.footer-bottom {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.footer-bottom a {
  color: var(--color-text-muted);
}

.footer-bottom a:hover {
  color: var(--color-accent);
}

/* --- Contact Info List --- */
.contact-info-list {
  list-style: none;
}

.contact-info-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.contact-info-list .icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  font-size: var(--text-lg);
  margin-top: 2px;
}

/* --- Form Styles --- */
.form-group {
  margin-bottom: var(--space-3);
}

.form-group label {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-1);
  letter-spacing: 0.02em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  transition: all var(--duration-fast) var(--ease-out-expo);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px oklch(0.52 0.18 155 / 0.2);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

/* --- ISO Badge --- */
.iso-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.375rem 0.75rem;
  background: var(--color-surface-dark);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--color-primary-light);
  text-transform: uppercase;
}

/* --- Stats Counter --- */
.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  line-height: 1;
}

/* --- Pricing Tag --- */
.price-tag {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-accent);
}

.price-tag span {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  letter-spacing: 0;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .nav-cta .btn {
    display: none;
  }

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

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

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

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