/* The chrome every page shares: the measure, the header with its theme switch, and the footer.
   Page-specific layout stays in each page's own <style>. */

.page { overflow-x: clip; }   /* `clip`, not `hidden`: hidden would break the sticky header */
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 520px) { .wrap { padding: 0 18px; } }

/* ── Header ── the app's floating bottom bar, turned the right way up. */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--color-bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--color-divider);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 12px; }

/* The app icon is the mark. Its artwork is a rounded square already; the radius here only
   trims the soft edge the PNG carries so it sits cleanly on either ground. */
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; flex: none; border-radius: 10px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: transform 320ms var(--ease);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.brand:hover .brand-mark { transform: scale(1.05) rotate(-3deg); }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; white-space: nowrap; }
.brand-name .the { font-weight: 500; color: var(--color-neutral-700); }

.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a.navlink {
  font-size: 14px; font-weight: 500; color: var(--color-neutral-700);
  padding: 9px 14px; border-radius: var(--radius-chip); text-decoration: none;
  transition: color 180ms ease, background 180ms ease;
}
.site-nav a.navlink:hover { color: var(--color-text); background: var(--color-neutral-200); }
.site-nav a.navlink[aria-current="page"] { color: var(--color-text); }
@media (max-width: 980px) { .site-nav .navlink { display: none; } }
@media (max-width: 440px) {
  .brand-name { font-size: 16px; }
  /* Get the app steps aside on a small phone; Sign in stays, because it is the only way
     into the signed-in half from the header and brand + switch + Sign in still fits. */
  .site-nav .btn-get { display: none; }
}

/* ── Theme switch ── System / Light / Dark, as in the app's Settings. */
.theme-switch {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--color-surface); border: 1px solid var(--color-divider);
  border-radius: var(--radius-chip); box-shadow: var(--shadow-sm);
  margin-inline: 6px;
}
.theme-switch button {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  color: var(--color-neutral-600); font: inherit;
  transition: background 180ms ease, color 180ms ease;
}
.theme-switch button:hover { color: var(--color-text); background: var(--color-neutral-200); }
.theme-switch svg { width: 16px; height: 16px; }
:root:not([data-theme-pref]) .theme-switch [data-theme-choice="light"],
:root[data-theme-pref="light"] .theme-switch [data-theme-choice="light"],
:root[data-theme-pref="dark"] .theme-switch [data-theme-choice="dark"] {
  background: var(--color-text); color: var(--color-on-text);
}

/* ── Coming-soon store badge ── The store button's shape with a dashed edge and no hover, so it
   reads as a promise rather than a link. No Apple artwork: Apple's badge and logo are only for
   apps already on the App Store. */
/* Two short words that must stay on one line: the header is tight on a phone and
   "Sign in" breaking in half looks like a mistake. */
/* The header buttons are two or three short words and must stay on one line: the bar is
   tight between 440px and 560px, and "Get the" above "app" reads as a mistake. */
.site-nav .btn-signin, .site-nav .btn-get { white-space: nowrap; }

.btn-soon {
  border: 1.5px dashed color-mix(in srgb, currentColor 45%, transparent);
  background: transparent; color: var(--color-text); cursor: default; box-shadow: none;
}
.btn-soon:hover { transform: none; }
.btn-soon.on-accent { color: var(--color-white); border-color: rgba(255, 255, 255, 0.6); }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--color-divider); }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding-block: 28px; }
.site-footer .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.site-footer .copy { font-size: 13px; color: var(--color-neutral-700); }
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; font-weight: 500; color: var(--color-neutral-700); }
.footer-links a:hover { color: var(--color-text); text-decoration: none; }
