/* ==========================================================================
   METRO OS — the page around the phone
   On a phone the OS fills the screen. On a wide screen the phone sits in a
   frame and the companion panel beside it reads like a website: it shows
   the notes for whatever is open on the phone.
   ========================================================================== */

.stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
.companion { display: none; }
.noscript { max-width: 560px; margin: 15vh auto; padding: 0 20px; color: #fff; font: 16px/1.5 system-ui, sans-serif; }
.noscript a { color: #6cb8ff; }

/* Tablet and up: the phone gets its frame. */
@media (min-width: 600px) and (min-height: 560px) {
  body {
    overflow: auto;
    background:
      radial-gradient(60% 50% at 25% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
      radial-gradient(50% 50% at 90% 10%, rgba(122, 77, 255, .12), transparent 70%),
      #05070c;
  }
  .stage { position: relative; min-height: 100dvh; gap: clamp(36px, 5vw, 88px); padding: 24px 32px; }
  .device {
    flex: none;
    width: auto;
    height: min(900px, calc(100dvh - 48px));
    aspect-ratio: 9 / 19.5;
    border-radius: 42px;
    box-shadow:
      0 0 0 9px #0c0f16,
      0 0 0 10px #2b313d,
      0 34px 100px rgba(0, 0, 0, .7);
  }
  .device .statusbar, .device .lock__bar { padding-inline: 26px; }
  .device .navbar { padding: 0 18px; }
}

/* Wide screens: the notes panel appears beside the phone. */
@media (min-width: 1100px) and (min-height: 560px) {
  .companion {
    display: block;
    width: min(560px, 42vw);
    max-height: calc(100dvh - 48px);
    overflow-y: auto;
    color: #e9edf4;
    font-size: 16px; line-height: 1.6;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent;
    padding-right: 8px;
  }
}

/* Full screen button beside the framed phone */
.stage__fs {
  display: none;
  position: fixed; top: 16px; right: 18px; z-index: 5;
  align-items: center; gap: 8px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(0, 0, 0, .35); color: #e9edf4;
  font: 14px var(--font); cursor: pointer;
}
.stage__fs:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, transparent); }
@media (min-width: 600px) and (min-height: 560px) { .stage__fs { display: inline-flex; } }

/* Full screen mode: the OS takes the whole window. */
:root[data-full="on"] body { overflow: hidden; background: #000; }
:root[data-full="on"] .stage { position: fixed; inset: 0; min-height: 0; padding: 0; gap: 0; }
:root[data-full="on"] .device {
  width: 100vw; height: 100dvh; aspect-ratio: auto;
  border-radius: 0; box-shadow: none;
}
:root[data-full="on"] .device .statusbar,
:root[data-full="on"] .device .lock__bar { padding-inline: 14px; }
:root[data-full="on"] .device .navbar { padding: 0; }
:root[data-full="on"] .companion,
:root[data-full="on"] .stage__fs { display: none !important; }

/* companion content */
.cmp__crumbs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: rgba(233, 237, 244, .6); margin-bottom: 18px; }
.cmp__crumbs a { color: inherit; text-decoration: none; }
.cmp__crumbs a:hover { color: #fff; }
.cmp__head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.cmp__icon {
  flex: none; width: 64px; height: 64px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 28px;
}
.cmp__icon svg { width: 32px; height: 32px; }
.cmp__title { margin: 0; font-size: 44px; font-weight: 300; line-height: 1.05; letter-spacing: -.5px; }
.cmp__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 20px; font-size: 13px; color: rgba(233, 237, 244, .7); }
.cmp__meta .chip { color: #9fd96b; }
.cmp__meta .chip--soon { color: rgba(233, 237, 244, .7); }
.cmp__summary { font-size: 19px; line-height: 1.5; margin: 0 0 22px; color: #fff; }
.cmp__toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.cmp__toc a {
  padding: 4px 12px; border: 1px solid rgba(255, 255, 255, .22);
  color: #e9edf4; text-decoration: none; font-size: 13px;
}
.cmp__toc a:hover, .cmp__toc a.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 25%, transparent); }
.cmp__section { margin: 0 0 30px; scroll-margin-top: 16px; }
.cmp__section > h2 { margin: 0 0 8px; font-size: 26px; font-weight: 300; text-transform: lowercase; color: #fff; }
.companion .md { font-size: 16px; }
.companion .md a { color: color-mix(in srgb, var(--accent) 70%, #fff); }
.companion .md code { background: rgba(255, 255, 255, .08); }
.companion .md blockquote { color: rgba(233, 237, 244, .75); }
.companion .md hr { border-top-color: rgba(255, 255, 255, .15); }
.cmp__tips { margin-top: 30px; padding: 16px 18px; border: 1px solid rgba(255, 255, 255, .14); font-size: 14px; color: rgba(233, 237, 244, .8); }
.cmp__tips b { color: #fff; }
.cmp__tips kbd { font: inherit; font-size: 12px; padding: 1px 6px; border: 1px solid rgba(255, 255, 255, .3); }
.cmp__foot { margin-top: 28px; font-size: 12px; color: rgba(233, 237, 244, .5); }
.cmp__foot a { color: inherit; }
