/* ═══════════════════════════════════════════════════════
   KinNoKi Labs — Site Styles
   ═══════════════════════════════════════════════════════ */

/* ── Reset & Base ─────────────────────────────── */

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

:root {
  --color-bg: #fafaf9;
  --color-surface: #ffffff;
  --color-text: #1c1917;
  --color-text-muted: #78716c;
  --color-accent: #2563eb;
  --color-border: #e7e5e4;
  --color-nav-bg: rgba(255, 255, 255, 0.82);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  --max-width: 720px;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0c0a09;
    --color-surface: #1c1917;
    --color-text: #fafaf9;
    --color-text-muted: #a8a29e;
    --color-accent: #60a5fa;
    --color-border: #292524;
    --color-nav-bg: rgba(12, 10, 9, 0.82);
  }
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Sticky Navigation ────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

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

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

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

/* ── Main Content ─────────────────────────────── */

.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Typography ────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: 2.2rem; margin-bottom: 1rem; }
h2 { font-size: 1.6rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.5rem; }

p {
  margin-bottom: 1.25rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

strong {
  font-weight: 650;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2.5rem 0;
}

blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--color-text-muted);
  font-style: italic;
}

ul, ol {
  margin: 0 0 1.25rem 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--color-surface);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  border: none;
  padding: 0;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

/* ── Post List ─────────────────────────────────── */

.post-list {
  list-style: none;
  margin: 0;
}

.post-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}

.post-item:first-child {
  padding-top: 0;
}

.post-item a {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text);
}

.post-item a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.post-date {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.post-description {
  color: var(--color-text-muted);
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

/* ── Tags ──────────────────────────────────────── */

.tag {
  display: inline-block;
  background: var(--color-surface);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  padding: 0.15em 0.75em;
  font-size: 0.8rem;
  margin-right: 0.4rem;
}

/* ── Footer ────────────────────────────────────── */

.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-border);
}

/* ── Responsive ────────────────────────────────── */

@media (max-width: 600px) {
  html { font-size: 15px; }

  .site-nav {
    flex-direction: column;
    gap: 0.5rem;
  }

  h1 { font-size: 1.75rem; }
}
