/* Simulation Speculations — last-archive terminal design system.
   Dark-mode-first, monospace. The premise: this is a salvaged terminal
   running the last surviving copy of this information — amber distress-
   signal accent (not phosphor green), paper-grain + burn-scorch texture,
   dashed "patched together" dividers, corner tick marks like a salvage
   tag. Restrained — no flicker/glitch animation. */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* Surfaces — warm near-black, like ash rather than a cool CRT tube */
  --color-bg: #0d0906;
  --color-surface: #16100a;
  --color-surface-2: #18130b;
  --color-border: #3a2c1c;
  --color-divider: #2a2015;

  /* Text — bone / aged paper, not phosphor-tinted */
  --color-text: #e6ded0;
  --color-text-muted: #a8927a;
  --color-text-faint: #6b5a48;

  /* Accent — salvaged amber signal, not green */
  --color-accent: #d9a35a;
  --color-accent-dim: #a8632f;
  --color-accent-highlight: #2e1f10;
  --glow-accent: 0 0 6px rgba(217, 163, 90, 0.5), 0 0 16px rgba(217, 163, 90, 0.22);
  --glow-accent-soft: 0 0 4px rgba(217, 163, 90, 0.32);

  /* Hazard — used sparingly: corner ticks, a hairline, nothing louder */
  --color-hazard: #8a3a2e;

  /* Status */
  --color-error: #c65a4a;
  --color-error-highlight: #2a1512;
  --color-warn: #d9b25e;

  /* Type */
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Courier New', monospace;

  --text-xs: clamp(0.72rem, 0.7rem + 0.1vw, 0.8rem);
  --text-sm: clamp(0.82rem, 0.8rem + 0.15vw, 0.92rem);
  --text-base: clamp(0.95rem, 0.92rem + 0.2vw, 1.05rem);
  --text-lg: clamp(1.1rem, 1rem + 0.5vw, 1.35rem);
  --text-xl: clamp(1.4rem, 1.2rem + 1vw, 1.9rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  --content-width: 680px;
  --transition: 140ms ease-out;
}

/* ---------------------------------------------------------------------- */
/* Base reset */
/* ---------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: 1.65;
  position: relative;
  /* Degraded-scan texture: a faint scorch mark in one corner (like fire
     damage on a salvaged terminal casing), heavy vignette darkening
     toward the edges, and a very light scanline trace — amber-neutral,
     not the old green CRT glow. */
  background-image:
    radial-gradient(ellipse 60% 45% at 88% 8%, rgba(138,58,46,0.14) 0%, transparent 60%),
    linear-gradient(180deg, rgba(230,222,208,0.018) 0px, rgba(230,222,208,0.018) 1px, transparent 1px, transparent 3px),
    radial-gradient(ellipse at 50% 0%, rgba(217,163,90,0.04) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.5) 100%);
  background-attachment: fixed;
}

/* Paper-grain noise overlay — static, no animation (per spec: no
   glitch/flicker effects). Reads as a degraded scan/photocopy rather
   than a glowing screen. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.22;
  mix-blend-mode: overlay;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover, a:focus-visible {
  text-decoration: underline;
  text-decoration-color: var(--color-accent-dim);
}

::selection {
  background: var(--color-accent-highlight);
  color: var(--color-accent);
}

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

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------- */
/* Shell / layout */
/* ---------------------------------------------------------------------- */
.shell {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: var(--space-10) var(--space-5) var(--space-20);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}

/* Salvage-tag corner ticks — like a case file or an evidence bag label.
   Purely decorative, static, no motion. */
.shell::before, .shell::after {
  content: '';
  position: fixed;
  width: 14px;
  height: 14px;
  pointer-events: none;
  z-index: 3;
  opacity: 0.55;
}
.shell::before {
  top: 14px;
  left: 14px;
  border-left: 1px solid var(--color-accent-dim);
  border-top: 1px solid var(--color-accent-dim);
}
.shell::after {
  bottom: 14px;
  right: 14px;
  border-right: 1px solid var(--color-accent-dim);
  border-bottom: 1px solid var(--color-accent-dim);
}

.site-header {
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: var(--space-5);
  margin-bottom: var(--space-8);
}

.site-header::before {
  content: 'recovered archive \2014\0020 last known copy';
  display: block;
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint);
  margin-bottom: var(--space-3);
}

.site-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.site-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}
.site-title a {
  color: inherit;
  text-decoration: none;
}
.site-title .cursor {
  color: var(--color-accent);
  text-shadow: var(--glow-accent);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.site-tagline {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.site-tagline::before {
  content: '# ';
  color: var(--color-text-faint);
}

nav.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
  margin-top: var(--space-5);
}
nav.main-nav a {
  color: var(--color-text-muted);
  padding: var(--space-1) 0;
  border-bottom: 1px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  white-space: nowrap;
}
nav.main-nav a:hover, nav.main-nav a[aria-current="page"] {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom-color: var(--color-accent-dim);
  text-shadow: var(--glow-accent-soft);
}
nav.main-nav a::before {
  content: '/';
  color: var(--color-text-faint);
  margin-right: var(--space-1);
}

main {
  flex: 1;
}

/* ---------------------------------------------------------------------- */
/* Post index (homepage) */
/* ---------------------------------------------------------------------- */
.index-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px dashed var(--color-divider);
}

.sort-controls {
  display: flex;
  gap: var(--space-1);
  font-size: var(--text-xs);
  text-transform: none;
  letter-spacing: normal;
}
.sort-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-1) var(--space-2);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}
.sort-btn:hover {
  color: var(--color-text-muted);
}
.sort-btn.active {
  color: var(--color-accent);
  border-color: var(--color-accent-dim);
  text-shadow: var(--glow-accent-soft);
}
.sort-divider {
  color: var(--color-text-faint);
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.post-list li {
  border-bottom: 1px dashed var(--color-divider);
}
.post-list li:first-child {
  border-top: 1px dashed var(--color-divider);
}

.post-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-1);
  color: inherit;
  transition: background var(--transition), padding-left var(--transition);
}
.post-row:hover, .post-row:focus-visible {
  background: var(--color-surface);
  padding-left: var(--space-3);
  text-decoration: none;
}
.post-row:hover .post-title, .post-row:focus-visible .post-title {
  color: var(--color-accent);
  text-shadow: var(--glow-accent-soft);
}

.post-title {
  font-size: var(--text-base);
  color: var(--color-text);
  transition: color var(--transition);
}
.post-title::before {
  content: '> ';
  color: var(--color-text-faint);
}

.post-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  flex-shrink: 0;
}

.post-date {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-tag {
  font-size: var(--text-xs);
  color: var(--color-accent-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.post-tag::before {
  content: '[';
  color: var(--color-text-faint);
}
.post-tag::after {
  content: ']';
  color: var(--color-text-faint);
}

.empty-state {
  color: var(--color-text-muted);
  padding: var(--space-8) var(--space-1);
  font-size: var(--text-sm);
}

.scroll-status {
  color: var(--color-text-faint);
  text-align: center;
  padding: var(--space-4) var(--space-1);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  min-height: 1.5em;
}

.scroll-status:empty {
  padding: 0;
  min-height: 0;
}

.scroll-status-retry {
  color: var(--color-accent);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
}

#scroll-sentinel {
  height: 1px;
}

/* ---------------------------------------------------------------------- */
/* Article page */
/* ---------------------------------------------------------------------- */
.back-link {
  display: inline-block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
}
.back-link:hover { color: var(--color-accent); }

.article-meta {
  color: var(--color-accent-dim);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}
.article-meta::before { content: '['; color: var(--color-text-faint); }
.article-meta::after { content: ']'; color: var(--color-text-faint); }

.article-title {
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: var(--space-2);
  color: var(--color-text);
  text-shadow: 0 0 12px rgba(230, 222, 208, 0.12);
}

.article-attribution {
  color: var(--color-accent-dim);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.article-attribution-sep {
  opacity: 0.6;
}

.article-date {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  margin-bottom: var(--space-8);
}

.article-divider {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin-bottom: var(--space-8);
}

.article-body {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text);
  white-space: pre-wrap;
  max-width: 68ch;
}
.article-body p + p { margin-top: var(--space-5); }
.article-body a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-color: var(--color-accent-dim, var(--color-accent));
  text-underline-offset: 2px;
}
.article-body a:hover { text-decoration-color: var(--color-accent); }

/* ---------------------------------------------------------------------- */
/* Entry navigation (previous / next post)                                */
/* ---------------------------------------------------------------------- */
.entry-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--space-6);
  margin-top: var(--space-12);
  padding-top: var(--space-6);
  border-top: 1px dashed var(--color-border);
  max-width: 68ch;
}
.entry-nav-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: 45%;
  text-decoration: none;
  color: var(--color-text);
}
.entry-nav-next {
  margin-left: auto;
  text-align: right;
  align-items: flex-end;
}
.entry-nav-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.entry-nav-title {
  font-size: var(--text-sm);
  color: var(--color-accent-dim);
  transition: color 0.15s ease;
}
.entry-nav-link:hover .entry-nav-title { color: var(--color-accent); }
.entry-nav-empty { cursor: default; opacity: 0.55; }
.entry-nav-empty .entry-nav-title { color: var(--color-text-faint); font-style: italic; }

/* ---------------------------------------------------------------------- */
/* Contact page */
/* ---------------------------------------------------------------------- */
.contact-heading {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
}
.contact-intro {
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  max-width: 60ch;
}
.contact-list {
  list-style: none;
  border-top: 1px dashed var(--color-divider);
}
.contact-list li {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px dashed var(--color-divider);
  align-items: baseline;
  flex-wrap: wrap;
}
.contact-label {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 6.5rem;
  flex-shrink: 0;
}
.contact-value {
  color: var(--color-text);
  font-size: var(--text-sm);
}
.contact-value.is-placeholder {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ---------------------------------------------------------------------- */
/* Generic content page (about, etc.)                                     */
/* ---------------------------------------------------------------------- */
.page-heading {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-4);
}
.page-body {
  font-size: var(--text-base);
  line-height: 1.8;
  color: var(--color-text);
  max-width: 68ch;
  margin-bottom: var(--space-8);
}
.page-body p + p { margin-top: var(--space-5); }
.page-notes {
  list-style: none;
  border-top: 1px dashed var(--color-divider);
  max-width: 68ch;
}
.page-notes li {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px dashed var(--color-divider);
  align-items: baseline;
  flex-wrap: wrap;
}
.page-notes-label {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: 6.5rem;
  flex-shrink: 0;
}
.page-notes-value {
  color: var(--color-text);
  font-size: var(--text-sm);
  line-height: 1.6;
}

/* ---------------------------------------------------------------------- */
/* CRT terminal vignette (About page) */
/* ---------------------------------------------------------------------- */
.terminal-vignette {
  margin-top: var(--space-16);
  padding-top: var(--space-6);
  border-top: 1px dashed var(--color-divider);
}
.terminal-vignette-label {
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-6);
  display: block;
  text-align: center;
}

.crt-monitor {
  width: min(100%, 380px);
  margin: 0 auto;
}
.crt-body {
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 14px 14px 8px;
  box-shadow: 0 14px 28px -16px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.crt-screen {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #050302;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.9), inset 0 0 2px var(--color-accent-dim);
  transform: translateX(0);
}
.crt-screen.is-glitching {
  animation: crtGlitchShake 0.15s steps(2) 1;
  filter: brightness(1.35) contrast(1.15);
}
.crt-code {
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.6;
  color: var(--color-accent-dim);
  white-space: pre;
  will-change: transform;
  animation: crtScroll 16s linear infinite;
  text-shadow: 0 0 6px rgba(217, 163, 90, 0.25);
}
.crt-code .crt-line-hi { color: var(--color-accent); }
.crt-code .crt-line-warn { color: var(--color-warn); }
.crt-code .crt-line-err { color: var(--color-hazard); }
.crt-code .crt-line-dim { color: var(--color-text-faint); }
.crt-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0px,
    rgba(0, 0, 0, 0.4) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  opacity: 0.55;
}
.crt-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.65) 100%);
}
.crt-glitch-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 40%;
  height: 8%;
  background: linear-gradient(90deg, transparent, var(--color-accent) 45%, transparent 75%);
  opacity: 0;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: opacity 0.05s linear;
}
.crt-screen.is-glitching .crt-glitch-bar {
  opacity: 0.75;
}
.crt-bezel-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-1) 0;
}
.crt-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 5px 1px var(--color-accent);
  animation: crtLedPulse 2.6s ease-in-out infinite;
}
.crt-bezel-label {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--color-text-faint);
  text-transform: uppercase;
}
.crt-stand {
  width: 46px;
  height: 20px;
  margin: 0 auto;
  background: linear-gradient(180deg, var(--color-surface-2), var(--color-surface));
  clip-path: polygon(32% 0, 68% 0, 100% 100%, 0 100%);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
}
.crt-base {
  width: 120px;
  height: 10px;
  margin: 0 auto;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  box-shadow: 0 5px 12px -5px rgba(0, 0, 0, 0.7);
}

@keyframes crtScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
@keyframes crtLedPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes crtGlitchShake {
  0% { transform: translateX(0); }
  30% { transform: translateX(-3px); }
  60% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}
@media (max-width: 480px) {
  .crt-code { font-size: 0.5rem; padding: 8px 9px; line-height: 1.55; }
}
@media (max-width: 360px) {
  .crt-code { font-size: 0.44rem; padding: 7px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .crt-code { animation: none; }
  .crt-led { animation: none; }
  .crt-screen.is-glitching { animation: none; filter: none; }
}

/* ---------------------------------------------------------------------- */
/* Footer */
/* ---------------------------------------------------------------------- */
footer.site-footer {
  margin-top: var(--space-20);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
  color: var(--color-text-faint);
  font-size: var(--text-xs);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
footer.site-footer a { color: var(--color-text-faint); }
footer.site-footer a:hover { color: var(--color-accent); }

.status-online {
  color: var(--color-accent);
  text-shadow: var(--glow-accent);
  font-weight: 500;
}

/* ---------------------------------------------------------------------- */
/* 404 */
/* ---------------------------------------------------------------------- */
.not-found {
  text-align: left;
  padding: var(--space-16) 0;
}
.not-found .code {
  color: var(--color-error);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
}

/* ---------------------------------------------------------------------- */
/* Responsive */
/* ---------------------------------------------------------------------- */
@media (max-width: 480px) {
  .shell { padding: var(--space-6) var(--space-4) var(--space-12); }
  .post-row { flex-direction: column; gap: var(--space-1); }
  .post-meta { gap: var(--space-2); }
  .contact-label { width: 100%; }
  .page-notes-label { width: 100%; }
  .entry-nav { flex-direction: column; gap: var(--space-4); }
  .entry-nav-link { max-width: 100%; }
  .entry-nav-next { margin-left: 0; text-align: left; align-items: flex-start; }
}

/* ---------------------------------------------------------------------- */
/* AI head widget — animated header ornament                              */
/* ---------------------------------------------------------------------- */
.site-title-row .site-title {
  flex-shrink: 0;
}

.ai-screen {
  position: relative;
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-screen::before,
.ai-screen::after,
.ai-screen .tick-tr,
.ai-screen .tick-bl {
  content: '';
  position: absolute;
  width: 9px;
  height: 9px;
  pointer-events: none;
  opacity: 0.7;
}
.ai-screen::before { top: 0; left: 0; border-left: 1px solid var(--color-accent-dim); border-top: 1px solid var(--color-accent-dim); }
.ai-screen::after { bottom: 0; right: 0; border-right: 1px solid var(--color-accent-dim); border-bottom: 1px solid var(--color-accent-dim); }
.ai-screen .tick-tr { top: 0; right: 0; border-right: 1px solid var(--color-accent-dim); border-top: 1px solid var(--color-accent-dim); }
.ai-screen .tick-bl { bottom: 0; left: 0; border-left: 1px solid var(--color-accent-dim); border-bottom: 1px solid var(--color-accent-dim); }

.ai-head-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ai-glow {
  animation: ai-pulse 3.6s ease-in-out infinite;
}

.ai-float {
  transform-box: fill-box;
  transform-origin: center;
  animation: ai-float 5.5s ease-in-out infinite;
}

.ai-ring-outer {
  transform-box: fill-box;
  transform-origin: center;
  animation: ai-rotate 22s linear infinite;
}
.ai-ring-inner {
  transform-box: fill-box;
  transform-origin: center;
  animation: ai-rotate-rev 16s linear infinite;
}

.ai-eye {
  animation: ai-pulse 2.4s ease-in-out infinite;
}
.ai-eye.eye-right {
  animation-delay: 0.15s;
}

.ai-node {
  animation: ai-pulse 3s ease-in-out infinite;
}
.ai-node.node-b { animation-delay: 0.9s; }

@keyframes ai-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3.5px); }
}
@keyframes ai-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes ai-rotate-rev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}
@keyframes ai-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* Nav-row placement — hidden by default, only used on mobile. Sits at the
   far right of the home/contact row via margin-left: auto. */
.ai-screen--nav {
  display: none;
  margin-left: auto;
}

nav.main-nav {
  align-items: center;
}

@media (max-width: 480px) {
  /* Below the mobile breakpoint the widget moves off the title line
     entirely and onto the same line as the home / contact links,
     right-aligned, instead of sitting beside the title text. */
  .ai-screen--title {
    display: none;
  }
  .ai-screen--nav {
    display: flex;
    width: 40px;
    height: 40px;
  }
}
