/* Theme variables */
:root {
  --bg: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card-bg: #ffffff;
  --accent: #0f172a;
  --accent-2: #f97316;
}

[data-theme="dark"] {
  --bg: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --card-bg: #ffffff;
  --accent: #0f172a;
  --accent-2: #f97316;
}

/* Reset and base styles */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Courier New', Courier, monospace;
  color: var(--text);
  background: var(--bg);
}

/* Container wraps everything */
#container {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  width: 90%;          /* wider than fixed 900px */
  max-width: 1200px;   /* cap so it’s not too wide */
  margin: 0 auto;
  padding-top: 10px;   /* bring nav/header closer to top */
}

/* Hamburger button (hidden on desktop) */
.mobile-nav-panel {
  display: none;
  padding: 15px;
  cursor: pointer;
  border-bottom: 1px solid #ddd;
}

.mobile-nav-panel .hamburger {
  font-size: 24px;
  line-height: 1;
}

/* Desktop nav */
.nav {
  margin: 0; 
  font-size: 16px;
}

.nav ul {
  display: flex;
  justify-content: space-around;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav ul li {
  flex: 1;
  text-align: center;
}

.nav ul li a {
  display: block;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 2px solid var(--border); /* underline always visible */
  text-transform: lowercase;
}

.nav ul li a:hover {
  border-bottom: 2px solid var(--accent); /* darker underline on hover */
}

/* Blog title */
.blog-title {
  font-size: 2.5rem;
  font-weight: normal;
  letter-spacing: .2em;
  margin: 30px 0;
}

#header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

/* Main content grows to push footer down */
#main {
  flex: 1;
}

/* Ensure content area expands to keep footer at bottom */
#contentRow {
  flex: 1;
}

/* Ensure floats in converted Markdown content don't overflow */
.article-body::after {
  content: "";
  display: block;
  clear: both;
}

.article {
  max-width: 900px;
  margin: 0 auto 48px auto;
  padding: 0 16px;
}

.article-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

.article-cover {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}
.mediumish-cover {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}

.article-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.article-kicker {
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: 0.8rem;
  color: var(--muted);
}

.article-title {
  font-family: 'Courier New', Courier, monospace;
  font-size: 2.6rem;
  line-height: 1.1;
  margin: 0;
}

.article-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.article-body {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  line-height: 1.75;
  font-size: 1.05rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* Post detail overrides — no box, clean Medium-style layout */
.mediumish-page .article-body {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.1rem;
  line-height: 1.8;
}

.article-body p { margin: 0 0 1.2rem 0; }
.article-body img { max-width: 100%; height: auto; border-radius: 0; }
.article-body a { color: var(--accent); font-weight: 600; text-decoration: underline; }
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: 'Courier New', Courier, monospace;
  margin: 2rem 0 1rem;
}
.article-body blockquote {
  margin: 1.4rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent-2);
  background: rgba(249, 115, 22, 0.08);
  color: var(--accent);
  border-radius: 10px;
}
.article-body pre {
  background: #0b1021;
  color: #e5e7eb;
  padding: 16px;
  border-radius: 12px;
  overflow: auto;
  font-size: 0.95rem;
}
.article-body code {
  background: #111827;
  color: #facc15;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
}
.codehilite {
  background: #0b1021;
  color: #e5e7eb;
  padding: 12px;
  border-radius: 12px;
  overflow: auto;
}
.codehilite pre { margin: 0; }
.article-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 10px;
}
.article-body th {
  background: rgba(15, 23, 42, 0.05);
  text-align: left;
}

.tag-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.tag-chip {
  background: rgba(15, 23, 42, 0.08);
  color: var(--accent);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.82rem;
  letter-spacing: .01em;
}

.article-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: var(--card-bg);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.article-card .project-thumb {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 12px;
}

.article-card .project-excerpt {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 4px 0;
}

.article-card .project-date {
  color: var(--muted);
  font-size: 0.85rem;
}

.article-card .project-title {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.3rem;
}

/* Mediumish projects / experience */
.mediumish-page {
  margin: 0 auto 48px;
  font-family: 'Courier New', Courier, monospace;
}

.mediumish-section { margin-bottom: 56px; }

.mediumish-page .section-title h2 {
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.mediumish-page .section-title span {
  border-bottom: 3px solid #2596be;
  padding-bottom: 4px;
}

.featured-grid,
.posts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.medium-card {
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-thumb {
  display: block;
  width: 220px;
  height: 160px;
  background: #e8e8e8;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.card-title a {
  color: var(--text);
  text-decoration: underline;
}

.card-title a:hover {
  color: #2596be;
}

.card-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.separator, .dot {
  color: #d1d5db;
}

.folder-thumb {
  background: var(--card-bg, #f5f5f5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-icon-img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.12));
}

.folder-breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 20px;
}

.folder-breadcrumb a {
  color: var(--accent, #2596be);
  text-decoration: none;
}

.folder-breadcrumb a:hover {
  text-decoration: underline;
}

.rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.95rem;
  color: #f59e0b;
}

.rating-stars .star {
  line-height: 1;
}

.rating-stars .star.empty {
  color: #d1d5db;
}

.rating-stars .star.half {
  color: transparent;
  background: linear-gradient(90deg, #f59e0b 50%, #d1d5db 50%);
  -webkit-background-clip: text;
  background-clip: text;
}

.rating-stars .rating-number {
  margin-left: 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.mediumish-page .tag-chip {
  background: #eef2ff;
  color: #312e81;
  border-radius: 0;
}

.mediumish-page .tag-row {
  margin-top: 6px;
}

.mediumish-article {
  max-width: 960px;
  margin: 0 auto 60px;
}

.mediumish-header {
  margin-bottom: 12px;
}

.mediumish-page .article-title {
  font-family: 'Iowan Old Style', 'Iowan Old Style BT', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 32px 0 12px;
  line-height: 1.15;
}

.mediumish-page .article-submeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.98rem;
}

.mediumish-page .author-chip {
  width: 32px;
  height: 32px;
  border-radius: 0;
  background: #111827;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.92rem;
}

.mediumish-cover {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 0;
  box-shadow: 0 22px 50px rgba(17, 24, 39, 0.18);
  margin: 24px 0;
}

.mediumish-body {
  border-radius: 0;
}

.mediumish-body .mediumish-toc {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 14px 16px;
  border-radius: 0;
  margin: 0 0 18px 0;
}

.mediumish-body .mediumish-toc h3 {
  margin: 0 0 10px 0;
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: 0.04em;
}

.mediumish-body .mediumish-toc ul {
  margin: 0;
  padding-left: 20px;
}

.mediumish-body .mediumish-toc li {
  margin: 4px 0;
}

.mediumish-page .after-post-tags ul {
  list-style: none;
  padding: 0;
  margin: 18px 0 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mediumish-page .after-post-tags .tag-chip {
  background: #f3f4f6;
  color: #1f2937;
  border-radius: 0;
}

.mediumish-page .article-body a {
  color: #2596be;
  text-decoration: none;
}

.mediumish-page .article-body a:hover {
  text-decoration: underline;
}

.mediumish-page .article-body blockquote {
  border-left-color: #2596be;
  background: rgba(0, 171, 107, 0.06);
}

.mediumish-page .spoiler {
  color: transparent;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  position: relative;
  transition: all .3s;
}

.mediumish-page .spoiler:after {
  position: absolute;
  opacity: 0;
  content: 'Click to reveal spoiler';
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #111827;
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 0;
  transition: opacity .3s;
}

.mediumish-page .spoiler:hover {
  color: inherit;
  text-shadow: none;
}

.mediumish-page .spoiler:hover:after {
  opacity: 1;
}

/* Square edges for mediumish content body */
.mediumish-page .article-body {
  border-radius: 0;
}

/* Footer always at bottom */
#footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* Mobile navigation */
@media (max-width: 767px) {
  #container {
    width: 93.75%;
  }

  .mobile-nav-panel {
    display: block; /* show hamburger */
  }

  .nav {
    display: none;  /* hidden until toggled */
    margin: 0;
  }

  .nav.active {
    display: block;
    border-bottom: 1px solid #ddd;
  }

  .nav ul {
    flex-direction: column;
  }

  .nav ul li {
    flex: unset;
    text-align: left;
  }

  .nav ul li a {
    border: none;
    border-top: 1px solid #ddd;
    padding: 10px;
  }

  .article-card {
    grid-template-columns: 1fr;
  }

  .article-body {
    padding: 22px;
  }

  .card-thumb {
    height: 200px;
  }

  .mediumish-page .article-title {
    font-size: 2rem;
  }

  .mediumish-cover {
    max-height: 360px;
  }
}

/* Stream wrapper (for images) */
.stream-wrapper {
  text-align: right;   /* pushes image to right */
  margin: 20px 0;
}

.stream-wrapper img {
  max-width: 100%;
  height: auto;    
  border: 2px solid var(--border);
  border-radius: 4px;
}

/* Home hero */
.home-hero h2 { margin-top: 0; }
.home-hero p { line-height: 1.6; }
.home-hero { margin-top: 16px; }
.home-hero .social-links { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px 14px; }
.home-hero .social-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-decoration: none; background: var(--card-bg); }
.home-hero .social-link:hover { border-color: var(--accent); }
.home-hero .icon { width: 18px; height: 18px; display: inline-block; }

/* About */
.about-hero { display: flex; gap: 16px; align-items: flex-start; }
.about-photo { width: 640px; max-width: 70%; height: auto; border-radius: 0; border: none; }
.about-copy p { line-height: 1.6; }

/* ---------- Two-column content row (desktop) ---------- */
/* Interactive page */
.interactive-mode #contentRow {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.interactive-mode #main { order: 1; flex: 0 0 44%; }
.interactive-mode #global-stream { order: 2; flex: 1 1 56%; margin: 0; }
.interactive-mode .stream-wrapper { margin-top: 10px; text-align: left; }
.interactive-left { padding-right: 0; }
.interactive-right { }

/* Tabs and panels */
.interactive-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 12px 0;
}

.interactive-tabs .tab-btn {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 6px;
  cursor: pointer;
}

.interactive-tabs .tab-btn.active {
  border-color: var(--accent);
  background: var(--card-bg);
}

.interactive-tabs .tab-link {
  display: block;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
}
.interactive-tabs .tab-link:hover { border-color: var(--accent); }

.tab-panel.hidden { display: none; }

.interactive-note {
  font-size: 12px;
  color: var(--muted);
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.row { display: flex; align-items: center; }
.gap { gap: 8px; }
.top6 { margin-top: 6px; }
.top8 { margin-top: 8px; }
.muted { color: var(--muted); }
.full { width: 100%; }
.card { border: 1px solid var(--border); border-radius: 6px; padding: 8px; background: var(--card-bg); }
.scroll { max-height: 240px; overflow: auto; }

/* Globe (interactive) */
/* Allow the globe to bleed outside its box and sit behind other UI */
.globe-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  background: transparent;
  border: 0;
  overflow: visible; /* let canvas extend beyond the box */
  margin: 6px auto;
  z-index: 0; /* UI that follows naturally layers above */
}
.globe-wrap canvas {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  will-change: transform, width, height;
}
.globe-controls { max-width: 240px; margin: 6px auto 0; }

/* Globe message bubble */
.globe-bubble { 
  position: relative; 
  background: #ffffff; 
  color: #000000; 
  border: 1px solid #dddddd; 
  border-radius: 8px; 
  padding: 4px 6px; 
  box-shadow: 0 6px 18px rgba(0,0,0,.22);
  font-size: 11px;
  max-width: 220px;
  transform: translate(-50%, -100%);
}
.globe-bubble::after { 
  content: ''; 
  position: absolute; 
  left: 50%; 
  bottom: -5px; 
  transform: translateX(-50%);
  width: 0; height: 0; 
  border-left: 5px solid transparent; 
  border-right: 5px solid transparent; 
  border-top: 5px solid #ffffff;
}
.globe-bubble .meta { color: var(--muted); font-size: 10px; margin-bottom: 3px; }

/* Full-screen globe page */
.globe-mode .mobile-nav-panel,
.globe-mode .nav,
.globe-mode #header,
.globe-mode #footer { display: none !important; }
.globe-mode #container { width: 100%; max-width: none; padding-top: 0; }
.globe-mode #contentRow, .globe-mode #main { padding: 0; margin: 0; }

.globe-page { position: fixed; inset: 0; background: #000; }
.globe-full { position: absolute; inset: 0; overflow: hidden; }
.globe-full canvas { position: absolute; left:0; top:0; }

.globe-topbar { position: fixed; top: 10px; left: 10px; z-index: 9999; }
.globe-back { display:inline-block; padding:6px 10px; border-radius: 8px; border:1px solid var(--border); background: rgba(20,20,20,0.6); color: #ffffff; text-decoration: none; }
.globe-back:hover { border-color: var(--accent); }
.globe-audio { margin-left: 8px; background: rgba(20,20,20,0.6); color: #ffffff; border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; cursor: pointer; }
.globe-audio:hover { border-color: var(--accent); }

.globe-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: #ffffff;
  color: #000000;
  border: 1px solid #dddddd;
  border-radius: 8px;
  font-size: 12px;
  padding: 6px 8px;
  max-width: 280px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  font-family: 'Courier New', Courier, monospace;
}
.globe-tooltip .flag { margin-right: 6px; }

.globe-overlay { 
  position: fixed; 
  left: 50%; 
  bottom: 12px; 
  transform: translateX(-50%);
  z-index: 9999; 
  background: rgba(20,20,20,0.75);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px; 
  display: flex; 
  align-items: center; 
  gap: 8px;
}
.globe-overlay input[type="text"] { 
  width: min(60vw, 520px); 
  background: var(--card-bg); 
  color: var(--text); 
  border: 1px solid var(--border); 
  border-radius: 8px; 
  padding: 6px 8px;
}

.meter { height: 10px; background: var(--border); border-radius: 5px; position: relative; }
.meter-fill { height: 100%; width: 0; background: #4caf50; border-radius: 5px; transition: width .2s ease; }

.stat-row { display: flex; justify-content: space-between; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); }

.primary {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.primary:hover { filter: brightness(1.1); }

/* Admin and Projects */
.form-row { display: flex; flex-direction: column; }
.projects-list { display: flex; flex-direction: column; gap: 10px; }
/* Grid for project tiles */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.project-card { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--text); background: var(--card-bg); }
.project-card.tile { flex-direction: column; align-items: stretch; gap: 8px; padding: 0; overflow: hidden; }
.project-card:hover { border-color: var(--accent); }
.project-thumb { width: 100%; height: 160px; object-fit: cover; display: block; }
.project-meta { display: flex; flex-direction: column; padding: 10px; }
.project-title { font-weight: 600; }
.project-date { font-size: 12px; color: var(--muted); }
.project-detail { max-width: 800px; margin: 0 auto; padding: 6px 14px 20px; }
.project-detail .project-hero { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); display:block; margin: 8px auto; }
.project-detail .project-body { line-height: 1.75; margin-top: 12px; font-size: 1.02rem; }
.project-detail .project-body p { margin: 10px 0; }
.project-detail .project-body h1,
.project-detail .project-body h2,
.project-detail .project-body h3,
.project-detail .project-body h4,
.project-detail .project-body h5,
.project-detail .project-body h6 { margin: 16px 0 8px; }
.project-detail .project-body ul,
.project-detail .project-body ol { margin: 10px 0; padding-left: 22px; }
.project-detail .project-body img,
.project-detail .project-body video,
.project-detail .project-body iframe { max-width: 100%; height: auto; display: block; margin: 10px auto; }
.project-detail .project-body img { border-radius: 6px; border: 1px solid var(--border); }
.project-detail .project-body blockquote { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--border); background: var(--card-bg); }
.project-detail .project-body pre { background: #0b1020; color: #e5e7eb; padding: 10px; overflow: auto; border-radius: 6px; }
.project-detail .project-body code { background: rgba(127,127,127,.15); padding: 2px 4px; border-radius: 4px; }
.project-detail .project-body table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.project-detail .project-body th,
.project-detail .project-body td { border: 1px solid var(--border); padding: 6px 8px; }

/* Admin polish */
.admin-bar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom: 12px; }
.admin-bar .primary { border-radius: 8px; padding: 8px 12px; }
.admin-form .form-row label { margin-bottom: 4px; }
.admin-form input[type="text"],
.admin-form input[type="file"],
.admin-form textarea { padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--card-bg); color: var(--text); }
.admin-form .form-row + .form-row { margin-top: 8px; }
.projects-admin .project-admin-row { transition: border-color .2s ease, box-shadow .2s ease; }
.projects-admin .project-admin-row:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0,0,0,.05); }

/* Live online badge (admin) */
.admin-online-badge {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}

/* Buttons */
button, .primary {
  font-weight: 600;
}

/* Upload progress bar */
.upload-progress { margin-top: 10px; background: var(--border); border-radius: 6px; position: relative; height: 12px; }
.upload-progress .upload-bar { position:absolute; left:0; top:0; bottom:0; width:0; background: linear-gradient(90deg, #3b82f6, #06b6d4); border-radius: 6px; transition: width .2s ease; }
.upload-progress .upload-status { margin-top: 6px; font-size: 12px; color: var(--muted); }
.hidden { display: none; }

/* Photography galleries */
.photo-albums { display:flex; flex-wrap:wrap; gap:10px; }
.album-card { display:flex; flex-direction:column; width:200px; text-decoration:none; color:var(--text); border:1px solid var(--border); border-radius:0; overflow:hidden; background:var(--card-bg); }
.album-card:hover { border-color: var(--accent); }
.album-cover { width:100%; height:150px; object-fit:cover; border-radius:0; }
.album-meta { padding:8px; }
.album-title { font-weight:600; }
.album-date { font-size:12px; color:var(--muted); }
.photo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:10px; }
.photo-grid img { width:100%; border-radius:0; border:1px solid var(--border); }
.photo-grid figure { margin:0; }
.photo-grid figcaption { margin-top:4px; font-size:14px; text-align:center; color:var(--muted); }

/* Fullscreen photo album detail */
.fullscreen-photos .photo-grid { grid-template-columns: 1fr; gap: 24px; padding: 8px 0; }
.fullscreen-photos .photo-grid figure { margin: 0; position: relative; padding: 0; }
.fullscreen-photos .photo-grid img { display:block; max-width: min(100%, 1200px); height: auto; max-height: 80vh; margin: 0 auto; object-fit: contain; border: 0; background: transparent; }
.fullscreen-photos .photo-grid figcaption { position: static; margin: 8px auto 0; max-width: min(100%, 1200px); text-align: center; color: var(--muted); font-size: 14px; }

/* Twemoji sizing: keep emoji inline-size reasonable */
img.emoji { height: 1em; width: 1em; margin: 0 .05em 0 .08em; vertical-align: -0.12em; }
.msg-flag img.emoji { height: 0.95em; width: 0.95em; vertical-align: -0.12em; }

/* Big Boss overlay for special command */
.bb-overlay { position: fixed; z-index: 9999; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.bb-overlay .bb-inner { position: absolute; background: rgba(0,0,0,0.50); inset: 0; }
.bb-overlay .bb-img { position: absolute; max-width: min(60vw, 520px); width: auto; height: auto; top: 10%; left: 50%; transform: translateX(-50%); filter: drop-shadow(0 6px 14px rgba(0,0,0,0.5)); }
.bb-overlay .bb-marquee { position: absolute; bottom: 8%; left: 0; right: 0; overflow: hidden; white-space: nowrap; }
.bb-overlay .bb-text { display: inline-block; font-size: clamp(14px, 2.2vw, 22px); color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.6); padding-left: 100%; animation: bb-marquee 12s linear infinite; }
@keyframes bb-marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* Home page two-column */
.home-mode #contentRow {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.home-mode #main { order: 1; flex: 0 0 44%; }
.home-mode #global-stream { order: 2; flex: 1 1 56%; margin: 0; }

/* Mobile layout overrides */
@media (max-width: 767px) {
  /* Stack stream above controls on mobile */
  .interactive-mode #contentRow,
  .home-mode #contentRow {
    display: block;
  }
  .interactive-tabs { flex-direction: row; overflow-x: auto; }
  .about-hero { display: block; }
  .about-photo { max-width: 100%; width: 100%; margin-bottom: 10px; border: none; border-radius: 0; }
}

/* Footer links */
#footer .footer-links { display: inline-flex; gap: 12px; align-items: center; margin-left: 16px; padding-left: 14px; border-left: 1px solid var(--border); }
#footer .footer-links a { color: var(--muted); text-decoration: none; }
#footer .footer-links a:hover { color: var(--text); text-decoration: underline; }

/* Theme toggle */
.theme-toggle {
  margin-top: 10px;
  margin-left: 10px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.interactive-mode #container { display: flex; }
/* Interactive page: buttons use Courier */
.interactive-app button,
.interactive-tabs .tab-btn,
.interactive-app .primary {
  font-family: "Courier New", Courier, monospace;
}

/* Hearts overlay for fun commands */
.hearts-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 9999;
}
.heart {
  position: absolute;
  bottom: -40px;
  opacity: 0.9;
  will-change: transform, opacity;
  animation-name: heartFloat;
  animation-timing-function: ease-in;
  text-shadow: 0 2px 4px rgba(0,0,0,.2);
}
@keyframes heartFloat {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-120vh) scale(1.4); opacity: 0; }
}

/* 404 video */
.video-404 { display:flex; align-items:center; justify-content:center; min-height: 72vh; }
.video-404-inner { width: 100%; max-width: 560px; margin: 0 auto; }
.video-404-player { width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; display:block; box-shadow: 0 8px 28px rgba(0,0,0,.15); }

/* Drawing modal for LCD custom chars */
.draw-overlay {
  position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.draw-modal {
  background: var(--card-bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px; width: min(92vw, 620px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.draw-header { font-weight: 700; margin-bottom: 6px; }
.draw-sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.draw-grid {
  display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; background: #101318;
  padding: 8px; border-radius: 8px; border: 1px solid var(--border);
}
.draw-cell {
  width: 16px; height: 16px; background: #1d2430; border-radius: 2px; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
}
.draw-cell.on { background: #34d399; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4); }
.draw-cell.tile-v { box-shadow: inset 2px 0 0 rgba(255,255,255,0.05), inset 0 0 0 1px rgba(255,255,255,0.06); }
.draw-cell.tile-h { box-shadow: inset 0 2px 0 rgba(255,255,255,0.05), inset 0 0 0 1px rgba(255,255,255,0.06); }
.draw-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }

/* ── Post interaction bar (claps / comments / share) ── */
.post-interaction-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 32px 0;
  font-size: .92rem;
  color: var(--muted);
}
.post-interaction-bar .ia-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--muted);
  font-size: .92rem;
  font-family: inherit;
  padding: 4px 0;
  transition: color .15s;
}
.post-interaction-bar .ia-btn:hover { color: var(--text); }
.post-interaction-bar .ia-btn.clapped { color: #2596be; }
.post-interaction-bar .ia-divider { width: 1px; height: 20px; background: var(--border); }
.post-interaction-bar .ia-btn .ia-icon { font-size: 1.15rem; line-height: 1; }
.clap-breakdown {
  position: absolute;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .82rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  white-space: nowrap;
  z-index: 10;
  top: -8px;
  transform: translateY(-100%);
  left: 0;
  min-width: 140px;
}
.clap-wrap { position: relative; }

/* ── Admin bar on post ── */
.post-admin-bar {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 7px 0;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .82rem;
  margin-bottom: 0;
}
.post-admin-bar strong { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.post-admin-bar a { color: #2596be; font-weight: 600; }
.post-admin-bar .del-btn { background: none; border: none; color: #c0392b; cursor: pointer; font-size: .82rem; font-weight: 600; padding: 0; font-family: inherit; }
.post-admin-bar .ia-spacer { margin-left: auto; }

/* ── Comments section ── */
.comments-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  max-width: 680px;
}
.comments-section h3 {
  font-family: 'Lato', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 24px;
}
.comment-form { margin-bottom: 32px; }
.comment-form .cf-name-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.comment-form input[type=text],
.comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  color: var(--text);
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
}
.comment-form input[type=text]:focus,
.comment-form textarea:focus { outline: none; border-color: #2596be; }
.comment-form .cf-name { width: 200px; flex-shrink: 0; }
.comment-form .cf-loc { font-size: .75rem; color: var(--muted); }
.comment-submit { margin-top: 8px; }
.comment-list { display: flex; flex-direction: column; gap: 20px; }
.comment-item {
  display: flex;
  gap: 12px;
}
.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1f2933;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { font-size: .78rem; color: var(--muted); margin-bottom: 4px; }
.comment-meta .c-name { font-weight: 700; color: var(--text); margin-right: 6px; }
.comment-meta .c-flag { margin-right: 4px; }
.comment-text { font-size: .9rem; line-height: 1.55; word-break: break-word; }
.comment-reply-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
  font-family: inherit;
  transition: color .15s;
}
.comment-reply-btn:hover { color: #2596be; }
.comment-actions { display: flex; align-items: center; gap: 12px; }
.comment-del-btn {
  background: none; border: none; color: #c0392b;
  font-size: .75rem; cursor: pointer; padding: 4px 0;
  font-family: inherit; opacity: .6;
}
.comment-del-btn:hover { opacity: 1; }
.comment-replies { margin-top: 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; border-left: 2px solid var(--border); }
.reply-form { margin-top: 10px; }
.reply-form textarea { min-height: 60px; }
.reply-form .reply-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.reply-cancel { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .82rem; font-family: inherit; }

/* ── Copy toast ── */
.copy-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1f2933;
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: .85rem;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 999;
}
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
