/* ==========================================================================
   Pict-o-view — site stylesheet
   One file, no build step, no third-party requests (the typeface is
   self-hosted). Every page links this.
   ========================================================================== */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../fonts/schibsted-grotesk.woff2") format("woff2-variations"),
       url("../fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

/* --- Tokens --------------------------------------------------------------- */

:root {
  color-scheme: light;

  --font: "Schibsted Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Cool grey page, near-black ink, and one blue accent (the app's selection blue). */
  --bg: #eef1f6;
  --paper: #f8f9fc;
  --ink: #121a28;
  --ink-2: #323c4d;
  --muted: #5a6578;
  --line: rgba(18, 26, 40, 0.12);
  --line-strong: rgba(18, 26, 40, 0.22);
  --accent: #1f63d6;
  --accent-ink: #ffffff;
  --accent-soft: rgba(31, 99, 214, 0.12);
  --reject: #b1432d;
  --link: #1a56bd;

  /* The one inverse surface (privacy band, keycaps). */
  --dark: #101828;
  --dark-ink: #e8edf5;
  --dark-muted: #9aa6ba;

  --header-bg: rgba(238, 241, 246, 0.82);
  --shot-shadow: 0 1px 1px rgba(18, 26, 40, 0.06), 0 30px 60px -20px rgba(18, 26, 40, 0.35);

  /* In-app Help topic hues (tiles now all use the accent blue). */
  --blue: #2f6db5;
  --indigo: #5a55c4;
  --orange: #b9650f;
  --purple: #8642c4;
  --mint: #2a8a7e;
  --green: #2c7a4d;
  --teal: #20708a;
  --pink: #b8396f;

  --measure: 38rem;
  --wide: 76rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f131a;
    --paper: #161b24;
    --ink: #e6ebf3;
    --ink-2: #c8cfdb;
    --muted: #97a2b5;
    --line: rgba(230, 235, 243, 0.12);
    --line-strong: rgba(230, 235, 243, 0.22);
    --accent: #5b9dff;
    --accent-ink: #0a1424;
    --accent-soft: rgba(91, 157, 255, 0.14);
    --reject: #e0745c;
    --link: #86b6ff;
    --dark: #18202c;
    --dark-ink: #e6ebf3;
    --dark-muted: #97a2b5;
    --header-bg: rgba(15, 19, 26, 0.82);
    --shot-shadow: 0 0 0 1px rgba(230, 235, 243, 0.08), 0 30px 60px -20px rgba(0, 0, 0, 0.7);
    --blue: #7fb0ec;
    --indigo: #a39ff5;
    --orange: #eda254;
    --purple: #c79af2;
    --mint: #6dcfc1;
    --green: #5cbd85;
    --teal: #6bc3dd;
    --pink: #ee8ab5;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f131a;
  --paper: #161b24;
  --ink: #e6ebf3;
  --ink-2: #c8cfdb;
  --muted: #97a2b5;
  --line: rgba(230, 235, 243, 0.12);
  --line-strong: rgba(230, 235, 243, 0.22);
  --accent: #5b9dff;
  --accent-ink: #0a1424;
  --accent-soft: rgba(91, 157, 255, 0.14);
  --reject: #e0745c;
  --link: #86b6ff;
  --dark: #18202c;
  --header-bg: rgba(15, 19, 26, 0.82);
}

/* --- Base ----------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
svg { flex: none; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { margin: 0; font-weight: 700; color: var(--ink); text-wrap: balance; }
h1 { letter-spacing: -0.035em; line-height: 1.02; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); letter-spacing: -0.028em; line-height: 1.08; }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; line-height: 1.3; font-weight: 650; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 650; }

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

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 0.6rem 1rem; border-radius: 8px;
}
.skip:focus { top: 0.75rem; }

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.wrap--wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }

main { display: block; }

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

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  height: var(--header-h);
  display: flex; align-items: center; gap: 1.5rem;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  color: var(--ink); text-decoration: none;
  font-weight: 750; font-size: 1.0625rem; letter-spacing: -0.02em;
  flex: none;
}
.brand-mark { width: 30px; height: 30px; }

.site-nav {
  margin-left: auto;
  display: flex; align-items: center; gap: 0.25rem;
  overflow-x: auto; scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
  color: var(--ink-2); text-decoration: none;
  font-size: 0.9375rem; font-weight: 500;
  padding: 0.4rem 0.7rem; border-radius: 8px; white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--line); }
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 650; }
.site-nav a.btn { margin-left: 0.5rem; padding: 0.45rem 0.95rem; color: var(--accent-ink); font-weight: 650; }
.site-nav a.btn:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); }

@media (max-width: 44rem) {
  .site-nav a:not(.btn):not([aria-current]) { display: none; }
  .site-nav .nav-more { display: inline-block; }
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 650; font-size: 1rem; line-height: 1;
  padding: 0.9rem 1.3rem; border-radius: 10px; border: 0;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.1em; height: 1.1em; }

.btn--quiet {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.btn--quiet:hover { background: var(--line); filter: none; }

/* --- Home: hero ----------------------------------------------------------- */

.hero { padding-block: clamp(3rem, 8vw, 6.5rem) 0; }

.hero-head {
  display: grid; gap: 1.75rem 4rem;
  grid-template-columns: 1fr;
  align-items: end;
}
@media (min-width: 60rem) {
  .hero-head { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

.hero h1 {
  font-size: clamp(2.7rem, 7.2vw, 5.6rem);
  font-weight: 760;
  max-width: 13ch;
}

.hero-copy .lede {
  font-size: clamp(1.125rem, 1.6vw, 1.3rem);
  line-height: 1.5; color: var(--ink-2);
  max-width: 34ch; margin-bottom: 1.6rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.hero-req { margin-top: 1rem; font-size: 0.875rem; color: var(--muted); }

/* The pager: the real app, paged with the same keys. */
.pager { margin-top: clamp(2.5rem, 6vw, 4.5rem); }

.pager-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: clamp(8px, 1.1vw, 14px);
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shot-shadow);
}

.pager-frame picture,
.pager-frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.pager-frame picture[hidden] { display: none; }

.pager-bar {
  margin-top: 1.25rem;
  display: flex; align-items: flex-start; gap: 1.25rem 2rem; flex-wrap: wrap;
}

.pager-keys { display: flex; gap: 0.4rem; flex: none; }

.keycap {
  display: inline-grid; place-items: center;
  min-width: 2.6rem; height: 2.6rem; padding: 0 0.6rem;
  font: inherit; font-size: 1.05rem; font-weight: 600; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 9px;
  cursor: pointer;
}
.keycap:hover { border-color: var(--muted); }
.keycap:active, .keycap.is-pressed { border-bottom-width: 1px; transform: translateY(2px); }

.pager-tabs {
  display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem;
  list-style: none; margin: 0; padding: 0.55rem 0 0;
}
.pager-tabs button {
  font: inherit; font-size: 0.95rem; font-weight: 500;
  color: var(--muted); background: none; border: 0; padding: 0.15rem 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.pager-tabs button:hover { color: var(--ink); }
.pager-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 650; }

.pager-caption {
  flex: 1 1 100%;
  margin: 0; color: var(--ink-2); max-width: 60ch;
  min-height: 3.2em;
}
@media (min-width: 60rem) {
  .pager-caption { flex: 1 1 22rem; text-align: right; margin-left: auto; padding-top: 0.55rem; }
}

/* --- Home: sections ------------------------------------------------------- */

.band { padding-block: clamp(4.5rem, 10vw, 8rem); }
.band + .band { padding-block-start: 0; }

.band-head { max-width: 40rem; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.band-head p { margin-top: 1rem; font-size: 1.15rem; color: var(--ink-2); max-width: 36rem; }

/* Culling */
.cull {
  display: grid; gap: 2.5rem 4rem; align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 60rem) {
  .cull { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}

.cull-keys { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; }
.cull-keys li { display: grid; grid-template-columns: auto 1fr; gap: 0 1rem; align-items: center; }
.cull-keys .keycap { cursor: default; width: 3.2rem; height: 3.2rem; font-size: 1.25rem; }
.cull-keys .keycap:hover { border-color: var(--line-strong); }
.cull-keys .k-keep { color: var(--accent); }
.cull-keys .k-reject { color: var(--reject); }
.cull-keys strong { display: block; font-size: 1.05rem; }
.cull-keys span.note { color: var(--muted); font-size: 0.95rem; }

.shot {
  margin: 0;
  border-radius: clamp(8px, 1vw, 12px);
  overflow: hidden;
  box-shadow: var(--shot-shadow);
  background: var(--paper);
}
.shot figcaption { display: none; }

/* Everything else: an editorial two-column list, not a deck of cards. */
.abilities {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 2.5rem 4rem;
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) { .abilities { grid-template-columns: 1fr 1fr; } }
@media (min-width: 70rem) { .abilities { grid-template-columns: 1fr 1fr 1fr; } }

.abilities li { max-width: 26rem; }
.abilities svg { width: 26px; height: 26px; color: var(--accent); margin-bottom: 0.9rem; }
.abilities h3 { margin-bottom: 0.4rem; }
.abilities p { color: var(--ink-2); font-size: 1rem; }

/* Pair of screenshots under the abilities */
.duo {
  display: grid; gap: 1.5rem; margin-top: clamp(3rem, 7vw, 5rem);
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) { .duo { grid-template-columns: 1fr 1fr; } }
.duo figure { margin: 0; }
.duo figcaption { margin-top: 0.85rem; color: var(--muted); font-size: 0.95rem; }

/* Privacy: the one dark surface on the page. */
.privacy-band {
  background: var(--dark); color: var(--dark-ink);
  padding: clamp(4.5rem, 10vw, 8rem) 0;
}
.privacy-band h2 { color: var(--dark-ink); max-width: 18ch; font-size: clamp(2rem, 4.6vw, 3.6rem); }
.privacy-band .band-head p { color: var(--dark-muted); }
.privacy-band a { color: #8fbcff; }

.facts {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 0; grid-template-columns: 1fr;
  border-top: 1px solid rgba(230, 235, 243, 0.16);
}
@media (min-width: 46rem) { .facts { grid-template-columns: 1fr 1fr; column-gap: 4rem; } }
.facts li {
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(230, 235, 243, 0.16);
  display: grid; grid-template-columns: 9rem 1fr; gap: 1rem;
}
.facts b { font-weight: 650; color: var(--dark-ink); }
.facts span { color: var(--dark-muted); }
@media (max-width: 30rem) { .facts li { grid-template-columns: 1fr; gap: 0.2rem; } }

/* Formats */
.formats {
  display: grid; gap: 2rem 4rem; grid-template-columns: 1fr;
}
@media (min-width: 46rem) { .formats { grid-template-columns: repeat(3, 1fr); } }
.formats h3 { margin-bottom: 0.6rem; }
.formats p { color: var(--ink-2); font-size: 1rem; }
.formats .fine { color: var(--muted); font-size: 0.9rem; margin-top: 0.6rem; }

/* Closing call */
.closer {
  display: grid; gap: 2rem; align-items: center;
  grid-template-columns: 1fr;
  padding-block-start: clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--line);
}
@media (min-width: 52rem) { .closer { grid-template-columns: auto 1fr auto; gap: 2.5rem; } }
.closer img { width: 96px; height: 96px; }
.closer h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.closer p { margin-top: 0.4rem; color: var(--ink-2); }

/* --- Inner pages ---------------------------------------------------------- */

.page { padding-bottom: 5rem; }

.page-head { padding-block: clamp(3rem, 7vw, 5rem) 2rem; }
.page-head h1 { font-size: clamp(2.4rem, 5.6vw, 3.8rem); font-weight: 760; }
.page-head .lede { margin-top: 1rem; font-size: 1.2rem; line-height: 1.5; color: var(--ink-2); max-width: 36rem; }

.pills {
  list-style: none; margin: 0.5rem 0 1.75rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.pills a {
  display: inline-block; padding: 0.35rem 0.8rem; border-radius: 999px;
  font-size: 0.9rem; font-weight: 500; text-decoration: none;
  color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.pills a:hover { color: var(--ink); background: var(--line); }
.pills a.is-active { color: var(--accent-ink); background: var(--accent); box-shadow: none; }

.section { padding-top: 3rem; }
.section > h2 {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  margin-bottom: 1rem;
}
.section > h2 + * { margin-top: 0; }
.section > p, .section-note { color: var(--ink-2); }
.section > p + p { margin-top: 0.8rem; }

.tile {
  --tint: var(--accent);
  display: inline-grid; place-items: center;
  width: 2.1rem; height: 2.1rem; border-radius: 9px;
  color: var(--tint);
  background: color-mix(in srgb, var(--tint) 13%, transparent);
  flex: none;
}
.tile svg { width: 1.15rem; height: 1.15rem; }
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .tile { background: var(--accent-soft); }
}
.t-blue { --tint: var(--accent); }
.t-indigo { --tint: var(--accent); }
.t-orange { --tint: var(--accent); }
.t-purple { --tint: var(--accent); }
.t-mint { --tint: var(--accent); }
.t-green { --tint: var(--accent); }
.t-teal { --tint: var(--accent); }
.t-pink { --tint: var(--accent); }

.features { list-style: none; margin: 0; padding: 0; }
.feature {
  display: grid; grid-template-columns: auto 1fr; gap: 1rem;
  padding: 1.1rem 0; border-top: 1px solid var(--line);
}
.feature .tile { width: 1.9rem; height: 1.9rem; border-radius: 8px; margin-top: 0.1rem; }
.feature .tile svg { width: 1rem; height: 1rem; }
.feature h3 { margin-bottom: 0.3rem; }
.feature p { color: var(--ink-2); font-size: 1rem; }

.faq { border-top: 1px solid var(--line); }
.faq-item { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.faq-item h3 { margin-bottom: 0.45rem; }
.faq-item p { color: var(--ink-2); font-size: 1rem; }
.faq-item p + p { margin-top: 0.7rem; }

.search { position: relative; margin: 0 0 1rem; }
.search input {
  width: 100%;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 0.75rem 0.9rem 0.75rem 2.6rem;
  -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.search svg {
  position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%);
  width: 1.1rem; height: 1.1rem; color: var(--muted); pointer-events: none;
}
.search-empty { color: var(--muted); padding: 1rem 0; }
[hidden] { display: none !important; }

kbd {
  display: inline-block; min-width: 1.6em;
  padding: 0.05em 0.4em; margin: 0 0.05em;
  font-family: var(--font); font-size: 0.85em; font-weight: 600; line-height: 1.45;
  text-align: center; color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 6px;
  white-space: nowrap;
}

.keys { border-top: 1px solid var(--line); }
.krow {
  display: grid; grid-template-columns: 11rem 1fr; gap: 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--line); align-items: baseline;
}
.krow > span:first-child { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; color: var(--muted); font-size: 0.9rem; }
.krow > span:last-child { color: var(--ink-2); font-size: 1rem; }
.krow .sep { color: var(--muted); }
@media (max-width: 32rem) {
  .krow { grid-template-columns: 1fr; gap: 0.35rem; }
}

.callout {
  --tint: var(--accent);
  margin: 0 0 2rem;
  padding: 1.1rem 1.25rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--tint) 9%, var(--paper));
  border-left: 3px solid var(--tint);
  color: var(--ink-2);
}
.section .callout { margin-top: 1.5rem; }

code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--line); padding: 0.1em 0.35em; border-radius: 5px;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 3rem;
  color: var(--muted); font-size: 0.9rem;
}
.site-footer .wrap {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }
.home .site-footer { border-top: 0; }

/* --- Back to top ---------------------------------------------------------- */

.to-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 15;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-strong);
  cursor: pointer; opacity: 0; visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top svg { width: 1.1rem; height: 1.1rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .keycap:active, .keycap.is-pressed { transform: none; }
}

@media print {
  .site-header, .site-footer, .to-top, .pills, .search, .pager-bar { display: none !important; }
  body { background: #fff; color: #000; }
}
