/* Personal Blog - Matching Hugo theme */

@import url('https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,200..900;1,7..72,200..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Red+Hat+Mono:ital,wght@0,300..700;1,300..700&display=swap');

:root {
  --font-body: 'Literata', Georgia, serif;
  --font-mono: 'Red Hat Mono', monospace;

  --color-bg: #fafaf8;
  --color-text: #1a1a1a;
  --color-text-muted: #666;
  --color-accent: #333;
  --color-link: #1a1a1a;
  --color-link-hover: #555;
  --color-border: #ddd;
  --color-code-bg: #f4f4f2;

  --nav-width: 160px;
  --content-max: 960px;
  --spacing: 1.5rem;
}

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

html {
  font-size: 16px;
  line-height: 1.7;
}

body {
  font-family: var(--font-body);
  font-size: 0.95em;
  font-optical-sizing: auto;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

/* Layout */
.layout {
  display: flex;
  min-height: 100vh;
}

.content {
  flex: 1;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: calc(var(--spacing) * 3) var(--spacing);
  padding-right: calc(var(--nav-width) + var(--spacing) * 2);
}

/* Navigation - Right Side Vertical */
.nav {
  position: fixed;
  right: 0;
  top: 0;
  width: var(--nav-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border-left: 2px solid var(--color-text);
  background: var(--color-bg);
}

.nav-inner {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: auto 0;
}

.social-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  padding-bottom: 2rem;
}

.social-link {
  font-size: 1.5rem;
  color: var(--color-text-muted);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.social-link:hover {
  opacity: 1;
}

.nav-link {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text);
  text-decoration: none;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.nav-link:hover {
  opacity: 1;
}

.nav-link.active {
  opacity: 1;
}

/* Active indicator */
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--color-text);
}

/* Staggered entrance animation - only on first visit */
@keyframes navSlideIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav.animate-entrance .nav-link {
  animation: navSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

.nav.animate-entrance .nav-link:nth-child(1) { animation-delay: 0.1s; }
.nav.animate-entrance .nav-link:nth-child(2) { animation-delay: 0.2s; }
.nav.animate-entrance .nav-link:nth-child(3) { animation-delay: 0.3s; }
.nav.animate-entrance .nav-link:nth-child(4) { animation-delay: 0.4s; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  position: fixed;
  right: 1rem;
  top: 1rem;
  z-index: 1001;
  background: var(--color-bg);
  border: 2px solid var(--color-text);
  padding: 0.5rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform;
}

.nav-toggle:hover {
  transform: scale(1.05);
}

.nav-toggle:active {
  transform: scale(0.95);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--color-text);
  transition: transform 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6),
              opacity 0.2s ease;
  will-change: transform, opacity;
}

.nav-toggle.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle.open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.3;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--color-link-hover);
}

/* Prose content */
.prose p {
  margin-bottom: 1.5rem;
}

.prose ul, .prose ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

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

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: 600;
  background: var(--color-code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.prose pre {
  background: var(--color-code-bg);
  padding: 1rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: 3px;
}

.prose pre code {
  background: none;
  padding: 0;
}

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

.prose img {
  max-width: 100%;
  height: auto;
}

/* Home page */
.home-header {
  margin-bottom: 3rem;
}

.site-title {
  font-size: 3.5rem;
  font-weight: 400;
  font-family: var(--font-body);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.site-tagline {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.home-section {
  margin-top: 8rem;
  margin-bottom: 3rem;
}

.home-section h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.75rem;
  padding-top: 0.5rem;
  background-color: var(--color-code-bg);
  padding-left: 1rem;
}

.see-all {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Post/Note lists */
.post-list, .note-list {
  list-style: none;
}

.post-item, .note-item {
  margin-bottom: 1.25rem;
}

.post-link, .note-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  text-decoration: none;
}

.post-title {
  font-weight: 500;
}

.post-date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

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

.compact .post-item,
.compact .note-item {
  margin-bottom: 0.75rem;
}

/* Individual post/note pages */
.post-header, .note-header {
  margin-bottom: 2.5rem;
}

.post-title, .note-title {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.post-summary {
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 1rem;
}

/* Page headers */
.page-header {
  margin-bottom: 2rem;
}

.page-description {
  color: var(--color-text-muted);
  margin-top: 0.5rem;
}

/* Tags */
.tag, .tag-small {
  font-size: 0.75rem;
  background: var(--color-code-bg);
  padding: 0.2em 0.5em;
  border-radius: 3px;
  margin-right: 0.25rem;
}

.note-tags {
  margin-top: 0.5rem;
}

.note-tags-inline {
  margin-left: 0.5rem;
}

/* Note footer */
.note-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.note-source {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Broken wiki-links */
.broken-link {
  color: var(--color-text-muted);
  border-bottom: 1px dashed var(--color-text-muted);
}

/* Empty states */
.empty-state {
  color: var(--color-text-muted);
  font-style: italic;
}

/* About page */
.about h2 {
  margin-top: 2.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .content {
    padding-right: var(--spacing);
    max-width: 100%;
  }

  .nav {
    position: fixed;
    right: 0;
    width: 100%;
    border-left: none;
    z-index: 1000;
    clip-path: inset(0 0 0 100%);
    transition: clip-path 0.5s cubic-bezier(0.77, 0, 0.175, 1);
    will-change: clip-path;
  }

  .nav.open {
    clip-path: inset(0 0 0 0);
  }

  /* Animate links when mobile menu opens */
  .nav.open .nav-link {
    animation: navSlideIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
  }

  .nav.open .nav-link:nth-child(1) { animation-delay: 0.15s; }
  .nav.open .nav-link:nth-child(2) { animation-delay: 0.25s; }
  .nav.open .nav-link:nth-child(3) { animation-delay: 0.35s; }
  .nav.open .nav-link:nth-child(4) { animation-delay: 0.45s; }

  .nav-toggle {
    display: flex;
  }
}

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

  .site-title {
    font-size: 1.3rem;
  }

  .post-link {
    flex-direction: column;
    gap: 0.25rem;
  }

  .post-date {
    order: -1;
  }
}
