:root {
  --ink: #122b30;
  --paper: #f7fbfb;
  --line: rgba(18, 43, 48, 0.2);
  --sans: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--page-bg, #75c9cb);
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--page-bg, #75c9cb);
  font-family: var(--sans);
  letter-spacing: 0;
}

body.page-brochure { --page-bg: #75c9cb; --accent: #83c956; }
body.page-price { --page-bg: #e6b2c7; --accent: #f09d4d; }
body.page-gallery { --page-bg: #9a7691; --accent: #65cbd3; }
body.page-registration { --page-bg: #719bd2; --accent: #24a59c; }

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

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

button {
  cursor: pointer;
}

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

.detail-shell {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  overflow: hidden;
  padding: 22px clamp(20px, 3vw, 44px) 48px;
}

.detail-shell::before,
.detail-shell::after {
  position: absolute;
  z-index: -1;
  width: 28vw;
  height: 100%;
  content: "";
  opacity: 0.38;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.34) 0 3px, transparent 3px 28px);
  pointer-events: none;
}

.detail-shell::before {
  inset: 0 auto 0 0;
  clip-path: polygon(0 0, 68% 0, 24% 100%, 0 100%);
}

.detail-shell::after {
  inset: 0 0 0 auto;
  clip-path: polygon(74% 0, 100% 0, 100% 100%, 28% 100%);
  transform: scaleX(-1);
}

.detail-header {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.detail-brand {
  width: clamp(150px, 15vw, 220px);
}

.detail-brand img {
  width: 100%;
  height: auto;
}

.menu-toggle {
  display: grid;
  place-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid #111;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #111;
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: #fff;
  outline: 3px solid rgba(255, 255, 255, 0.72);
  outline-offset: 2px;
}

.nav-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.nav-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.detail-nav {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 29;
  display: grid;
  align-content: start;
  width: min(360px, 88vw);
  padding: 100px 34px 34px;
  background: rgba(247, 251, 251, 0.98);
  box-shadow: -20px 0 50px rgba(18, 43, 48, 0.18);
  transform: translateX(105%);
  transition: transform 220ms ease;
}

.detail-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
}

.detail-nav a::after {
  content: "↗";
  font-size: 15px;
}

.detail-nav a:hover,
.detail-nav a:focus-visible,
.detail-nav a[aria-current="page"] {
  color: var(--accent);
  outline: none;
}

.detail-nav a[aria-current="page"]::before {
  width: 7px;
  height: 7px;
  margin-right: 10px;
  content: "";
  background: currentColor;
  transform: rotate(45deg);
}

.nav-home {
  margin-bottom: 14px;
  font-size: 13px !important;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: block;
  border: 0;
  background: rgba(10, 24, 27, 0.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.nav-open .detail-nav {
  transform: translateX(0);
}

.nav-open .nav-scrim {
  opacity: 1;
  pointer-events: auto;
}

.nav-open .contact-float {
  animation: none;
  opacity: 0;
  pointer-events: none;
}

.detail-main {
  position: relative;
  width: min(92vw, 1370px);
  height: min(78vh, 760px);
  min-height: 600px;
  margin: -28px auto 0;
}

.detail-visual {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 2px solid #111;
  border-radius: 34% 66% 42% 58% / 17% 22% 78% 83%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: 12px 13px 0 rgba(255, 255, 255, 0.24);
}

.detail-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
}

.page-brochure .detail-visual {
  background-image: url("assets/pages/sb-bg.jpg");
}

.page-brochure .detail-visual::after,
.page-price .detail-visual::after {
  background: linear-gradient(90deg, transparent 42%, rgba(5, 25, 30, 0.36) 100%);
}

.page-price .detail-visual {
  background-image: url("assets/pages/pl-bg.jpg");
  background-position: center 47%;
}

.page-gallery .detail-visual {
  background-image: url("assets/pages/gallery-bg.jpg");
}

.page-gallery .detail-visual::after {
  background: linear-gradient(90deg, rgba(8, 15, 18, 0.5) 0%, transparent 54%);
}

.page-registration .detail-visual {
  background-image: url("assets/pages/registration-bg.jpg");
}

.page-registration .detail-visual::after {
  background: linear-gradient(90deg, transparent 30%, rgba(7, 20, 32, 0.44) 100%);
}

.collection-label {
  position: absolute;
  top: 5%;
  right: 15%;
  z-index: 2;
  color: #f7d437;
  font-size: clamp(13px, 1.55vw, 24px);
  font-weight: 900;
  letter-spacing: 0.3em;
  text-shadow: -1px -1px 0 #2d2924, 1px -1px 0 #2d2924, -1px 1px 0 #2d2924, 1px 1px 0 #2d2924;
  transform: rotate(8deg);
  white-space: nowrap;
}

.visual-title {
  position: absolute;
  z-index: 3;
  max-width: min(44vw, 620px);
  margin: 0;
  padding: 12px 28px 18px;
  border: 2px solid #171717;
  border-radius: 45% 55% 41% 59% / 54% 44% 56% 46%;
  color: #171717;
  background: #fff;
  box-shadow: 9px 10px 0 var(--accent);
  font-family: Arial, sans-serif;
  font-size: clamp(44px, 6vw, 86px);
  font-style: italic;
  font-weight: 900;
  line-height: 0.86;
  text-align: center;
  transform: rotate(-2deg);
}

.page-brochure .visual-title {
  right: 1.5%;
  bottom: 3%;
}

.page-price .visual-title {
  left: 2%;
  bottom: 4%;
}

.page-gallery .visual-title {
  right: 1%;
  top: 39%;
}

.page-registration .visual-title {
  left: 2%;
  bottom: 3%;
}

.detail-content {
  position: absolute;
  z-index: 5;
  width: min(360px, 31vw);
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  color: #fff;
  background: rgba(8, 26, 30, 0.24);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
}

.page-brochure .detail-content {
  top: 36%;
  right: 7%;
}

.page-price .detail-content {
  top: 29%;
  right: 7%;
}

.page-gallery .detail-content {
  top: 40%;
  left: 8%;
}

.page-registration .detail-content {
  top: 55%;
  right: 25%;
}

.eyebrow,
.detail-content h1,
.intro {
  margin: 0;
}

.eyebrow {
  margin-bottom: 8px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  opacity: 0.82;
}

.detail-content h1 {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
  line-height: 1;
}

.intro {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.65;
}

.document-list {
  display: grid;
  max-height: 245px;
  margin-top: 12px;
  overflow-y: auto;
  scrollbar-color: #fff rgba(255, 255, 255, 0.18);
}

.document-link {
  display: grid;
  grid-template-columns: 1fr 30px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.48);
}

.document-link:hover,
.document-link:focus-visible {
  color: #fff4a9;
  outline: none;
}

.document-copy {
  display: grid;
  gap: 3px;
}

.document-copy strong {
  font-size: 14px;
  font-weight: 600;
}

.document-copy small {
  font-size: 8px;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

.download-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.gallery-grid {
  display: grid;
  margin-top: 12px;
}

.gallery-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 24px;
  align-items: center;
  min-height: 54px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.48);
  color: #fff;
  background: transparent;
  text-align: left;
}

.gallery-card::after {
  content: "↘";
  text-align: right;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  color: #fff4a9;
  outline: none;
}

.gallery-thumb {
  display: none;
}

.gallery-card > span:last-child {
  padding-right: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.registration-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.registration-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  color: #fff;
  background: rgba(8, 26, 30, 0.34);
  font-weight: 700;
}

.registration-action--whatsapp {
  background: #178c4d;
}

.registration-action:hover,
.registration-action:focus-visible {
  color: var(--ink);
  background: #fff;
  outline: 3px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.registration-action svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.detail-footer {
  position: absolute;
  right: clamp(86px, 8vw, 124px);
  bottom: 11px;
  left: clamp(20px, 3vw, 44px);
  z-index: 12;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

.detail-footer p {
  margin: 0;
}

.contact-float {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(54px, calc(env(safe-area-inset-bottom) + 14px));
  z-index: 24;
  display: grid;
  gap: 9px;
  transition: opacity 160ms ease;
}

.contact-float a {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 5px 16px rgba(18, 43, 48, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.contact-float a:hover,
.contact-float a:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(18, 43, 48, 0.34);
  outline: 3px solid rgba(255, 255, 255, 0.82);
  outline-offset: 2px;
}

.contact-float__whatsapp { background: #25d366; }
.contact-float__phone { background: var(--ink); }

.contact-float svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.contact-float__whatsapp svg {
  stroke-width: 1.8;
}

.gallery-dialog {
  max-height: 92vh;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(8, 24, 27, 0.38);
}

.gallery-dialog::backdrop {
  background: rgba(8, 22, 25, 0.82);
}

.gallery-dialog {
  width: min(94vw, 1280px);
  padding: 42px 18px 18px;
}

.gallery-dialog img {
  width: 100%;
  max-height: calc(92vh - 64px);
  object-fit: contain;
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  font-size: 22px;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  color: #fff;
  background: var(--ink);
  outline: none;
}

/* Page motion keeps the organic campaign layout lively without shifting its geometry. */
.detail-brand {
  animation: brand-arrive 720ms 80ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.menu-toggle {
  animation: menu-arrive 620ms 180ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.detail-visual {
  animation: hero-reveal 980ms 160ms cubic-bezier(0.2, 0.72, 0.2, 1) both;
}

.page-brochure .detail-visual {
  animation: hero-reveal 980ms 160ms cubic-bezier(0.2, 0.72, 0.2, 1) both,
    brochure-scene 12s 1.2s ease-in-out infinite alternate;
}

.page-price .detail-visual {
  animation: hero-reveal 980ms 160ms cubic-bezier(0.2, 0.72, 0.2, 1) both,
    price-scene 13s 1.2s ease-in-out infinite alternate;
}

.page-gallery .detail-visual {
  animation: hero-reveal 980ms 160ms cubic-bezier(0.2, 0.72, 0.2, 1) both,
    gallery-scene 11s 1.2s ease-in-out infinite alternate;
}

.page-registration .detail-visual {
  animation: hero-reveal 980ms 160ms cubic-bezier(0.2, 0.72, 0.2, 1) both,
    registration-scene 14s 1.2s ease-in-out infinite alternate;
}

.collection-label {
  animation: label-arrive 760ms 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both,
    label-float 4.4s 1.4s ease-in-out infinite alternate;
}

.visual-title {
  animation: sticker-pop 760ms 620ms cubic-bezier(0.18, 0.9, 0.28, 1.18) both,
    sticker-float 4.8s 1.45s ease-in-out infinite alternate;
}

.page-price .visual-title {
  animation-delay: 620ms, 1.7s;
  animation-duration: 760ms, 5.4s;
}

.page-gallery .visual-title {
  animation-delay: 620ms, 1.55s;
  animation-duration: 760ms, 4.2s;
}

.detail-content {
  animation: content-reveal 760ms 720ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.document-link,
.gallery-card,
.registration-action {
  animation: item-arrive 540ms cubic-bezier(0.2, 0.75, 0.2, 1) backwards;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.document-link:hover,
.document-link:focus-visible,
.gallery-card:hover,
.gallery-card:focus-visible,
.registration-action:hover,
.registration-action:focus-visible {
  transform: translateX(4px);
}

.document-link:nth-child(1),
.gallery-card:nth-child(1),
.registration-action:nth-child(1) { animation-delay: 940ms; }

.document-link:nth-child(2),
.gallery-card:nth-child(2),
.registration-action:nth-child(2) { animation-delay: 1010ms; }

.document-link:nth-child(3) { animation-delay: 1080ms; }
.document-link:nth-child(4) { animation-delay: 1150ms; }
.document-link:nth-child(5) { animation-delay: 1220ms; }
.document-link:nth-child(6) { animation-delay: 1290ms; }
.document-link:nth-child(n + 7) { animation-delay: 1360ms; }

.detail-footer {
  animation: footer-arrive 680ms 980ms ease-out both;
}

.contact-float {
  animation: contact-arrive 620ms 1.08s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

@keyframes brand-arrive {
  from { opacity: 0; transform: translate(-14px, -10px); }
  to { opacity: 1; transform: translate(0, 0); }
}

@keyframes menu-arrive {
  from { opacity: 0; transform: scale(0.76) rotate(-12deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes hero-reveal {
  from { opacity: 0; clip-path: inset(7% 8% 9% 8% round 38%); }
  to { opacity: 1; clip-path: inset(0 round 0); }
}

@keyframes brochure-scene {
  from { background-position: 50% center; }
  to { background-position: 47% center; }
}

@keyframes price-scene {
  from { background-position: 50% 47%; }
  to { background-position: 53% 45%; }
}

@keyframes gallery-scene {
  from { background-position: 50% center; }
  to { background-position: 52% 48%; }
}

@keyframes registration-scene {
  from { background-position: 50% center; }
  to { background-position: 47% 52%; }
}

@keyframes label-arrive {
  from { opacity: 0; transform: translateY(-16px) rotate(2deg); }
  to { opacity: 1; transform: translateY(0) rotate(8deg); }
}

@keyframes label-float {
  from { transform: translateY(0) rotate(8deg); }
  to { transform: translateY(-7px) rotate(6deg); }
}

@keyframes sticker-pop {
  from { opacity: 0; transform: scale(0.72) rotate(-8deg); }
  to { opacity: 1; transform: scale(1) rotate(-2deg); }
}

@keyframes sticker-float {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-7px) rotate(0deg); }
}

@keyframes content-reveal {
  from { opacity: 0; clip-path: inset(0 100% 0 0); }
  to { opacity: 1; clip-path: inset(0); }
}

@keyframes item-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes footer-arrive {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes contact-arrive {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 900px) {
  .detail-main {
    width: 94vw;
  }

  .visual-title {
    font-size: clamp(38px, 7vw, 64px);
  }

  .detail-content {
    width: min(340px, 40vw);
  }
}

@media (max-width: 700px) {
  .detail-shell {
    min-height: 820px;
    padding: 16px 14px 76px;
  }

  .detail-shell::before,
  .detail-shell::after {
    width: 54vw;
  }

  .detail-brand {
    width: 150px;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
  }

  .menu-toggle span {
    width: 21px;
  }

  .detail-nav {
    width: min(330px, 88vw);
    padding: 84px 26px 28px;
  }

  .detail-main {
    width: 100%;
    height: 700px;
    min-height: 700px;
    margin: -8px auto 0;
  }

  .detail-visual {
    border-radius: 27% 73% 35% 65% / 12% 18% 82% 88%;
    box-shadow: 7px 8px 0 rgba(255, 255, 255, 0.23);
  }

  .page-brochure .detail-visual { background-image: url("assets/pages/sb-bg-mobile.jpg"); }
  .page-price .detail-visual { background-image: url("assets/pages/pl-bg-mobile.jpg"); }
  .page-gallery .detail-visual { background-image: url("assets/pages/gallery-bg-mobile.jpg"); }
  .page-registration .detail-visual { background-image: url("assets/pages/registration-bg-mobile.jpg"); }

  .collection-label {
    top: 7%;
    right: 5%;
    font-size: 11px;
    letter-spacing: 0.2em;
  }

  .visual-title {
    max-width: 92%;
    padding: 10px 18px 14px;
    font-size: 42px;
    box-shadow: 6px 7px 0 var(--accent);
  }

  .page-brochure .visual-title,
  .page-gallery .visual-title {
    right: 3%;
    top: auto;
    bottom: 3%;
  }

  .page-price .visual-title,
  .page-registration .visual-title {
    left: 3%;
    bottom: 3%;
  }

  .detail-content {
    right: auto !important;
    left: 22px !important;
    width: calc(100% - 48px);
    padding: 15px 16px;
  }

  .page-brochure .detail-content { top: 42%; }
  .page-price .detail-content { top: 27%; }
  .page-gallery .detail-content { top: 39%; }
  .page-registration .detail-content { top: 48%; }

  .detail-content h1 {
    font-size: 30px;
  }

  .intro {
    font-size: 11px;
  }

  .document-list {
    max-height: 250px;
  }

  .document-link {
    min-height: 48px;
  }

  .document-copy strong {
    font-size: 13px;
  }

  .detail-footer {
    right: 78px;
    bottom: 12px;
    left: 16px;
    display: grid;
    gap: 3px;
    font-size: 8px;
  }

  .contact-float {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(13px, env(safe-area-inset-bottom));
    gap: 8px;
  }

  .contact-float a {
    width: 46px;
    height: 46px;
  }

  .contact-float svg {
    width: 21px;
    height: 21px;
  }

}

@media (max-height: 700px) and (min-width: 701px) {
  .detail-main {
    height: calc(100svh - 86px);
    min-height: 520px;
  }

  .detail-content {
    transform: scale(0.92);
    transform-origin: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition: none;
  }
}
