/* 清單式連結中心：手機單欄，寬螢幕左清單右示意圖。主色由 body 的 --color 帶入 */
:root {
  --ink: #f6f5f7;
  --ink-soft: #b9b6c0;
  --page: #0c0b0f;
  --surface: rgb(255 255 255 / 7%);
  --surface-hover: rgb(255 255 255 / 12%);
  --line: rgb(255 255 255 / 12%);
  --gap: 12px;
  --radius: 18px;
  --row: 64px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  margin: 0;
}

body {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--page);
  color: var(--ink);
  font-family:
    system-ui,
    -apple-system,
    'PingFang TC',
    'Noto Sans TC',
    'Microsoft JhengHei',
    sans-serif;
  line-height: 1.5;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
}

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

/* 背景：圖片只當氛圍，往下漸層收進底色 */
.bg img {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-height: 100vh;
  object-fit: cover;
  object-position: top;
  opacity: 0.55;
}

body::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 100vh;
  background:
    radial-gradient(90% 45% at 50% 0%, color-mix(in srgb, var(--color) 32%, transparent), transparent 70%),
    linear-gradient(transparent 25%, var(--page) 96%);
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  width: 100%;
  max-width: 440px;
  padding: clamp(28px, 6vh, 56px) 20px 0;
}

/* 語言切換 */
.langs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 76px));
  justify-content: center;
  gap: 4px;
}

.langs a {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 100px;
  color: var(--ink-soft);
  font-size: 13px;
}

.langs a[aria-current] {
  background: var(--surface-hover);
  color: var(--ink);
  font-weight: 700;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

h1 {
  text-wrap: balance;
}

h1 {
  font-size: clamp(24px, 7vw, 30px);
  font-weight: 800;
  line-height: 1.3;
}

.logo {
  width: auto;
  max-width: 100%;
  height: 56px;
  object-fit: contain;
}

header .logo {
  height: 40px;
  margin-bottom: 8px;
}

.reward {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid color-mix(in srgb, var(--color) 60%, transparent);
  border-radius: 100px;
  background: color-mix(in srgb, var(--color) 18%, transparent);
  font-size: 15px;
  font-weight: 700;
}

.reward img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* 入口清單 */
.buttons {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.buttons a,
.intro > .outline {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: var(--row);
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 17px;
  font-weight: 700;
}

.buttons a::after,
.intro > .outline::after {
  content: '';
  justify-self: center;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  rotate: 45deg;
  opacity: 0.7;
  transition: translate 0.2s ease;
}

.tile {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: calc(var(--radius) - 6px);
  background: var(--color);
}

.tile img {
  width: 24px;
  height: 24px;
}

.buttons a:first-child {
  border-color: transparent;
  background: var(--color);
  box-shadow: 0 12px 32px -14px var(--color);
  text-shadow: 0 1px 3px rgb(0 0 0 / 35%);
}

.buttons a:first-child .tile {
  background: rgb(0 0 0 / 22%);
}

.intro > .outline {
  min-height: 52px;
  border-color: color-mix(in srgb, var(--color) 55%, transparent);
  background: transparent;
  font-size: 15px;
}

.outline img {
  justify-self: center;
  width: 20px;
  height: 20px;
}

.socials {
  display: flex;
  justify-content: center;
  gap: var(--gap);
  margin-top: 8px;
}

.social {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
}

.social img {
  width: 32px;
  height: 32px;
}

/* 手機示意圖：底部淡出 */
.preview {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  max-height: 340px;
  margin-top: 32px;
  padding: 0 24px;
  overflow: hidden;
  mask-image: linear-gradient(#000 60%, transparent);
}

.phone {
  width: 100%;
  height: auto;
  align-self: flex-start;
}

footer {
  display: flex;
  justify-content: center;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

footer .outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 100px;
  color: var(--ink-soft);
  font-size: 14px;
}

/* 互動回饋 */
.buttons a,
.outline,
.social {
  transition:
    scale 0.15s ease,
    background-color 0.2s ease,
    filter 0.2s ease;
}

@media (hover: hover) {
  .buttons a:hover,
  .intro > .outline:hover,
  footer .outline:hover,
  .social:hover {
    background-color: var(--surface-hover);
  }

  .buttons a:first-child:hover {
    background-color: var(--color);
    filter: brightness(1.12);
  }

  .buttons a:hover::after,
  .intro > .outline:hover::after {
    translate: 3px 0;
  }
}

.buttons a:active,
.outline:active,
.social:active {
  scale: 0.97;
}

a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

/* 進場：清單依序上移 */
@media (prefers-reduced-motion: no-preference) {
  header,
  .buttons a,
  .intro > .outline,
  .socials {
    animation: rise 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }

  .buttons a:nth-child(1) {
    animation-delay: 60ms;
  }

  .buttons a:nth-child(2) {
    animation-delay: 110ms;
  }

  .buttons a:nth-child(3) {
    animation-delay: 160ms;
  }

  .buttons a:nth-child(4),
  .intro > .outline {
    animation-delay: 210ms;
  }

  .socials {
    animation-delay: 260ms;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* 平板直向 */
@media (min-width: 600px) and (max-width: 899px) and (orientation: portrait) {
  .intro {
    max-width: 500px;
  }

  .preview {
    max-width: 440px;
    max-height: 420px;
  }
}

/* 寬螢幕與手機橫向：左清單、右示意圖，兩欄同高並整組置中 */
@media (min-width: 900px), (orientation: landscape) and (min-width: 560px) {
  main {
    display: grid;
    grid-template-columns: minmax(0, 440px) minmax(0, 460px);
    justify-content: center;
    align-content: center;
    align-items: stretch;
    column-gap: clamp(24px, 6vw, 96px);
    padding: 0 24px;
  }

  .intro {
    padding: 32px 0;
  }

  /* 高度跟著左欄走：圖片絕對定位，不會把版面撐高 */
  .preview {
    position: relative;
    align-self: stretch;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    mask-image: none;
  }

  .phone {
    position: absolute;
    inset: 32px 0;
    width: 100%;
    height: calc(100% - 64px);
    object-fit: contain;
    object-position: top;
    mask-image: linear-gradient(#000 80%, transparent);
  }
}

/* 大螢幕：整組放大，避免縮在中央 */
@media (min-width: 1600px) and (min-height: 900px) {
  main,
  footer {
    zoom: 1.2;
  }
}

/* 矮視窗：壓縮列高 */
@media (max-height: 760px) and (min-width: 900px), (max-height: 540px) and (orientation: landscape) {
  :root {
    --gap: 8px;
    --row: 54px;
  }

  .intro {
    padding: 20px 0;
  }

  header {
    gap: 4px;
    margin-bottom: 4px;
  }

  header .logo {
    height: 30px;
    margin-bottom: 0;
  }

  h1 {
    font-size: 24px;
  }

  .tile {
    height: 38px;
  }

  .intro > .outline {
    min-height: 46px;
  }

  .socials {
    margin-top: 0;
  }

  .social {
    width: 44px;
    height: 44px;
  }

  footer {
    padding-block: 8px;
  }
}
