/* Site chrome: header nav + footer, shared by every page.
   Loaded on its own (without style.css) by hand-written HTML posts, so it must not depend
   on the host page: colors live in private --chrome-* vars, sizes are px/em (not rem). */

@font-face {
  font-family: "Inter Variable";
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter Variable";
  src: url("/static/fonts/inter-latin-wght-italic.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk Variable";
  src: url("/static/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

.site-header, .site-footer, .site-comments {
  --chrome-text: #1a1d21;
  --chrome-muted: #697077;
  --chrome-faint: #e3e7eb;
  --chrome-accent: #3a6ea5;
  --chrome-accent-soft: #eaf1f8;
  --chrome-card: #eff2f5;
  font-family: "Inter Variable", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
}
@media (prefers-color-scheme: dark) {
  .site-header, .site-footer, .site-comments {
    --chrome-text: #e6e9ec;
    --chrome-muted: #98a0a8;
    --chrome-faint: #2b3037;
    --chrome-accent: #8db8e0;
    --chrome-accent-soft: #1d2733;
    --chrome-card: #1b1f25;
  }
}

/* header */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1em;
  padding: 1.8em 0 1em;
  margin-bottom: 2.4em;
  border-bottom: 1px solid var(--chrome-faint);
}
.site-name {
  font-family: "Space Grotesk Variable", "Inter Variable", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--chrome-text);
  text-decoration: none;
  white-space: nowrap;
}
.site-header nav { display: flex; gap: 0.4em; }
.site-header nav a {
  font-size: 0.92em;
  font-weight: 500;
  color: var(--chrome-muted);
  text-decoration: none;
  padding: 0.25em 0.65em;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-header nav a:hover {
  color: var(--chrome-accent);
  background: var(--chrome-accent-soft);
}
@media (max-width: 600px) {
  .site-header { gap: 0.5em; }
  .site-header nav { gap: 0.1em; }
  .site-header nav a { padding: 0.25em 0.45em; }
}

/* footer */
.site-footer {
  margin-top: 59.5px;
  padding-top: 17px;
  border-top: 1px solid var(--chrome-faint);
  font-size: 15.3px;
  color: var(--chrome-muted);
}
.site-footer p { margin: 1em 0; }
.site-footer a { color: var(--chrome-muted); text-decoration: underline; text-decoration-color: var(--chrome-faint); }
.site-footer a:hover { color: var(--chrome-accent); }
.site-footer .fine { font-size: 13.6px; }
.site-footer .social-row { display: flex; flex-wrap: wrap; gap: 11.9px; margin: 25.5px 0; }
.site-footer .icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42.5px;
  height: 42.5px;
  border-radius: 50%;
  background: var(--chrome-card);
  color: var(--chrome-muted);
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.site-footer .icon-link svg { width: 21.25px; height: 21.25px; }
.site-footer .icon-link:hover { background: var(--chrome-accent-soft); color: var(--chrome-accent); }

/* comments (markup from build.mjs, comments filled in by the edge Worker) */
.site-comments {
  --chrome-field: #ffffff;
  margin-top: 59.5px;
  padding-top: 8.5px;
  border-top: 1px solid var(--chrome-faint);
  color: var(--chrome-text);
}
@media (prefers-color-scheme: dark) {
  .site-comments { --chrome-field: #1b1f25; }
}
.site-comments h2 {
  font-family: "Space Grotesk Variable", "Inter Variable", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.25em;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1em 0 0.6em;
}
.site-comments .comment-list { list-style: none; padding: 0; margin: 0 0 1.5em; }
.site-comments .comment-list:empty { display: none; }
.site-comments .comment {
  padding: 0.9em 1.1em;
  margin: 0 0 0.75em;
  background: var(--chrome-card);
  border-radius: 12px;
}
.site-comments .comment-meta { margin: 0 0 0.25em; font-size: 0.85em; color: var(--chrome-muted); }
.site-comments .comment-meta b { color: var(--chrome-text); font-weight: 600; margin-right: 0.5em; }
.site-comments .comment-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.site-comments .comment-empty { color: var(--chrome-muted); margin: 0 0 1.5em; }
.site-comments .comment-notice {
  margin: 0 0 1em;
  padding: 0.6em 0.9em;
  border-radius: 10px;
  background: var(--chrome-accent-soft);
  color: var(--chrome-accent);
  font-size: 0.92em;
}
.site-comments .comment-notice.err { background: color-mix(in srgb, #c0392b 12%, transparent); color: #c0392b; }
@media (prefers-color-scheme: dark) {
  .site-comments .comment-notice.err { color: #f08a7e; }
}
.site-comments .comment-form { display: grid; gap: 0.8em; max-width: 640px; }
.site-comments .comment-form label {
  display: grid;
  gap: 0.3em;
  font-size: 0.85em;
  font-weight: 500;
  color: var(--chrome-muted);
}
.site-comments input, .site-comments textarea {
  box-sizing: border-box;
  width: 100%;
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  color: var(--chrome-text);
  background: var(--chrome-field);
  border: 1px solid var(--chrome-faint);
  border-radius: 10px;
  padding: 0.55em 0.75em;
}
.site-comments textarea { resize: vertical; min-height: 6.5em; }
.site-comments input:focus, .site-comments textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--chrome-accent) 45%, transparent);
  outline-offset: 1px;
  border-color: var(--chrome-accent);
}
.site-comments .comment-note { margin: 0; font-size: 0.8em; color: var(--chrome-muted); }
.site-comments button {
  justify-self: start;
  font: inherit;
  font-size: 0.92em;
  font-weight: 600;
  color: var(--chrome-accent);
  background: var(--chrome-accent-soft);
  border: 0;
  border-radius: 999px;
  padding: 0.5em 1.2em;
  cursor: pointer;
}
.site-comments button:hover { filter: brightness(0.96); }
.site-comments .comment-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Hand-written HTML posts own <body>; this box gives the chrome the same column as the
   template pages (body max-width 56rem, side padding 2rem / 1.2rem at 17px). */
.chrome-column {
  box-sizing: border-box;
  max-width: 952px;
  margin: 0 auto;
  padding: 0 34px;
}
.chrome-column:last-child { padding-bottom: 51px; }
@media (max-width: 600px) {
  .chrome-column { padding-inline: 20px; }
}
