/* ===== MDN Apps: edit the tokens below to rebrand ===== */
/* Inter, hosted here (licence: assets/fonts/OFL.txt). Latin characters, weights 400 to 600.
   Apple devices use their own font first, so they don't download it. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("assets/fonts/inter.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #fff;
  --alt: #f5f5f7;
  --card: #fff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #d2d2d7;
  --hairline: rgba(0,0,0,.08);
  --link: #0066cc;
  --button: #0071e3;
  --button-hover: #006edb;
  --button-ink: #fff;
  --control: #e8e8ed;
  --control-hover: #dcdce1;
  --control-on: #fff;
  --nav: rgba(251,251,253,.82);
  --band: #000;
  --band-ink: #f5f5f7; /* the showcase bands stay dark in both themes */
  --band-muted: #a1a1a6;
  --band-link: #2997ff;
  --font: -apple-system, BlinkMacSystemFont, "Inter", system-ui, sans-serif;
}
/* Dark theme. theme.js sets data-theme on <html> when a visitor picks Light or Dark; with neither (Auto)
   the device decides. The two dark blocks below must stay identical. */
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000;
    --alt: #111113;
    --card: #1c1c1e;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --line: #38383a;
    --hairline: rgba(255,255,255,.14);
    --link: #2997ff;
    --control: #2c2c2e;
    --control-hover: #3a3a3c;
    --control-on: #636366;
    --nav: rgba(22,22,23,.82);
    --band: #161618;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000;
  --alt: #111113;
  --card: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --line: #38383a;
  --hairline: rgba(255,255,255,.14);
  --link: #2997ff;
  --control: #2c2c2e;
  --control-hover: #3a3a3c;
  --control-on: #636366;
  --nav: rgba(22,22,23,.82);
  --band: #161618;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; scroll-behavior: auto !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.47 var(--font); letter-spacing: -.012em; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.08; letter-spacing: -.025em; font-weight: 600; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--button); outline-offset: 3px; }
.wrap { width: min(1024px, 100% - 44px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 6px; z-index: 100; background: var(--card); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Buttons and links: every control is at least 44px tall */
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; background: var(--button); color: var(--button-ink); border-radius: 99px; padding: 0 22px; }
.pill:hover { background: var(--button-hover); text-decoration: none; }
/* looks 32px tall, but the clear border keeps the tap area at 44px */
.pill--small { min-height: 44px; padding: 0 14px; border: 6px solid transparent; background-clip: padding-box; font-size: 14px; white-space: nowrap; }
.pill--small:hover { background-clip: padding-box; }
.more { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.more::after { content: "\203A"; font-size: 1.15em; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: center; margin-top: 24px; }

/* Header, product bar and footer */
.nav, .subnav { z-index: 20; background: var(--nav); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--hairline); }
.nav { position: sticky; top: 0; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 52px; }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; color: var(--ink); font-size: 14px; white-space: nowrap; }
.nav .brand { justify-content: flex-start; gap: 8px; font-size: 15px; font-weight: 600; }
.nav nav { display: flex; gap: clamp(2px, 2.4vw, 26px); margin-left: auto; }
/* Theme button and its menu, added by theme.js */
.theme { position: relative; flex: none; }
.theme svg { width: 20px; height: 20px; flex: none; }
.theme__button { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 99px; background: none; color: var(--ink); }
.theme__button:hover, .theme__button[aria-expanded="true"] { background: var(--control); }
.theme__button:focus-visible { outline-offset: -3px; }
.theme__menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 160px; padding: 6px; background: var(--card); border: 1px solid var(--hairline); border-radius: 18px; box-shadow: 0 16px 48px rgba(0,0,0,.22); }
.theme__menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none; color: var(--ink); font-size: 15px; text-align: left; }
.theme__menu button:hover { background: var(--control); }
.theme__menu button:focus-visible { outline-offset: -3px; }
.theme__menu button[aria-pressed="true"] { font-weight: 600; }
.theme__menu button[aria-pressed="true"]::after { content: "\2713"; margin-left: auto; color: var(--link); }
/* phones: tighter header so the button fits beside the name and links */
@media (max-width: 419px) {
  .nav__inner, .subnav__inner { width: calc(100% - 24px); }
  .nav nav { gap: 0; }
  .nav nav a { padding: 0 5px; } /* keeps the words apart */
  .subnav strong { display: none; } /* the download button needs the room */
  .subnav__inner > .theme { margin-left: auto; }
}
@media (max-width: 389px) { .nav .brand span { display: none; } } /* logo alone on narrow phones */

/* App pages: the header scrolls away and the download bar takes its place */
.app-page .nav { position: relative; }
.subnav { position: fixed; top: 0; left: 0; right: 0; }
.subnav__inner { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.subnav strong { margin-right: auto; font-size: 19px; font-weight: 600; }
.footer { background: var(--alt); color: var(--muted); font-size: 14px; padding: 32px 0 28px; }
.footer__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.footer strong { display: block; color: var(--ink); margin-bottom: 2px; }
/* lines up with the first link in the neighbouring columns */
.footer__credits p { display: flex; align-items: center; min-height: 44px; margin: 0; }
.footer a { display: flex; align-items: center; min-height: 44px; width: max-content; min-width: 44px; color: var(--muted); }

/* Home: opening */
.hero { text-align: center; padding: clamp(64px, 9vw, 112px) 0 clamp(56px, 7vw, 88px); }
.hero h1 { font-size: clamp(44px, 7.4vw, 88px); max-width: 9.5em; margin-inline: auto; }
.hero p { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.4; color: var(--muted); max-width: 29em; margin: 22px auto 0; }

/* Home: featured apps */
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; overflow: hidden; padding-top: 56px; background: var(--alt); }
.tile h2 { font-size: clamp(38px, 5vw, 56px); }
.tile p { font-size: clamp(18px, 2vw, 24px); margin: 10px 20px 0; }
.tile__shots { display: flex; justify-content: center; align-items: flex-start; gap: clamp(14px, 3vw, 28px); width: 100%; height: clamp(280px, 45vw, 480px); overflow: hidden; margin-top: 32px; }
.tile__shots img { width: clamp(190px, 24vw, 250px); height: auto; border-radius: 34px; box-shadow: 0 20px 60px rgba(0,0,0,.28); }
.tile__shots img:nth-child(odd):not(:only-child) { margin-top: 56px; }
.tile--dark { background: var(--band); color: var(--band-ink); }
.tile--dark p { color: var(--band-muted); }
.tile--dark .more { color: var(--band-link); }
/* Home: all apps */
.catalogue { background: var(--alt); padding: clamp(48px, 8vw, 96px) 0; }
.catalogue h2 { font-size: clamp(34px, 4.4vw, 48px); text-align: center; margin-bottom: 36px; }
.segmented { display: flex; width: max-content; max-width: 100%; margin: -8px auto 40px; padding: 3px; background: var(--control); border-radius: 99px; }
.segmented button { min-height: 44px; min-width: 64px; border: 0; background: none; border-radius: 99px; padding: 0 20px; font-size: 14px; }
.segmented button[aria-pressed="true"] { background: var(--control-on); box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.app { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; align-content: start; gap: 14px 16px; background: var(--card); border-radius: 18px; padding: 18px; }
.app:hover { box-shadow: 0 8px 28px rgba(0,0,0,.1); }
.app img { width: 64px; height: 64px; border-radius: 15px; }
.app h4 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.app p { font-size: 14px; color: var(--muted); }
/* the app name is the link; it stretches over the whole card */
.app__link { color: var(--ink); }
.app__link::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.app__link:focus-visible { outline: none; }
.app__link:focus-visible::after { outline: 3px solid var(--button); outline-offset: 2px; }
.app__chevron { color: var(--muted); font-size: 24px; }
.group + .group { margin-top: 48px; }
.group h3 { font-size: 24px; margin-bottom: 16px; }

/* Card controls: store links and Preview. They sit above the card's own link */
/* as wide as its buttons, so the rest of the card stays clickable; wraps when they don't fit */
.app__actions { grid-column: 1 / -1; justify-self: start; min-width: 0; position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: -4px -6px -6px; }
.stores { display: flex; flex-wrap: wrap; gap: 2px; list-style: none; margin: 0; padding: 0; }
/* text buttons, 32px tall like the small pill; the clear border keeps the tap area at 44px */
.store a, .preview { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 6px solid transparent; border-radius: 99px; background: var(--control) padding-box; color: var(--link); font-size: 14px; font-weight: 600; white-space: nowrap; }
.store a:hover, .preview:hover { background-color: var(--control-hover); text-decoration: none; }
.store a:focus-visible, .preview:focus-visible { outline-offset: -6px; }

/* Screenshot quick view */
html:has(.quickview[open]) { overflow: hidden; }
.quickview { width: min(420px, 100% - 24px); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: 24px; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.quickview::backdrop { background: rgba(0,0,0,.6); }
.quickview__box { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 20px; }
.quickview__head, .quickview__controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quickview__head h2 { font-size: 21px; }
.quickview__controls { justify-content: center; font-size: 14px; color: var(--muted); }
.quickview__controls p { min-width: 4.5em; text-align: center; }
.quickview__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior: contain; }
.quickview__track::-webkit-scrollbar { display: none; }
.quickview__track > div { flex: 0 0 100%; display: flex; justify-content: center; scroll-snap-align: center; scroll-snap-stop: always; }
/* fit the window: leave room for the title, controls and buttons */
.quickview__track img { width: auto; height: clamp(220px, 100vh - 290px, 600px); height: clamp(220px, 100dvh - 290px, 600px); aspect-ratio: 1 / 2; border-radius: 22px; box-shadow: inset 0 0 0 1px var(--hairline); }
.quickview .actions { margin-top: 0; }
.round { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border: 6px solid transparent; border-radius: 99px; background: var(--control) padding-box; font-size: 20px; line-height: 1; padding: 0 0 2px; }
.round:hover { background-color: var(--control-hover); }
.round:focus-visible { outline-offset: -6px; }
.round[aria-disabled="true"] { opacity: .35; cursor: default; }

/* Home: about */
.about { text-align: center; padding: 120px 0; }
.about h2 { font-size: clamp(34px, 4.8vw, 56px); max-width: 12em; margin-inline: auto; }
.about__lede { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.38; font-weight: 500; color: var(--muted); max-width: 27em; margin: 28px auto 0; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin-top: 80px; text-align: left; }
.principles div { border-top: 1px solid var(--line); padding-top: 20px; }
.principles h3 { font-size: 21px; margin-bottom: 8px; }
.principles p { color: var(--muted); }
blockquote { font-size: clamp(24px, 3.2vw, 36px); line-height: 1.25; font-weight: 600; max-width: 19em; margin: 96px auto 0; }

/* App pages */
.product { background: var(--alt); text-align: center; overflow: hidden; padding-top: 72px; }
.product__icon { width: 88px; height: 88px; border-radius: 20px; margin: 0 auto 22px; }
.product h1 { font-size: clamp(48px, 9vw, 96px); }
.product h1 span { display: block; font-size: clamp(21px, 2.8vw, 32px); letter-spacing: -.012em; margin-top: 10px; }
.product p { font-size: clamp(18px, 2.1vw, 23px); line-height: 1.4; color: var(--muted); max-width: 30em; margin: 18px auto 0; }
.product h1, .product p { padding-inline: 22px; } /* side gutter on phones */
.product__shot { width: clamp(240px, 30vw, 300px); height: auto; margin: 56px auto -120px; border-radius: 40px; box-shadow: 0 30px 80px rgba(0,0,0,.28); }
.band { background: var(--band); color: var(--band-ink); padding: 110px 0; }
.band__inner { display: grid; grid-template-columns: 1fr 300px; gap: 64px; align-items: center; }
.band h2 { font-size: clamp(36px, 5vw, 56px); }
.band p { font-size: 21px; line-height: 1.4; color: var(--band-muted); margin-top: 18px; }
.band img { width: 100%; height: auto; border-radius: 36px; box-shadow: 0 0 0 1px rgba(255,255,255,.14); }
.features { background: var(--alt); padding: 96px 0; }
.features > .wrap > h2 { font-size: clamp(34px, 4.4vw, 48px); margin-bottom: 36px; }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { display: flex; flex-direction: column; overflow: hidden; background: var(--card); border-radius: 24px; padding: 36px; }
.card h3 { font-size: 28px; }
.card p { color: var(--muted); margin-top: 10px; }
.card p a { text-decoration: underline; }
.card p + h3 { margin-top: 32px; }
.card img { width: 250px; height: 340px; object-fit: cover; object-position: top; border-radius: 30px 30px 0 0; margin: auto auto -36px; box-shadow: 0 0 0 1px var(--hairline); }
.card--shot p { margin-bottom: 32px; }
.card--wide { grid-column: 1 / -1; }
.card--split { display: grid; grid-template-columns: 1fr 250px; gap: 36px; align-items: center; padding-block: 36px 0; }
.card--split > div { padding-bottom: 36px; }
.card--split img { margin: 0; align-self: end; object-position: center 65%; }
.notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding: 80px 0; }
.notes h2 { font-size: 19px; margin-bottom: 8px; }
.notes p { font-size: 15px; color: var(--muted); }
.notes a { text-decoration: underline; }

/* Contact page */
.nav a[aria-current="page"] { font-weight: 600; }
.contact .contact__address { font-size: clamp(22px, 4vw, 32px); font-weight: 600; color: var(--ink); margin-top: 32px; overflow-wrap: anywhere; }
.contact .contact__status { min-height: 1.5em; font-size: 15px; margin-top: 12px; }
.soft { min-height: 46px; padding: 0 22px; border: 0; border-radius: 99px; background: var(--control); color: var(--link); font-weight: 600; }
.soft:hover { background: var(--control-hover); }
.choice { display: flex; align-items: center; gap: 14px; height: 100%; background: var(--card); color: var(--ink); border-radius: 18px; padding: 16px 18px; }
.choice:hover { text-decoration: none; box-shadow: 0 8px 28px rgba(0,0,0,.1); }
.choice img { width: 48px; height: 48px; border-radius: 12px; }
.choice strong { display: block; font-weight: 600; }
.choice small { display: block; font-size: 14px; color: var(--muted); }
.choice__chevron { margin-left: auto; color: var(--muted); font-size: 24px; }
.help { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; }
.help__card { background: var(--card); border-radius: 18px; padding: 24px; }
.help__card h3 { font-size: 21px; margin-bottom: 12px; }
.help__card ul { margin: 0; padding-left: 20px; color: var(--muted); }
.help__card li { margin-bottom: 6px; }
.help__card .help__links { list-style: none; padding: 0; }
.help__links li { margin: 0; }
.help__links a { display: flex; align-items: center; min-height: 44px; }

/* Text pages (privacy policies) */
.page { max-width: 724px; padding: 72px 0 96px; overflow-wrap: break-word; }
.page h1 { font-size: clamp(34px, 5vw, 48px); margin-bottom: 28px; }
.page h2 { font-size: 24px; margin: 48px 0 12px; }
.page p, .page ul { margin: 0 0 16px; }
.page a { text-decoration: underline; overflow-wrap: anywhere; }
.page li { margin-bottom: 8px; }
.page .eyebrow { color: var(--muted); font-weight: 600; margin-bottom: 8px; }

@media (max-width: 760px) {
  .principles, .help, .bento, .notes, .footer__cols, .band__inner, .card--split { grid-template-columns: 1fr; }
  .band img { width: 260px; margin-inline: auto; }
  .card--split img { margin-inline: auto; }
}
