:root {
  --ink: #1a1a1a;
  --ink-light: #555;
  --ink-faint: #bbb;
  --ink-ghost: #e5e5e5;
  --bg: #fafafa;
  --white: #fff;
  --accent-blue: #2563eb;
  --accent-blue-bg: rgba(37, 99, 235, 0.06);
  --accent-red: #dc2626;
  --accent-red-bg: rgba(220, 38, 38, 0.06);
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --sans: 'Heebo', 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  direction: rtl;
  min-height: 100vh;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--ink-light);
}

/* Blueprint subtle grid */
.blueprint-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--ink-ghost) 1px, transparent 1px),
    linear-gradient(90deg, var(--ink-ghost) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.4;
}

/* ===== HEADER ===== */
header {
  background: var(--white);
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 101;
  border-bottom: 1px solid var(--ink);
}

header::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink-ghost);
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

/* Logo with technical frame */
.logo-frame {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.header-logo {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid var(--ink);
  position: relative;
  z-index: 1;
}

.logo-corners .corner {
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--ink);
  border-style: solid;
  z-index: 2;
}

.corner.tl { top: -3px; right: -3px; border-width: 1px 1px 0 0; }
.corner.tr { top: -3px; left: -3px; border-width: 1px 0 0 1px; }
.corner.bl { bottom: -3px; right: -3px; border-width: 0 1px 1px 0; }
.corner.br { bottom: -3px; left: -3px; border-width: 0 0 1px 1px; }

.header-text {
  position: relative;
  min-width: 0;
}

.dimension-line.top-dim {
  position: absolute;
  top: -6px;
  right: 0;
  width: 60px;
  height: 1px;
  background: var(--ink-faint);
}

.dimension-line.top-dim::before,
.dimension-line.top-dim::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--ink-faint);
}

.dimension-line.top-dim::before { right: 0; }
.dimension-line.top-dim::after { left: 0; }

header h1 {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subtitle {
  font-size: 0.78rem;
  color: var(--ink-light);
  font-weight: 300;
  margin-top: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.callout-line {
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--ink-faint);
  vertical-align: middle;
}

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-meta {
  font-size: 0.7rem;
  color: var(--ink-faint);
}

/* ===== MAIN ===== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 160px);
  position: relative;
  z-index: 1;
}

/* Section label */
.section-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-line {
  flex: 1;
  height: 1px;
  background: var(--ink-ghost);
}

.section-label .mono {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
}

/* Search bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--white);
  border: 1px solid var(--ink-ghost);
  padding: 0.6rem 1rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s;
}

.search-bar:focus-within {
  border-color: var(--ink);
}

.search-bar svg {
  color: var(--ink-faint);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
  background: transparent;
}

.search-bar input::placeholder {
  color: var(--ink-faint);
}

/* ===== POST CARDS ===== */
.post-card {
  background: var(--white);
  border: 1px solid var(--ink-ghost);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  transition: all 0.25s ease;
  position: relative;
}

.post-card::before,
.post-card::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
}

.post-card::before {
  top: -1px;
  right: -1px;
  border-top: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
}

.post-card::after {
  bottom: -1px;
  left: -1px;
  border-bottom: 2px solid var(--ink);
  border-left: 2px solid var(--ink);
}

.post-card:hover {
  border-color: var(--ink-faint);
  box-shadow: 8px 8px 0 var(--ink-ghost);
}

.post-card h2 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  line-height: 1.7;
  font-weight: 700;
  color: var(--ink);
  position: relative;
  padding-right: 1rem;
}

.post-card h2::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0.55em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-red);
}

.post-card .post-content {
  font-size: 0.9rem;
  line-height: 1.9;
  color: var(--ink-light);
  white-space: pre-line;
  padding-right: 1rem;
  border-right: 1px solid var(--ink-ghost);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.post-card .post-image {
  width: 100%;
  margin-top: 1.25rem;
  border: 1px solid var(--ink-ghost);
  display: block;
}

.post-card .post-video {
  width: 100%;
  margin-top: 1.25rem;
  border: 1px solid var(--ink-ghost);
  background: #000;
  display: block;
}

/* Post footer */
.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--ink-ghost);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.post-card .post-date {
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-family: var(--mono);
}

.post-stats {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.post-views {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
  font-family: var(--mono);
}

.post-views svg {
  opacity: 0.5;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: 1px solid var(--ink-ghost);
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  color: var(--ink-light);
  cursor: pointer;
  font-family: var(--mono);
  transition: all 0.2s;
  letter-spacing: 0.03em;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* Load more */
.load-more-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--white);
  border: 1px dashed var(--ink-faint);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--ink-light);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.load-more-btn:hover {
  border-style: solid;
  border-color: var(--ink);
  color: var(--ink);
}

.load-more-btn .mono {
  color: var(--accent-blue);
}

/* Loader */
.loader {
  text-align: center;
  padding: 3rem;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink-ghost);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-msg {
  text-align: center;
  color: var(--ink-faint);
  padding: 5rem 1rem;
  font-size: 0.95rem;
  line-height: 2;
}

/* ===== FOOTER ===== */
footer {
  position: relative;
  z-index: 1;
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.footer-inner p {
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  padding: 1rem 0;
}

.dimension-line-h {
  height: 1px;
  background: var(--ink-ghost);
  position: relative;
}

.dimension-line-h::before,
.dimension-line-h::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 1px;
  height: 7px;
  background: var(--ink-faint);
}

.dimension-line-h::before { right: 0; }
.dimension-line-h::after { left: 0; }

/* ===== MOBILE ===== */
@media (max-width: 600px) {
  header {
    padding: 0.75rem 1rem;
  }

  header h1 {
    font-size: 1rem;
  }

  .header-logo {
    width: 40px;
    height: 40px;
  }

  .logo-frame {
    width: 44px;
    height: 44px;
  }

  .header-brand {
    gap: 0.75rem;
  }

  .dimension-line.top-dim {
    display: none;
  }

  .callout-line {
    display: none;
  }

  .subtitle {
    font-size: 0.7rem;
  }

  main {
    padding: 1.25rem 0.75rem;
  }

  .section-label {
    margin-bottom: 1.25rem;
  }

  .post-card {
    padding: 1.15rem;
    margin-bottom: 1rem;
  }

  .post-card h2 {
    font-size: 1rem;
  }

  .post-card .post-content {
    font-size: 0.85rem;
    padding-right: 0.75rem;
  }

  .post-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  footer {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 380px) {
  header h1 {
    font-size: 0.9rem;
  }

  .header-logo {
    width: 34px;
    height: 34px;
  }

  .logo-frame {
    width: 38px;
    height: 38px;
  }

  .post-card {
    padding: 1rem;
  }
}
