/* ============================================================
   Theme: HUD — FPV telemetry meets terminal.
   Palette, type, and layout tokens live here as CSS variables.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --bg:        #0B0F0E;
  --surface:   #131917;
  --surface-2: #1A211E;
  --line:      #263029;
  --hud:       #7CE7D6;   /* primary HUD teal — line art, links */
  --text:      #E8F5F0;
  --muted:     #5C6F6A;
  --amber:     #F2A93B;   /* metadata / warnings */
  --live:      #FF3D81;   /* spend rarely: one indicator only */

  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;

  --hud-bar-h: 44px;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- HUD top bar (signature element) ---------- */

.hud-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--hud-bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(11, 15, 14, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.hud-bar__brand {
  color: var(--hud);
  font-weight: 700;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* reticle mark — pure CSS, no image assets */
.reticle {
  width: 16px;
  height: 16px;
  position: relative;
  flex-shrink: 0;
}
.reticle::before,
.reticle::after {
  content: "";
  position: absolute;
  background: var(--hud);
}
.reticle::before { top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%); }
.reticle::after  { left: 50%; top: 0; height: 100%; width: 1px; transform: translateX(-50%); }
.reticle::before, .reticle::after { opacity: 0.9; }

.hud-bar__stats {
  display: flex;
  gap: 24px;
  font-variant-numeric: tabular-nums;
}

.hud-bar__stats span { color: var(--text); }
.hud-bar__stats b { color: var(--amber); font-weight: 500; }

.hud-bar__nav {
  display: flex;
  gap: 18px;
}
.hud-bar__nav a {
  color: var(--muted);
  text-decoration: none;
}
.hud-bar__nav a:hover,
.hud-bar__nav a:focus-visible {
  color: var(--hud);
}

/* ---------- Layout shell ---------- */

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 96px;
}

/* ---------- Post list ("flight log") ---------- */

.log-entry {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.log-entry__time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

.log-entry__title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
}
.log-entry__title a {
  color: var(--text);
  text-decoration: none;
  background-image: linear-gradient(var(--hud), var(--hud));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size 0.15s ease;
}
.log-entry__title a:hover,
.log-entry__title a:focus-visible {
  background-size: 100% 1px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--amber);
  border: 1px solid rgba(242, 169, 59, 0.35);
  padding: 2px 6px;
  border-radius: 2px;
  text-decoration: none;
}
.tag::before { content: "["; }
.tag::after  { content: "]"; }

.source-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 2px;
  margin-left: 8px;
  vertical-align: middle;
}
.source-badge--youtrack {
  color: var(--hud);
  border: 1px solid rgba(124, 231, 214, 0.35);
}
.source-badge--gitea {
  color: var(--amber);
  border: 1px solid rgba(242, 169, 59, 0.35);
}

.source-link {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}
.source-link:hover,
.source-link:focus-visible {
  color: var(--hud);
}

/* ---------- Gallery shortcode ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 1.6em 0;
}
.gallery__item {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}
.gallery__item:hover img,
.gallery__item:focus-visible img {
  transform: scale(1.04);
}

/* ---------- Gitea widget shortcode ---------- */

.gitea-widget {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  margin: 1.6em 0;
  background: var(--surface);
}

.gitea-widget__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gitea-widget__repo {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--hud);
  text-decoration: none;
}

.gitea-widget__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ci-badge,
.release-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 2px;
  text-decoration: none;
}

.ci-badge--success { color: var(--hud); border: 1px solid rgba(124, 231, 214, 0.35); }
.ci-badge--failure,
.ci-badge--error   { color: var(--live); border: 1px solid rgba(255, 61, 129, 0.35); }
.ci-badge--pending,
.ci-badge--warning { color: var(--amber); border: 1px solid rgba(242, 169, 59, 0.35); }

.release-badge {
  color: var(--amber);
  border: 1px solid rgba(242, 169, 59, 0.35);
}

.gitea-widget__since {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}

.gitea-widget__commits {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.gitea-widget__commits li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.commit-sha {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  flex-shrink: 0;
}
.commit-sha:hover,
.commit-sha:focus-visible {
  color: var(--hud);
}
.commit-msg {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commit-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

@media (max-width: 560px) {
  .gitea-widget__commits li { flex-wrap: wrap; }
  .commit-msg { white-space: normal; }
}

/* ---------- Mastodon widget shortcode ---------- */

.mastodon-widget {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 14px 16px;
  margin: 1.6em 0;
  background: var(--surface);
}

.mastodon-widget__header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mastodon-widget__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}

.mastodon-widget__author {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.mastodon-widget__author:hover,
.mastodon-widget__author:focus-visible {
  color: var(--hud);
}

.mastodon-widget__handle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.mastodon-widget__content {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.55;
}
.mastodon-widget__content p {
  margin: 0 0 0.6em;
}
.mastodon-widget__content p:last-child {
  margin-bottom: 0;
}
.mastodon-widget__content a {
  color: var(--hud);
}

.mastodon-widget__media {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
  margin-top: 10px;
}

.mastodon-widget__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.mastodon-widget__time {
  color: var(--muted);
  text-decoration: none;
}
.mastodon-widget__time:hover,
.mastodon-widget__time:focus-visible {
  color: var(--hud);
}
.mastodon-widget__stats {
  display: flex;
  gap: 12px;
}

/* ---------- Single post ---------- */

.post-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.post-header h1 {
  font-family: var(--font-mono);
  font-size: 28px;
  line-height: 1.3;
  margin: 0 0 10px;
}
.post-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.post-body h2 { font-family: var(--font-mono); font-size: 20px; color: var(--hud); margin-top: 2.2em; }
.post-body a { color: var(--hud); }
.post-body code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}
.post-body pre {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
}
.post-body pre code { background: none; padding: 0; }
.post-body img {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.post-body blockquote {
  border-left: 2px solid var(--hud);
  margin-left: 0;
  padding-left: 16px;
  color: var(--muted);
}

/* "live" indicator — the one place magenta appears */
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--live);
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(255, 61, 129, 0.5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255, 61, 129, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(255, 61, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 61, 129, 0); }
}

footer.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 20px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- Focus visibility (accessibility floor) ---------- */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--hud);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .hud-bar__stats { display: none; }
  .log-entry { grid-template-columns: 1fr; }
  .log-entry__time { padding-top: 0; }
}
