@font-face {
  font-family: 'Berkeley Mono';
  src: url('fonts/berkeley_mono/BerkeleyMono-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('fonts/berkeley_mono/BerkeleyMono-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('fonts/berkeley_mono/BerkeleyMono-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('fonts/berkeley_mono/BerkeleyMono-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
}

:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-hover: #1a1a1a;
  --card: #111111;
  --text: #f5f5f5;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.15);
  --border: #2a2a2a;
  --border-light: #333333;
  --gradient-start: #6366f1;
  --gradient-end: #8b5cf6;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.2s ease;
  --transition-slow: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Berkeley Mono', 'SF Mono', 'Fira Code', 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
}

/* Move page-header above the title */
#content > .page-header {
  order: -1;
}

/* Page header - navigation */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
  position: sticky;
  top: 0;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.page-header a {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.05em;
  transition: color var(--transition);
}

.page-header a:hover {
  color: var(--accent-light);
  background: transparent;
}

/* Typography */
h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
  color: var(--text);
  line-height: 1.2;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 2rem 0 1rem 0;
  color: var(--text);
}

h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem 0;
  color: var(--text);
}

p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.7;
}

a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition);
}

a:hover { 
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: transparent;
}

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

li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Code blocks */
pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
  overflow-x: auto;
  font-family: 'Berkeley Mono', 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
}

code {
  font-family: 'Berkeley Mono', 'SF Mono', 'Fira Code', 'Courier New', monospace;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.4rem;
  font-size: 0.875em;
  color: var(--accent-light);
}

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

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.figure {
  margin: 2rem 0;
}

.figure p {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  text-align: center;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 700px) {
  #content { padding: 1.5rem 1rem 3rem; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.1rem; }
}

/* Hide org-generated structure */
.outline-2, .outline-3, .outline-4, .outline-text-2, .outline-text-3, .outline-text-4 { display: contents; }

/* ===================
   Homepage specific styles
   =================== */

/* Wider content for homepage */
.homepage #content {
  max-width: 1200px;
}

/* Profile & Hero Section */
.site-header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0 3rem;
  position: relative;
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  border: 3px solid var(--border-light);
  box-shadow: var(--shadow-md), 0 0 40px var(--accent-glow);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
  object-fit: cover;
}

.profile-image:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg), 0 0 60px var(--accent-glow);
}

.site-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
  color: var(--text);
  text-transform: none;
  border-bottom: none;
  padding-bottom: 0;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.site-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 480px;
  margin: 0 auto 1.5rem;
  font-weight: 400;
  line-height: 1.6;
}

.site-header .social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.site-header .social-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.site-header .social-links a:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
}

/* Grid Layout */
.two-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  margin-top: 1rem;
}

@media (max-width: 900px) {
  .two-columns { 
    grid-template-columns: 1fr; 
    gap: 1.5rem;
  }
}

@media (max-width: 700px) {
  .site-header h1 { font-size: 1.5rem; }
  .site-header p { font-size: 0.9rem; }
  .profile-image { width: 100px; height: 100px; }
  .site-header .social-links {
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .site-header .social-links a {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* Column Cards */
.column {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.column:hover {
  border-color: var(--border-light);
}

.column h2 {
  font-family: 'Berkeley Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  margin-bottom: 1.25rem;
  margin-top: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.column h2::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.column h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem 0;
  color: var(--text);
}

.column h3:first-of-type { margin-top: 0; }

.column p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.column a {
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 500;
  transition: all var(--transition);
}

.column a:hover { 
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
}

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

.column li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.column li:last-child { border-bottom: none; }

/* Post Items */
.post-item { 
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.post-item:last-child { 
  margin-bottom: 0; 
  padding-bottom: 0;
  border-bottom: none;
}

/* View All Posts Button */
.view-all-btn {
  display: block;
  text-align: center;
  padding: 0.75rem 1.5rem;
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}

.view-all-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
}

.post-item h3 {
  margin-bottom: 0.35rem;
}

.post-item h3 a {
  font-weight: 600;
  transition: all var(--transition);
}

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

/* Support/Cause Items */
.support-item {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-hover) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
  transition: all var(--transition);
}

.support-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.support-item:last-of-type { margin-bottom: 0; }

.support-item p { 
  margin: 0; 
  color: var(--text-secondary);
}

.support-item h3 { 
  color: var(--text);
  margin-bottom: 0.35rem;
  margin-top: 0;
}

.support-item a { 
  color: var(--accent-light);
}

.support-item a:hover { 
  color: var(--text);
  background: transparent;
}

/* Links Section */
.links-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.links-section h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 1rem;
}

.links-list {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.links-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}

.links-list a:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-2px);
}

/* Footer note */
.footer-note {
  text-align: center;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Hide first h2 on homepage */
#content > .outline-2 > h2:first-child { display: none; }

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

.site-header,
.column {
  animation: fadeIn 0.5s ease forwards;
}

.column:nth-child(2) { animation-delay: 0.1s; }
.column:nth-child(3) { animation-delay: 0.2s; }

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

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===================
   Posts page styles
   =================== */

.posts-page {
  max-width: 900px;
  margin: 0 auto;
}

.posts-page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text);
}

/* Search bar styles */
.search-container {
  position: sticky;
  top: 60px;
  z-index: 99;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1.25rem;
  font-family: 'Berkeley Mono', 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: all var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

/* Posts list */
.posts-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all var(--transition);
  cursor: pointer;
}

.post-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.post-card h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

/* Stretch link to cover entire card */
.post-card h2 a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

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

.post-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem;
  font-size: 0.95rem;
}

.header-posts-link {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  transition: color var(--transition);
}

.header-posts-link:hover {
  color: var(--accent-light);
  text-decoration: none;
  background: transparent;
}

@media (max-width: 700px) {
  .posts-page-title {
    font-size: 1.5rem;
  }
  
  .search-container {
    top: 55px;
  }
  
  .search-input {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
  
  .post-card {
    padding: 1.25rem;
  }
  
  .post-card h2 {
    font-size: 1rem;
  }
}

/* ===================
   Videos Section - Full Width Carousel
   =================== */

.videos-section {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-top: 3rem;
  padding: 3rem 0;
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 50%, var(--bg) 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.videos-section h2 {
  font-family: 'Berkeley Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-light);
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.videos-section h2::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.video-carousel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  overflow: hidden;
}

.video-carousel-track {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.video-item {
  flex: 0 0 auto;
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all var(--transition);
}

.video-item:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 30px var(--accent-glow);
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-item h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 1rem 0 0.35rem 0;
  line-height: 1.4;
}

.video-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Multiple videos layout */
@media (min-width: 900px) {
  .video-carousel-track {
    justify-content: center;
  }
  
  .video-item {
    max-width: 480px;
  }
}

/* Two videos side by side on larger screens */
@media (min-width: 1100px) {
  .video-carousel-track {
    flex-wrap: nowrap;
    justify-content: center;
  }
  
  .video-item {
    max-width: 520px;
  }
}

/* Single video centered */
.video-carousel-track:has(.video-item:only-child) {
  justify-content: center;
}

.video-carousel-track:has(.video-item:only-child) .video-item {
  max-width: 640px;
}

@media (max-width: 700px) {
  .videos-section {
    padding: 2rem 0;
    margin-top: 2rem;
  }
  
  .video-carousel {
    padding: 0 1rem;
  }
  
  .video-item {
    padding: 1rem;
  }
  
  .video-item h3 {
    font-size: 0.9rem;
  }
  
  .video-item p {
    font-size: 0.8rem;
  }
}
