/* arkui's palette, written by docs/site/src/site.rs. */
:root{color-scheme:light;--bg:#ffffff;--weak:#dedede;--strong:#cecece;--surface:#f6f6f6;--edge:#e4e4e4;--text:#1c1c1c;--dim:rgba(28,28,28,0.65);--faint:rgba(28,28,28,0.60);--accent:#005ad2;--primary:#005ad2;--on-primary:#f9fafd;}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--bg:#1c1c1c;--weak:#343434;--strong:#414141;--surface:#242424;--edge:#343434;--text:#e8e8e8;--dim:rgba(232,232,232,0.65);--faint:rgba(232,232,232,0.60);--accent:#6cb4ff;--primary:#6cb4ff;--on-primary:#152a3f;}}
:root[data-theme=dark]{color-scheme:dark;--bg:#1c1c1c;--weak:#343434;--strong:#414141;--surface:#242424;--edge:#343434;--text:#e8e8e8;--dim:rgba(232,232,232,0.65);--faint:rgba(232,232,232,0.60);--accent:#6cb4ff;--primary:#6cb4ff;--on-primary:#152a3f;}

/* The page around arkui's pictures. The colours above are arkui's palette,
   written by site.rs; the sizes are arkui's: the sidebar's 200, a page's
   24 gutter (16 on a phone), Fira Sans. */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "nav main";
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12.5px/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
p code, li code, td code { background: var(--surface); border-radius: 4px; padding: 1px 4px; }
h1 { font-size: 28px; line-height: 1.2; margin: 8px 0 6px; }
h2 { font-size: 20px; margin: 36px 0 10px; }
h3 { font-size: 15px; margin: 22px 0 6px; }
h4 { font-size: 12px; margin: 10px 0 4px; color: var(--faint); font-weight: 500; }
ul { padding-left: 20px; margin: 6px 0; }
li { margin: 3px 0; }
.lede { font-size: 15px; max-width: 760px; }
main p { max-width: 760px; }
.dim { color: var(--dim); }
.faint { color: var(--faint); }

/* The bar: where the page is (a phone's), arkui, the theme. */
header {
  grid-area: top;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px 0 24px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}
.brand { font-weight: 700; color: var(--text); margin-right: auto; }
select {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 4px 8px;
  cursor: pointer;
}
select:hover, .places:hover { background: var(--surface); }
.places { display: none; }

/* The sidebar: arkui::sidebar's look, in HTML. */
nav {
  grid-area: nav;
  border-right: 1px solid var(--edge);
  padding: 0 8px 24px;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}
nav h2 { font-size: 11px; font-weight: 500; color: var(--faint); margin: 14px 8px 4px; }
nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}
nav a:hover { background: var(--surface); text-decoration: none; }
nav a[aria-current] { background: var(--primary); color: var(--on-primary); }
i {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--g) center / contain no-repeat;
  mask: var(--g) center / contain no-repeat;
}
i.down { --g: url(glyphs/down.svg); width: 12px; height: 12px; opacity: 0.6; }

main { grid-area: main; padding: 8px 24px 64px; min-width: 0; }
.modules { color: var(--dim); font-size: 12px; }

/* A picture of a component, in the page's theme. */
.example {
  margin: 14px 0;
  padding: 20px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  max-width: 682px;
}
.example img { display: block; max-width: 100%; height: auto; }
.example figcaption, .capture figcaption { font-size: 12px; color: var(--dim); margin-top: 12px; }
.dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) .light { display: none; }
  :root:not([data-theme=light]) .dark { display: block; }
}
:root[data-theme=dark] .light { display: none; }
:root[data-theme=dark] .dark { display: block; }

table { border-collapse: collapse; font-size: 13px; }
.list { width: 100%; max-width: 900px; }
.list th { text-align: left; font-weight: 500; font-size: 11px; color: var(--faint); padding: 4px 8px; }
.list td { padding: 5px 8px; }
.list tbody tr:nth-child(odd), .answers tr:nth-child(odd) { background: var(--surface); }
.answers { margin: 14px 0; }
.answers caption { text-align: left; font-size: 12px; color: var(--faint); padding-bottom: 4px; }
.answers td { padding: 4px 10px; vertical-align: top; }
.answers td code { background: none; padding: 0; }

.module { margin-top: 8px; }
.source { font-size: 11px; }

/* Mobile, and the switch between the two phones. */
.mobile-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.mobile-head h2 { margin-bottom: 10px; }
.switch { display: flex; gap: 6px; margin-bottom: 12px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch label { font-size: 12px; padding: 4px 12px; border-radius: 6px; cursor: pointer; }
.switch label:hover { background: var(--surface); }
.switch input:checked + label { background: var(--primary); color: var(--on-primary); }
.switch input:focus-visible + label { outline: 2px solid var(--accent); }
.pane.ios { display: none; }
.mobile:has(#ios:checked) .pane.ios { display: block; }
.mobile:has(#ios:checked) .pane.android { display: none; }
/* Side by side: each shot both phones take, Android's beside iOS's, two
   columns however narrow the page, so the two move in step before the eye. */
.pane.both { display: none; }
.mobile:has(#both:checked) .pane.both { display: block; }
.mobile:has(#both:checked) .pane.android { display: none; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 270px)); gap: 24px; }
.pair .capture { width: auto; }

/* A capture in a frame of its device, at the device's aspect and corner
   (site.js sets --aspect, --corner and the cutout from the manifest). */
.captures { display: flex; flex-wrap: wrap; gap: 24px; margin: 8px 0 16px; }
.capture { margin: 0; width: 270px; }
.capture small { display: block; font-size: 11px; color: var(--faint); }
.device {
  --bezel: 10px;
  padding: var(--bezel);
  background: #111;
  border-radius: calc(var(--corner, 0.09) * 250px + var(--bezel));
  box-shadow: 0 0 0 1px var(--edge);
}
.screen {
  position: relative;
  aspect-ratio: var(--aspect, 1080 / 2400);
  border-radius: calc(var(--corner, 0.09) * 250px);
  overflow: hidden;
  background: var(--bg);
  display: grid;
  place-items: center;
}
.screen p { font-size: 12px; color: var(--faint); padding: 16px; text-align: center; margin: 0; }
.screen img, .screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.screen::after { content: ""; position: absolute; background: #000; z-index: 1; }
.hole .screen::after { width: 3.6%; aspect-ratio: 1; border-radius: 50%; top: 1.6%; left: 48.2%; }
.island .screen::after { width: 31%; height: 3.4%; border-radius: 99px; top: 1.3%; left: 34.5%; }

/* A phone's width: the narrow pictures, and the sidebar as a dropdown. */
@media (max-width: 700px) {
  body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  header { padding: 0 8px; }
  .places {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
  }
  .brand { display: none; }
  .places { margin-right: auto; }
  nav { display: none; }
  #places:checked ~ nav {
    display: block;
    position: fixed;
    inset: 52px 0 0 0;
    width: auto;
    height: auto;
    background: var(--bg);
    border: 0;
    z-index: 3;
  }
  main { padding: 8px 16px 48px; }
  .example { padding: 12px; }
  .wide { display: none; }
  .capture { width: min(270px, 100%); }
}
