/* =============================================================================
   Semaphore site pages — nav, footer, page headers and article typography for
   the pages generated by tools/build-pages.js (support, developers, use cases,
   blog, terms, privacy). Builds on assets/app.css tokens.
   ============================================================================= */

:root { --gutter: 5%; --section-y: clamp(72px, 9vw, 128px); }
body { font-size: 16px; }
.skip { position: fixed; top: -100px; left: 16px; z-index: 101; padding: 12px 20px; background: var(--accent); color: var(--on-accent); }
.skip:focus { top: 16px; }

/* ---- Header ---- */
.site-nav {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 30px;
  height: 96px;
  padding: 0 var(--gutter);
}
.site-nav .logo { font-size: 25px; justify-self: start; }
.site-nav .logo svg { width: 22px; height: 27px; }
.site-links { display: flex; align-items: center; gap: 30px; font-size: 15px; }
.site-links a { display: flex; align-items: center; gap: 4px; }
.site-links a:hover, .site-links a[aria-current="page"] { color: var(--accent); }
.site-actions { justify-self: end; display: flex; align-items: center; gap: 14px; }
.site-actions .signin { font-size: 14px; font-weight: 550; margin: 0 6px 0 2px; }
.site-actions .signin:hover { color: var(--accent); }
.site-actions .btn { min-height: 44px; padding: 0 19px; font-size: 12px; }
.menu-btn { display: none; }

/* ---- Page header ---- */
.page-hero { padding: clamp(40px, 6vw, 88px) var(--gutter) clamp(48px, 6vw, 80px); }
.page-hero h1 {
  max-width: 14ch;
  margin-top: 26px;
  font-size: clamp(44px, 5.4vw, 84px);
  font-weight: 520;
  letter-spacing: -0.04em;
  line-height: 1.0;
  text-wrap: balance;
}
.page-hero > p:not(.eyebrow) { max-width: 520px; margin-top: 28px; font-size: 18px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.page-hero .meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; font-size: 14px; color: var(--muted); }
.page-hero .meta .tag { font-size: 11px; }

/* ---- Sections ---- */
.section { padding: var(--section-y) var(--gutter); }
.section + .section { border-top: 1px solid var(--line); }
.section-band { background: var(--panel); border-top: 0 !important; }
.section-dark { background: var(--fg); color: var(--bg); border-top: 0 !important; --line: color-mix(in srgb, var(--bg) 16%, transparent); --muted: color-mix(in srgb, var(--bg) 62%, var(--fg)); }
.section h2 { font-size: clamp(32px, 3.6vw, 52px); font-weight: 520; letter-spacing: -0.035em; line-height: 1.04; max-width: 14ch; text-wrap: balance; }
.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: end; margin-bottom: 56px; }
.section-head > p { max-width: 460px; font-size: 17px; line-height: 1.6; color: var(--muted); padding-bottom: 6px; text-wrap: pretty; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; align-items: start; }
.sticky { position: sticky; top: 40px; }

/* ---- Hairline rows ---- */
.rows > * { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; padding: 36px 0; border-top: 1px solid var(--line); }
.rows > *:last-child { border-bottom: 1px solid var(--line); }
.rows h3 { font-size: 20px; font-weight: 550; letter-spacing: -0.015em; }
.rows h3 + p { margin-top: 8px; max-width: 380px; font-size: 14px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.rows .link { justify-self: end; }
.logos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
.logos li { --brand: var(--fg); display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; color: var(--muted); transition: color 0.24s var(--ease); }
.logos svg { width: 22px; height: 22px; fill: currentColor; transition: fill 0.24s var(--ease), transform 0.3s var(--ease); }
.logos li:hover { color: var(--fg); }
.logos li:hover svg { fill: var(--brand); transform: translateY(-1px); }
html[data-theme="dark"] .logos li:hover svg { fill: color-mix(in srgb, var(--brand) 70%, #fff); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- Prose ---- */
.prose { max-width: 68ch; font-size: 17px; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; font-size: 30px; font-weight: 550; letter-spacing: -0.025em; line-height: 1.15; max-width: none; scroll-margin-top: 32px; }
.prose h3 { margin-top: 1.8em; font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose li { color: color-mix(in srgb, var(--fg) 86%, var(--muted)); text-wrap: pretty; }
.prose ul, .prose ol { padding-left: 1.2em; list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.prose a:hover { color: var(--accent); text-decoration-color: currentColor; }
.prose code { font-family: var(--mono); font-size: 0.9em; padding: 2px 6px; border-radius: 4px; background: var(--panel); }
.prose pre { margin-top: 1.1em; padding: 22px 26px; border-radius: 12px; background: var(--fg); color: var(--bg); font-family: var(--mono); font-size: 14px; line-height: 1.8; overflow-x: auto; white-space: pre; }
.prose pre code { padding: 0; background: none; font-size: inherit; }
.prose pre .k { color: #f5a07a; }
.prose pre .s { color: #bcd593; }
html[data-theme="dark"] .prose pre .k { color: #c9441f; }
html[data-theme="dark"] .prose pre .s { color: #4e7a2b; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.prose .callout { padding: 18px 22px; border-radius: 10px; background: var(--panel); font-size: 15px; }
.prose .callout b { font-weight: 600; }
.toc { position: sticky; top: 40px; }
.toc p { margin-bottom: 14px; }
.toc a { display: block; padding: 7px 0; font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); }
.toc a:last-child { border-bottom: 1px solid var(--line); }
.toc a:hover { color: var(--fg); }
.draft { display: inline-flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--fg); font-size: 13px; }
.draft b { color: var(--warn); font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- Forms ---- */
.form { display: grid; gap: 22px; max-width: 560px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.textarea { min-height: 140px; resize: vertical; line-height: 1.5; padding-top: 12px; }
.form .btn { justify-self: start; }

/* ---- Blog ---- */
.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px 40px; }
.post { position: relative; display: flex; flex-direction: column; }
.cover {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px;
  background: radial-gradient(circle, color-mix(in srgb, var(--fg) 14%, transparent) 1px, transparent 1.5px) 0 0 / 14px 14px, var(--panel);
}
.cover:after { content: ""; position: absolute; inset: 0; transition: transform 0.7s var(--ease); }
.cover-bars:after { inset: 22% 18%; background: repeating-linear-gradient(90deg, var(--accent) 0 14px, transparent 14px 26px); transform: skewY(-18deg); -webkit-mask: linear-gradient(90deg, #0006, #000 45%, #000 55%, #0006); mask: linear-gradient(90deg, #0006, #000 45%, #000 55%, #0006); }
.cover-rings:after { inset: -30% -10% -30% 35%; background: repeating-radial-gradient(circle at 30% 50%, transparent 0 18px, var(--accent) 18px 20px); opacity: 0.8; }
.cover-slats:after { inset: 24% 24%; background: repeating-linear-gradient(180deg, var(--fg) 0 18px, transparent 18px 26px); transform: skewY(-10deg); }
.cover-grid:after { background: radial-gradient(circle at 68% 42%, var(--accent) 0 9%, transparent 9.4%), linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 25%, linear-gradient(90deg, var(--line) 1px, transparent 1px) 0 0 / 12.5% 100%; }
.cover-dark { background-color: var(--fg); background-image: radial-gradient(circle, color-mix(in srgb, var(--bg) 16%, transparent) 1px, transparent 1.5px); }
.cover-dark span { color: var(--bg); }
.cover span { position: absolute; z-index: 1; left: 18px; top: 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg); }
.post:hover .cover:after { transform: scale(1.06); }
.post-meta { display: flex; gap: 10px; margin: 22px 0 10px; font-size: 13px; color: var(--muted); }
.post-meta span + span:before { content: "·"; margin-right: 10px; }
.post h3 { font-size: 21px; font-weight: 550; letter-spacing: -0.02em; line-height: 1.28; text-wrap: pretty; }
.post h3 a:after { content: ""; position: absolute; inset: 0; }
.post h3 a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.45s var(--ease); }
.post:hover h3 a { background-size: 100% 1px; }
.post > p:last-child { margin-top: 10px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.post-hero-cover { margin: 0 var(--gutter) 56px; aspect-ratio: 21 / 9; }
.more { margin-top: 72px; padding-top: 40px; border-top: 1px solid var(--line); }
.more p { margin-bottom: 24px; }
.more ul { display: grid; gap: 0; }
.more li { border-bottom: 1px solid var(--line); }
.more a { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-size: 16px; font-weight: 500; }
.more a:hover { color: var(--accent); }

/* ---- Footer ---- */
.site-footer { background: var(--panel); padding: 76px var(--gutter) 30px; }
.site-footer-top { display: flex; justify-content: space-between; align-items: center; gap: 40px; margin-bottom: 68px; }
.site-footer-top h2 { font-size: clamp(40px, 4.7vw, 68px); font-weight: 520; letter-spacing: -0.035em; line-height: 1.08; }
.site-footer-nav { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 28px 0; border-block: 1px solid var(--line); }
.site-footer-nav > div { display: flex; flex-wrap: wrap; gap: 30px; font-size: 13px; }
.site-footer-nav .logo { font-size: 25px; }
.site-footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 28px; font-size: 11px; color: var(--muted); }

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  .menu-btn { display: grid; }
  .site-links { display: none; }
  .site-links.is-open { display: flex; position: absolute; left: 4%; right: 4%; top: calc(100% - 8px); padding: 22px; flex-direction: column; align-items: flex-start; gap: 24px; font-size: 16px; background: var(--surface); border-radius: 8px; box-shadow: 0 15px 45px #0002, 0 0 0 1px var(--line); }
  .grid-2, .section-head, .rows > * { grid-template-columns: 1fr; gap: 24px; }
  .sticky, .toc { position: static; }
  .rows .link { justify-self: start; }
  .posts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  :root { --gutter: 6%; --section-y: 72px; }
  .site-nav { height: 78px; gap: 16px; }
  .site-actions .btn, .site-actions .signin { display: none; }
  .site-nav .logo { font-size: 23px; }
  .page-hero h1 { font-size: 40px; max-width: none; }
  .page-hero > p:not(.eyebrow) { font-size: 16px; margin-top: 20px; }
  .section h2 { font-size: 32px; max-width: none; }
  .logos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
  .posts { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .site-footer { padding-top: 56px; }
  .site-footer-top { flex-direction: column; align-items: flex-start; gap: 28px; margin-bottom: 41px; }
  .site-footer-nav { flex-wrap: wrap; gap: 24px; }
  .site-footer-bottom { flex-direction: column; gap: 6px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 26px; }
  .prose pre { padding: 18px; font-size: 13px; }
}

/* Ghost editor cards (required by gscan) */
.kg-width-wide, .kg-width-full { max-width: 100%; }
