:root {
  color-scheme: dark;
  --ink: #100e0c;
  --ink-soft: #191613;
  --paper: #f3efe7;
  --muted: #b9afa1;
  --faint: #948a7e;
  --bronze: #c99a68;
  --line: rgba(243, 239, 231, 0.13);
  --line-accent: rgba(201, 154, 104, 0.42);
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

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

html {
  min-width: 320px;
  background: var(--ink);
}

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
}

a:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 4px;
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 76px 76px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.ambient::after {
  position: absolute;
  top: -260px;
  left: 50%;
  width: 720px;
  height: 720px;
  transform: translateX(-50%);
  border: 1px solid rgba(201, 154, 104, 0.07);
  border-radius: 50%;
  box-shadow: 0 0 0 110px rgba(201, 154, 104, 0.015);
  content: "";
}

header,
main,
footer {
  width: min(100%, 1240px);
  margin-inline: auto;
  padding-right: max(24px, env(safe-area-inset-right));
  padding-left: max(24px, env(safe-area-inset-left));
}

header {
  display: flex;
  min-height: 76px;
  align-items: center;
  padding-top: env(safe-area-inset-top);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 18px;
}

.brand img {
  width: 112px;
  height: auto;
}

.brand span {
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.12em;
}

main {
  padding-top: clamp(54px, 7vh, 84px);
  padding-bottom: clamp(40px, 6vh, 72px);
}

.hero {
  text-align: center;
}

.app-icon {
  width: clamp(68px, 7vw, 84px);
  height: auto;
  margin: 0 auto 24px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28));
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(38px, 5vw, 58px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.lead {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: clamp(14px, 1.5vw, 16px);
}

.downloads {
  display: grid;
  margin-top: clamp(44px, 6vh, 68px);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.download-card {
  display: flex;
  min-width: 0;
  min-height: 228px;
  flex-direction: column;
  padding: 26px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(25, 22, 19, 0.5);
  transition: background 160ms ease, border-color 160ms ease;
}

.platform-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 15px;
}

.platform-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--bronze);
}

.platform-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.download-card:first-child .platform-icon svg path {
  fill: currentColor;
  stroke: none;
}

.platform-icon svg.apple-mark {
  width: 27px;
  height: 27px;
  fill: currentColor;
  stroke: none;
}

.platform-icon svg.android-mark {
  width: 29px;
  height: 29px;
  fill: currentColor;
  stroke: none;
}

.platform-heading h2,
.platform-heading p {
  margin: 0;
}

.platform-heading h2 {
  font-family: var(--display);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.platform-heading p {
  margin-top: 4px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.25;
}

.version {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.version span {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.version strong {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.download-button {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 11px 14px;
  border: 1px solid var(--line-accent);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.download-button > span {
  color: var(--bronze);
  font-size: 17px;
}

.download-button.is-disabled {
  justify-content: center;
  border-color: var(--line);
  color: var(--faint);
  cursor: not-allowed;
  font-size: 12px;
  font-weight: 500;
}

footer {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
}

@media (hover: hover) {
  .download-card:hover {
    border-color: rgba(201, 154, 104, 0.24);
    background: rgba(36, 32, 28, 0.7);
  }

  .download-button:not(.is-disabled):hover {
    border-color: var(--paper);
    background: var(--paper);
    color: var(--ink);
  }
}

@media (max-width: 900px) {
  .downloads {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  header,
  main,
  footer {
    padding-right: max(18px, env(safe-area-inset-right));
    padding-left: max(18px, env(safe-area-inset-left));
  }

  header {
    min-height: 68px;
  }

  .brand img {
    width: 103px;
  }

  .brand span {
    font-size: 11px;
  }

  main {
    padding-top: 42px;
    padding-bottom: 44px;
  }

  .app-icon {
    margin-bottom: 20px;
  }

  h1 {
    font-size: clamp(34px, 10vw, 44px);
  }

  .lead {
    max-width: 300px;
    margin-inline: auto;
    line-height: 1.7;
  }

  .downloads {
    margin-top: 38px;
  }

  .download-card {
    min-height: 220px;
    padding: 20px;
  }

  .platform-icon {
    width: 42px;
    height: 42px;
  }

  .platform-icon svg {
    width: 22px;
    height: 22px;
  }

  .platform-heading {
    align-items: flex-start;
    gap: 12px;
  }

  .platform-heading h2 {
    font-size: 20px;
  }

  .version {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
    margin-top: 24px;
  }

  .download-button {
    min-height: 44px;
  }
}

@media (max-width: 350px) {
  .downloads {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
