/* -----------------------------------------------------------------------
   literate-robot / forwarddeployed.eu — space-age dark theme
   Plain CSS, no framework. Static background only (CSS gradients + an
   inline SVG data URI for the starfield) — no JavaScript, no animation
   beyond opt-in hover transitions, which are disabled below under
   prefers-reduced-motion.
   ----------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Surfaces, darkest to lightest */
  --color-bg: #05070d;
  --color-bg-elevated: #0d1220;   /* header, footer, cards */
  --color-bg-inset: #10182b;      /* code, tags */

  /* Text */
  --color-text: #e8ecf7;
  --color-muted: #a6b0c8;

  /* Accents */
  --color-accent: #22d3ee;        /* neon cyan */
  --color-accent-strong: #67e8f9;
  --color-accent-2: #c084fc;      /* neon violet */

  /* Borders / dividers */
  --color-border: #262f4d;
  --color-border-strong: #3a4568;

  /* Layout */
  --max-width: 46rem;
  --content-width: 68ch;
  --radius: 0.6rem;

  --font-heading: "Space Grotesk", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* -------------------------------------------------------------------- */
/* Self-hosted fonts                                                    */
/* -------------------------------------------------------------------- */
/* Space Grotesk (headings) and Inter (body) are self-hosted from
   docs/assets/fonts/ under the SIL Open Font License. font-display:
   swap avoids invisible text; the system-font stacks above are the
   fallback while a font loads (or if a file is ever missing). */

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* -------------------------------------------------------------------- */
/* Reset & base                                                         */
/* -------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.65;
  overflow-wrap: break-word;
  position: relative;
}

/* Static starfield + nebula glow. Fixed, behind all content, purely
   decorative (aria-hidden isn't needed since it's not in the DOM). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  background-position: 0 0, 0 0, 0 0, 0 0;
  background-size: auto, auto, auto, 300px 300px;
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 0%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(ellipse 60% 45% at 100% 15%, rgba(192, 128, 252, 0.13), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 100%, rgba(34, 211, 238, 0.06), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Ccircle cx='12' cy='34' r='1' fill='white' fill-opacity='0.8'/%3E%3Ccircle cx='47' cy='10' r='0.7' fill='white' fill-opacity='0.6'/%3E%3Ccircle cx='78' cy='58' r='1.2' fill='white' fill-opacity='0.9'/%3E%3Ccircle cx='130' cy='22' r='0.6' fill='white' fill-opacity='0.5'/%3E%3Ccircle cx='162' cy='77' r='1' fill='white' fill-opacity='0.7'/%3E%3Ccircle cx='200' cy='15' r='0.8' fill='white' fill-opacity='0.6'/%3E%3Ccircle cx='238' cy='60' r='1.3' fill='white' fill-opacity='0.8'/%3E%3Ccircle cx='270' cy='30' r='0.7' fill='white' fill-opacity='0.5'/%3E%3Ccircle cx='20' cy='110' r='0.9' fill='white' fill-opacity='0.7'/%3E%3Ccircle cx='55' cy='140' r='0.6' fill='white' fill-opacity='0.4'/%3E%3Ccircle cx='90' cy='160' r='1.1' fill='white' fill-opacity='0.8'/%3E%3Ccircle cx='125' cy='105' r='0.7' fill='white' fill-opacity='0.5'/%3E%3Ccircle cx='150' cy='150' r='1' fill='white' fill-opacity='0.6'/%3E%3Ccircle cx='185' cy='120' r='0.8' fill='white' fill-opacity='0.7'/%3E%3Ccircle cx='215' cy='160' r='1.2' fill='white' fill-opacity='0.9'/%3E%3Ccircle cx='250' cy='110' r='0.6' fill='white' fill-opacity='0.5'/%3E%3Ccircle cx='280' cy='150' r='0.9' fill='white' fill-opacity='0.6'/%3E%3Ccircle cx='10' cy='190' r='0.7' fill='white' fill-opacity='0.6'/%3E%3Ccircle cx='40' cy='220' r='1' fill='white' fill-opacity='0.7'/%3E%3Ccircle cx='75' cy='250' r='0.6' fill='white' fill-opacity='0.4'/%3E%3Ccircle cx='105' cy='205' r='1.3' fill='white' fill-opacity='0.8'/%3E%3Ccircle cx='140' cy='230' r='0.8' fill='white' fill-opacity='0.6'/%3E%3Ccircle cx='175' cy='270' r='0.7' fill='white' fill-opacity='0.5'/%3E%3Ccircle cx='205' cy='220' r='1' fill='white' fill-opacity='0.7'/%3E%3Ccircle cx='235' cy='250' r='0.6' fill='white' fill-opacity='0.4'/%3E%3Ccircle cx='260' cy='200' r='1.1' fill='white' fill-opacity='0.8'/%3E%3Ccircle cx='290' cy='240' r='0.7' fill='white' fill-opacity='0.5'/%3E%3Ccircle cx='25' cy='270' r='0.9' fill='white' fill-opacity='0.6'/%3E%3Ccircle cx='60' cy='290' r='0.6' fill='white' fill-opacity='0.4'/%3E%3Ccircle cx='95' cy='10' r='0.8' fill='white' fill-opacity='0.6'/%3E%3C/svg%3E");
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 1rem;
}

img, svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration-color: rgba(34, 211, 238, 0.5);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--color-accent-strong);
  text-decoration-color: currentColor;
}

/* -------------------------------------------------------------------- */
/* Accessibility: focus, motion, skip link                              */
/* -------------------------------------------------------------------- */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--color-bg-elevated);
  color: var(--color-text);
  padding: 0.65rem 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  z-index: 100;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* -------------------------------------------------------------------- */
/* Header                                                                */
/* -------------------------------------------------------------------- */

.site-header {
  background: var(--color-bg-elevated);
  border-bottom: 1px solid var(--color-border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 1.1rem 1.25rem;
}

.site-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-text);
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.site-title:hover {
  color: var(--color-accent-strong);
}

.brand-mark {
  color: var(--color-accent);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--color-muted);
  font-size: 0.95rem;
}

.site-nav a:hover {
  color: var(--color-accent-strong);
}

/* -------------------------------------------------------------------- */
/* Main / hero                                                          */
/* -------------------------------------------------------------------- */

main.wrap {
  padding-top: 0;
  padding-bottom: 3.5rem;
  min-height: 60vh;
}

.hero {
  padding: 3.25rem 0 2.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2.5rem;
}

.hero-title {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  margin: 0 0 0.75rem;
  text-shadow: 0 0 28px rgba(34, 211, 238, 0.25);
}

.hero-tagline {
  max-width: var(--content-width);
  color: var(--color-muted);
  font-size: 1.1rem;
  margin: 0;
}

.section {
  margin-top: 3rem;
}

.section h2 {
  font-size: 1.4rem;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-border-strong);
  display: inline-block;
}

/* -------------------------------------------------------------------- */
/* Card lists (posts / from-the-web)                                    */
/* -------------------------------------------------------------------- */

.post-list,
.ftw-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.1rem;
}

.post-item,
.ftw-item {
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.post-item:hover,
.ftw-item:hover {
  border-color: var(--color-border-strong);
  box-shadow: 0 0 0 1px var(--color-border-strong), 0 8px 28px -12px rgba(34, 211, 238, 0.25);
  transform: translateY(-1px);
}

.post-item h3,
.ftw-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
  line-height: 1.35;
}

.post-item h3 a,
.ftw-item h3 a {
  color: var(--color-text);
  text-decoration: none;
}

.post-item h3 a:hover,
.ftw-item h3 a:hover {
  color: var(--color-accent-strong);
}

.post-item-meta,
.ftw-meta {
  margin: 0 0 0.6rem;
  font-size: 0.85rem;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.ftw-type {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-accent-2);
}

.post-item-summary,
.ftw-summary {
  margin: 0.25rem 0 0;
  color: var(--color-text);
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--color-accent);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  margin: 0.15rem 0.3rem 0.15rem 0;
}

.empty {
  color: var(--color-muted);
  font-style: italic;
}

/* -------------------------------------------------------------------- */
/* Post page                                                            */
/* -------------------------------------------------------------------- */

.post {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-top: 2.5rem;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.post-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  margin: 0 0 0.75rem;
}

.post-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.post-tags {
  display: inline-flex;
  flex-wrap: wrap;
}

.post-content {
  font-size: 1.05rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
  margin: 2.2rem 0 0.9rem;
}

.post-content h2:first-child,
.post-content h3:first-child {
  margin-top: 0;
}

.post-content p,
.post-content ul,
.post-content ol {
  margin: 0 0 1.15rem;
}

.post-content ul,
.post-content ol {
  padding-left: 1.4rem;
}

.post-content li + li {
  margin-top: 0.35rem;
}

.post-content a {
  overflow-wrap: break-word;
}

.post-content blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 3px solid var(--color-accent-2);
  background: rgba(192, 128, 252, 0.06);
  color: var(--color-muted);
}

.post-content blockquote p:last-child {
  margin-bottom: 0;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: 0.3rem;
  padding: 0.15em 0.4em;
}

.post-content pre {
  background: var(--color-bg-inset);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  max-width: 100%;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85em;
}

.post-content hr {
  border: none;
  height: 1px;
  margin: 2.5rem 0;
  background: linear-gradient(90deg, transparent, var(--color-border-strong), transparent);
}

.post-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 1.15rem;
}

.post-content th,
.post-content td {
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.post-content th {
  background: var(--color-bg-inset);
  font-family: var(--font-heading);
}

.post-content img {
  display: block;
  margin: 1.5rem 0;
  border-radius: var(--radius);
}

/* -------------------------------------------------------------------- */
/* Footer                                                                */
/* -------------------------------------------------------------------- */

.site-footer {
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border);
  padding: 1.5rem 0;
  color: var(--color-muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--color-muted);
  text-decoration-color: rgba(166, 176, 200, 0.5);
}

.site-footer a:hover {
  color: var(--color-accent-strong);
}

/* -------------------------------------------------------------------- */
/* Responsive (down to ~360px)                                          */
/* -------------------------------------------------------------------- */

@media (max-width: 30rem) {
  .site-header .wrap {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 2.25rem 0 1.75rem;
  }

  .post {
    padding-top: 1.75rem;
  }

  .post-item,
  .ftw-item {
    padding: 1rem 1.1rem;
  }
}

/* -------------------------------------------------------------------- */
/* Reduced motion (placed last so it overrides the hover rules above)   */
/* -------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .post-item:hover,
  .ftw-item:hover {
    transform: none;
  }
}
