/* Shared foundation originally adapted from Minima 2.5.1 (MIT).
   See minima-LICENSE.txt in this directory. */
:root {
  color-scheme: light;
  --background: #ffffff;
  --surface: #f6f8fc;
  --text: #101828;
  --muted: #586579;
  --border: #e1e6ef;
  --link: #2454df;
  --accent: #2454df;
}

* { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
body {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--background);
  color: var(--text);
  font: 400 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-text-size-adjust: 100%;
  font-kerning: normal;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol, figure { margin-bottom: 20px; }
h1, h2, h3 { line-height: 1.25; font-weight: 650; letter-spacing: -0.035em; }
h1 { font-size: clamp(36px, 5vw, 48px); }
h2 { font-size: 25px; }
h3 { font-size: 20px; }
:lang(zh) h1, :lang(ja) h1, :lang(ko) h1 { letter-spacing: -0.02em; }
[id] { scroll-margin-top: 28px; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { color: #153ba5; }
a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
img { max-width: 100%; vertical-align: middle; }
ul, ol { margin-left: 26px; }
li { padding-inline-start: 3px; }
li > ul, li > ol { margin-bottom: 0; }
li + li { margin-top: 7px; }
code {
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.wrapper { width: 100%; max-width: 1136px; margin-inline: auto; padding-inline: 28px; }
.skip-link {
  position: absolute;
  top: -100px;
  left: 20px;
  z-index: 5;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--background);
}
.skip-link:focus { top: 12px; }

.site-header { border-bottom: 1px solid var(--border); background: var(--background); }
.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px 28px;
  min-height: 80px;
  padding-block: 12px;
}
.site-title {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.045em;
  text-decoration: none;
}
.site-title:hover { color: var(--text); }
.brand-mark { flex: 0 0 auto; border-radius: 22%; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.site-nav a {
  padding-block: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.language-menu { position: relative; grid-column: -2; grid-row: 1; }
.language-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.7;
  list-style: none;
  white-space: nowrap;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.language-menu[open] summary { border-color: #a9bce9; background: #f4f7ff; }
.language-options {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 10px);
  z-index: 4;
  min-width: 208px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--background);
  box-shadow: 0 16px 48px #1825401a, 0 2px 8px #18254008;
  list-style: none;
}
.language-options li { margin: 0; padding: 0; }
.language-options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}
.language-options a:hover { background: var(--surface); }
.language-options a[aria-current="true"] { background: #edf2ff; color: #173da9; font-weight: 650; }
.language-options a[aria-current="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.page-content { flex: 1; padding-block: 64px 80px; }
.collection-page .page-content { background: linear-gradient(180deg, #fcfdff, #f6f8fc); }
.collection-page .page-content > .wrapper { padding-top: 20px; }
.collection-intro { position: relative; isolation: isolate; padding-block: 16px 56px; }
.collection-intro::before {
  content: "";
  position: absolute;
  top: 0;
  width: 40px;
  height: 3px;
  background: var(--accent);
}
.collection-intro::after {
  content: "";
  position: absolute;
  top: 20px;
  right: 10px;
  z-index: -1;
  width: 168px;
  height: 168px;
  background-image: linear-gradient(#2454df12 1px, transparent 1px), linear-gradient(90deg, #2454df12 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(135deg, transparent, #000);
}
.collection-intro h1 { margin-bottom: 20px; font-size: clamp(64px, 8vw, 96px); line-height: 1.1; letter-spacing: -0.065em; }
.collection-intro p { max-width: 35ch; margin: 0; color: var(--muted); font-size: 22px; line-height: 1.6; }
.app-list { margin: 0; list-style: none; }
.app-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  align-items: center;
  gap: 36px;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--background);
  box-shadow: 0 4px 24px #18254003;
}
.app-card + .app-card { margin-top: 20px; }
.app-summary { min-width: 0; }
.app-heading { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.app-heading h2 { margin: 0; font-size: 30px; letter-spacing: -0.035em; }
.app-heading h2 a { color: var(--text); text-decoration: none; }
.app-heading h2 a:hover { color: var(--accent); }
.app-heading img { flex: 0 0 auto; border-radius: 22.5%; }
.app-summary > p:first-of-type { margin-bottom: 10px; font-size: 20px; font-weight: 550; line-height: 1.5; letter-spacing: -0.02em; }
.app-summary > p:last-of-type { max-width: 43ch; margin: 0; color: var(--muted); }
.app-links { display: grid; gap: 10px; margin: 0; list-style: none; }
.app-links li { margin: 0; padding: 0; }
.app-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  height: 100%;
  padding: 10px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.5;
  hyphens: auto;
  overflow-wrap: anywhere;
  text-decoration: none;
  transition: background-color 140ms, border-color 140ms;
}
.app-links a::after { content: "\2192"; flex: 0 0 auto; font-size: 17px; }
.app-links a:hover { border-color: #a8b8d9; background: var(--surface); }
.app-links li:first-child a { border-color: var(--text); background: var(--text); color: #fff; }
.app-links li:first-child a:hover { border-color: var(--accent); background: var(--accent); }

.app-page .page-content > .wrapper, .error-page .page-content > .wrapper { max-width: 816px; }
article > h1 { margin-bottom: 20px; }
article > h1 + p { color: var(--muted); font-size: 18px; }
article h2 { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--border); }
article h3 { margin-top: 28px; }
article li { margin-bottom: 6px; }
article strong { font-weight: 600; }
table { width: 100%; margin-bottom: 28px; border-collapse: collapse; font-size: 15px; text-align: left; }
th, td { padding: 13px 16px; border: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface); color: var(--text); font-weight: 600; }
tr:nth-child(even) { background: #fafbfe; }

.product-gallery { margin-block: 36px; }
.screenshot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.screenshot-grid figure { min-width: 0; margin: 0; }
.screenshot-grid img, .ipad-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.65; }
figcaption strong { display: block; margin-bottom: 4px; color: var(--text); font-weight: 600; }
.screenshot-more { margin-top: 28px; }
.screenshot-more summary { margin-bottom: 20px; padding-block: 10px; color: var(--link); cursor: pointer; font-weight: 550; }
.ipad-screenshot { max-width: 560px; margin-inline: auto; }

.site-footer { padding-block: 36px; border-top: 1px solid var(--border); background: #fbfcfe; }
.footer-heading { margin-bottom: 8px; font-size: 16px; font-weight: 650; letter-spacing: -0.02em; }
.site-footer p { color: var(--muted); font-size: 14px; }
.site-footer a { color: var(--muted); }
.collection-page .site-footer .wrapper { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 32px; }
.collection-page .site-footer p { margin: 0; }
.collection-page .site-footer .footer-heading { color: var(--text); }
.copyright { margin-bottom: 0; color: var(--muted); }
.collection-page .copyright { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.copyright small { font-size: 12px; }
.footer-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.footer-columns p:last-child { margin-bottom: 0; }

@media (max-width: 800px) {
  .app-page .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; }
  .app-card { grid-template-columns: 1fr; gap: 28px; }
  .app-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-links li:first-child { grid-column: 1 / -1; }
  .collection-intro::after { width: 120px; height: 120px; opacity: 0.7; }
}

@media (max-width: 600px) {
  .wrapper { padding-inline: 20px; }
  .header-inner { min-height: 72px; gap: 12px 16px; }
  .app-page .site-title { font-size: 18px; letter-spacing: -0.04em; }
  .app-page .brand-mark { width: 24px; height: 24px; }
  .site-nav { column-gap: 20px; }
  .site-nav a { padding-block: 5px; font-size: 13px; }
  .page-content { padding-block: 40px 56px; }
  .collection-page .page-content > .wrapper { padding-top: 12px; }
  .collection-intro { padding-bottom: 36px; }
  .collection-intro h1 { font-size: 64px; }
  .collection-intro p { font-size: 18px; }
  .collection-intro::after { width: 96px; height: 96px; }
  .app-card { padding: 24px; border-radius: 12px; }
  .app-heading { gap: 14px; margin-bottom: 20px; }
  .app-heading h2 { font-size: 26px; }
  .app-summary > p:first-of-type { font-size: 18px; }
  .app-summary > p:last-of-type { font-size: 15px; }
  .app-links a { gap: 8px; padding-inline: 12px; font-size: 13px; }
  .app-page h1 { font-size: 36px; }
  article h2 { margin-top: 36px; padding-top: 24px; font-size: 23px; }
  th, td { padding: 9px 10px; }
  table { font-size: 14px; }
  .screenshot-grid { grid-template-columns: 1fr; gap: 30px; max-width: 390px; margin-inline: auto; }
  .footer-columns, .collection-page .site-footer .wrapper { grid-template-columns: 1fr; gap: 12px; }
  .collection-page .copyright { grid-column: auto; grid-row: auto; margin-top: 8px; }
}

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