:root {
  color-scheme: light;
  --black: #1d1d1f;
  --white: #ffffff;
  --ink: #1d1d1f;
  --body: #424245;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --border: #d2d2d7;
  --paper: #f5f5f7;
  --soft: #fbfbfd;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-light: #e8f2ff;
  --blue-dark: #004c99;
  --radius-sm: 12px;
  --radius-md: 12px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.12);
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "SF Pro Text", "Helvetica Neue", Helvetica, Arial, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
a {
  -webkit-tap-highlight-color: transparent;
}

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

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

p,
h1,
h2,
h3,
figure,
ol,
ul {
  margin: 0;
}

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

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: -100px;
  left: 16px;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: top 200ms var(--ease), background-color 200ms var(--ease);
}

.skip-link:focus {
  top: 16px;
  background: var(--blue-hover);
}

.miniapp-main {
  background: var(--paper);
}

.hero {
  border-bottom: 1px solid var(--line-soft);
  background: var(--white);
}

.hero-grid,
.how-to-grid {
  display: grid;
  width: min(calc(100% - 64px), 1280px);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
  margin: 0 auto;
}

.hero-grid {
  align-items: center;
  padding: 80px 0 88px;
}

.hero-copy {
  min-width: 0;
  grid-column: 1 / span 6;
}

.eyebrow {
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-eyebrow-icon {
  width: 28px;
  height: 28px;
  flex: none;
  object-fit: contain;
}

.hero-copy h1 {
  max-width: 760px;
  margin-top: 24px;
  font-size: 64px;
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

.hero-copy h1 span {
  color: var(--muted);
}

.hero-lead {
  max-width: 620px;
  margin-top: 28px;
  color: var(--body);
  font-size: 21px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: color 200ms var(--ease), background-color 200ms var(--ease),
    box-shadow 200ms var(--ease), transform 200ms var(--ease);
}

.primary-link {
  background: var(--blue);
  color: var(--white);
}

.primary-link:hover {
  background: var(--blue-hover);
}

.secondary-link {
  background: var(--white);
  color: var(--blue);
}

.secondary-link:hover {
  background: var(--blue-light);
  color: var(--blue-hover);
}

.primary-link:active,
.secondary-link:active {
  transform: scale(0.98);
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 42px;
  padding: 0;
  list-style: none;
}

.hero-points li {
  min-width: 0;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: background-color 200ms var(--ease);
}

.hero-points li:hover {
  background: var(--soft);
}

.hero-points span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

.hero-points strong {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.4;
}

.hero-points p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.scan-panel {
  scroll-margin-top: 88px;
  display: flex;
  width: min(100%, 400px);
  min-width: 0;
  grid-column: 8 / span 5;
  justify-self: end;
  overflow: hidden;
  flex-direction: column;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow);
}

.scan-head {
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}

.scan-head p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.scan-head h2 {
  margin-top: 5px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

.scan-head > span {
  display: inline-flex;
  min-height: 32px;
  flex: none;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--blue-light);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 600;
}

.qr-figure {
  padding: 20px 22px 18px;
  text-align: center;
}

.qr-image {
  width: 100%;
  height: auto;
  margin: 0 auto;
  aspect-ratio: 1;
  background: var(--white);
  object-fit: contain;
}

.qr-figure figcaption {
  max-width: 390px;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.scan-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
}

.scan-meta p {
  min-width: 0;
  padding: 16px 18px;
}

.scan-meta p + p {
  border-left: 1px solid var(--line-soft);
}

.scan-meta strong,
.scan-meta span {
  display: block;
}

.scan-meta strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.scan-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.how-to {
  background: var(--white);
}

.how-to-grid {
  align-items: start;
  padding: 76px 0 84px;
}

.how-to-copy {
  min-width: 0;
  grid-column: 1 / span 4;
}

.how-to-copy h2 {
  margin-top: 18px;
  font-size: 44px;
  font-weight: 600;
  line-height: 1.1;
}

.how-to-copy > p:last-child {
  max-width: 400px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.step-grid {
  display: grid;
  min-width: 0;
  grid-column: 6 / span 7;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  list-style: none;
}

.step-grid li {
  min-width: 0;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: background-color 200ms var(--ease);
}

.step-grid li:hover {
  background: var(--soft);
}

.step-grid span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
}

.step-grid h3 {
  margin-top: 34px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.step-grid p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.platform-scope {
  border-top: 1px solid var(--line-soft);
  background: var(--paper);
}

.platform-scope-inner {
  display: grid;
  width: min(calc(100% - 64px), 1280px);
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 64px;
  align-items: start;
  padding: 72px 0;
  margin: 0 auto;
}

.platform-scope h2 {
  margin-top: 16px;
  color: var(--ink);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.1;
}

.platform-scope-copy {
  max-width: 660px;
}

.platform-scope-copy p {
  color: var(--body);
  font-size: 17px;
  line-height: 1.7;
}

.platform-scope-copy a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 18px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 500;
  transition: color 200ms var(--ease);
}

.platform-scope-copy a:hover {
  color: var(--blue-dark);
}

@media (max-width: 1024px) {
  .hero-grid,
  .how-to-grid,
  .platform-scope-inner {
    width: min(calc(100% - 48px), 1280px);
  }

  .hero-grid,
  .how-to-grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 20px;
  }

  .hero-grid {
    padding: 64px 0 76px;
  }

  .hero-copy,
  .scan-panel,
  .how-to-copy,
  .step-grid {
    grid-column: 1 / span 8;
  }

  .scan-panel {
    width: min(100%, 560px);
    justify-self: start;
    margin-top: 24px;
  }

  .how-to-grid {
    padding: 64px 0 72px;
  }

  .step-grid {
    margin-top: 24px;
  }

  .platform-scope-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 64px 0;
  }
}

@media (max-width: 720px) {
  .hero-grid,
  .how-to-grid,
  .platform-scope-inner {
    width: calc(100% - 32px);
  }

  .hero-grid,
  .how-to-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }

  .hero-copy,
  .scan-panel,
  .how-to-copy,
  .step-grid {
    grid-column: 1 / span 4;
  }

  .hero-grid {
    padding: 48px 0 calc(62px + env(safe-area-inset-bottom, 0px));
  }

  .hero-copy h1 {
    margin-top: 18px;
    font-size: 44px;
    line-height: 1.08;
  }

  .hero-lead {
    margin-top: 22px;
    font-size: 17px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .hero-points {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 30px;
  }

  .hero-points li {
    display: grid;
    min-height: 70px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 4px 10px;
    align-items: center;
    padding: 12px 14px;
  }

  .hero-points strong {
    margin-top: 0;
  }

  .hero-points p {
    grid-column: 2;
    margin-top: 0;
  }

  .scan-panel {
    margin-top: 14px;
  }

  .scan-head {
    min-height: 80px;
    padding: 16px 18px;
  }

  .scan-head h2 {
    font-size: 18px;
  }

  .qr-figure {
    padding: 16px 18px;
  }

  .scan-meta {
    grid-template-columns: 1fr;
  }

  .scan-meta p + p {
    border-top: 1px solid var(--line-soft);
    border-left: 0;
  }

  .how-to-grid {
    padding: 54px 0 calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .how-to-copy h2 {
    margin-top: 14px;
    font-size: 36px;
  }

  .how-to-copy > p:last-child {
    margin-top: 16px;
  }

  .step-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 26px;
  }

  .step-grid li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 4px 10px;
    padding: 18px;
  }

  .step-grid h3 {
    margin-top: 0;
    font-size: 18px;
  }

  .step-grid p {
    grid-column: 2;
    margin-top: 0;
  }

  .platform-scope-inner {
    padding: 54px 0 calc(60px + env(safe-area-inset-bottom, 0px));
  }

  .platform-scope h2 {
    margin-top: 14px;
    font-size: 36px;
  }

  .platform-scope-copy p {
    font-size: 16px;
  }

}

@media (max-width: 420px) {

  .hero-copy h1 {
    font-size: 38px;
  }

  .scan-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
}

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

  .primary-link:active,
  .secondary-link:active {
    transform: none;
  }
}

.open-instructions-mobile {
  display: none;
}

@media (max-width: 720px) {
  .open-instructions-desktop {
    display: none;
  }

  .open-instructions-mobile {
    display: inline-flex;
  }
}
