:root {
  --bg: #fbfaf7;
  --paper: rgba(255,255,255,.72);
  --ink: #1f2322;
  --muted: rgba(31,35,34,.68);
  --line: rgba(31,35,34,.12);
  --wood: #7a5a3a;
  --green: #1f5b45;
  --green2: #2a6a52;
  --shadow: 0 18px 50px rgba(0,0,0,.10);
  --radius: 18px;
  --radius2: 26px;
  --max: 1140px;
  
  --h1: clamp(34px, 4vw, 56px);
  --h2: clamp(22px, 2.4vw, 34px);
  --h3: clamp(18px, 1.8vw, 22px);
  --p: clamp(15px, 1.2vw, 17px);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .08;
  mix-blend-mode: multiply;
  background-image: url("https://sspark.genspark.ai/cfimages?u1=%2FnH40K%2BhNMg9wIlQ%2FgPx49SdBdutmcRrbtautHjmU9KSbK0QG3CFJgkKrCQYglfHhmVfHEPrqGMY6POockY863erWf7BZKFk4eIj9wgSKRedfQXG42ZUvQ%3D%3D&u2=EVwj8wjlc5t%2BmTIZ&width=2560");
  background-size: 900px 900px;
  background-repeat: repeat;
  z-index: -2;
}

a { color: inherit; text-decoration: none; }
a.underline { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

.container { width: min(var(--max), calc(100% - 44px)); margin: 0 auto; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(10px);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  font-weight: 650;
  letter-spacing: .2px;
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover {
  transform: translateY(-2px);
  border-color: rgba(31,35,34,.22);
  background: rgba(255,255,255,.80);
}

.btn.primary {
  background: linear-gradient(135deg, var(--green), var(--green2));
  color: #fff;
  border-color: rgba(255,255,255,.18);
}

.btn.primary:hover {
  transform: translateY(-2px) scale(1.01);
}

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251,250,247,.62);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 820;
  letter-spacing: .2px;
}

.brand svg {
  width: 42px;
  height: 42px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-text strong {
  font-size: 18px;
  letter-spacing: .4px;
}

.brand-text small {
  font-weight: 650;
  color: var(--muted);
  letter-spacing: .6px;
  font-size: 11px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 14px;
  padding: 0;
  margin: 0;
  align-items: center;
}

nav a {
  padding: 10px 10px;
  border-radius: 999px;
  color: rgba(31,35,34,.78);
  transition: background .18s ease, color .18s ease;
  font-weight: 650;
}

nav a:hover {
  background: rgba(31,35,34,.06);
  color: rgba(31,35,34,.95);
}

.nav-cta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.menuBtn { display: none; }

@media (max-width: 920px) {
  nav ul { display: none; }
  .menuBtn { display: inline-flex; }
  .nav-cta .btn:not(.primary) { display: none; }
}

.drawer {
  display: none;
  border-top: 1px solid var(--line);
  padding: 12px 0 18px;
}

.drawer a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(31,35,34,.88);
  font-weight: 650;
}

.drawer a:hover {
  background: rgba(31,35,34,.06);
}

/* Case detail page */
.case-hero {
  padding: 32px 0 18px;
}

.case-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
}

.case-breadcrumb a {
  color: var(--green);
  font-weight: 650;
}

.case-header {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 22px;
  align-items: start;
  margin-bottom: 22px;
}

@media (max-width: 920px) {
  .case-header { grid-template-columns: 1fr; }
}

.case-title h1 {
  margin: 0 0 12px;
  font-size: var(--h1);
  line-height: 1.05;
  letter-spacing: -.6px;
}

.case-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31,91,69,.10);
  color: rgba(31,91,69,.95);
  border: 1px solid rgba(31,91,69,.14);
  font-weight: 750;
  font-size: 12px;
  letter-spacing: .2px;
}

.case-lead {
  margin: 0 0 18px;
  font-size: var(--p);
  color: var(--muted);
  line-height: 1.7;
}

.case-meta {
  border-radius: var(--radius2);
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: 0 14px 36px rgba(0,0,0,.06);
}

.case-meta h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.meta-grid {
  display: grid;
  gap: 10px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.meta-item:last-child {
  border-bottom: none;
}

.meta-item strong {
  font-weight: 750;
  color: var(--ink);
}

.meta-item span {
  color: var(--muted);
  font-weight: 650;
}

.case-gallery {
  padding: 22px 0 56px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16/9;
  background: rgba(31,35,34,.04);
  border: 1px solid var(--line);
  transition: transform .24s ease, box-shadow .24s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 46px rgba(0,0,0,.12);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .36s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,.94);
  backdrop-filter: blur(8px);
  z-index: 9999;
  animation: fadeIn .24s ease;
}

.lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  animation: slideUp .28s ease;
}

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

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 28px 88px rgba(0,0,0,.4);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
  z-index: 10000;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,.22);
  transform: scale(1.08);
}

.lightbox-close {
  top: 24px;
  right: 24px;
}

.lightbox-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.08);
}

.lightbox-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.08);
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.18);
  padding: 8px 16px;
  border-radius: 999px;
  color: #fff;
  font-weight: 650;
  font-size: 14px;
}

/* Section */
section {
  padding: 56px 0;
}

.section-head {
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: var(--h2);
  letter-spacing: -.3px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--p);
  max-width: 72ch;
}

/* Footer */
footer {
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .6s ease, transform .6s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

/* Note */
.note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
}

/* Homepage Case Cards */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

@media (max-width: 768px) {
  .case-grid {
    grid-template-columns: 1fr;
  }
}

.case {
  display: block;
  border-radius: var(--radius2);
  overflow: hidden;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  transition: transform .24s ease, box-shadow .24s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

.case:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 50px rgba(0,0,0,.12);
}

.case-media {
  width: 100%;
  height: 280px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.case-body {
  padding: 20px;
}

.case-tag-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.case-body h3 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: -.3px;
}

.case-body p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.case-body .meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.case-body .meta > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.case-body .meta strong {
  font-weight: 750;
  font-size: 16px;
  color: var(--ink);
}

.case-body .meta span {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}
