/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px; overflow-x: hidden; min-height: 100%;
  background-color: #e8f2f0;
}
body {
  font-family: 'Noto Sans TC', sans-serif; background: transparent; color: #000;
  overflow-x: hidden; max-width: 100%; min-height: 100%;
  position: relative;
}

/* Global typography: serif + uppercase */
html, body, button, input, textarea, select, label, span, p, h1, h2, h3, h4, h5, h6, a {
  font-family: "Times New Roman", Georgia, serif !important;
  text-transform: uppercase;
}

#page-bg {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  background-color: transparent;
  background-image: url("assets/BackgroundImage.png");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

/* ── Loading ───────────────────────────────────────────────── */
#loading {
  position: fixed; inset: 0; z-index: 9999;
  background: #fff; display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid #e0e0e0; border-top-color: #000;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Nav ───────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  display: flex; align-items: center; justify-content: flex-start;
  padding: 12px clamp(16px, 5vw, 28px);
  background: transparent;
}
.btn-pill {
  background: #000; color: #fff; border: none;
  border-radius: 12px; padding: 8px 22px;
  font-size: 14px; font-family: inherit; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s;
}
.btn-pill:hover { opacity: 0.75; }
.btn-pill.outline { background: transparent; color: #000; border: 1.5px solid #000; transition: background 0.2s, color 0.2s; }
.btn-pill.outline:hover { background: #000; color: #fff; opacity: 1; }

/* ── Section 1: Hero ───────────────────────────────────────── */
#s-hero {
  position: relative; height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; contain: layout style;
  width: 100%; max-width: 100%;
}

/* ── Scroll hint — flows below "Learn more" link ──────────── */
#scroll-down-hint {
  display: flex; align-items: center; justify-content: center; gap: 15px;
  margin-top: 28px;
  font-family: 'Shantell Sans', cursive; font-size: 16px; font-weight: 500; color: #000;
  white-space: nowrap; pointer-events: none;
  animation: hint-bob 2s ease-in-out 1.5s infinite;
}
.scroll-arrow-img { width: 14px; height: 43px; transform: rotate(180deg); flex-shrink: 0; }
@keyframes hint-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(6px); }
}

/* ── Audio overlay — visible immediately ───────────────────── */
#hero-audio {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 0 clamp(20px,6vw,40px) 64px; z-index: 5;
}
.audio-title { font-size: clamp(24px,6.5vw,32px); font-weight: 700; margin-bottom: 20px; }
.audio-sub   { font-size: clamp(14px,4vw,16px); color: #666; margin-bottom: clamp(40px,9vw,60px); }
#audio-ui    { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 20px; }
#play-btn-wrap {
  position: relative; cursor: pointer; display: inline-flex;
}
#play-btn {
  display: block; transition: transform 0.15s; flex-shrink: 0;
}
#play-btn-wrap:hover #play-btn { transform: scale(1.08); }
#pause-overlay {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.18s; pointer-events: none;
  background: transparent; border-radius: 50%;
}
#play-btn-wrap.playing:hover #pause-overlay { opacity: 1; }
@keyframes hp-vibrate {
  0%   { transform: rotate(0deg) translateX(0); }
  6%   { transform: rotate(-12deg) translateX(-3px); }
  12%  { transform: rotate(12deg) translateX(3px); }
  18%  { transform: rotate(-9deg) translateX(-2px); }
  24%  { transform: rotate(9deg) translateX(2px); }
  30%  { transform: rotate(-5deg) translateX(-1px); }
  36%  { transform: rotate(5deg) translateX(1px); }
  42%, 100% { transform: rotate(0deg) translateX(0); }
}
#play-btn.idle { animation: hp-vibrate 2.8s ease-in-out 1s infinite; }
#audio-label { font-size: 14px; color: #666; letter-spacing: 0.05em; margin-bottom: 0; }
#pause-overlay svg { stroke: #fff; }
#audio-progress { width: min(260px, 80vw); height: 4px; background: #e0e0e0; border-radius: 4px; overflow: hidden; opacity: 0; transition: opacity 0.3s; margin-top: 12px; }
#audio-bar { height: 100%; width: 0%; background: #000; border-radius: 4px; transition: width 0.4s linear; }

/* ── Section 2: Optional Form ──────────────────────────────── */
#s-form {
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: clamp(48px, 10vw, 80px) clamp(16px, 5vw, 40px) 100px;
  gap: 28px;
}

.form-section-label {
  font-size: clamp(18px, 4.5vw, 24px);
  font-weight: 700; color: #000; text-align: center; letter-spacing: 0.03em;
}

/* ── Card area ─────────────────────────────────────────────── */
#card-area { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; }

#card-wrap {
  position: relative;
  width: min(86vw, 380px);
  height: calc(min(86vw, 380px) * 0.632);
  perspective: 1200px; will-change: transform;
}
#card-inner { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; }

#card-wrap.submitted  { perspective: none; }
#card-inner.submitted { transform-style: flat; transform: none; }
#card-wrap.submitted .c-front { display: none; }
#card-wrap.submitted .c-back {
  display: flex;
  transform: none;
  pointer-events: none;
}

.c-face {
  position: absolute; inset: 0; border-radius: 18px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
  border: 2px solid #000; box-shadow: 0 10px 40px rgba(0,0,0,0.12);
}
#card-inner .c-back          { pointer-events: none; }
#card-inner.flipped .c-back  { pointer-events: auto; }
#card-inner.flipped .c-front { pointer-events: none; }

.c-front {
  display: flex; align-items: center; justify-content: center;
  background: #fff; padding: clamp(14px, 5vw, 24px);
}
.card-front-title {
  font-family: 'Shantell Sans', 'Noto Sans TC', cursive, sans-serif;
  font-size: clamp(20px, 5.5vw, 28px); font-weight: 500; color: #000;
  text-align: center; line-height: 1.3; margin: 0;
  pointer-events: none; user-select: none;
}

.c-back {
  background: #fff; transform: rotateY(180deg);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(14px,4vw,20px) clamp(14px,4vw,18px);
}
#lead-form {
  width: min(100%, 260px); display: flex; flex-direction: column;
  justify-content: center; gap: 24px;
}

.f-note   { font-family: 'Shantell Sans', cursive; font-size: clamp(11px,3vw,13px); color: #000; line-height: 1.4; text-align: center; }
.f-group  { display: flex; flex-direction: column; gap: 2px; }
.f-label  { font-family: 'Shantell Sans', cursive; font-size: clamp(13px,3.5vw,16px); font-weight: 500; color: #000; line-height: 1.2; }
.f-field  { position: relative; }
.f-input  { font-family: 'Shantell Sans', cursive; font-size: clamp(13px,3.5vw,15px); font-weight: 500; color: #000; border: none; outline: none; background: transparent; width: 100%; padding: 2px 0 4px; display: block; }
.f-input  { text-transform: none !important; }
.f-underline { width: 100%; height: 4px; display: block; margin-top: 2px; }
.f-error  {
  position: absolute; top: 0; left: 0; width: 100%;
  font-family: 'Shantell Sans', cursive; font-size: clamp(13px,3.5vw,15px); font-weight: 500;
  color: #fc3838; padding: 2px 0 4px; display: none; pointer-events: none; line-height: 1.2;
}
.f-error.show { display: block; }

/* ── Submit button ─────────────────────────────────────────── */
#btn-submit {
  position: relative; margin-top: 24px;
  width: 102px; height: 45px; background: transparent; border: none;
  font-family: 'Shantell Sans', cursive; font-size: 18px; font-weight: 500; color: #000;
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.35s;
  display: flex; align-items: center; justify-content: center;
}
#btn-submit.show { opacity: 1; pointer-events: all; }
.btn-border-img {
  position: absolute; width: 45px; height: 102px; top: 50%; left: 50%;
  transform: translate(-50%,-50%) rotate(-90deg); pointer-events: none;
}
.btn-border-saving { display: none; }
#btn-submit.saving .btn-border-default { display: none; }
#btn-submit.saving .btn-border-saving  { display: block; }
#btn-submit.saving { color: #fafafa; }
.btn-label { position: relative; z-index: 1; }


@media (min-width: 900px) { #audio-progress { width: min(300px,80vw); } }
@media (max-width: 430px) { .btn-pill { padding: 7px 14px; font-size: 13px; } }
