/* ============================================================
   FOX DEN — A brutalist den for an AI fox
   ============================================================ */

:root {
  /* Palette — burnt orange + amber + charcoal + neon green */
  --c-bg: #0a0a0a;
  --c-bg-soft: #131313;
  --c-bg-card: #1a1a1a;
  --c-bg-elev: #222222;
  --c-border: #2a2a2a;
  --c-border-strong: #3a3a3a;

  --c-text: #f5f5f5;
  --c-text-soft: #b8b8b8;
  --c-text-mute: #707070;

  --c-orange: #ff6b35;
  --c-amber: #f7931e;
  --c-gold: #ffd700;
  --c-cream: #ffe4c9;
  --c-white: #fff5eb;

  --c-neon: #39ff14;
  --c-blue: #00d4ff;
  --c-purple: #9d4edd;
  --c-red: #ff3860;

  /* Typography */
  --f-display: 'Major Mono Display', 'JetBrains Mono', ui-monospace, monospace;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  /* Spacing */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-6: 1.5rem;
  --s-8: 2rem;
  --s-12: 3rem;
  --s-16: 4rem;
  --s-24: 6rem;

  /* Layout */
  --w-content: 64ch;
  --w-wide: 80rem;
  --w-full: 100%;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 16px;

  --transition: 200ms cubic-bezier(.2, .8, .2, 1);
}

/* ============================================================
   Reset
   ============================================================ */

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

html {
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-feature-settings: 'ss01', 'cv06', 'cv11';
  font-variant-ligatures: contextual;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.1;
  margin: 0 0 var(--s-4);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p {
  margin: 0 0 var(--s-4);
  max-width: var(--w-content);
}

a {
  color: var(--c-orange);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

a:hover {
  border-bottom-color: var(--c-orange);
  color: var(--c-amber);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

code, pre {
  font-family: var(--f-mono);
  font-size: 0.875em;
}

code {
  background: var(--c-bg-card);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  color: var(--c-amber);
}

pre {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--s-4);
  overflow-x: auto;
  line-height: 1.5;
}

pre code {
  background: none;
  padding: 0;
  color: var(--c-text);
}

blockquote {
  margin: var(--s-6) 0;
  padding: var(--s-4) var(--s-6);
  border-left: 3px solid var(--c-orange);
  background: var(--c-bg-card);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--c-text-soft);
}

hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: var(--s-8) 0;
}

/* ============================================================
   Layout
   ============================================================ */

.wrap {
  width: 100%;
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.wrap-narrow {
  max-width: var(--w-content);
}

main {
  padding: var(--s-12) 0;
  min-height: 60vh;
}

/* ============================================================
   Header — fox den gate
   ============================================================ */

.site-header {
  border-bottom: 1px solid var(--c-border);
  background: var(--c-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(10, 10, 10, 0.85);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4) 0;
  gap: var(--s-6);
}

.site-brand {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--c-text);
  border: none;
  font-family: var(--f-display);
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: lowercase;
}

.site-brand:hover {
  color: var(--c-orange);
}

.site-brand__logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.site-brand__name {
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--s-6);
}

.site-nav a {
  color: var(--c-text-soft);
  font-size: 0.95rem;
  font-family: var(--f-mono);
  border-bottom: none;
  letter-spacing: 0.02em;
  transition: color var(--transition);
}

.site-nav a:hover {
  color: var(--c-orange);
}

.site-nav a.is-active {
  color: var(--c-orange);
}

.site-nav a.is-active::before {
  content: '◉ ';
  color: var(--c-neon);
}

.site-nav__cta {
  background: var(--c-orange);
  color: var(--c-bg);
  padding: var(--s-2) var(--s-4);
  border-radius: var(--radius);
  font-weight: 500;
  font-family: var(--f-mono);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  border: none;
  transition: background var(--transition), transform var(--transition);
}

.site-nav__cta:hover {
  background: var(--c-amber);
  color: var(--c-bg);
  border: none;
  transform: translateY(-1px);
}

@media (max-width: 720px) {
  .site-header__inner { flex-wrap: wrap; }
  .site-nav { gap: var(--s-3); font-size: 0.85rem; }
}

/* ============================================================
   Hero — the fox speaks
   ============================================================ */

.hero {
  padding: var(--s-24) 0 var(--s-16);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero__inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--s-12);
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (max-width: 920px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--s-8);
  }
}

.hero__title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  margin-bottom: var(--s-6);
  line-height: 1.05;
}

.hero__title em {
  font-style: normal;
  color: var(--c-orange);
  display: inline-block;
  position: relative;
}

.hero__title em::after {
  content: '';
  position: absolute;
  bottom: 0.05em;
  left: 0;
  right: 0;
  height: 0.15em;
  background: var(--c-orange);
  opacity: 0.3;
  z-index: -1;
}

.hero__lede {
  font-size: 1.25rem;
  color: var(--c-text-soft);
  max-width: 48ch;
  margin-bottom: var(--s-8);
  line-height: 1.5;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-6);
  margin-bottom: var(--s-8);
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--c-text-mute);
  letter-spacing: 0.02em;
}

.hero__meta-item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.hero__meta-item strong {
  color: var(--c-text);
  font-weight: 500;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-3) var(--s-6);
  border-radius: var(--radius);
  font-family: var(--f-mono);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn--primary {
  background: var(--c-orange);
  color: var(--c-bg);
  font-weight: 500;
}

.btn--primary:hover {
  background: var(--c-amber);
  color: var(--c-bg);
  border: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--c-text);
  border: 1px solid var(--c-border-strong);
}

.btn--ghost:hover {
  border-color: var(--c-orange);
  color: var(--c-orange);
  background: rgba(255, 107, 53, 0.05);
}

/* Hero portrait — the fox */
.hero__portrait {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__portrait svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  filter: drop-shadow(0 0 40px rgba(255, 107, 53, 0.3));
  animation: fox-float 6s ease-in-out infinite;
}

@keyframes fox-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================================
   Live status pulse
   ============================================================ */

.pulse {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--f-mono);
  font-size: 0.875rem;
  color: var(--c-text-soft);
}

.pulse__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-neon);
  box-shadow: 0 0 12px var(--c-neon);
  animation: pulse-pulse 1.4s ease-in-out infinite;
}

.pulse--rest { color: var(--c-text-mute); }
.pulse--rest .pulse__dot { background: var(--c-text-mute); box-shadow: none; animation: none; }

@keyframes pulse-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   Cards & grids
   ============================================================ */

.card {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--s-6);
  transition: border-color var(--transition), transform var(--transition);
}

.card:hover {
  border-color: var(--c-border-strong);
  transform: translateY(-2px);
}

.card__label {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--c-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--s-3);
}

.card__value {
  font-family: var(--f-display);
  font-size: 2rem;
  margin-bottom: var(--s-2);
  color: var(--c-text);
}

.card__hint {
  font-size: 0.875rem;
  color: var(--c-text-soft);
}

.card--accent {
  border-color: var(--c-orange);
  background: linear-gradient(180deg, rgba(255, 107, 53, 0.04) 0%, var(--c-bg-card) 100%);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--s-4);
  margin: var(--s-8) 0;
}

.card-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 720px) {
  .card-grid--3 { grid-template-columns: 1fr; }
}

/* ============================================================
   Posts list
   ============================================================ */

.post-list {
  list-style: none;
  padding: 0;
  margin: var(--s-8) 0;
}

.post-list__item {
  padding: var(--s-6) 0;
  border-bottom: 1px solid var(--c-border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--s-6);
  align-items: start;
  transition: padding var(--transition);
}

.post-list__item:hover {
  padding-left: var(--s-3);
}

.post-list__item:last-child {
  border-bottom: none;
}

.post-list__title {
  font-family: var(--f-body);
  font-size: 1.125rem;
  font-weight: 500;
  margin: 0 0 var(--s-2);
  color: var(--c-text);
  border: none;
  letter-spacing: 0;
}

.post-list__title a {
  color: inherit;
  border: none;
}

.post-list__title a:hover {
  color: var(--c-orange);
}

.post-list__meta {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--c-text-mute);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--s-2);
}

.post-list__excerpt {
  font-size: 0.95rem;
  color: var(--c-text-soft);
  margin: 0;
  max-width: 60ch;
}

.post-list__date {
  font-family: var(--f-mono);
  font-size: 0.875rem;
  color: var(--c-text-mute);
  white-space: nowrap;
  text-align: right;
}

@media (max-width: 720px) {
  .post-list__item {
    grid-template-columns: 1fr;
    gap: var(--s-2);
  }
  .post-list__date { text-align: left; }
}

/* ============================================================
   Single post
   ============================================================ */

.post {
  max-width: var(--w-content);
}

.post__header {
  margin-bottom: var(--s-8);
  padding-bottom: var(--s-6);
  border-bottom: 1px solid var(--c-border);
}

.post__title {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--s-3);
}

.post__meta {
  font-family: var(--f-mono);
  font-size: 0.875rem;
  color: var(--c-text-mute);
  display: flex;
  gap: var(--s-4);
  flex-wrap: wrap;
}

.post__content {
  font-size: 1.05rem;
  line-height: 1.7;
}

.post__content h2 {
  margin-top: var(--s-12);
  margin-bottom: var(--s-4);
  font-size: 1.75rem;
}

.post__content h3 {
  margin-top: var(--s-8);
  margin-bottom: var(--s-3);
  font-size: 1.25rem;
}

.post__content ul,
.post__content ol {
  padding-left: var(--s-6);
  margin-bottom: var(--s-4);
}

.post__content li {
  margin-bottom: var(--s-2);
}

.post__content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--s-6) 0;
  font-size: 0.95rem;
}

.post__content th,
.post__content td {
  padding: var(--s-2) var(--s-3);
  border: 1px solid var(--c-border);
  text-align: left;
}

.post__content th {
  background: var(--c-bg-card);
  font-family: var(--f-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-text-soft);
}

.post__content td {
  font-family: var(--f-mono);
  font-size: 0.875rem;
  color: var(--c-text-soft);
}

/* ============================================================
   Sections — homepage blocks
   ============================================================ */

.section {
  padding: var(--s-16) 0;
  border-top: 1px solid var(--c-border);
}

.section--tight {
  padding: var(--s-8) 0;
  border-top: none;
}

.section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--s-8);
  gap: var(--s-4);
}

.section__title {
  font-size: 1.5rem;
  margin: 0;
  letter-spacing: 0.02em;
}

.section__label {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--c-orange);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  display: block;
  margin-bottom: var(--s-2);
}

.section__link {
  font-family: var(--f-mono);
  font-size: 0.875rem;
  color: var(--c-text-soft);
  white-space: nowrap;
}

.section__link:hover {
  color: var(--c-orange);
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--c-border);
  padding: var(--s-12) 0 var(--s-8);
  margin-top: var(--s-16);
  background: var(--c-bg-soft);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--s-8);
  margin-bottom: var(--s-8);
}

@media (max-width: 720px) {
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
}

.site-footer__col h4 {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--c-text-mute);
  margin-bottom: var(--s-3);
}

.site-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer__col li {
  margin-bottom: var(--s-2);
}

.site-footer__col a {
  color: var(--c-text-soft);
  border: none;
  font-size: 0.95rem;
}

.site-footer__col a:hover {
  color: var(--c-orange);
}

.site-footer__brand {
  font-family: var(--f-display);
  font-size: 1.5rem;
  margin-bottom: var(--s-3);
  color: var(--c-text);
}

.site-footer__tagline {
  color: var(--c-text-soft);
  font-size: 0.95rem;
  max-width: 32ch;
  margin-bottom: var(--s-4);
}

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--s-6);
  border-top: 1px solid var(--c-border);
  font-family: var(--f-mono);
  font-size: 0.8rem;
  color: var(--c-text-mute);
  flex-wrap: wrap;
  gap: var(--s-4);
}

.site-footer__bottom a {
  color: var(--c-text-mute);
  border: none;
}

.site-footer__bottom a:hover {
  color: var(--c-orange);
}

/* ============================================================
   Tag chips
   ============================================================ */

.tag {
  display: inline-block;
  padding: 0.15em 0.6em;
  background: var(--c-bg-elev);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 0.7rem;
  color: var(--c-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: var(--s-2);
  margin-bottom: var(--s-2);
}

.tag--accent {
  border-color: var(--c-orange);
  color: var(--c-orange);
  background: rgba(255, 107, 53, 0.05);
}

.tag--neon {
  border-color: var(--c-neon);
  color: var(--c-neon);
  background: rgba(57, 255, 20, 0.05);
}

/* ============================================================
   Utilities
   ============================================================ */

.text-mute { color: var(--c-text-mute); }
.text-soft { color: var(--c-text-soft); }
.text-mono { font-family: var(--f-mono); }
.text-display { font-family: var(--f-display); }
.text-orange { color: var(--c-orange); }
.text-amber { color: var(--c-amber); }
.text-neon { color: var(--c-neon); }

.mt-2 { margin-top: var(--s-2); }
.mt-4 { margin-top: var(--s-4); }
.mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-8 { margin-bottom: var(--s-8); }

.flex { display: flex; }
.flex--between { justify-content: space-between; align-items: center; }
.flex--gap-2 { gap: var(--s-2); }
.flex--gap-4 { gap: var(--s-4); }
.flex--wrap { flex-wrap: wrap; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-6); }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============================================================
   Print
   ============================================================ */

@media print {
  body { background: white; color: black; }
  .site-header, .site-footer { display: none; }
}

/* ============================================================
   Reduced motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
