/* ==========================================================================
   Pict-o-view — shared stylesheet
   One file, no build step, no external requests. Every page links this.
   ========================================================================== */

/* --- Design tokens -------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-2: #fbfbfd;
  --text: #1d1d1f;
  --text-2: #3f3f46;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-text: #0062c4;
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.16);
  --header-bg: rgba(255, 255, 255, 0.72);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 12px 32px rgba(0, 0, 0, 0.07);
  --tile-alpha: 0.13;

  /* Accents mirror the in-app Help sheet, one hue per topic. */
  --blue: #0071e3;
  --indigo: #5b57e0;
  --orange: #d97706;
  --purple: #9333ea;
  --mint: #0d9488;
  --green: #16a34a;
  --teal: #0e7490;
  --pink: #db2777;

  --radius: 14px;
  --radius-sm: 9px;
  --measure: 46rem;
  --wide: 68rem;
  --header-h: 54px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #17171a;
    --surface-2: #101013;
    --text: #f5f5f7;
    --text-2: #d6d6da;
    --muted: #98989d;
    --accent: #2997ff;
    --accent-text: #58aeff;
    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.2);
    --header-bg: rgba(12, 12, 14, 0.72);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.55);
    --tile-alpha: 0.22;

    --blue: #2997ff;
    --indigo: #8b87ff;
    --orange: #f59e0b;
    --purple: #c084fc;
    --mint: #2dd4bf;
    --green: #4ade80;
    --teal: #22d3ee;
    --pink: #f472b6;
  }
}

/* --- Reset / base --------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--accent-text);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0 0 1em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

.muted {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* --- Layout --------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 24px;
}

.wrap--wide {
  max-width: var(--wide);
}

main {
  padding-bottom: 72px;
}

/* --- Header / navigation -------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
}

.site-header .wrap {
  max-width: var(--wide);
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

/* The app icon already carries its own rounded-square shape and shadow in
   the PNG, so it drops in as a plain <img> — no background or radius here. */
.brand-mark {
  width: 30px;
  height: 30px;
  flex: none;
  display: block;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.93rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* `.site-nav a` (0,1,1) outranks `.btn` (0,1,0), so the button's white text
   has to be restated at (0,2,0) or it inherits the muted nav colour. */
.site-nav .btn {
  margin-left: 6px;
  padding: 5px 13px;
  font-size: 0.88rem;
  color: #fff;
}

.site-nav .btn:hover {
  color: #fff;
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 980px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}

.btn:hover {
  filter: brightness(1.07);
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn--ghost {
  background: transparent;
  color: var(--accent-text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--surface);
  filter: none;
}

/* --- Hero (home) ---------------------------------------------------------- */

.hero {
  padding: clamp(48px, 9vw, 96px) 0 8px;
  text-align: center;
}

.hero-icon {
  width: clamp(88px, 14vw, 120px);
  height: auto;
  margin: 0 auto 1.4rem;
  display: block;
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2.25rem, 6.4vw, 3.6rem);
  letter-spacing: -0.03em;
}

.hero .lede {
  max-width: 34rem;
  margin: 0 auto 1.9rem;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.hero-note {
  margin: 1.4rem 0 0;
  font-size: 0.87rem;
  color: var(--muted);
}

/* A CSS-drawn stand-in for a screenshot: no image assets to ship or break. */
.mock {
  margin: clamp(36px, 6vw, 64px) auto 0;
  max-width: 56rem;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.mock-bar {
  height: 30px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mock-bar i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
}

.mock-bar i:nth-child(1) {
  background: #ff5f57;
}
.mock-bar i:nth-child(2) {
  background: #febc2e;
}
.mock-bar i:nth-child(3) {
  background: #28c840;
}

.mock-bar span {
  margin-left: 8px;
  font-size: 0.72rem;
  color: var(--muted);
}

.mock-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.mock-side {
  width: 27%;
  min-width: 96px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mock-side b,
.mock-side em {
  display: block;
  height: 9px;
  border-radius: 4px;
  background: var(--border-strong);
  opacity: 0.5;
}

.mock-side b {
  width: 72%;
}

.mock-side em {
  width: 54%;
  margin-left: 14px;
  opacity: 0.32;
}

.mock-side b.on {
  background: var(--accent);
  opacity: 0.85;
}

.mock-grid {
  flex: 1;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 9px;
  min-height: 0;
}

.mock-grid u {
  display: block;
  border-radius: 6px;
  background: linear-gradient(140deg, #7fc7ff, #2f6fd0);
}

.mock-grid u:nth-child(2) {
  background: linear-gradient(140deg, #ffd08a, #e0722a);
}
.mock-grid u:nth-child(3) {
  background: linear-gradient(140deg, #b7f3d0, #1f9c62);
}
.mock-grid u:nth-child(4) {
  background: linear-gradient(140deg, #d9c2ff, #7a49c9);
}
.mock-grid u:nth-child(5) {
  background: linear-gradient(140deg, #ffc7d8, #cf3f6d);
}
.mock-grid u:nth-child(6) {
  background: linear-gradient(140deg, #a8e9ff, #1d7fa8);
}
.mock-grid u:nth-child(7) {
  background: linear-gradient(140deg, #ffe9a8, #c99a1e);
}
.mock-grid u:nth-child(8) {
  background: linear-gradient(140deg, #c6d4ff, #4257c4);
}

/* --- Feature cards (home) ------------------------------------------------- */

/* Three columns at most, deliberately: six cards then land 3 + 3 instead of
   4 + 2, and the copy gets a readable measure rather than a narrow gutter. */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 34rem) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 56rem) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
}

.card h3 {
  margin: 14px 0 6px;
  font-size: 1.03rem;
}

.card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* --- Tinted icon tiles ---------------------------------------------------- */

.tile {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--tint, var(--accent));
  background: color-mix(in srgb, var(--tint, var(--accent)) calc(var(--tile-alpha) * 100%), transparent);
}

.tile svg {
  width: 19px;
  height: 19px;
}

/* Fallback for engines without color-mix(): a neutral wash still reads fine. */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .tile {
    background: var(--surface);
  }
}

.t-blue { --tint: var(--blue); }
.t-indigo { --tint: var(--indigo); }
.t-orange { --tint: var(--orange); }
.t-purple { --tint: var(--purple); }
.t-mint { --tint: var(--mint); }
.t-green { --tint: var(--green); }
.t-teal { --tint: var(--teal); }
.t-pink { --tint: var(--pink); }

/* --- Page header (doc pages) --------------------------------------------- */

.page-head {
  padding: clamp(40px, 7vw, 68px) 0 4px;
}

.page-head h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 5vw, 2.7rem);
  letter-spacing: -0.025em;
}

.page-head .lede {
  margin: 0;
  font-size: 1.08rem;
  color: var(--muted);
  max-width: 36rem;
}

/* --- Section jump pills -------------------------------------------------- */

.pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
}

.pills a {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 980px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.86rem;
}

.pills a:hover {
  color: var(--text);
  border-color: var(--border-strong);
  text-decoration: none;
}

.pills a.is-active {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

/* --- Sections ------------------------------------------------------------- */

.section {
  padding-top: 2.6rem;
  scroll-margin-top: calc(var(--header-h) + 18px);
}

.section > h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.section > .section-note {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.97rem;
}

/* --- Feature list (help page) -------------------------------------------- */

.features {
  display: grid;
  gap: 2px;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}

.feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 15px 4px;
  border-top: 1px solid var(--border);
}

.feature h3 {
  margin: 0 0 2px;
  font-size: 1.02rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

/* --- FAQ ----------------------------------------------------------------- */

.faq {
  margin: 1rem 0 0;
}

.faq-item {
  padding: 16px 4px;
  border-top: 1px solid var(--border);
}

.faq-item h3 {
  margin: 0 0 0.35rem;
  font-size: 1.04rem;
}

.faq-item p {
  margin: 0 0 0.6rem;
  color: var(--text-2);
  font-size: 0.97rem;
}

.faq-item p:last-child {
  margin-bottom: 0;
}

/* --- Search (added by js/site.js; hidden when JS is off) ----------------- */

.search {
  position: relative;
  margin-top: 26px;
}

.search input {
  width: 100%;
  font: inherit;
  font-size: 0.98rem;
  color: var(--text);
  padding: 11px 15px 11px 40px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  -webkit-appearance: none;
  appearance: none;
}

.search input::placeholder {
  color: var(--muted);
}

.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.search-empty {
  margin: 1.4rem 0 0;
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

/* --- Keyboard shortcuts -------------------------------------------------- */

kbd {
  font-family: var(--font);
  font-size: 0.84em;
  font-weight: 500;
  line-height: 1.4;
  display: inline-block;
  padding: 0.1em 0.42em;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  white-space: nowrap;
}

.keys {
  margin: 1.1rem 0 0;
  display: grid;
  gap: 0;
}

.krow {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 10px 16px;
  align-items: baseline;
  padding: 9px 4px;
  border-top: 1px solid var(--border);
  font-size: 0.96rem;
}

.krow > span:first-child {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.krow > span:last-child {
  color: var(--muted);
}

.krow .sep {
  color: var(--muted);
  font-size: 0.85em;
}

@media (max-width: 32rem) {
  .krow {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* --- Callout ------------------------------------------------------------- */

.callout {
  margin: 1.4rem 0 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--tint, var(--accent));
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.95rem;
}

.callout p:last-child {
  margin-bottom: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.08em 0.35em;
}

/* --- Footer -------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 34px 0 56px;
  font-size: 0.88rem;
  color: var(--muted);
  background: var(--surface-2);
}

.site-footer .wrap {
  max-width: var(--wide);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-left: auto;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--text);
}

/* --- Back to top (added by js/site.js) ----------------------------------- */

.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top svg {
  width: 17px;
  height: 17px;
}

/* --- Motion / print ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .pills,
  .search,
  .to-top,
  .mock {
    display: none !important;
  }
  body {
    font-size: 11pt;
    color: #000;
    background: #fff;
  }
}
