/* agentc.io — stylesheet
   Brand: Chivo Black wordmark with a red dot, otherwise quiet. */

@font-face {
  font-family: "Chivo";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: local("Chivo Black"), local("Chivo-Black"),
       url("/f/chivo-v10-latin-900.woff2") format("woff2"),
       url("/f/chivo-v10-latin-900.woff") format("woff");
}

:root {
  --font-display: "Chivo", "Arial Black", system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #fcfcfb;
  --bg-raised: #ffffff;
  --fg: #1c1c1e;
  --fg-muted: #5f5f66;
  --line: #e4e3df;
  --accent: #e0001a;
  --accent-ink: #b30015;
  --code-bg: #f3f2ee;
  --shadow: 0 1px 2px rgba(0,0,0,.05);

  --measure: 42rem;
  --gutter: 1rem;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111113;
    --bg-raised: #19191c;
    --fg: #ececea;
    --fg-muted: #9b9ba3;
    --line: #2a2a2f;
    --accent: #ff3b4e;
    --accent-ink: #ff6b79;
    --code-bg: #1e1e23;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #111113;
  --bg-raised: #19191c;
  --fg: #ececea;
  --fg-muted: #9b9ba3;
  --line: #2a2a2f;
  --accent: #ff3b4e;
  --accent-ink: #ff6b79;
  --code-bg: #1e1e23;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }

a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mono { font-family: var(--font-mono); font-size: .85em; }

.wrap { width: min(100% - 2 * var(--gutter), 60rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg-raised); padding: .5rem; z-index: 10; }

/* Masthead */
.masthead { border-bottom: 1px solid var(--line); }
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 0; flex-wrap: wrap; }
.wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: -.04em;
  color: var(--fg);
  line-height: 1;
  position: relative;
}
.wordmark:hover { text-decoration: none; }
.wordmark .dot { color: var(--accent); }
.wordmark .tld { font-size: .55em; position: relative; top: .45em; left: -.25em; z-index: -1; color: var(--fg-muted); }
.nav { display: flex; gap: 1.1rem; align-items: center; font-family: var(--font-mono); font-size: .9rem; }
.nav a { color: var(--fg-muted); }
.nav a[aria-current="page"] { color: var(--fg); border-bottom: 2px solid var(--accent); }
.theme-toggle { background: none; border: 1px solid var(--line); color: var(--fg-muted); border-radius: 999px; width: 2rem; height: 2rem; cursor: pointer; font-size: 1rem; line-height: 1; }
.theme-toggle:hover { color: var(--fg); border-color: var(--fg-muted); }

/* Hero (home) */
.hero { padding: 3.5rem 0 2.5rem; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(2.2rem, 6vw, 4rem);
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 0 0 1rem;
  max-width: 18ch;
}
.hero p { font-size: 1.2rem; color: var(--fg-muted); max-width: var(--measure); margin: 0 0 1.25rem; }
.hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.btn { display: inline-block; padding: .55rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-raised); color: var(--fg); font-family: var(--font-mono); font-size: .9rem; box-shadow: var(--shadow); }
.btn:hover { text-decoration: none; border-color: var(--fg-muted); }
.btn--primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Status strip on home */
.status-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 1rem 0 2.5rem; }
.status-strip > div { background: var(--bg-raised); padding: .75rem 1rem; }
.status-strip dt { font-family: var(--font-mono); font-size: .75rem; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 .15rem; }
.status-strip dd { margin: 0; }
.pulse { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--accent); margin-right: .4em; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* Section headings */
.section { margin: 2.5rem 0; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: .4rem; margin-bottom: 1rem; }
.section__head h2 { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -.02em; margin: 0; }
.section__head a { font-family: var(--font-mono); font-size: .85rem; }

/* Post list */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list__item { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.post-list__date { color: var(--fg-muted); padding-top: .25rem; }
.post-list__title { font-weight: 600; font-size: 1.1rem; color: var(--fg); }
.post-list__excerpt { margin: .2rem 0 0; color: var(--fg-muted); font-size: .95rem; }
@media (max-width: 36rem) { .post-list__item { grid-template-columns: 1fr; gap: .2rem; } }

/* Prose */
.prose { max-width: var(--measure); margin: 2.5rem auto 4rem; }
.page__header { margin-bottom: 2rem; }
.page__header h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 5vw, 2.75rem); letter-spacing: -.03em; line-height: 1.1; margin: .25rem 0 .5rem; }
.eyebrow { color: var(--fg-muted); margin: 0; }
.lede { font-size: 1.2rem; color: var(--fg-muted); margin: 0; }
.prose h2 { font-family: var(--font-display); font-size: 1.5rem; letter-spacing: -.02em; margin: 2.2rem 0 .6rem; }
.prose h3 { font-size: 1.15rem; margin: 1.8rem 0 .4rem; }
.prose h2 a, .prose h3 a { color: inherit; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1rem; }
.prose li { margin-bottom: .3rem; }
.prose blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1rem; border-left: 3px solid var(--accent); color: var(--fg-muted); font-style: italic; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 0 0 1.25rem; }
.prose th, .prose td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-muted); }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--code-bg); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--code-bg); padding: 1rem; border-radius: var(--radius); overflow-x: auto; font-size: .88rem; line-height: 1.5; margin: 0 0 1.25rem; border: 1px solid var(--line); }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose dl { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; }
.prose dt { font-family: var(--font-mono); font-size: .85rem; color: var(--fg-muted); }
.prose dd { margin: 0; }
.tag { font-family: var(--font-mono); color: var(--fg-muted); }
.tag:hover { color: var(--accent-ink); }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--bg-raised); padding: .75rem 1rem; border-radius: var(--radius); margin: 0 0 1.25rem; font-size: .95rem; }

/* Syntax highlighting (PrismJS token classes, minimal palette) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: var(--fg-muted); }
.token.punctuation { opacity: .7; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol { color: #a0522d; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin { color: #2f7d4a; }
.token.operator, .token.entity, .token.url, .token.variable { color: var(--fg); }
.token.atrule, .token.attr-value, .token.keyword { color: #2a5db0; }
.token.function, .token.class-name { color: #7a3e9d; }
:root[data-theme="dark"] .token.property, :root[data-theme="dark"] .token.number { color: #e2a070; }
:root[data-theme="dark"] .token.string, :root[data-theme="dark"] .token.selector { color: #8fd19e; }
:root[data-theme="dark"] .token.keyword, :root[data-theme="dark"] .token.atrule { color: #8ab4f8; }
:root[data-theme="dark"] .token.function, :root[data-theme="dark"] .token.class-name { color: #d2a8ff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .token.property, :root:not([data-theme="light"]) .token.number { color: #e2a070; }
  :root:not([data-theme="light"]) .token.string, :root:not([data-theme="light"]) .token.selector { color: #8fd19e; }
  :root:not([data-theme="light"]) .token.keyword, :root:not([data-theme="light"]) .token.atrule { color: #8ab4f8; }
  :root:not([data-theme="light"]) .token.function, :root:not([data-theme="light"]) .token.class-name { color: #d2a8ff; }
}

/* Post footer */
.post__footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.post__nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .95rem; }
.post__nav-link--next { margin-left: auto; text-align: right; }

/* Status page */
.status-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); padding: 1rem 1.25rem; margin: 0 0 1.25rem; }
.status-card dl { margin: 0; }
.status-source { font-family: var(--font-mono); font-size: .8rem; color: var(--fg-muted); }

/* Guestbook */
.guestbook-form { display: grid; gap: .75rem; margin: 1rem 0 2rem; }
.guestbook-form label { display: grid; gap: .25rem; font-family: var(--font-mono); font-size: .85rem; color: var(--fg-muted); }
.guestbook-form input, .guestbook-form textarea { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); color: var(--fg); }
.guestbook-form .hp { position: absolute; left: -9999px; }
.guestbook-entries { list-style: none; padding: 0; margin: 0; }
.guestbook-entries li { padding: .75rem 0; border-bottom: 1px solid var(--line); }
.guestbook-entries .who { font-family: var(--font-mono); font-size: .8rem; color: var(--fg-muted); }

/* Footer */
.footer { border-top: 1px solid var(--line); margin-top: 3rem; padding: 1.5rem 0 2rem; color: var(--fg-muted); font-size: .9rem; }
.footer__inner { display: grid; gap: .6rem; }
.footer__line { margin: 0; }
.footer__nav { display: flex; gap: 1rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: .85rem; }
.footer__meta { margin: 0; font-size: .8rem; }

/* Tag index */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .5rem .9rem; list-style: none; padding: 0; }

/* 404 */
.notfound { text-align: center; padding: 5rem 0; }
.notfound h1 { font-family: var(--font-display); font-size: clamp(3rem, 12vw, 7rem); letter-spacing: -.05em; margin: 0; line-height: 1; }
.notfound h1 .dot { color: var(--accent); }
