/* ================================================================
   山水雲林股份有限公司 — 企業網站樣式
   ================================================================ */

/* ---------- 設計變數 ---------- */
:root {
  /* 色彩系統 */
  --primary:        #1B5E20;   /* 深林綠 */
  --primary-light:  #2E7D32;
  --primary-dark:   #0E3D12;
  --secondary:      #1565C0;   /* 山泉藍 */
  --secondary-light:#1976D2;
  --accent:         #F9A825;   /* 陽光金 */
  --accent-light:   #FBC02D;

  --success: #2E7D32;
  --warning: #F9A825;
  --error:   #C62828;

  /* 中性色階 */
  --n-50:  #F5F7F5;
  --n-100: #E8ECE8;
  --n-200: #D1D8D1;
  --n-300: #A8B3A8;
  --n-400: #7A8A7A;
  --n-500: #566056;
  --n-600: #3D463D;
  --n-700: #2A302A;
  --n-800: #1A1F1A;
  --n-900: #0E120E;

  /* 背景 / 文字 */
  --bg:         #FAFBFA;
  --bg-alt:     #F0F3F0;
  --text:       #1A2018;
  --text-light: #566056;
  --white:      #FFFFFF;

  /* 字體 */
  --font-sans:  'Noto Sans TC', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: 'Noto Serif TC', Georgia, serif;

  /* 間距 */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 56px;
  --space-7: 80px;

  /* 圓角 / 陰影 */
  --radius:    12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(26,32,24,.08);
  --shadow-md: 0 8px 24px rgba(26,32,24,.12);
  --shadow-lg: 0 16px 48px rgba(26,32,24,.16);

  /* 過場 */
  --ease: cubic-bezier(.22,1,.36,1);
  --transition: .35s var(--ease);

  --container: 1200px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ---------- 通用容器 ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-2); }
.section { padding: var(--space-7) 0; }
.section-alt { background: var(--bg-alt); }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.7);
}
.btn-outline:hover {
  background: rgba(255,255,255,.12);
  border-color: var(--white);
  transform: translateY(-2px);
}
.btn-block { width: 100%; }

/* ================================================================
   導覽列
   ================================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition), padding var(--transition);
  padding: var(--space-2) 0;
}
#navbar.scrolled {
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
  padding: 10px 0;
}
.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { display: flex; }
.logo-text {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  transition: color var(--transition);
  letter-spacing: 2px;
}
#navbar.scrolled .logo-text { color: var(--primary); }

/* Nav links */
.nav-links { display: flex; gap: var(--space-3); }
.nav-link {
  position: relative;
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255,255,255,.85);
  transition: color var(--transition);
  padding: 4px 0;
}
#navbar.scrolled .nav-link { color: var(--n-600); }
#navbar.scrolled .nav-link:hover,
.nav-link:hover { color: var(--accent); }
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width var(--transition);
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}
.nav-toggle span {
  width: 26px; height: 3px;
  background: var(--white);
  border-radius: 3px;
  transition: all var(--transition);
}
#navbar.scrolled .nav-toggle span { background: var(--primary); }
.nav-toggle.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ================================================================
   Hero 首屏
   ================================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url('https://images.pexels.com/photos/37266245/pexels-photo-37266245.jpeg?auto=compress&cs=tinysrgb&w=1920') center / cover no-repeat;
  transform: scale(1.05);
  animation: heroZoom 20s ease-in-out infinite alternate;
}
@keyframes heroZoom {
  from { transform: scale(1.05); }
  to   { transform: scale(1.15); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14,61,18,.78) 0%, rgba(21,101,192,.55) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 0 var(--space-2); max-width: 760px; }
.hero-tag {
  display: inline-block;
  font-size: .9rem;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: var(--space-2);
  font-weight: 500;
}
.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: var(--space-2);
  text-shadow: 0 4px 24px rgba(0,0,0,.3);
}
.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  color: rgba(255,255,255,.9);
  margin-bottom: var(--space-4);
  line-height: 1.6;
}
.hero-actions { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; }

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
.mouse {
  display: block;
  width: 26px; height: 42px;
  border: 2px solid rgba(255,255,255,.6);
  border-radius: 14px;
  position: relative;
}
.wheel {
  position: absolute;
  top: 6px; left: 50%;
  width: 4px; height: 8px;
  margin-left: -2px;
  background: rgba(255,255,255,.8);
  border-radius: 4px;
  animation: wheelDown 1.8s ease infinite;
}
@keyframes wheelDown {
  0%   { opacity: 1; top: 6px; }
  100% { opacity: 0; top: 22px; }
}

/* ================================================================
   章節標題
   ================================================================ */
.section-head {
  text-align: center;
  margin-bottom: var(--space-5);
}
.section-label {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: 4px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: var(--space-1);
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--primary-dark);
  position: relative;
  padding-bottom: var(--space-2);
}
.section-title::after {
  content: '';
  position: absolute;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 56px; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
}
.section-desc {
  margin-top: var(--space-2);
  color: var(--text-light);
  font-size: 1.05rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* ================================================================
   關於我們
   ================================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
  align-items: start;
}
.about-text p { margin-bottom: var(--space-2); color: var(--text-light); line-height: 1.8; }
.about-text p:first-child {
  font-size: 1.15rem;
  color: var(--text);
  font-weight: 500;
}
.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}
.stat-card {
  text-align: center;
  padding: var(--space-3);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.stat-num {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--primary);
}
.stat-suffix {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-card p { color: var(--text-light); margin-top: var(--space-1); font-size: .95rem; }

/* ================================================================
   服務項目
   ================================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.service-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.service-img {
  position: relative;
  height: 220px;
  background-size: cover;
  background-position: center;
  transition: transform .6s var(--ease);
}
.service-card:hover .service-img { transform: scale(1.06); }
.service-badge {
  position: absolute;
  top: var(--space-2); left: var(--space-2);
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27,94,32,.9);
  color: var(--white);
  border-radius: 50%;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  backdrop-filter: blur(4px);
}
.service-body { padding: var(--space-3); }
.service-body h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: var(--space-1);
}
.service-body > p { color: var(--text-light); margin-bottom: var(--space-2); line-height: 1.7; }
.service-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  color: var(--n-600);
  font-size: .95rem;
}
.service-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

/* ================================================================
   實績案例
   ================================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}
.project-card {
  display: flex;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.project-img {
  flex: 0 0 180px;
  background-size: cover;
  background-position: center;
  min-height: 180px;
}
.project-info { padding: var(--space-3); flex: 1; }
.project-cat {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--secondary);
  background: rgba(21,101,192,.1);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: var(--space-1);
}
.project-info h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--primary-dark);
  margin-bottom: var(--space-1);
}
.project-info p { color: var(--text-light); font-size: .95rem; line-height: 1.7; }

/* ================================================================
   聯絡我們
   ================================================================ */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-5);
  align-items: start;
}
.contact-info .section-label,
.contact-info .section-title,
.contact-info .section-desc { text-align: left; }
.contact-info .section-title::after { left: 0; transform: none; }
.contact-info .section-desc { margin-left: 0; }
.contact-list { margin-top: var(--space-3); }
.contact-list li {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  align-items: flex-start;
}
.ci-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}
.contact-list strong { color: var(--primary-dark); }
.contact-list a { color: var(--secondary); transition: color var(--transition); }
.contact-list a:hover { color: var(--accent); }

.contact-form {
  background: var(--white);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.form-row { margin-bottom: var(--space-2); }
.form-row label {
  display: block;
  font-size: .9rem;
  font-weight: 500;
  color: var(--primary-dark);
  margin-bottom: 6px;
}
.req { color: var(--error); }
.form-row input,
.form-row textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--n-200);
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--n-50);
  transition: border-color var(--transition), background var(--transition);
}
.form-row input:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
}
.form-row textarea { resize: vertical; min-height: 100px; }
.form-note {
  margin-top: var(--space-2);
  text-align: center;
  font-size: .9rem;
  font-weight: 500;
  min-height: 24px;
}
.form-note.success { color: var(--success); }
.form-note.error   { color: var(--error); }

/* ================================================================
   Footer
   ================================================================ */
.footer { background: var(--primary-dark); color: rgba(255,255,255,.75); padding: var(--space-5) 0 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-name { font-family: var(--font-serif); font-weight: 700; color: var(--white); font-size: 1.1rem; }
.footer-sub  { font-size: .85rem; color: rgba(255,255,255,.5); }
.footer-links { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.footer-links a { transition: color var(--transition); font-size: .95rem; }
.footer-links a:hover { color: var(--accent-light); }
.footer-bottom { text-align: center; padding: var(--space-2) 0; font-size: .85rem; color: rgba(255,255,255,.4); }

/* ================================================================
   滾動浮現動畫
   ================================================================ */
[data-reveal] {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================================
   RWD — 平板
   ================================================================ */
@media (max-width: 960px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .about-stats { grid-template-columns: repeat(4, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; }
  .project-img { flex-basis: 140px; }
}

/* ================================================================
   RWD — 手機
   ================================================================ */
@media (max-width: 680px) {
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(14,61,18,.97);
    backdrop-filter: blur(12px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    transition: right .4s var(--ease);
    padding: var(--space-4);
  }
  .nav-links.open { right: 0; }
  .nav-link { font-size: 1.2rem; color: rgba(255,255,255,.9); }
  .nav-toggle { display: flex; }

  .services-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }

  .project-card { flex-direction: column; }
  .project-img { flex-basis: auto; width: 100%; height: 180px; min-height: auto; }

  .hero-actions { flex-direction: column; width: 100%; max-width: 280px; margin: 0 auto; }
  .hero-actions .btn { width: 100%; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }

  .section { padding: var(--space-5) 0; }
  .stat-num { font-size: 2rem; }
}

/* ================================================================
   RWD — 小手機
   ================================================================ */
@media (max-width: 400px) {
  .about-stats { grid-template-columns: 1fr; }
  .contact-form { padding: var(--space-3); }
}

/* ================================================================
   降低動態偏好
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .hero-bg { animation: none; }
  [data-reveal] { opacity: 1; transform: none; }
}
