/* Home page. Tokens come from the app icon: paper, ink and the red quarter. */
:root {
  color-scheme: light dark;
  --paper: #F6F3ED;
  --ink: #15151A;
  --red: #E8402A;
  --muted: #66625B;
  --rule: #E1DBD0;
  --surface: #FFFFFF;
  --bubble: #FFFFFF;
  --chat: #EDEDED;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #15151A; --ink: #F6F3ED; --muted: #A29E96; --rule: #2C2B30; --surface: #1F1F24; --bubble: #2C2C2C; --chat: #111111; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "PingFang TC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 4px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.top nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a[aria-current] { color: var(--ink); font-weight: 600; }
.top nav a:hover { color: var(--ink); }

/* Hero: copy and the live demo side by side */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 56px; align-items: start; padding: 40px 0 88px; }
h1 { font-size: clamp(40px, 6.2vw, 72px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 24px; text-wrap: balance; }
.lede { font-size: 20px; line-height: 1.5; color: var(--muted); max-width: 34em; margin: 0 0 32px; }
.get { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
/* Apple's badge, shown as supplied; at least 40 px tall per Apple's guidelines. */
.store { display: inline-block; line-height: 0; border-radius: 9px; }
.store img { height: 54px; width: auto; display: block; }
.store-qr { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; line-height: 1.35; }
.store-qr svg { width: 72px; height: 72px; background: #fff; padding: 6px; border-radius: 8px; }
.wechat-tip { display: none; margin: 14px 0 0; font-size: 14px; color: var(--muted); }
.in-wechat .wechat-tip { display: block; }
.in-wechat .store-qr { display: none; }

/* The demo: a link field above a WeChat-like chat */
.demo { position: relative; }
.demo::before {
  /* The icon's red quarter, behind the chat. */
  content: ""; position: absolute; right: -20px; bottom: -32px; width: 62%; height: 58%; background: var(--red); border-radius: 0 0 28px 0;
}
.demo form { position: relative; display: flex; gap: 8px; margin-bottom: 10px; }
.demo input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 13px 14px; border-radius: 12px;
  border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink);
}
.demo input:focus { border-color: var(--ink); outline: none; }
.demo button {
  font: inherit; font-size: 16px; font-weight: 600; padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--red); color: #fff; cursor: pointer; white-space: nowrap;
}
.demo button:disabled { opacity: .6; cursor: progress; }
.samples { position: relative; display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.samples button { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: var(--ink); }
.samples button:focus-visible { outline: 3px solid var(--red); }
.chat { position: relative; background: var(--chat); border-radius: 22px; padding: 18px 16px 22px; min-height: 420px; }
.msg { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.msg + .msg { margin-top: 18px; }
.who { font-size: 12px; color: var(--muted); }
.bare {
  background: #95EC69; color: #111; padding: 9px 12px; border-radius: 6px; max-width: 86%;
  font-size: 15px; line-height: 1.4; overflow-wrap: anywhere;
}
.status { min-height: 1.4em; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.status.error { color: var(--red); }

/* The card: a port of TileTemplate.swift at the app's 360 pt width */
.card-frame { width: 100%; max-width: 300px; }
.card {
  width: 360px; transform-origin: top left; overflow: hidden; border-radius: 6px;
  color: #121214; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", system-ui, sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.card .photo { position: relative; display: block; width: 360px; object-fit: cover; }
.card .over { position: relative; }
.card .over .info { position: absolute; left: 0; right: 0; bottom: 0; }
.card .info { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.card .text-only { padding: 22px; min-height: 288px; display: flex; flex-direction: column; }
.card .text-only .grow { flex: 1; min-height: 28px; }
.card .eyebrow { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.card .fav { width: 16px; height: 16px; border-radius: 4px; background: #fff; padding: 2px; object-fit: contain; }
.card .title { margin: 6px 0 0; font-weight: 700; line-height: 1.22; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card .byline { margin: 6px 0 0; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .foot { display: flex; align-items: flex-end; gap: 12px; }
.card .foot .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; }
.card .foot .url { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .made { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.card .made img { width: 18px; height: 18px; }
.card .qr { width: 70px; height: 70px; padding: 5px; background: #fff; border-radius: 9px; flex: none; }
.card .play {
  position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); display: grid; place-items: center;
}
.card .play::after { content: ""; margin-left: 5px; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }
/* QR template, for links with no preview */
.card.qr-card { background: #fff; padding: 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.card .chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; color: #fff; font-size: 13px; font-weight: 700; }
.card .big-qr { width: 192px; height: 192px; padding: 6px; background: #fff; margin-top: 20px; }
.card .qr-title { font-size: 18px; font-weight: 600; margin: 0; overflow-wrap: anywhere; }
.card .note { font-size: 13px; color: rgba(18, 18, 20, .62); margin: 0; }
.card .mark { font-size: 11px; color: rgba(18, 18, 20, .38); margin-top: 20px; }
.card.loading { opacity: .45; transition: opacity .2s; }

/* Features */
.features { border-top: 1px solid var(--rule); padding: 72px 0 24px; }
.features h2, .closing h2 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 800; margin: 0 0 56px; max-width: 18em; }
.feature { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: center; margin-bottom: 64px; }
.feature img { width: 220px; height: auto; border-radius: 28px; display: block; }
.feature h3 { font-size: 26px; letter-spacing: -0.015em; margin: 0 0 10px; }
.feature p { margin: 0; color: var(--muted); max-width: 30em; font-size: 18px; }
.feature:nth-of-type(even) { grid-template-columns: minmax(0, 1fr) 220px; }
.feature:nth-of-type(even) img { order: 2; }

/* Closing */
.closing { position: relative; overflow: hidden; background: var(--ink); color: var(--paper); border-radius: 28px; padding: 64px 48px; margin: 40px 0 72px; }
.closing::after { content: ""; position: absolute; right: 0; bottom: 0; width: 34%; height: 50%; background: var(--red); }
.closing h2 { margin-bottom: 16px; position: relative; z-index: 1; }
.closing p { position: relative; z-index: 1; color: color-mix(in srgb, var(--paper) 70%, transparent); margin: 0 0 28px; max-width: 30em; }
.closing .store { position: relative; z-index: 1; }

footer.bottom { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; padding: 24px 0 48px; border-top: 1px solid var(--rule); font-size: 14px; color: var(--muted); }
footer.bottom nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer.bottom a { color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 16px; }
  .demo::before { right: -20px; }
  .store-qr { display: none; }
  .feature, .feature:nth-of-type(even) { grid-template-columns: 120px minmax(0, 1fr); gap: 20px; align-items: start; }
  .feature img, .feature:nth-of-type(even) img { width: 120px; border-radius: 18px; order: 0; }
  .feature h3 { font-size: 21px; }
  .feature p { font-size: 16px; }
  .closing { padding: 40px 24px 120px; }
  .closing::after { width: 40%; height: 90px; }
}
@media (max-width: 480px) {
  .top nav .lang { display: none; }
  .lede { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
