/* ============================================
   Simbiosi.org — Editorial Brutalist
   Single CSS file. No SASS. No frameworks.
   ============================================ */

:root {
  --bg:        #111110;
  --bg-raised: #1a1a18;
  --text:      #e5ddd0;
  --text-dim:  #8a8478;
  --accent:    #6b8f5e;
  --accent-h:  #8ab87a;
  --warm:      #d4a853;
  --border:    #2a2926;
  --font-head: Georgia, 'Times New Roman', serif;
  --font-body: Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --max-w:     42rem;
  --space:     1.6rem;
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Navigation ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem var(--space);
  max-width: 60rem;
  width: 100%;
  margin: 0 auto;
  background: var(--bg);
}

.site-nav::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--space);
  right: var(--space);
  height: 1px;
  background: var(--border);
}

.nav-logo img {
  display: block;
  opacity: 0.85;
  transition: opacity 0.2s;
}

.nav-logo:hover img { opacity: 1; }

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-family: var(--font-head);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
  padding-bottom: 2px;
}

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

.nav-links a.active {
  border-bottom: 1px solid var(--accent);
}

/* ---- Content ---- */
.content {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem var(--space) 6rem;
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 { font-size: 2.4rem; margin-bottom: 1.5rem; }
h2 { font-size: 1.6rem; margin-top: 3rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.05rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.25rem; }

a {
  color: var(--accent);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

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

strong { font-weight: 600; color: var(--text); }
em { font-style: italic; }

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

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

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

li { margin-bottom: 0.4rem; }

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-raised);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

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

pre code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}

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

th {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

/* ---- Home / Manifesto ---- */
.manifesto {
  padding-top: 2rem;
}

.manifesto-eyebrow {
  font-family: var(--font-head);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.manifesto-eyebrow::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.manifesto h1 {
  font-size: 2.8rem;
  line-height: 1.15;
  margin-bottom: 2rem;
  max-width: 18ch;
}

.manifesto h1 .accent {
  color: var(--accent);
}

.manifesto-lead {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 2rem;
  max-width: 55ch;
}

.manifesto-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--warm);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.4rem;
  line-height: 1.4;
}

.manifesto-section {
  margin-top: 3rem;
}

.manifesto-section h2 {
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

/* ---- Blog listing ---- */
.blog-list {
  list-style: none;
  padding: 0;
}

.blog-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

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

.blog-item time {
  font-size: 0.8rem;
  color: var(--text-dim);
  font-family: var(--font-head);
  letter-spacing: 0.03em;
}

.blog-item h3 {
  margin: 0.3rem 0 0.4rem;
  font-size: 1.3rem;
}

.blog-item h3 a {
  color: var(--text);
  text-decoration: none;
}

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

.blog-item p {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
  line-height: 1.6;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  padding: 4rem 0;
}

/* ---- Post ---- */
.post-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.post-title {
  font-size: 2.4rem;
  margin-bottom: 0.75rem;
}

.post-date {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-family: var(--font-head);
}

.post-tags {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: rgba(107, 143, 94, 0.1);
  padding: 0.2em 0.6em;
  border-radius: 3px;
  font-family: var(--font-head);
}

.post-content {
  margin-bottom: 3rem;
}

/* ---- Related Posts ---- */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-posts h3 {
  font-size: 1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  margin-top: 0;
}

.related-posts ul {
  list-style: none;
  padding: 0;
}

.related-posts li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

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

.related-posts time {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-head);
  display: block;
  margin-bottom: 0.15rem;
}

.related-posts a {
  font-size: 0.95rem;
  color: var(--text);
  text-decoration: none;
}

.related-posts a:hover { color: var(--accent); }

.post-footer {
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.post-footer a {
  font-size: 0.9rem;
}

/* ---- Page ---- */
.page-title {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

/* ---- Projects ---- */
.project-section {
  margin-bottom: 3rem;
}

.project-section h2 {
  color: var(--accent);
  font-size: 1.3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.project-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.project-card {
  background: var(--bg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 1rem;
  transition: background 0.2s;
}

.project-card:hover {
  background: var(--bg-raised);
}

.project-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1rem;
  min-width: fit-content;
}

.project-name a {
  color: var(--text);
  text-decoration: none;
}

.project-name a:hover {
  color: var(--accent);
}

.project-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.project-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--warm);
  font-family: var(--font-head);
  white-space: nowrap;
}

/* ---- Footer ---- */
.site-footer {
  max-width: 60rem;
  width: 100%;
  margin: 0 auto;
  padding: 2rem var(--space);
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.site-footer a {
  color: var(--text-dim);
  text-decoration: none;
}

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

.footer-links {
  display: flex;
  gap: 1.25rem;
  margin-top: 0.25rem;
}

/* ---- 404 ---- */
.lost {
  text-align: center;
  padding: 6rem 0;
}

.lost h1 {
  font-size: 4rem;
  color: var(--text-dim);
}

.lost p {
  color: var(--text-dim);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
  html { font-size: 16px; }

  .manifesto h1 { font-size: 2rem; }

  .site-nav {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .nav-links { gap: 1rem; flex-wrap: wrap; }

  .content { padding: 2.5rem var(--space) 4rem; }

  .manifesto-stats {
    grid-template-columns: 1fr 1fr;
  }

  .project-card {
    flex-direction: column;
    gap: 0.25rem;
  }

  .post-title { font-size: 1.8rem; }
}

/* ---- Before/After Mockups ---- */
.mockup-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.mockup-pair-compact .mockup-frame {
  min-height: auto;
}

.mockup {
  display: flex;
  flex-direction: column;
}

.mockup-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.mockup-before .mockup-label { color: var(--text-dim); }
.mockup-after .mockup-label { color: var(--accent); }

.mockup-frame {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem;
  flex: 1;
  font-size: 0.85rem;
  line-height: 1.5;
}

.mockup-before .mockup-frame {
  background: var(--bg);
  opacity: 0.7;
}

.mockup-after .mockup-frame {
  background: var(--bg-raised);
  border-color: var(--accent);
}

.mockup-heading {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.mockup-btn {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  margin-top: 0.8rem;
}

.mockup-btn-dim {
  background: var(--border);
  color: var(--text-dim);
}

.mockup-after .mockup-btn {
  background: var(--accent);
  color: #fff;
}

.mockup-grid-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0.8rem 0;
}

.mockup-amount-card {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.6rem 0.4rem;
  text-align: center;
  position: relative;
}

.mockup-amount-featured {
  border-color: var(--accent);
  background: rgba(107, 143, 94, 0.08);
}

.mockup-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.55rem;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.mockup-amount {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.mockup-impact {
  font-size: 0.65rem;
  opacity: 0.6;
  margin-top: 0.2rem;
  line-height: 1.3;
}

.mockup-progress-track {
  width: 100%;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin: 0.5rem 0 0.3rem;
}

.mockup-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-h));
  border-radius: 6px;
}

.mockup-note {
  font-size: 0.78rem;
  padding: 0.6rem 0.8rem;
  background: rgba(212, 168, 83, 0.08);
  border-left: 2px solid var(--warm);
  border-radius: 0 4px 4px 0;
  line-height: 1.5;
}

.mockup-health-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

.mockup-health-card {
  text-align: center;
  padding: 0.6rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 5px;
}

.mockup-health-value {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
}

.mockup-health-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.5;
  margin-top: 0.2rem;
}

.mockup-scenarios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.mockup-scenario {
  padding: 0.7rem;
  border-radius: 5px;
  font-size: 0.8rem;
}

.mockup-scenario-good {
  background: rgba(45, 138, 78, 0.08);
  border: 1px solid rgba(45, 138, 78, 0.2);
}

.mockup-scenario-risk {
  background: rgba(193, 122, 26, 0.08);
  border: 1px solid rgba(193, 122, 26, 0.2);
}

.mockup-feed-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}

.mockup-feed-item:last-child { border-bottom: none; }

.mockup-feed-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
  opacity: 0.6;
  flex-shrink: 0;
}

.mockup-feed-time {
  font-size: 0.65rem;
  opacity: 0.4;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .mockup-pair {
    grid-template-columns: 1fr;
  }

  .mockup-grid-amounts {
    grid-template-columns: repeat(2, 1fr);
  }

  .mockup-health-grid {
    grid-template-columns: 1fr;
  }

  .mockup-scenarios {
    grid-template-columns: 1fr;
  }
}

/* ---- Light mode ---- */
@media (prefers-color-scheme: light) {
  :root {
    --bg:        #faf9f7;
    --bg-raised: #f0efec;
    --text:      #2c2a25;
    --text-dim:  #6b6660;
    --accent:    #4a7340;
    --accent-h:  #3a5e32;
    --warm:      #a07520;
    --border:    #dddad4;
  }

  .tag {
    background: rgba(74, 115, 64, 0.1);
  }

  body::before {
    opacity: 0.015;
  }
}

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

/* ---- Fade in ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.content {
  animation: fadeUp 0.5s ease-out;
}
