/* ==========================================================================
   ORNDOR.COM — DEEP CHARCOAL MINIMALIST STYLESHEET
   3-Column Desktop Grid / Responsive Mobile Architecture
   ========================================================================== */

:root {
  /* Core Deep Charcoal Palette */
  --bg-canvas: #0c0e12;       /* Base background */
  --bg-surface: #13171f;      /* Column background & card surface */
  --bg-surface-elevated: #1a202b; /* Elevated panels & cards */
  --bg-subtle: #222a38;       /* Code blocks, input fields, hover states */
  
  /* Borders & Dividers */
  --border-dim: #1f2733;
  --border-muted: #283242;
  --border-highlight: #3b4759;

  /* Typography */
  --text-primary: #f0f3f6;     /* Pure high-contrast body text */
  --text-secondary: #9aa5b5;   /* Subtext, dates, metadata */
  --text-muted: #64748b;       /* Minor labels, timestamps */
  --text-inverse: #0c0e12;

  /* Precision Accents */
  --accent-cyan: #38bdf8;
  --accent-cyan-glow: rgba(56, 189, 248, 0.15);
  --accent-blue: #60a5fa;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;

  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Sizing & Transitions */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
}

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-cyan);
}

/* ==========================================================================
   LAYOUT: 3-COLUMN DESKTOP GRID
   ========================================================================== */

.site-wrapper {
  max-width: 1540px;
  margin: 0 auto;
  padding: 24px 20px;
}

.tri-grid-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

/* Columns */
.col-sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-muted) transparent;
}

.col-sidebar::-webkit-scrollbar {
  width: 4px;
}

.col-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-muted);
  border-radius: var(--radius-pill);
}

.sidebar-inner {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.col-main {
  min-width: 0; /* Prevents pre/code blowout in CSS grid */
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Divider */
.nav-divider {
  border: none;
  height: 1px;
  background: var(--border-dim);
  margin: 4px 0;
}

/* Section Header Labels */
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-label .sub-link {
  font-size: 0.7rem;
  color: var(--accent-cyan);
}

.count-badge {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

/* ==========================================================================
   LEFT COLUMN: BRAND & RECENT POSTS NAV
   ========================================================================== */

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-avatar-link {
  flex-shrink: 0;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border-muted);
  display: block;
}

.profile-meta {
  display: flex;
  flex-direction: column;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-logo a {
  color: var(--text-primary);
}

.author-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.author-role {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.author-bio-short {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Recent Post Navigation List */
.recent-posts-nav {
  display: flex;
  flex-direction: column;
}

.recent-post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.recent-post-item {
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.recent-post-item:hover {
  background: var(--bg-subtle);
}

.recent-post-item.is-active {
  background: var(--bg-subtle);
  border-left: 2px solid var(--accent-cyan);
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  gap: 2px;
}

.post-nav-date {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.post-nav-title {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recent-post-item:hover .post-nav-title {
  color: var(--accent-cyan);
}

/* Left Column Footer Nav */
.left-col-footer {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-canvas);
  border: 1px solid var(--border-dim);
  transition: all var(--transition-fast);
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--bg-subtle);
  border-color: var(--border-muted);
}

.nav-btn.btn-highlight {
  color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.25);
  background: var(--accent-cyan-glow);
}

.nav-btn.btn-highlight:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
}

.social-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px;
}

.social-icon {
  color: var(--text-muted);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.social-icon:hover {
  color: var(--text-primary);
  transform: translateY(-1px);
}

.back-home-link-box {
  margin-top: 4px;
}

.btn-back-home {
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

/* ==========================================================================
   MIDDLE COLUMN: MAIN FEED (POSTS STREAM)
   ========================================================================== */

.main-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
}

.feed-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent-emerald);
}

.feed-subtext {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.posts-stream {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.post-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-lg);
  padding: 36px 36px 28px 36px;
  transition: border-color var(--transition-fast);
  scroll-margin-top: 24px;
}

.post-card:hover {
  border-color: var(--border-muted);
}

.post-card-header {
  margin-bottom: 24px;
}

.post-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.post-date-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.meta-separator {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.post-read-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-permalink-icon {
  color: var(--text-muted);
  margin-left: auto;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.post-permalink-icon:hover {
  color: var(--accent-cyan);
  background: var(--bg-subtle);
}

.post-title {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.post-title a {
  color: var(--text-primary);
}

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

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dim);
}

.post-card-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-dim);
  display: flex;
  justify-content: flex-end;
}

.btn-read-permalink {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.btn-read-permalink:hover {
  text-decoration: underline;
}

/* Feed Footer Card */
.feed-footer-card {
  background: var(--bg-surface);
  border: 1px dashed var(--border-muted);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
}

.feed-footer-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.feed-footer-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.btn-archive-cta {
  display: inline-block;
  background: var(--bg-subtle);
  color: var(--accent-cyan);
  border: 1px solid var(--border-muted);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-archive-cta:hover {
  background: var(--accent-cyan);
  color: var(--text-inverse);
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   MARKDOWN CONTENT TYPOGRAPHY
   ========================================================================== */

.markdown-body {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.markdown-body p {
  margin-bottom: 1.25rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: var(--text-primary);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
}

.markdown-body h2 {
  font-size: 1.35rem;
  border-bottom: 1px solid var(--border-dim);
  padding-bottom: 6px;
}

.markdown-body h3 {
  font-size: 1.15rem;
}

.markdown-body ul,
.markdown-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.4rem;
}

.markdown-body li {
  margin-bottom: 0.4rem;
}

.markdown-body blockquote {
  margin: 1.4rem 0;
  padding: 12px 18px;
  background: var(--bg-canvas);
  border-left: 3px solid var(--accent-cyan);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-body hr {
  border: none;
  height: 1px;
  background: var(--border-dim);
  margin: 2rem 0;
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-subtle);
  color: #e2e8f0;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-dim);
}

.markdown-body pre {
  margin: 1.4rem 0;
  background: #090c10;
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  position: relative;
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
  border: none;
  font-size: 0.85rem;
  line-height: 1.55;
  color: #e6edf3;
  display: block;
}

/* Copy Code Button */
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-muted);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition-fast), color var(--transition-fast);
}

.markdown-body pre:hover .code-copy-btn {
  opacity: 1;
}

.code-copy-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dim);
  margin: 1.25rem 0;
}

/* ==========================================================================
   RIGHT COLUMN: PROJECTS SHOWCASE
   ========================================================================== */

.projects-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-card {
  background: var(--bg-canvas);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

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

.project-thumb-link {
  display: block;
  position: relative;
}

.project-thumb-container {
  width: 100%;
  height: 140px;
  background: #05070a;
  overflow: hidden;
  position: relative;
}

.project-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}

.project-card:hover .project-thumb {
  transform: scale(1.03);
}

.project-external-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(12, 14, 18, 0.85);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.project-card:hover .project-external-overlay {
  opacity: 1;
}

.project-info {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.project-title a {
  color: var(--text-primary);
}

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

.project-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.proj-tag-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

.right-col-footer {
  text-align: center;
  padding-top: 8px;
}

.repo-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.repo-note a {
  color: var(--accent-cyan);
  text-decoration: underline;
}

/* ==========================================================================
   PAGES: ARCHIVE, SINGLE POST, ABOUT
   ========================================================================== */

/* Single Post View */
.single-post-view .single-post-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 12px;
}

.post-nav-adjacent {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.nav-adj-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 48%;
}

.adj-direction {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

.adj-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-adj-link.next {
  text-align: right;
  margin-left: auto;
}

/* Archive List */
.archive-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.archive-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  align-items: start;
}

.archive-date-col time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
}

.archive-item-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.archive-item-summary {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.archive-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* About Page */
.about-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-dim);
}

.about-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border-muted);
}

.about-name {
  font-size: 1.6rem;
  font-weight: 700;
}

.about-role-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

.contact-action-box {
  margin-top: 24px;
  background: var(--bg-canvas);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.contact-box-info {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.contact-email-large {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.btn-primary-contact {
  background: var(--accent-cyan);
  color: var(--text-inverse);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
}

.btn-primary-contact:hover {
  background: #7dd3fc;
  color: var(--text-inverse);
}

/* ==========================================================================
   MOBILE & RESPONSIVE BREAKPOINTS
   ========================================================================== */

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-dim);
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.mobile-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.mobile-menu-btn {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.mobile-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 998;
}

/* Tablet & Mobile Breakpoints */
@media (max-width: 1200px) {
  .tri-grid-layout {
    grid-template-columns: 260px minmax(0, 1fr) 280px;
    gap: 20px;
  }
}

@media (max-width: 992px) {
  .tri-grid-layout {
    grid-template-columns: 1fr;
  }

  .mobile-header {
    display: flex;
  }

  .site-wrapper {
    padding: 16px 12px;
  }

  /* Transform left sidebar into off-canvas drawer on mobile */
  .col-sidebar.col-left {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    max-height: 100vh;
    z-index: 999;
    background: var(--bg-canvas);
    transition: left var(--transition-normal);
  }

  .col-sidebar.col-left.is-open {
    left: 0;
  }

  .col-sidebar.col-right {
    position: static;
    max-height: none;
    order: 3;
  }

  .col-main {
    order: 2;
  }

  .archive-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .post-card {
    padding: 24px 18px;
  }

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

  .contact-action-box {
    flex-direction: column;
    align-items: flex-start;
  }
}
