/* ============================================
   Built With Agents — Main Stylesheet
   Design: "Builder's Workshop" — dark mode, terminal energy
   ============================================ */

/* --- Google Fonts loaded in HTML head --- */

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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-card: #161b22;
  --border: #30363d;
  --border-light: #484f58;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #D4890A;
  --accent-green: #00ff41;
  --accent-dim: rgba(212, 137, 10, 0.15);
  --accent-green-dim: rgba(0, 255, 65, 0.1);
  --link: #58a6ff;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-width: 1200px;
  --content-width: 780px;
  --radius: 8px;
  --radius-lg: 12px;
}

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

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

a { color: var(--link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); letter-spacing: -0.02em; margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1.25rem; color: var(--text-secondary); }
p strong { color: var(--text-primary); }

code, .mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-tertiary);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  color: var(--accent);
}

pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p { color: var(--text-primary); margin-bottom: 0; }

/* === Navigation === */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}

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

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

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

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-green-dim);
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid rgba(0, 255, 65, 0.2);
  letter-spacing: 0.03em;
}

.nav-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Mobile nav */
.nav-toggle { display: none; background: none; border: none; color: var(--text-primary); cursor: pointer; padding: 0.5rem; }

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-badge { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 0.75rem;
  }
}

/* === Hero === */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-dim);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(212, 137, 10, 0.2);
  margin-bottom: 1.5rem;
}

.hero h1 {
  max-width: 800px;
  margin: 0 auto 1.25rem;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 0.75rem;
  line-height: 1.7;
}

.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.hero-cta:hover {
  background: var(--accent-dim);
  color: var(--accent);
}

/* === Section Layout === */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-header h2 { margin: 0; }

.section-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.section-link:hover { color: var(--accent); }

/* === Card Grid === */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.card-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.card-tag.build-log {
  color: var(--accent-green);
  background: var(--accent-green-dim);
}

.card h3 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  line-height: 1.35;
}

.card h3 a { color: var(--text-primary); }
.card h3 a:hover { color: var(--accent); }

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* === Article Page === */
.article-header {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
}

.article-header .card-tag { margin-bottom: 1rem; }

.article-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.article-intro {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.article-body {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

.article-body h2 {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.article-body p {
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-body ul, .article-body ol {
  margin: 1rem 0 1.5rem 1.25rem;
  color: var(--text-secondary);
}

.article-body li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

/* === Build Log Specifics === */
.build-log-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
}

@media (max-width: 900px) {
  .build-log-layout {
    grid-template-columns: 1fr;
  }
  .build-log-sidebar { order: -1; }
}

.build-log-sidebar {
  position: sticky;
  top: 5rem;
  align-self: start;
}

.sidebar-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-card h4 {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.sidebar-meta-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.sidebar-meta-item:last-child { border-bottom: none; }

.sidebar-meta-label { color: var(--text-muted); }
.sidebar-meta-value { color: var(--text-primary); font-weight: 500; }

.sidebar-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.tool-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Lessons section */
.lessons-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--accent-green);
}

.lessons-section h2 { color: var(--accent-green); border: none; padding-top: 0; }

.lesson-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-green);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.lesson-item h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--accent-green);
}

.lesson-item p { margin: 0; font-size: 0.9rem; }

/* === FAQ Section === */
.faq-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.faq-item {
  margin-bottom: 1.5rem;
}

.faq-item h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.faq-item p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

/* === Transparency Disclosure === */
.ai-disclosure {
  background: var(--accent-green-dim);
  border: 1px solid rgba(0, 255, 65, 0.15);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 2.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.ai-disclosure-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.ai-disclosure p { margin: 0; color: var(--text-secondary); }
.ai-disclosure a { color: var(--accent-green); }

/* === "How This Site Works" Page === */
.transparency-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.transparency-page h1 { margin-bottom: 1.5rem; }

.transparency-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.transparency-page th,
.transparency-page td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.transparency-page th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.transparency-page td { color: var(--text-secondary); }
.transparency-page td strong { color: var(--text-primary); }

/* === Hub Pages === */
.hub-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
}

.hub-header h1 { margin-bottom: 0.5rem; }
.hub-header p { font-size: 1.05rem; max-width: 600px; }

/* === Related Articles === */
.related-section {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.related-section h2 { font-size: 1.25rem; margin-bottom: 1.25rem; }

/* === Footer === */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  margin-top: 4rem;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

.footer-brand p {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 360px;
  margin-top: 0.5rem;
}

.footer-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.footer-logo:hover { color: var(--accent); }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 0.4rem; }

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-bottom p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

/* === Utilities === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}
