/* Inner pages: download, support, privacy and security.
   Builds on styles.css (tokens, frame, .page-hero, .prose, details) and adds
   only what these pages need: bands with corner marks, edge-to-edge grids,
   spec lists, a docs layout with a contents column, and the connection
   diagram on /security. No glow, no dot screens, no glass. */

/* A band: a hairline on top with corner marks where it meets the frame. */
.band { position: relative; border-top: 1px solid var(--line); padding: clamp(3rem, 6vw, 4.5rem) var(--pad); }
.band::before, .band::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 9px;
  height: 9px;
  background:
    linear-gradient(var(--mark), var(--mark)) center / 1px 100% no-repeat,
    linear-gradient(var(--mark), var(--mark)) center / 100% 1px no-repeat;
  pointer-events: none;
}
.band::before { left: -5px; }
.band::after { right: -5px; }
.band-head { max-width: 44rem; margin: 0 auto; text-align: center; }
.band-head h2 { margin: 0 0 0.75rem; font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.03em; }
.band-head p { margin: 0 auto; max-width: 36rem; color: var(--ink-2); font-size: 1.0625rem; }
.band-col { max-width: 44rem; margin-inline: auto; }
.band-col > h2 { margin: 0 0 1rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.band-col > p, .band-col li { color: var(--ink-2); }
.band-col a, .band-head a, .cells a, .spec a { color: var(--ink); }

/* Edge-to-edge grid of cells, split by hairlines. */
.cells {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 1px;
  margin: clamp(2rem, 4vw, 3rem) calc(-1 * var(--pad)) calc(-1 * clamp(3rem, 6vw, 4.5rem));
  padding: 0;
  list-style: none;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.cells-2 { --cols: 2; }
.cells > * { padding: clamp(1.5rem, 3vw, 2.25rem) var(--pad); background: var(--bg); }
.cells h3 { margin: 0 0 0.5rem; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
.cells p { margin: 0 0 0.75rem; font-size: 0.9375rem; color: var(--ink-2); }
.cells p:last-child { margin-bottom: 0; }
.cells ul, .cells ol { margin: 0; padding-left: 1.1rem; font-size: 0.9375rem; color: var(--ink-2); }
.cells > li { margin: 0; }
.cells :is(ul, ol) li { margin-bottom: 0.55rem; }
.cells :is(ul, ol) li:last-child { margin-bottom: 0; }
.cells :is(ul, ol) li::marker { color: var(--ink-3); }
.cells :is(ul, ol) + p { margin-top: 1rem; }
.cells b { color: var(--ink); font-weight: 600; }
.cells-steps { counter-reset: step; }
.cells-steps > li { counter-increment: step; }
.cells-steps h3::before { content: counter(step) ". "; color: var(--brand-tint); }

/* Spec list: term on the left, value on the right, hairline rows. */
.spec { margin: 0; border-top: 1px solid var(--line); }
.spec > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 0.25rem 1.5rem; padding: 0.95rem 0; border-bottom: 1px solid var(--line); }
.spec dt { color: var(--ink-3); font-size: 0.9375rem; }
.spec dd { margin: 0; color: var(--ink); font-size: 0.9375rem; }
.doc-body .spec :is(dt, dd), .prose .spec :is(dt, dd) { font-size: 1rem; }
.spec dd span { color: var(--ink-2); }
/* The checksum: the one value people copy, so it's monospaced and selects whole. */
.hash { display: block; font: 400 0.875rem/1.55 var(--mono); letter-spacing: 0; color: var(--ink); overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.spec-note { margin: 1rem 0 0; font-size: 0.875rem; color: var(--ink-3); }
.spec-note code { color: var(--ink-2); user-select: all; -webkit-user-select: all; }

/* Download */
.dl-hero { padding: clamp(4rem, 9vw, 6.5rem) var(--pad) clamp(3rem, 6vw, 4.5rem); text-align: center; }
.dl-icon { display: block; width: 4.5rem; height: 4.5rem; margin: 0 auto 1.75rem; color: var(--logo); }
.dl-hero h1 { margin: 0 0 0.9rem; font-size: clamp(2.5rem, 1.4rem + 4.4vw, 4rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.035em; }
.dl-hero > p { max-width: 32rem; margin: 0 auto; color: var(--ink-2); font-size: 1.125rem; }
.dl-hero .actions { margin-top: 2rem; }
.dl-hero .button { height: 3rem; padding: 0 1.5rem; font-size: 1rem; }
.dl-meta { max-width: 40rem !important; margin-top: 1.1rem !important; font-size: 0.875rem !important; color: var(--ink-3) !important; }
.dl-meta a { color: var(--ink-2); }
.notes { margin: 0; padding-left: 1.1rem; }
.notes li { margin-bottom: 0.6rem; }
.notes li::marker { color: var(--ink-3); }
.notes b { color: var(--ink); font-weight: 600; }
.band-col > h2.notes-older { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); }

/* Docs layout: a contents column beside the text, like a docs site. */
.doc { display: grid; grid-template-columns: 15rem minmax(0, 1fr); flex: 1; }
.doc-toc { border-right: 1px solid var(--line); padding: 2.5rem 1.5rem 2.5rem var(--pad); font-size: 0.875rem; }
.doc-toc > div { position: sticky; top: 6rem; }
.doc-toc p { margin: 0 0 0.75rem; color: var(--ink-3); }
.doc-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.15rem; }
.doc-toc a { display: block; padding: 0.3rem 0; color: var(--ink-2); text-decoration: none; }
.doc-toc a:hover { color: var(--ink); }
.doc-body { padding: 2.5rem var(--pad) clamp(4rem, 8vw, 6rem) clamp(2rem, 5vw, 4.5rem); min-width: 0; }
.doc-body > * { max-width: 44rem; }
.doc-body h2 { margin: 3.5rem 0 0.85rem; padding-top: 0.25rem; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; scroll-margin-top: 5.5rem; }
.doc-body h2:first-child { margin-top: 0; }
.doc-body h3 { margin: 2rem 0 0.5rem; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
/* Reading text: 17px and lighter than --ink-2, for long policy pages. */
.doc-body, .prose { --read: #c3c7ce; font-size: 1.0625rem; line-height: 1.6; }
.doc-body p, .doc-body li, .prose p, .prose li { color: var(--read); }
.doc-body li::marker, .prose li::marker { color: var(--ink-3); }
.prose h3 { margin: 2rem 0 0.5rem; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
.prose b { color: var(--ink); font-weight: 600; }
.doc-body a { color: var(--ink); }
.doc-body ul, .doc-body ol { padding-left: 1.25rem; margin: 0 0 1rem; }
.doc-body li { margin-bottom: 0.45rem; }
.doc-body li::marker { color: var(--ink-3); }
.doc-body b, .doc-body strong { color: var(--ink); font-weight: 600; }
.doc-body pre { margin: 0 0 1rem; padding: 0.9rem 1rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font: 400 0.8125rem/1.6 var(--mono); color: var(--ink); }
.doc-body pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.page-meta { margin-top: 1.25rem !important; font-size: 0.9375rem !important; color: var(--ink-3) !important; }

/* Known limits: a hairline box at the top of /security. */
.limits { margin: 0; scroll-margin-top: 5.5rem; padding: 1.5rem 1.6rem 0.5rem; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); }
.doc-body .limits h2 { margin: 0 0 0.5rem; scroll-margin-top: 5.5rem; }
.limits > p { margin: 0 0 1rem; }
.limits ul { padding-left: 1.15rem; }
.limits li { margin-bottom: 0.7rem; }

/* A collapsed part of a section, for detail most readers can skip. */
.doc-more { margin: 1rem 0 0; border-top: 1px solid var(--line); }
.doc-more summary { font-weight: 600; }
.doc-more p { margin: 0 0 1rem; }

/* A labelled aside for things that are designed but not in this release. */
.planned { margin: 1.5rem 0; padding: 1.25rem 1.4rem; border: 1px solid var(--line-2); border-radius: 12px; }
.planned > :last-child { margin-bottom: 0; }
.planned-label { margin: 0 0 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--brand-tint) !important; }

/* The connection diagram: two Macs, the direct path, the relay below. */
.wire { margin: 2rem 0 2.25rem; }
.wire-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(7rem, 1fr) minmax(0, 1fr); align-items: center; }
.wire-node { padding: 1rem 1.1rem; border: 1px solid var(--line-2); border-radius: 12px; background: var(--bg); font-size: 0.875rem; color: var(--ink-2); }
.wire-node b { display: block; margin-bottom: 0.2rem; color: var(--ink); font-size: 0.9375rem; font-weight: 600; }
.wire-node svg { display: block; width: 22px; height: 22px; margin-bottom: 0.6rem; fill: none; stroke: var(--brand-tint); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.wire-link { position: relative; padding: 0 0.75rem; text-align: center; font-size: 0.8125rem; color: var(--ink-2); }
.wire-link::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid var(--brand); }
.wire-link span { position: relative; display: inline-block; padding: 0.2rem 0.5rem; background: var(--bg); }
.wire-via { position: relative; height: 4.5rem; margin-inline: calc(100% / 6); border: 1px dashed var(--line-2); border-top: 0; border-radius: 0 0 12px 12px; }
.wire-relay { position: relative; width: min(24rem, 52%); margin: -2.6rem auto 0; text-align: center; }
.wire-relay svg { margin-inline: auto; }
.wire-caption { margin: 1rem 0 0; font-size: 0.875rem; color: var(--ink-3) !important; text-align: center; }

@media (max-width: 81rem) {
  .band::before, .band::after { display: none; }
}
@media (max-width: 60rem) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc-toc { border-right: 0; border-bottom: 1px solid var(--line); padding: 1.75rem var(--pad); }
  .doc-toc > div { position: static; }
  .doc-toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.5rem; }
  .doc-body { padding-left: var(--pad); }
  .cells { --cols: 1; }
}
@media (max-width: 44rem) {
  .limits { padding: 1.25rem 1.1rem 0.25rem; }
  .spec > div { grid-template-columns: minmax(0, 1fr); }
  .doc-toc ol { grid-template-columns: minmax(0, 1fr); }
  /* The diagram stands up: home, the direct path, away, then the relay. */
  .wire-row { grid-template-columns: minmax(0, 1fr); }
  .wire-link { padding: 1.4rem 0; }
  .wire-link::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 1.5px solid var(--brand); }
  .wire-via { display: none; }
  .wire-relay { width: auto; margin-top: 1.25rem; }
}

/* Long paths and commands wrap instead of pushing the page sideways. */
:is(.cells, .doc-body, .spec, .prose, .spec-note) code { overflow-wrap: anywhere; }
