:root {
  --teal-900: #075668;
  --teal-800: #076d7e;
  --teal-700: #0b7175;
  --teal-600: #0e4d66;
  --teal-500: #046073;
  --teal-400: #085769;
  --teal-300: #108c95;
  --teal-200: #12a8a3;
  --teal-100: #21d2be;
  --mint-500: #10b1a4;
  --mint-400: #1ec0bc;
  --mint-300: #49f0db;
  --mint-200: #59f0dd;
  --mint-100: #d1fbf8;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: #eafcfb;
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  display: flex;
  justify-content: center;
}

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

.page {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  overflow: hidden;
  background: url("../img/bg_m.png") no-repeat top center / cover, #eafcfb;
  padding-bottom: 48px;
}

button { font-family: inherit; cursor: pointer; }

/* ---------- Hero ---------- */

.hero {
  text-align: center;
  padding-top: 24px;
}

.hero__logo {
  width: 120px;
  margin: 0 auto;
}

.hero__title {
  margin: 12px auto 0;
  font-weight: 900;
  font-style: italic;
  font-size: 40px;
  letter-spacing: 0.84px;
  line-height: 1.1;
  background: linear-gradient(195deg, var(--teal-800) 55%, var(--teal-100) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__subtitle {
  margin: 4px auto 0;
  font-weight: 600;
  font-style: italic;
  font-size: 24px;
  letter-spacing: 0.96px;
  background: linear-gradient(182deg, var(--teal-900) 55%, var(--teal-100) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.photo {
  position: relative;
  width: 230px;
  height: 210px;
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo__ring {
  position: absolute;
  pointer-events: none;
}

.photo__ring--outer {
  width: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(101deg);
}

.photo__ring--inner {
  width: 90%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.photo__arrow {
  position: absolute;
  width: 16px;
  height: 12px;
  left: 28px;
  bottom: 16px;
  transform: rotate(50deg);
}

.photo__frame {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.photo__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- Persona ---------- */

.persona {
  text-align: center;
  padding: 0 24px;
  margin-top: 8px;
}

.persona__label {
  margin: 0;
  color: var(--teal-500);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.36px;
}

.persona__title {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 900;
  font-size: 36px;
  letter-spacing: 1.44px;
  background: linear-gradient(180deg, var(--teal-900) 45%, var(--mint-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ticks {
  display: inline-flex;
}

.ticks img {
  width: 14px;
  height: 8px;
}

.ticks--left { transform: scaleX(-1); }

.persona__desc {
  margin: 8px auto 0;
  max-width: 266px;
  color: var(--teal-600);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.72px;
  text-align: justify;
}

.stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}

.stats__divider {
  width: 2px;
  height: 90px;
  background: linear-gradient(180deg, #e1fcfc, #71e9db 50%, #e1fcfc);
}

.stats__item { min-width: 108px; }

.stats__label {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.72px;
  background: linear-gradient(170deg, #25b2a7 25%, var(--teal-800) 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stats__icon { width: 18px; height: 18px; }

.stats__value {
  margin: 6px 0 0;
  color: var(--teal-400);
  font-weight: 900;
  font-size: 48px;
  line-height: 1;
}

.stats__unit {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.72px;
  margin-left: 2px;
}

/* ---------- Buttons ---------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: none;
  border-radius: 24px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.72px;
  width: 100%;
  max-width: 278px;
  padding: 12px 20px;
  transition: transform 0.12s ease;
  margin: 24px auto 0;
  text-decoration: none;
}

.btn__icon { width: 18px; height: 18px; }

.btn--save {
  color: #fff;
  background: linear-gradient(184deg, #25d5c3 14%, #0e92ad 86%);
  box-shadow: 0 0 0 3px var(--mint-300);
}

.btn--save[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.result-actions {
  text-align: center;
  padding: 0 24px;
}

/* html2canvas can't rasterize `background-clip: text` gradient text (it paints the gradient
   as a solid box and leaves the text invisible), so swap these to a flat brand color only
   while #js-result-card is being captured for the "儲存成績單" export. */
#js-result-card.exporting .hero__title,
#js-result-card.exporting .hero__subtitle,
#js-result-card.exporting .persona__title,
#js-result-card.exporting .stats__label {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  color: var(--teal-800);
}

.btn--download {
  color: #fff;
  background: linear-gradient(189deg, #12b6c2 22%, #1476bd 77%);
  box-shadow: 0 0 0 3px var(--mint-300);
}

.btn--open {
  color: var(--teal-700);
  background: #f6fdfd;
  outline: 3px solid var(--mint-400);
  outline-offset: -1.5px;
}

/* ---------- Journey ---------- */

.journey {
  text-align: center;
  margin-top: 32px;
  padding: 0 24px;
}

.journey__title {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.96px;
  background: linear-gradient(180deg, var(--teal-900), var(--teal-700));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chevrons { display: inline-flex; }
.chevrons img { width: 16px; height: 20px; }

.journey__list {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 320px;
  margin: 24px auto 0;
}

.journey__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 80px;
}

.journey__item p {
  margin: 0;
  color: var(--teal-400);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.72px;
}

.journey__circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--mint-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.journey__circle img { width: 32%; }

.journey__divider {
  width: 2px;
  height: 80px;
  margin-top: 8px;
  background: linear-gradient(180deg, #e1fcfc, #71e9db 50%, #e1fcfc);
}

/* ---------- Download ---------- */

.download {
  text-align: center;
  margin-top: 32px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.download__text {
  margin: 0;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: 0.96px;
  line-height: 1.45;
  background: linear-gradient(170deg, var(--teal-300) 20%, #11aebd 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.download__appicon {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  margin-top: 20px;
}

/* ---------- Scroll reveal ---------- */

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.16, 0.84, 0.44, 1),
      transform 0.7s cubic-bezier(0.16, 0.84, 0.44, 1);
    transition-delay: var(--reveal-delay, 0s);
    will-change: opacity, transform;
  }

  [data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Small phones ---------- */

@media (max-width: 360px) {
  .hero__title { font-size: 34px; }
  .hero__subtitle { font-size: 18px; }
  .persona__title { font-size: 28px; }
  .stats__value { font-size: 40px; }
  .journey__list { max-width: 280px; }
}
