/* Iosevka */
@font-face {
  font-family: 'Iosevka';
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/iosevka@latest/files/iosevka-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Iosevka';
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/iosevka@latest/files/iosevka-latin-500-normal.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Iosevka';
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/iosevka@latest/files/iosevka-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Base */
:root {
  color-scheme: dark;
  --stagger: 1;
  --bg: #0a0a0a;
  --surface: #0e0e0e;
  --border: #2a2a2a;
  --text: #c9d1d9;
  --text-strong: #e6edf3;
  --text-muted: #a6adc8;
  --text-faint: #6c7086;
  --accent: #6699ff;
  --hover: var(--accent);
  --font-mono: 'Iosevka', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

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

html {
  background-color: var(--bg);
  color: var(--text);
  font-size: 20px;
  font-family: 'Iosevka', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--bg);
}

/* Layout */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem 6rem;
}

.site-main {
  max-width: 42rem;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Header */
.site-header {
  max-width: 42rem;
  margin: 0 auto 3rem;
  width: 100%;
}

.site-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
}

.header-brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--random-accent);
  font-size: 1.25rem;
}

.header-brand:hover {
  color: var(--random-accent);
}

.header-nav {
  display: flex;
  gap: 1.25rem;
}

.header-nav a {
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.header-nav a:hover {
  color: var(--random-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.header-nav a.header-nav-external {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Archive list */
.archive-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--text-strong);
  color: var(--bg);
  padding: 0.5rem 1rem;
  margin: 0 0 1rem;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-item {
  display: flex;
  align-items: baseline;
  padding: 0.35rem 0;
  gap: 0.75rem;
}

.archive-date {
  flex-shrink: 0;
  font-size: 1.25rem;
  color: var(--text-faint);
  white-space: nowrap;
  width: 10rem;
}

.archive-link {
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s ease;
  white-space: nowrap;
  font-size: 1.25rem;
}

.archive-link:hover {
  color: var(--random-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.archive-dots {
  flex: 1;
  margin: 0 0.75rem;
  min-width: 1rem;
  height: 0.5em;
  background-image: radial-gradient(circle, var(--text-faint) 1.5px, transparent 2px);
  background-size: 32px 100%;
  background-repeat: repeat-x;
  background-position: right bottom;
}

.archive-meta {
  font-size: 1.25rem;
  color: var(--text-faint);
  white-space: nowrap;
}

/* Post page */
.post-header {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--text-strong);
  color: var(--bg);
  padding: 0.5rem 1rem;
  margin: 0 0 1rem;
}

.post-footer {
  color: var(--text-faint);
  font-size: 1rem;
  margin-top: 2rem;
  text-align: right;
}

.post-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bg);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-body {
  margin-bottom: 2rem;
}

.post-body p,
.post-body ul,
.post-body ol {
  margin: 0 0 1rem;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
  font-weight: 600;
  color: var(--text-strong);
  margin: 2rem 0 1rem;
  line-height: 1.3;
}

.post-body h1 { font-size: 1.5rem; }
.post-body h2 { font-size: 1.35rem; }
.post-body h3 { font-size: 1.2rem; }
.post-body h4 { font-size: 1.1rem; }
.post-body h5 { font-size: 1.0rem; }

/* Kungfusheep-style heading blocks */
.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5 {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--surface);
  border-left: 3px solid var(--text-strong);
  padding: 0.4em 0.6em;
  margin: 2.5em 0 1em;
}

.post-body h3,
.post-body h4,
.post-body h5 {
  margin: 2em 0 0.5em;
}

.post-body strong {
  font-weight: 700;
  color: var(--text-strong);
}

.post-body em {
  font-style: italic;
}

.post-body blockquote {
  font-style: italic;
  border-left: 2px solid #45475a;
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.post-body a:hover {
  color: var(--random-accent);
}

.post-body ul {
  list-style-type: disc;
  padding-left: 1.5rem;
}

.post-body ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
}

/* Inline code */
:not(pre) > code {
  background-color: #161616;
  padding: 0.15em 0.3em;
  font-size: 0.85em;
  font-family: var(--font-mono);
  color: var(--text-strong);
}

/* Code blocks — brutalist square */
pre {
  background-color: #1e1e1e;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}

pre code {
  display: block;
  padding: 0.75rem;
  font-size: 16px;
  font-family: var(--font-mono);
  line-height: 1.5;
  color: var(--text);
  background: none;
}

/* Images — brutalist square */
.post-body img,
.post-body video,
article img,
article video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

/* Entry animations — disabled for now */
/*
@keyframes entry {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .animate-entry {
    animation: entry 0.6s both calc(var(--stagger) * 0.12s);
  }

  html:active-view-transition .animate-entry {
    animation: none;
  }
}
*/

/* Copy button for code blocks */
pre .copy-button {
  position: absolute;
  top: 0.375rem;
  right: 0.375rem;
  background: var(--surface);
  border: 1px solid #3a3a3a;
  padding: 0.25rem;
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

pre .copy-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

pre:hover .copy-button {
  opacity: 1;
}

pre .copy-button:hover {
  background: #1a1a1a;
  color: var(--text);
}

pre .copy-button.copied {
  background: #1a1a1a;
  color: var(--random-accent);
  opacity: 1;
}

/* About list grid */
.about-list {
  columns: 2;
  column-gap: 1.5rem;
  list-style: disc;
  padding-left: 1.25rem;
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .about-list {
    columns: 1;
  }

  .archive-item {
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
  }

  .archive-dots {
    display: none;
  }

  .archive-date {
    width: auto;
  }
}
