:root {
  --bg: #0f172a;
  --bg-soft: #020617;
  --accent: #38bdf8;
  --accent-soft: #0f766e;
  --text-main: #e5e7eb;
  --text-sub: #9ca3af;
  --card-bg: #020617;
  --border-soft: #1f2937;
  --radius-xl: 18px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%);
  color: var(--text-main);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* 頂部導覽列 */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.92),
    rgba(15, 23, 42, 0.7),
    transparent
  );
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.nav-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-mark {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  font-size: 14px;
}

nav a {
  color: var(--text-sub);
  padding: 6px 10px;
  border-radius: 999px;
  transition: 0.2s;
}

nav a:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.8);
}

nav a.active {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.7);
}

.btn-primary {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background: linear-gradient(135deg, #0ea5e9, #22c55e);
  color: #0b1120;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.35);
  cursor: pointer;
  transition: 0.18s transform, 0.18s box-shadow, 0.18s filter;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 18px 40px rgba(34, 197, 94, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
}

.btn-ghost {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.btn-ghost:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(148, 163, 184, 0.9);
}

/* 漢堡選單 (手機用) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text-main);
  border-radius: 999px;
}

/* 主內容 */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 18px 60px;
}

/* 首頁 Hero 區塊 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 32px 22px;
  border-radius: 28px;
  background: radial-gradient(circle at top left, #0f172a, #020617 55%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: var(--shadow-soft);
  margin-top: 16px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.9);
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 14px;
}

.hero-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #bbf7d0, #22c55e);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
}

.hero-title {
  font-size: clamp(30px, 4vw, 38px);
  line-height: 1.15;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.hero-title span {
  background: linear-gradient(135deg, #38bdf8, #22c55e);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-sub);
  max-width: 34rem;
  line-height: 1.7;
  margin-bottom: 22px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 6px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-meta-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

/* Hero 右側卡片 */
.hero-card {
  border-radius: 24px;
  background: radial-gradient(circle at top, #1e293b, #020617 70%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  padding: 16px 18px 18px;
  position: relative;
  overflow: hidden;
  min-height: 230px;
}

.hero-card-tag {
  font-size: 11px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.hero-card-main {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.hero-card-sub {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 14px;
  max-width: 18rem;
  line-height: 1.6;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  font-size: 11px;
  margin-top: 4px;
}

.metric {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.36);
}

.metric strong {
  display: block;
  font-size: 15px;
  margin-bottom: 2px;
}

.hero-card-orbit {
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 10% 10%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(circle at 80% 0, rgba(34, 197, 94, 0.18), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(8, 47, 73, 0.9), transparent 65%);
  opacity: 0.9;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero-card-inner {
  position: relative;
  z-index: 2;
}

/* 通用區塊 */
section {
  margin-top: 48px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 18px;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-sub);
  max-width: 26rem;
  line-height: 1.6;
}

/* 內頁 Page Hero */
/* 內頁 Page Hero 玻璃感區塊 */
.page-hero {
  position: relative;
  margin-top: 18px;
  padding: 26px 22px;
  border-radius: 24px;
  background: radial-gradient(circle at top left,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.98)
  );
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.25), transparent 55%),
    radial-gradient(circle at 80% 0%, rgba(34, 197, 94, 0.2), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}

.page-hero-title {
  position: relative;
  font-size: 26px;
  margin-bottom: 6px;
}

.page-hero-subtitle {
  position: relative;
  font-size: 13px;
  color: var(--text-sub);
  max-width: 36rem;
  line-height: 1.7;
}


/* 服務卡片 */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* 玻璃感服務卡片 */
.card {
  position: relative;
  background: radial-gradient(circle at top left,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.98)
  );
  border-radius: var(--radius-xl);
  border: 1px solid rgba(30, 64, 175, 0.9);
  padding: 16px 16px 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
  transition:
    0.2s transform,
    0.2s box-shadow,
    0.2s border-color,
    0.2s background;
  font-size: 13px;
  overflow: hidden;
  backdrop-filter: blur(14px);
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 90% 0%, rgba(34, 197, 94, 0.18), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s opacity;
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 1);
  background: radial-gradient(circle at top left,
    rgba(15, 23, 42, 0.85),
    rgba(15, 23, 42, 0.98)
  );
}

.card:hover::before {
  opacity: 1;
}

.card-label {
  position: relative;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.card-title {
  position: relative;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.card-body {
  position: relative;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 10px;
}

.card-footer {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 6px;
}


.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.9);
  font-size: 11px;
}

/* 作品集 */
.grid-portfolio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* 玻璃感卡片＋發光 hover */
.portfolio-item {
  position: relative;
  border-radius: 24px;
  border: 1px solid rgba(30, 64, 175, 0.8);
  overflow: hidden;
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.98));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  cursor: pointer;
  transition:
    0.22s transform,
    0.22s box-shadow,
    0.22s border-color,
    0.22s background;
  backdrop-filter: blur(18px);
}

.portfolio-item::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 10% 0, rgba(56, 189, 248, 0.14), transparent 55%),
    radial-gradient(circle at 80% 0, rgba(34, 197, 94, 0.18), transparent 55%);
  opacity: 0;
  pointer-events: none;
  transition: 0.25s opacity;
}

.portfolio-item:hover {
  transform: translateY(-4px) scale(1.01);
  border-color: rgba(56, 189, 248, 0.8);
  box-shadow: 0 26px 60px rgba(15, 23, 42, 1);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.98));
}

.portfolio-item:hover::before {
  opacity: 1;
}

/* 上半部圖片縮圖：用 background-image 放圖 */
.portfolio-thumb {
  height: 170px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid rgba(30, 64, 175, 0.8);
}

/* 下半部文字區塊 */
.portfolio-content {
  position: relative;
  padding: 12px 14px 14px;
}

.portfolio-tag {
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}

.portfolio-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.portfolio-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.7;
}


/* 聯絡表單 */
.contact-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: flex-start;
}

.contact-panel {
  background: var(--card-bg);
  border-radius: 22px;
  border: 1px solid var(--border-soft);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-soft);
}

.contact-panel h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.contact-panel p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

label {
  font-size: 12px;
  color: var(--text-sub);
}

input,
textarea {
  background: #020617;
  border-radius: 12px;
  border: 1px solid rgba(30, 64, 175, 0.9);
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: 0.18s border-color, 0.18s box-shadow, 0.18s background;
}

input:focus,
textarea:focus {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45);
  background: #020617;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.contact-side {
  font-size: 13px;
  color: var(--text-sub);
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px dashed rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.75);
  line-height: 1.7;
}

.contact-list {
  list-style: none;
  margin-top: 10px;
}

.contact-list li {
  margin-bottom: 6px;
}

.contact-list span {
  color: var(--text-main);
}
  /* Popup 背景 */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9990;
  opacity: 0;
  visibility: hidden;
  transition: 0.3s ease;
}

/* Popup 本體 */
.popup-box {
  position: relative;
  background: #ffffff;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.28);
  animation: popup-fade 0.35s ease;
}

.popup-img {
  width: 100%;
  display: block;
}

/* 關閉按鈕 */
.popup-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.45);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

/* 顯示 Popup */
.popup-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 動畫 */
@keyframes popup-fade {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}



/* Footer */
footer {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid rgba(30, 64, 175, 0.7);
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* RWD */
@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px 18px;
  }

  .hero-card {
    order: -1;
  }

  .grid-3,
  .grid-portfolio,
  .contact-wrapper {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  nav ul {
    position: absolute;
    right: 18px;
    top: 56px;
    flex-direction: column;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 16px;
    padding: 10px 10px 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    min-width: 140px;
    display: none;
  }

  nav ul.show {
    display: flex;
  }

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

  .nav-toggle {
    display: flex;
  }
