:root {
  color-scheme: light;
  --paper: #fff;
  --stage: #f1f2f4;
  --ink: #17181b;
  --muted: #565a62;
  --line: #d8dbe0;
  --dark: #16171a;
  --gutter: clamp(24px, 5vw, 80px);
  --content: 1200px;
  --masthead-height: 80px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--masthead-height) + 24px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.75 var(--font); }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { line-height: 1.22; font-weight: 650; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; }
img { display: block; max-width: 100%; height: auto; }
[hidden] { display: none !important; }
:is(a, button, input):focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.wrap { width: min(var(--content), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.skip-link { position: absolute; top: 8px; left: 8px; padding: 10px 16px; clip-path: inset(50%); }
.skip-link:focus { z-index: 4; clip-path: none; background: var(--paper); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 49px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  transition: background-color .16s, border-color .16s, transform .16s;
}
.button-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.button-primary:hover { background: #383a40; border-color: #383a40; }
.button-secondary { background: transparent; border-color: #8c9098; }
.button-secondary:hover { background: #fff; border-color: #555961; }
.button:active { transform: translateY(1px); }
.button:focus-visible { outline-color: #5c6470; }
.text-link { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: .38em; text-decoration-thickness: 1px; }
.text-link:hover { text-decoration-thickness: 2px; }

.site-header { position: sticky; z-index: 10; top: 0; background: var(--paper); border-bottom: 1px solid #e4e6e9; }
.masthead { position: relative; display: flex; min-height: var(--masthead-height); align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; padding-block: 6px; font-size: 21px; font-weight: 700; letter-spacing: -.045em; }
.brand img { width: 38px; height: 38px; border-radius: 8px; }
.masthead .brand { flex: none; gap: 11px; font-size: 23px; }
.brand-mark { position: relative; display: block; overflow: hidden; flex: none; width: 48px; border-radius: 10px; }
.brand-mark img { width: 100%; height: auto; border-radius: 0; }
.site-nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); color: var(--muted); font-size: 15px; font-weight: 500; }
.site-nav a { display: inline-flex; align-items: center; min-height: 48px; white-space: nowrap; }
.site-nav a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: .4em; }
.masthead-actions { display: flex; align-items: center; gap: 12px; }
.masthead-actions .button { min-height: 44px; padding: 9px 16px; font-size: 14px; }
.menu-toggle { display: none; min-height: 44px; padding: 0 2px 0 8px; border: 0; background: transparent; font-size: 13px; white-space: nowrap; }

.product-hero { background: var(--stage); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(0, 1.06fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  min-height: min(800px, calc(100svh - var(--masthead-height)));
  padding-block: clamp(54px, 8vw, 110px);
}
.hero-copy h1 span { display: block; }
.product-name { margin: 0 0 18px -.045em; font-size: clamp(83px, 9vw, 128px); font-weight: 700; line-height: .96; letter-spacing: -.095em; }
.product-title { font-size: clamp(32px, 4.05vw, 59px); line-height: 1.18; letter-spacing: -.055em; }
.hero-copy > p { max-width: 30em; margin-top: 24px; color: var(--muted); font-size: 17px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 31px; }
.hero-copy .device-note { margin-top: 15px; font-size: 13px; }
.hero-visual { width: 100%; min-width: 0; }
.hero-visual img { width: 100%; height: auto; mix-blend-mode: multiply; }

.feature-band { background: var(--dark); color: var(--paper); }
.feature-grid, .guide-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 9vw, 128px); align-items: start; padding-block: clamp(60px, 8vw, 115px); }
.feature-intro h2, .guide-band h2, .footer-grid h2 { font-size: clamp(29px, 4vw, 55px); letter-spacing: -.045em; }
.feature-intro p { margin-top: 22px; max-width: 24em; color: #c7c9ce; }
.feature-intro .text-link { margin-top: 16px; font-size: 14px; }
.feature-list { border-top: 1px solid #45474f; }
.guide-band { background: var(--paper); }
.guide-band h2 { font-size: clamp(28px, 3.5vw, 46px); }
.guide-band p { margin-top: 16px; color: var(--muted); }
.guide-links { display: grid; border-top: 1px solid var(--line); }
.guide-links a { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: 60px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }

.site-footer { background: var(--stage); }
.footer-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 38px; align-items: start; padding: 48px 0 32px; }
.footer-grid h2 { font-size: 25px; }
.footer-grid p { margin-top: 10px; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 26px; }
.footer-links a, .footer-meta a { display: inline-flex; align-items: center; min-height: 42px; font-size: 13px; }
.footer-links a:hover, .footer-meta a:hover { text-decoration: underline; text-underline-offset: .35em; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; min-height: 60px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.page-wrap { padding-block: 34px clamp(55px, 8vw, 100px); }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: 13px; }
.breadcrumb a:hover { text-decoration: underline; text-underline-offset: .3em; }
.page-heading { margin: 38px 0 clamp(34px, 6vw, 72px); }
.page-heading h1 { font-size: clamp(36px, 6vw, 70px); letter-spacing: -.055em; }
.page-heading p { margin-top: 16px; color: var(--muted); font-size: 17px; }
.install-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(24px, 8vw, 104px); align-items: start; }
.install-grid h2, .package-section h2, .purchase-panel h2 { font-size: clamp(23px, 3vw, 34px); letter-spacing: -.025em; }
.install-content > p, .package-section p { margin-top: 13px; color: var(--muted); }
.source-box { margin-top: 28px; padding: 19px 20px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--stage); }
.source-box label { display: block; font-size: 13px; color: var(--muted); }
.source-row { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
.source-row input { width: 100%; min-width: 0; padding: 8px 0; border: 0; background: transparent; color: var(--ink); font-size: clamp(16px, 2.3vw, 20px); }
.source-row .button { min-height: 44px; padding-inline: 15px; }
.copy-status { min-height: 22px; padding-top: 4px; color: var(--muted); font-size: 12px; }
.install-steps { margin: 26px 0 12px; padding-inline-start: 24px; }
.install-steps li { padding: 4px 0 4px 6px; }
.install-visual { display: grid; place-items: center; padding: 24px; background: var(--stage); border-radius: 10px; }
.install-visual img { width: min(100%, 244px); height: auto; border-radius: 6px; }
.package-section { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 28px; align-items: center; margin-top: 55px; padding-top: 35px; border-top: 1px solid var(--line); }
.package-section .package-message { margin: 0; font-size: 14px; }

.document-grid { display: grid; grid-template-columns: minmax(150px, .3fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 70px); align-items: start; }
.document-nav { display: grid; gap: 2px; padding: 12px 0; border-block: 1px solid var(--line); }
.document-nav a { display: flex; align-items: center; min-height: 43px; padding: 4px 10px; border-radius: 5px; color: var(--muted); font-size: 14px; }
.document-nav a:hover, .document-nav a[aria-current="page"] { background: var(--stage); color: var(--ink); }
.cms-article { min-width: 0; max-width: 820px; overflow-wrap: anywhere; line-height: 1.85; }
.cms-article p { margin-block: 9px; }
.cms-article img { max-width: 100% !important; height: auto !important; }
.cms-article a { text-decoration: underline; text-underline-offset: .26em; }
.cms-article pre { max-width: 100%; overflow: auto; padding: 16px; border: 1px solid var(--line); background: var(--stage); }
.cms-article table { max-width: 100%; }
.purchase-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px; padding: 32px; background: var(--stage); border-radius: 10px; margin-bottom: 32px; }
.purchase-panel p { margin-top: 11px; color: var(--muted); }

.support-contact {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr);
  align-items: start;
  gap: clamp(28px, 6vw, 88px);
  padding-block: 24px;
  border-top: 1px solid var(--line);
}
.support-contact p { color: var(--muted); font-size: 17px; }
.support-contact img { width: 100%; max-width: 719px; height: auto; }

@media (max-width: 1000px) {
  .masthead { gap: 18px; }
  .hero-grid { min-height: min(690px, calc(100svh - var(--masthead-height))); gap: 20px; }
  .hero-copy > p { font-size: 16px; }
}
@media (max-width: 820px) {
  :root { --masthead-height: 70px; }
  .masthead { flex-wrap: wrap; gap: 0 16px; }
  .masthead .brand { gap: 8px; font-size: 21px; }
  .brand-mark { width: 42px; border-radius: 9px; }
  .masthead-actions .button { font-size: 13px; }
  .site-nav { order: 3; width: 100%; flex-wrap: wrap; gap: 0 22px; padding-bottom: 10px; }
  .js .menu-toggle { display: inline-flex; align-items: center; }
  .js .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 11px 18px; border: 1px solid var(--line); border-radius: 0 0 9px 9px; background: var(--paper); }
  .js .site-nav.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .js .site-nav a + a { border-top: 1px solid #eaebed; }
  .hero-grid { min-height: 0; padding-block: 60px; }
  .product-name { font-size: clamp(69px, 12vw, 98px); }
  .hero-copy > p { margin-top: 18px; }
  .hero-actions { margin-top: 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 12px; }
  .footer-links { justify-content: flex-start; }
  .install-grid { gap: 26px; }
}
@media (max-width: 620px) {
  .support-contact { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .hero-grid, .feature-grid, .guide-grid, .install-grid, .document-grid, .package-section, .purchase-panel { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { gap: 24px; padding-block: 44px 28px; }
  .hero-copy { max-width: 480px; }
  .product-name { font-size: clamp(70px, 19vw, 92px); margin-bottom: 14px; }
  .product-title { font-size: clamp(34px, 8.4vw, 44px); }
  .hero-copy > p { font-size: 15px; }
  .hero-copy .device-note { margin-top: 12px; }
  .hero-actions .button { min-height: 47px; padding-inline: 15px; }
  .hero-visual { max-width: 460px; margin-inline: auto; }
  .feature-grid, .guide-grid { gap: 26px; padding-block: 48px; }
  .feature-intro h2 br { display: none; }
  .feature-intro p { margin-top: 14px; }
  .page-heading { margin-top: 27px; }
  .page-heading p { font-size: 15px; }
  .source-box { padding: 15px 14px 10px; }
  .source-row { flex-wrap: wrap; }
  .source-row input { flex: 1 1 160px; }
  .source-row .button { flex: 0 0 auto; }
  .install-visual { padding: 18px; }
  .package-section { gap: 12px; margin-top: 40px; padding-top: 25px; }
  .document-nav { grid-template-columns: 1fr 1fr; }
  .purchase-panel { padding: 23px; gap: 15px; }
  .purchase-panel .button { width: fit-content; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

.qr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-top: 22px;
}
.qr-item { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--stage); }
.qr-item h2 { margin-bottom: 13px; font-size: 17px; }
.qr-item p { margin-bottom: 0; color: var(--muted); font-size: 14px; }
.qr-frame {
  position: relative;
  overflow: hidden;
  width: min(100%, 170px);
  aspect-ratio: 1;
  background: #fff;
}
.cms-article .qr-frame img {
  position: absolute;
  width: var(--qr-width);
  max-width: none !important;
  left: var(--qr-left);
  top: var(--qr-top);
}
.qr-support-qq { --qr-width: 278.68%; --qr-left: -3.49%; --qr-top: -34.88%; }
.qr-support-wechat { --qr-width: 279.77%; --qr-left: -158.75%; --qr-top: -33.46%; }
.qr-group-two { --qr-width: 507.61%; --qr-left: -28.43%; --qr-top: -40.61%; }
.qr-group-three { --qr-width: 512.82%; --qr-left: -197.44%; --qr-top: -43.08%; }
.qr-group-telegram { --qr-width: 571.43%; --qr-left: -406.29%; --qr-top: -50.86%; }

/* Each half of the transparent artwork displays one complete device. */
.hero-visual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hero-device { position: relative; min-width: 0; overflow: hidden; }
.hero-device-display {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  font-family: "AMG Manrope", "AMG Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  pointer-events: none;
}
.hero-device img {
  width: 200%;
  max-width: none;
  mix-blend-mode: normal;
}
.hero-device--second img { transform: translateX(-50%); }

/* Show the two silhouettes from the supplied 1080 × 1080 image. */
.hero-visual--supplied { gap: clamp(12px, 3.5vw, 42px); padding-inline: 4.5%; }
.hero-visual--supplied .hero-device {
  aspect-ratio: 414 / 868;
  overflow: visible;
  isolation: isolate;
}
.hero-visual--supplied .hero-device-screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 round 16.9% / 8%);
}
.hero-visual--supplied .hero-device::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: -1.152% -2.657% -1.382%;
  background: url("./amg-phone-frame.svg") center / 100% 100% no-repeat;
  pointer-events: none;
}
.hero-visual--supplied .hero-device img {
  position: absolute;
  top: -12.212%;
  left: -24.155%;
  width: 260.87%;
  height: auto;
  transform: none;
}
.hero-visual--supplied .hero-device--second img { left: -136.715%; }
.hero-import-switch { display: none; }

/* Positions follow the Toolbox and Import AMG Data rows in the supplied artwork. */
.hero-visual--supplied .hero-device { --cue-top: 55.9%; --cue-height: 4.85%; --cue-delay: 820ms; }
.hero-visual--supplied .hero-device--second { --cue-top: 44.65%; --cue-height: 6.4%; --cue-delay: 1340ms; }

@media screen and (min-width: 1100px) {
  .hero-grid { grid-template-columns: minmax(0, .89fr) minmax(0, 1.11fr); }
}

@media screen and (prefers-reduced-motion: no-preference) {
  .amg-home .brand-mark::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(112deg, transparent 35%, rgb(255 255 255 / 42%) 50%, transparent 65%);
    pointer-events: none;
    animation: amg-logo-glint 680ms cubic-bezier(.2, .65, .3, 1) 110ms both;
  }
  @keyframes amg-logo-glint {
    from { transform: translateX(-125%); }
    to { transform: translateX(125%); }
  }

  .hero-device { animation: amg-device-arrive 620ms cubic-bezier(.22, .61, .36, 1) both; }
  .hero-device--second { animation-delay: 120ms; }
  @keyframes amg-device-arrive {
    from { transform: translateY(16px); }
    to { transform: translateY(0); }
  }

  .hero-visual--supplied .hero-device::after {
    content: "";
    position: absolute;
    z-index: 1;
    inset-inline: 7.5%;
    top: var(--cue-top);
    height: var(--cue-height);
    border-radius: 6px;
    background: rgb(0 122 255 / 10%);
    box-shadow: inset 0 0 0 1px rgb(0 105 230 / 46%);
    opacity: 0;
    pointer-events: none;
    animation: amg-device-cue 760ms ease-in-out var(--cue-delay) both;
  }
  @keyframes amg-device-cue {
    0%, 100% { opacity: 0; }
    22%, 58% { opacity: 1; }
  }

  .hero-import-switch {
    display: block;
    position: absolute;
    left: 77.05%;
    top: 45.97%;
    width: 12.32%;
    height: 3.69%;
    border-radius: 999px;
    pointer-events: none;
    background: #e6e6e8;
    animation: amg-import-enable 360ms cubic-bezier(.2, .65, .35, 1) 1520ms both;
  }
  .hero-import-switch::after {
    content: "";
    position: absolute;
    top: 8%;
    left: 5%;
    width: 51%;
    height: 84%;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px rgb(0 0 0 / 20%);
    animation: amg-import-slide 360ms cubic-bezier(.2, .65, .35, 1) 1520ms both;
  }
  @keyframes amg-import-enable {
    to { background: #30c85a; }
  }
  @keyframes amg-import-slide {
    to { transform: translateX(76%); }
  }
}

@media screen and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .hero-visual--supplied .hero-device { translate: 0 0; transition: translate 240ms cubic-bezier(.2, .7, .3, 1); }
  .hero-visual--supplied .hero-device:hover { translate: 0 -4px; }
}

@media screen {
  :root {
    color-scheme: dark;
    --paper: #090909;
    --stage: #151515;
    --ink: #f5f5f5;
    --muted: #b7b7b7;
    --line: #383838;
    --dark: #141414;
  }

  .site-header { border-color: var(--line); }
  .js .site-nav a + a { border-color: var(--line); }

  .product-hero { background: var(--paper); }

  .amg-home .site-header,
  .amg-home .site-nav,
  .amg-home .product-hero {
    background: #000;
  }

  .amg-home .site-header { border-bottom-color: #292929; }

  .amg-home .guide-band {
    background: linear-gradient(155deg, #161616, #090909 72%);
  }

  .button-primary:hover { background: #dedede; border-color: #dedede; }
  .button-secondary { border-color: #777; }
  .button-secondary:hover { background: #222; border-color: #aaa; }
  .button:focus-visible { outline-color: #e1e1e1; }
  .source-row input { color-scheme: dark; }

  .feature-band { color: var(--ink); }
  .feature-intro p { color: var(--muted); }
  .feature-list { border-color: var(--line); }
  .site-footer { background: var(--stage); }

  /* Old CMS documents contain inline dark text and light code backgrounds. */
  .cms-article :where([style*="color:" i], font[color]) { color: var(--ink) !important; }
  .cms-article :where([style*="background-color:" i]) { background-color: var(--stage) !important; }
  .cms-article a { color: var(--ink); }
}
