/* YourKeyper — 夜間安防顧問 visual system */
:root {
  --ink: #0b1018;
  --navy: #121a28;
  --navy-soft: #1a2436;
  --blue: #1ea7ff;
  --blue-deep: #0b6fb8;
  --blue-glow: rgba(30, 167, 255, 0.35);
  --brass: #c4a574;
  --brass-dim: #8d734c;
  --paper: #f4f1ea;
  --cream: #fbf8f2;
  --white: #ffffff;
  --text: #1a1f2b;
  --muted: #5c6573;
  --line: rgba(196, 165, 116, 0.28);
  --danger: #c23b3b;
  --ok: #1f7a4d;
  --shadow: 0 18px 40px rgba(11, 16, 24, 0.18);
  --radius: 18px;
  --header-h: 76px;
  --max: 1180px;
  --font: "Noto Sans TC", "Segoe UI", sans-serif;
  --display: "Cormorant Garamond", "Noto Serif TC", serif;
  --space-xs: 0.4rem;
  --space-sm: 0.8rem;
  --space-md: 1.4rem;
  --space-lg: 2.4rem;
  --space-xl: 4.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--cream);
  line-height: 1.7;
}

body.nav-open {
  overflow: hidden;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

p {
  margin: 0 0 1em;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--blue);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 10000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.container {
  width: min(calc(100% - 2rem), var(--max));
  margin-inline: auto;
}

.eyebrow {
  display: inline-block;
  color: var(--brass-dim);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 130;
  background: rgba(11, 16, 24, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(196, 165, 116, 0.2);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  flex-shrink: 0;
}

.logo img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--blue-glow);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.logo-text strong {
  font-size: 0.98rem;
}

.logo-text span {
  font-size: 0.68rem;
  color: var(--brass);
  letter-spacing: 0.12em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem 1.1rem;
}

.desktop-nav a {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--blue);
}

.nav-item {
  position: relative;
}

.nav-item > button {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  padding: 0.35rem 0;
}

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.7rem);
  left: 0;
  min-width: 180px;
  background: var(--navy);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.55rem;
  box-shadow: var(--shadow);
}

/* Bridge the visual gap so mouse can reach submenu without losing hover */
.dropdown::before {
  content: "";
  position: absolute;
  top: -0.7rem;
  left: 0;
  width: 100%;
  height: 0.7rem;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  display: grid;
  gap: 0.2rem;
}

.dropdown a {
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  border: 0;
}

.dropdown a:hover {
  background: rgba(30, 167, 255, 0.12);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-primary {
  background: var(--blue);
  color: #041018;
}

.btn-primary:hover {
  background: #59c0ff;
}

.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-ghost:hover {
  border-color: var(--brass);
  color: var(--brass);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

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

.menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  z-index: 140;
}

.menu-toggle span,
.menu-toggle span::before,
.menu-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  margin: 0 auto;
  position: relative;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

body.nav-open .menu-toggle span {
  background: transparent;
}

body.nav-open .menu-toggle span::before {
  top: 0;
  transform: rotate(45deg);
}

body.nav-open .menu-toggle span::after {
  top: 0;
  transform: rotate(-45deg);
}

/* Mobile overlay — independent of desktop nav / parent height */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  z-index: 120;
  background: #0b1018;
  overflow-y: auto;
  padding: 5.5rem 1.3rem 2rem;
}

body.nav-open .mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mobile-nav a,
.mobile-nav button.sub-toggle {
  color: #fff;
  font-size: 1.25rem;
  padding: 0.85rem 0.2rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
}

.mobile-sub {
  display: none;
  padding: 0.3rem 0 0.8rem 0.8rem;
}

.mobile-sub.is-open {
  display: grid;
}

.mobile-sub a {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
}

.mobile-cta {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.7rem;
}

/* Hero */
.hero {
  position: relative;
  min-height: min(88vh, 820px);
  display: grid;
  align-items: end;
  color: #fff;
  overflow: hidden;
  background: var(--ink);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.55);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 16, 24, 0.15) 0%, rgba(11, 16, 24, 0.82) 78%),
    radial-gradient(circle at 80% 20%, rgba(30, 167, 255, 0.22), transparent 40%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4.5rem 0 3.5rem;
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 5vw, 4.4rem);
  font-weight: 600;
  max-width: 14ch;
}

.hero .lead {
  max-width: 38rem;
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.86);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.page-hero {
  background:
    linear-gradient(120deg, rgba(11, 16, 24, 0.88), rgba(18, 26, 40, 0.72)),
    url("../images/lifestyle/modern-door.jpg") center/cover;
  color: #fff;
  padding: 4.2rem 0 3.2rem;
}

.page-hero h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3.4rem);
}

/* Sections */
.section {
  padding: var(--space-xl) 0;
}

.section-dark {
  background: var(--navy);
  color: #fff;
}

.section-paper {
  background: var(--paper);
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.grid-3,
.grid-4,
.cards,
.steps,
.features,
.products-grid {
  display: grid;
  gap: 1.1rem;
}

.grid-3,
.features,
.steps {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4,
.products-grid {
  grid-template-columns: repeat(4, 1fr);
}

.card,
.product-card,
.step-card,
.feature-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(11, 16, 24, 0.04);
  color: var(--text);
}

.product-card img,
.gallery img,
.media-frame img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: #111;
}

.product-card .body,
.card-body,
.step-card {
  padding: 1.1rem 1.15rem 1.25rem;
}

.feature-card h3,
.feature-card p {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.feature-card h3 {
  padding-top: 1rem;
}

.feature-card p:last-child {
  padding-bottom: 1.2rem;
}

.product-card h3,
.step-card h3,
.feature-card h3 {
  margin-bottom: 0.35rem;
}

body[data-page="warranty"] .feature-card {
  padding: 1.2rem 1.15rem 1.25rem;
}

body[data-page="warranty"] .feature-card h2 {
  margin-bottom: 0.35rem;
}

body[data-page="warranty"] .feature-card p {
  padding: 0;
}

.muted {
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--blue-deep);
  background: rgba(30, 167, 255, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: none;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
  transition: 0.7s ease;
}

.cta-band {
  background:
    linear-gradient(120deg, #0b1018 0%, #16324d 60%, #0b6fb8 140%);
  color: #fff;
  padding: 3.2rem 0;
}

.cta-band .container {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
}

/* Footer */
.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.82);
  padding: 3rem 0 1.4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 1.6rem;
}

.site-footer a:hover {
  color: var(--blue);
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.55);
}

.back-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--blue);
  color: #041018;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}

.back-top.is-on {
  opacity: 1;
  pointer-events: auto;
}

.wa-float {
  position: fixed;
  right: 1.1rem;
  bottom: 4.4rem;
  z-index: 70;
  background: #25d366;
  color: #fff;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

/* Forms / map */
.form {
  display: grid;
  gap: 0.85rem;
}

.form label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid #d6d0c4;
  border-radius: 12px;
  background: #fff;
}

.map-embed {
  margin-top: 1rem;
  height: 320px;
  min-height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #e8eaee;
}

.map-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.spec-table th,
.spec-table td {
  border: 1px solid #e6e0d4;
  padding: 0.65rem 0.8rem;
  text-align: left;
}

.spec-table th {
  width: 38%;
  background: var(--paper);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.icon-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}

.icon-list li {
  list-style: none;
  background: var(--paper);
  border-radius: 12px;
  padding: 0.8rem;
  font-size: 0.92rem;
}

ul.plain {
  padding: 0;
  margin: 0 0 1rem;
}

.breadcrumb {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.8rem;
}

.breadcrumb a {
  color: #fff;
}

.prose {
  max-width: 46rem;
}

.prose h2 {
  margin-top: 1.6rem;
}

.product-layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 2rem;
  align-items: start;
}

.media-frame {
  background: #101820;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}

.media-frame img {
  aspect-ratio: auto;
  width: 100%;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.85rem;
  background: #fff;
}

.step-num {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--blue-deep);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.why-grid .feature-card img,
.why-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.case-gallery {
  display: grid;
  gap: 1.6rem;
}

.case-pair {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.35rem;
  box-shadow: 0 8px 24px rgba(11, 16, 24, 0.04);
}

.case-pair h2 {
  margin: 0 0 0.9rem;
  font-size: 1.15rem;
}

.case-pair-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.case-pair figure {
  margin: 0;
}

.case-pair img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}

.case-pair figcaption {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 980px) {
  .product-layout,
  .why-grid {
    grid-template-columns: 1fr;
  }
}

.notice {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  background: #e8f7ee;
  color: var(--ok);
  display: none;
}

.notice.is-show {
  display: block;
}

@media (max-width: 980px) {
  .desktop-nav,
  .header-cta .btn-ghost,
  .header-cta .btn-primary {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .features,
  .steps,
  .products-grid,
  .footer-grid,
  .cta-band .container,
  .gallery,
  .icon-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .grid-2,
  .grid-3,
  .grid-4,
  .features,
  .steps,
  .products-grid,
  .footer-grid,
  .cta-band .container,
  .gallery,
  .icon-list,
  .case-pair-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: 78vh;
  }

  .wa-float {
    right: 0.8rem;
    bottom: 4.2rem;
  }
}
