/* Gamma Interface — Where Flesh Meets Frequency */

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

:root {
  --bg: #08080c;
  --bg-elevated: #0f0f14;
  --bg-hover: rgba(139, 92, 246, 0.05);
  --text: #d4d4d8;
  --text-bright: #fafafa;
  --text-muted: #71717a;
  --accent: #8b5cf6;
  --accent-hover: #9d7bea;
  --accent-dim: rgba(139, 92, 246, 0.15);
  --border: rgba(255, 255, 255, 0.06);
  --glow: rgba(139, 92, 246, 0.4);
}

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

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

body {
  font-family: 'Cormorant Garamond', Georgia, serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  z-index: -1;
}

/* Global link transitions */
a {
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

/* Container */
.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
}

/* Header */
header {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-bright);
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-title:hover {
  color: var(--accent-hover);
}

.nav-links {
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid transparent;
}

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

.nav-links a.active,
.nav-links a[aria-current="page"] {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

/* Main */
main {
  max-width: 700px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* Hero image */
.post-hero {
  margin: -3rem -1.5rem 2.5rem;
  overflow: hidden;
}

.post-hero img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  opacity: 0.9;
  filter: saturate(0.9);
  transition: opacity 0.5s ease;
}

.post-hero img:hover {
  opacity: 1;
}

/* Home */
.home h1 {
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.site-description {
  color: var(--text-muted);
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 4rem;
}

.recent-posts h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* Post list */
.post-preview {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border-radius: 6px;
  border-left: 2px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.post-preview:hover {
  background-color: var(--bg-hover);
  border-left-color: var(--accent);
}

.post-preview h2,
.post-preview h3 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
  line-height: 1.3;
}

.post-preview a {
  color: var(--text-bright);
  text-decoration: none;
}

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

.post-preview time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.post-preview p {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* Single post */
.post-header {
  margin-bottom: 3rem;
  text-align: center;
}

.post-header h1 {
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}

.post-header time {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.tags {
  margin-top: 1rem;
}

.tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  margin-right: 0.5rem;
  letter-spacing: 0.03em;
  transition: background-color 0.2s ease;
}

.tag:hover {
  background: rgba(139, 92, 246, 0.25);
}

/* Post content */
.post-content h2 {
  font-size: 1.6rem;
  font-weight: 400;
  margin: 3rem 0 1rem;
  color: var(--text-bright);
  letter-spacing: -0.01em;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 2.5rem 0 0.75rem;
  color: var(--text-bright);
}

.post-content p {
  margin-bottom: 1.5rem;
}

.post-content blockquote {
  position: relative;
  border-left: none;
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  background: var(--bg-elevated);
  border-radius: 4px;
  font-style: italic;
}

.post-content blockquote::before {
  content: '"';
  position: absolute;
  top: 0.5rem;
  left: 0.75rem;
  font-size: 3rem;
  color: var(--accent);
  opacity: 0.3;
  line-height: 1;
}

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.post-content a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.post-content code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
  background: var(--bg-elevated);
  padding: 0.2em 0.5em;
  border-radius: 3px;
  color: var(--accent);
}

.post-content pre {
  background: var(--bg-elevated);
  padding: 1.25rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 2rem 0;
  border: 1px solid var(--border);
}

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

.post-content ul, .post-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

.post-content li {
  margin-bottom: 0.75rem;
}

.post-content hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 3rem 0;
}

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

.post-content strong {
  font-weight: 600;
  color: var(--text-bright);
}

/* Footer */
footer {
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tagline {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.post {
  animation: fadeIn 0.6s ease-out;
}

.post-preview {
  animation: fadeIn 0.5s ease-out;
  animation-fill-mode: both;
}

.post-preview:nth-child(1) { animation-delay: 0.1s; }
.post-preview:nth-child(2) { animation-delay: 0.2s; }
.post-preview:nth-child(3) { animation-delay: 0.3s; }

/* Selection */
::selection {
  background: var(--accent);
  color: var(--bg);
}

/* Responsive */
@media (max-width: 600px) {
  html {
    font-size: 17px;
  }
  
  header, main, footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .site-title {
    font-size: 0.85rem;
    letter-spacing: 0.05em;
  }
  
  .nav-links {
    gap: 1rem;
  }
  
  .nav-links a {
    font-size: 0.75rem;
    letter-spacing: 0;
  }
  
  .home h1 {
    font-size: 2rem;
  }
  
  .post-header h1 {
    font-size: 2rem;
  }
  
  .post-hero {
    margin-left: -1rem;
    margin-right: -1rem;
  }
  
  .post-preview {
    padding: 1rem;
  }
}
