/* Aegis site styles. Colours come ONLY from tokens.css variables. */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img, svg { max-width: 100%; height: auto; display: block; }

/* Visible focus ring everywhere. Never removed without a replacement. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-top: 1.8em; }
h3 { font-size: 1.2rem; margin-top: 1.4em; }
p, ul, ol, table { margin: 0 0 1.1em; }
code { font-family: var(--font-mono); font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 6px; }

.wrap { width: min(100% - 2.5rem, var(--maxw)); margin-inline: auto; }
.narrow { max-width: 46rem; }
.muted { color: var(--muted); }

/* Skip link: hidden until focused, so keyboard users can jump past the menu. */
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--accent); color: var(--on-accent);
  padding: 0.6rem 1rem; border-radius: var(--radius); font-weight: 700;
}
.skip-link:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; padding-block: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--text); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; }
.brand svg { width: 1.6rem; color: var(--accent); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; padding: 0.35rem 0.1rem; }
.site-nav a:hover { color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

main { display: block; padding-block: 3rem 4rem; }

/* Hero */
.hero { padding-block: 2rem 1rem; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; margin-bottom: 0.8rem; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 40rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }

.button {
  display: inline-block; text-decoration: none; font-weight: 700;
  padding: 0.75rem 1.3rem; border-radius: var(--radius);
  background: var(--accent); color: var(--on-accent); border: 2px solid var(--accent);
  font: inherit; font-weight: 700; cursor: pointer;
}
.button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.button[disabled] { opacity: 0.6; cursor: not-allowed; }

/* Cards */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-block: 2rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem 1.4rem 0.6rem; }
.card h2, .card h3 { margin-top: 0; font-size: 1.2rem; }
.card p { color: var(--muted); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text); background: var(--surface); }
td { color: var(--muted); }
td strong { color: var(--text); }

.callout { border-left: 4px solid var(--accent); background: var(--surface); padding: 1rem 1.2rem; border-radius: 0 var(--radius) var(--radius) 0; margin-block: 1.5rem; }
.callout.warn { border-left-color: var(--danger); }
.callout p:last-child { margin-bottom: 0; }

/* Blog list */
.post-list { list-style: none; padding: 0; }
.post-list li { border-bottom: 1px solid var(--border); padding-block: 1.1rem; }
.post-list h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }
.post-list a { color: var(--text); text-decoration: none; }
.post-list a:hover { color: var(--accent); }

/* Forms */
.form { display: grid; gap: 1.1rem; max-width: 36rem; }
.field { display: grid; gap: 0.35rem; }
.field label { font-weight: 700; }
.field .hint { color: var(--muted); font-size: 0.92rem; }
input[type="text"], input[type="email"], textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.85rem;
}
textarea { min-height: 9rem; resize: vertical; }
.form-status { min-height: 1.5em; font-weight: 600; }
.form-status.error { color: var(--danger); }
.form-status.ok { color: var(--accent); }

/* Honeypot (1.11): hidden with CSS, never type="hidden", so bots still see and fill it. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding-block: 2rem; color: var(--muted); font-size: 0.95rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
