/* Every page but the home page: help, about, updates, privacy, terms, the blog and the writing
   page (loaded after site.css). The same dark bar as the home page on top; below it the words
   sit on white paper, like a document, in larger type. Blog covers without a photo are drawn in
   the app's own language: a page with one highlighted line and a star. */

.doc-body {
  --night: #090d16;
  background: var(--night);
}

/* ── The bar: brand, page links, Download — one line on every screen ─────────────────── */

.doc-header {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: none;
  gap: 1rem;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) var(--gutter) 8px;
  background: rgba(9, 13, 22, 0.96);
  border-bottom: 1px solid rgba(243, 245, 249, 0.1);
}
.doc-header .nav-brand {
  flex: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.15rem;
  text-decoration: none;
  color: #f3f5f9;
}
.doc-header .nav-brand img {
  border-radius: 7px;
}
.doc-nav {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 0 0 auto;
  min-width: 0;
  column-gap: 0.4rem;
}
.doc-nav::-webkit-scrollbar {
  display: none;
}
.doc-nav a {
  flex: none;
  padding: 12px 8px;
  font-size: 0.92rem;
}
.site-get {
  flex: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  background: #f3f5f9;
  color: var(--night);
}
@media (max-width: 720px) {
  .doc-header {
    flex-wrap: wrap;
    row-gap: 0;
  }
  .site-get {
    margin-left: auto;
  }
  .doc-nav {
    order: 3;
    width: calc(100% + 2 * var(--gutter));
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 calc(var(--gutter) - 8px);
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
}

/* ── Paper: the reading area ──────────────────────────────────────────────────────────── */

.doc-body main {
  --ink: #15171c;
  --ink-dim: #4a5160;
  --line: rgba(21, 23, 28, 0.12);
  --night-2: #f3f4f7;
  --accent: #b3262d;
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 0 0 100vmax #ffffff;
  clip-path: inset(0 -100vmax);
}
.doc {
  max-width: 70ch;
  padding-top: clamp(2.5rem, 6vw, 4.5rem);
}
.doc .eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  font-weight: 600;
}
.doc .eyebrow a {
  text-decoration: none;
}
.doc h1 {
  font-size: clamp(2.3rem, 1.4rem + 3.4vw, 4rem);
  letter-spacing: -0.03em;
  line-height: 1.04;
  color: var(--ink);
}
.doc h2 {
  font-size: clamp(1.4rem, 1.15rem + 0.8vw, 1.8rem);
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
}
.doc h3 {
  color: var(--ink);
}
.doc p,
.doc li {
  color: #2b303a;
  font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.12rem);
  line-height: 1.7;
}
.doc a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.doc-summary {
  background: #f6f7fa;
  border: 0;
  border-left: 4px solid var(--accent);
  border-radius: 12px;
}
.doc summary {
  min-height: 56px;
  font-size: 1.12rem;
}
.doc .fine {
  color: var(--ink-dim);
}
.about-person img {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 20px 40px -24px rgba(21, 23, 28, 0.5);
}

/* the footer, back on the night */
.footer {
  border-top: 0;
  padding-top: 48px;
}

/* ── Blog: a magazine ─────────────────────────────────────────────────────────────────── */

.doc--wide {
  max-width: 1180px;
}
.blog-body main:has(.doc--wide) {
  background: #f3f4f7;
  box-shadow: 0 0 0 100vmax #f3f4f7;
}
.blog-intro {
  color: var(--ink-dim) !important;
  max-width: 38em;
}
.blog-search input {
  background: #ffffff;
  border: 1px solid #dfe2e8;
  color: var(--ink);
  min-height: 48px;
  border-radius: 14px;
}
.blog-chips .chip {
  background: #ffffff;
  border: 1px solid #dfe2e8;
  color: var(--ink);
  min-height: 40px;
}
.blog-chips .chip[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}
.blog-tools {
  display: grid;
  grid-template-columns: minmax(0, 420px) 1fr;
  gap: 12px 20px;
  align-items: center;
}
.blog-tools[hidden] {
  display: none;
}
@media (max-width: 760px) {
  .blog-tools {
    grid-template-columns: 1fr;
  }
}
.doc .blog-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 22px;
  margin-top: 2rem;
}
.blog-card {
  padding: 0 0 22px;
  gap: 0.55rem;
  overflow: hidden;
  border: 0;
  border-top: 0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(21, 23, 28, 0.06),
    0 12px 30px -18px rgba(21, 23, 28, 0.25);
}
.blog-card:hover,
.blog-card:focus-within {
  border-color: transparent;
  box-shadow:
    0 1px 2px rgba(21, 23, 28, 0.06),
    0 24px 48px -20px rgba(21, 23, 28, 0.35);
}
.blog-card > :not(.blog-cover) {
  margin-inline: 22px;
}
.blog-card h2 {
  font-size: 1.35rem;
  line-height: 1.22;
  margin: 0;
}
.blog-card h2 a {
  color: var(--ink);
}
.blog-card p {
  color: var(--ink-dim) !important;
  font-size: 0.98rem !important;
  line-height: 1.55 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-card .blog-meta {
  display: block;
  -webkit-line-clamp: unset;
  font-size: 0.82rem !important;
}
.blog-more {
  display: none;
}
.blog-card--featured {
  background: #ffffff;
  grid-template-columns: 1.25fr 1fr;
  column-gap: 0;
  align-items: center;
  padding: 0;
}
.blog-card--featured .blog-cover {
  grid-row: 1 / span 3;
  height: 100%;
  aspect-ratio: auto;
  min-height: 300px;
  border-radius: 0;
}
.blog-card--featured > :not(.blog-cover) {
  margin-inline: 36px;
}
.blog-card--featured h2 {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.4rem);
}
@media (max-width: 760px) {
  .blog-card--featured {
    grid-template-columns: 1fr;
    padding-bottom: 22px;
  }
  .blog-card--featured .blog-cover {
    grid-row: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .blog-card--featured > :not(.blog-cover) {
    margin-inline: 22px;
  }
}
.blog-topic {
  background: #fde8e9;
  color: #9b1f26;
}
.blog-meta {
  color: var(--ink-dim);
}

/* covers: a photo is shown whole (never cropped); a drawn cover fills the 16:9 frame */
.blog-cover {
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8ebf0;
}
.blog-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: scale 600ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.blog-card:hover .blog-cover img {
  scale: 1.035;
}
/* the drawn cover: a sheet of paper, lines of text, one highlighted, and the star */
.blog-cover--drawn {
  position: relative;
  display: grid;
  place-items: center;
  --tint: #e7e2f3;
  --tint-2: #d4cbea;
  background:
    radial-gradient(90% 120% at 15% 0%, rgba(255, 255, 255, 0.7), transparent 60%),
    linear-gradient(150deg, var(--tint), var(--tint-2));
}
.blog-cover--drawn[data-topic='Guide'] {
  --tint: #f6dfe0;
  --tint-2: #e9b9bc;
}
.blog-cover--drawn[data-topic='IP news'] {
  --tint: #dde6f3;
  --tint-2: #b8c9e3;
}
.blog-cover--drawn[data-topic='Privacy'] {
  --tint: #dcece6;
  --tint-2: #b4d6c9;
}
.blog-cover--drawn[data-topic="What's new"] {
  --tint: #f7ead0;
  --tint-2: #eccf94;
}
.sheet {
  position: relative;
  width: 46%;
  aspect-ratio: 3 / 3.4;
  padding: 9% 9%;
  display: flex;
  flex-direction: column;
  gap: 9%;
  background: #ffffff;
  border-radius: 4px;
  box-shadow:
    0 2px 4px rgba(21, 23, 28, 0.08),
    0 22px 40px -18px rgba(21, 23, 28, 0.45);
  rotate: -4deg;
  transition: rotate 500ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.blog-cover--drawn[data-v='1'] .sheet {
  rotate: 3deg;
}
.blog-cover--drawn[data-v='2'] .sheet {
  rotate: -1.5deg;
}
.blog-card:hover .sheet {
  rotate: 0deg;
}
.sheet i {
  display: block;
  height: 6%;
  border-radius: 3px;
  background: #d9dde4;
}
.sheet i:nth-child(3n + 2) {
  width: 86%;
}
.sheet i.short {
  width: 58%;
}
.sheet i.hl {
  background: linear-gradient(90deg, #f6d55c, #f3c93c);
  box-shadow: 0 0 0 3px rgba(246, 213, 92, 0.35);
}
.sheet svg {
  position: absolute;
  left: -9%;
  top: 33%;
  width: 15%;
  fill: #f5b942;
  stroke: #9c6a12;
  stroke-width: 0.8;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}
.blog-cover--drawn .cover-topic {
  position: absolute;
  left: 18px;
  bottom: 14px;
  font: 600 0.78rem var(--body);
  color: rgba(21, 23, 28, 0.6);
}

/* ── An article ───────────────────────────────────────────────────────────────────────── */

.blog-article h1 {
  font-size: clamp(2.2rem, 1.3rem + 3.2vw, 3.8rem);
}
.blog-article > .blog-cover {
  margin: 1.6rem 0 0.4rem;
  border-radius: 16px;
}
.blog-actions .button {
  min-height: 40px;
  padding: 0 16px;
  background: #f3f4f7;
  color: var(--ink);
  border: 0;
}
.blog-video,
.doc .blog-video {
  margin: 1.2rem 0;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: #f3f4f7;
  color: var(--ink);
  text-decoration: none;
}
.blog-video__play {
  width: 40px;
  height: 40px;
}
.blog-body-text {
  font-family: var(--display);
}
.blog-body-text p,
.blog-body-text li {
  font-size: clamp(1.1rem, 1rem + 0.35vw, 1.27rem);
  line-height: 1.75;
  color: #22262e;
}
.blog-body-text h2 {
  margin-top: 2.6rem;
}
.blog-body-text h2::after {
  content: '';
  display: block;
  width: 48px;
  height: 6px;
  margin-top: 10px;
  border-radius: 3px;
  background: #f6d55c;
}
.blog-figure img {
  border-radius: 14px;
  border: 1px solid #e3e6eb;
}
.blog-figure figcaption {
  color: var(--ink-dim);
}
/* "On this page": a small fold-out; on wide screens a list beside the article */
.blog-contents,
.doc .blog-contents {
  margin: 1.2rem 0;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #f3f4f7;
}
.blog-contents summary {
  min-height: 48px;
  padding: 0 16px;
  font: 600 0.95rem var(--body);
}
.blog-contents ol {
  list-style: none;
  margin: 0;
  padding: 0 16px 14px;
}
.blog-contents a {
  color: var(--ink-dim);
  font-size: 0.92rem;
}
.blog-contents a.is-here,
.blog-contents a:hover {
  color: var(--ink);
}
@media (min-width: 1240px) {
  .blog-article:not(.is-stepping) .blog-contents {
    position: fixed;
    top: 110px;
    left: calc(50% + 35ch + 40px);
    width: min(250px, calc(50% - 35ch - 64px));
    max-height: calc(100vh - 140px);
    overflow: auto;
    margin: 0;
    background: transparent;
  }
  .blog-article:not(.is-stepping) .blog-contents summary {
    padding: 0;
    min-height: 32px;
    color: var(--ink-dim);
  }
  .blog-article:not(.is-stepping) .blog-contents ol {
    padding: 0;
    border-left: 2px solid #e3e6eb;
  }
  .blog-article:not(.is-stepping) .blog-contents a {
    display: block;
    padding: 6px 0 6px 14px;
    margin-left: -2px;
    border-left: 2px solid transparent;
  }
  .blog-article:not(.is-stepping) .blog-contents a.is-here {
    border-left-color: var(--accent);
  }
}
.blog-next a {
  background: #f3f4f7;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
}
.blog-stepper__dots button::before {
  background: #c9ced8;
}
.read-progress span {
  background: #f6d55c;
}

.blog-cover:not(.blog-cover--drawn),
.blog-card--featured .blog-cover:not(.blog-cover--drawn) {
  aspect-ratio: auto;
  height: auto;
  min-height: 0;
  background: transparent;
}
.blog-cover:not(.blog-cover--drawn) img {
  height: auto;
  object-fit: contain;
}

/* ── Blog: one search for every article, with what it finds inside them ───────────────────── */

.blog-tools {
  grid-template-columns: minmax(0, 1fr);
}
.blog-search {
  position: relative;
  display: block;
}
.blog-search svg {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 20px;
  height: 20px;
  translate: 0 -50%;
  fill: none;
  stroke: var(--ink-dim);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}
.blog-search input {
  width: 100%;
  min-height: 56px;
  padding: 0 52px 0 48px;
  font-size: 17px;
  box-shadow: 0 8px 24px rgb(16 24 40 / 6%);
}
.blog-search input::-webkit-search-cancel-button {
  display: none;
}
.blog-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  translate: 0 -50%;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-dim);
  font-size: 18px;
  cursor: pointer;
}
.blog-try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: -2px 0 0;
}
.blog-try button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px dashed #c9ced8;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: 500 14px var(--body);
  cursor: pointer;
}
.blog-try button:hover,
.blog-try button:focus-visible {
  border-style: solid;
  background: #ffffff;
}
.blog-found {
  margin: 1.6rem 0 0;
  padding: 18px 18px 8px;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgb(16 24 40 / 8%);
}
.blog-found[hidden] {
  display: none;
}
.blog-found__title {
  margin: 0 0 6px;
  font: 700 1.25rem/1.3 var(--display);
}
.blog-found__title .fine {
  font: 500 14px var(--body);
  color: var(--ink-dim);
  margin-left: 6px;
}
.blog-found__article {
  padding: 12px 0 10px;
  border-top: 1px solid #e8eaef;
}
.blog-found__article:first-of-type {
  border-top: 0;
}
.blog-found__name {
  display: inline-block;
  font: 700 1.05rem/1.35 var(--display);
  color: var(--ink);
  text-decoration: none;
  margin: 2px 0 6px;
}
.blog-found__name:hover {
  text-decoration: underline;
}
.blog-found__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.blog-found__list a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6f7f9;
  color: var(--ink);
  text-decoration: none;
  transition: background 150ms ease;
}
.blog-found__list a:hover,
.blog-found__list a:focus-visible {
  background: #eef0f4;
}
.blog-found__head {
  display: block;
  font: 600 12.5px/1.35 var(--body);
  color: var(--ink-dim);
  margin-bottom: 3px;
}
.blog-found__text {
  display: block;
  font: 400 15px/1.5 var(--body);
}
.blog-found mark {
  background: var(--hl-soft);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.blog-found__more {
  display: inline-block;
  margin: 8px 0 4px;
  font: 600 14px var(--body);
  color: var(--tape);
}
@media (prefers-reduced-motion: reduce) {
  .blog-found__list a {
    transition: none;
  }
}

/* Under every article's title (scripts/site-blog.mjs): the author, and a quiet line about the apps.
   Colours are set here so the lines read on the light article pages and the compilations alike. */
.blog-byline {
  margin: 6px 0 4px;
  font: 600 15px/1.4 var(--body);
  color: #4a5160;
}
.blog-byline a {
  color: inherit;
}
.blog-apps {
  margin: 0 0 18px;
  font: 400 14px/1.5 var(--body);
  color: #5b6270;
}
.blog-apps a {
  color: #a8741a;
  font-weight: 600;
}
