/* Tesian — Minimalist Monochrome CSS */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --bg-tertiary: #f0f0f0;
  --text-primary: #0a0a0a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border-color: #0a0a0a;
  --border-light: #e2e2e2;
  --accent-invert: #0a0a0a;
  --accent-text-invert: #ffffff;
  --code-bg: #f4f4f4;
  --ink-color: #0a0a0a;
  --ink-bleed: rgba(10, 10, 10, 0.22);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-serif: "Baskerville", "Baskerville Old Face", "Hoefler Text", "Palatino", "Palatino Linotype", "Georgia", serif;
  --font-cursive: "Nothing You Could Do", "La Belle Aurore", cursive;
  
  --max-width: 1080px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1f1f1f;
  --text-primary: #f5f5f5;
  --text-secondary: #aaaaaa;
  --text-muted: #666666;
  --border-color: #f5f5f5;
  --border-light: #2a2a2a;
  --accent-invert: #f5f5f5;
  --accent-text-invert: #0a0a0a;
  --code-bg: #1a1a1a;
  --ink-color: #f5f5f5;
  --ink-bleed: rgba(245, 245, 245, 0.22);
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.6rem; margin-bottom: 0.85rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s ease;
}

a:hover {
  opacity: 0.7;
}

code, pre {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:not(pre) > code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border-light);
}

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

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

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header & Navigation */
header.site-header {
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.brand-logo .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-invert);
  color: var(--accent-text-invert);
  border-radius: 7px;
  border: 1px solid var(--border-color);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1;
  padding-bottom: 2px;
  letter-spacing: -0.04em;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.brand-logo:hover .logo-mark {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
}

.brand-logo .title-cursive {
  font-family: var(--font-cursive);
  font-size: 1.18em;
  font-weight: 400;
  line-height: 1;
  display: inline-block;
  vertical-align: 0.05em;
  color: var(--ink-color);
  letter-spacing: 0.01em;
  filter: url(#ink-paper);
  text-shadow: 0 0 0.4px var(--ink-bleed);
  transform: rotate(-1.8deg) skewX(-2deg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.brand-logo:hover .title-cursive {
  transform: rotate(-2.4deg) translateY(-0.5px) skewX(-2deg);
  opacity: 0.82;
}

.brand-logo .title-first,
.brand-logo .title-rest,
.brand-logo .title-separator {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  vertical-align: 0.04em;
  opacity: 0.9;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0.35rem 0;
  position: relative;
  transition: color 0.15s ease;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--accent-invert);
  color: var(--accent-text-invert);
  opacity: 1;
}

.btn-primary {
  background: var(--accent-invert);
  color: var(--accent-text-invert);
}

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

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 0;
}

/* Main Content Area */
main#app-root {
  flex: 1;
  padding: 2.5rem 0;
}

/* Page Components: Hero Section */
.hero-section {
  border: 1px solid var(--border-color);
  padding: 3rem 2.5rem;
  margin-bottom: 3rem;
  background: var(--bg-secondary);
  position: relative;
}

.hero-pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  background: var(--bg-primary);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 750px;
  margin-bottom: 2rem;
}

/* Grid & Cards */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.card {
  border: 1px solid var(--border-color);
  padding: 1.75rem;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0px var(--border-color);
}

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

.card-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

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

.card-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
  font-size: 0.85rem;
}

/* Principles List Styles */
.principles-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.principle-card {
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--accent-invert);
  background: var(--bg-primary);
  padding: 1.75rem 2rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.principle-card:hover {
  transform: translateX(4px);
  box-shadow: 2px 2px 0px var(--border-color);
}

.principle-card .principle-num {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

/* Tag Badges */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
}

.status-Active { background: var(--accent-invert); color: var(--accent-text-invert); }
.status-Incubating { background: var(--bg-tertiary); color: var(--text-primary); }
.status-Vision { background: transparent; border-style: dashed; }

/* Blog Article Layout */
.article-container {
  max-width: 800px;
  margin: 0 auto;
}

.article-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 1rem;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.article-content th, .article-content td {
  border: 1px solid var(--border-color);
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.article-content th {
  background: var(--bg-secondary);
  font-weight: 700;
}

/* Editor Component */
.editor-container {
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  margin-bottom: 2rem;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
}

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

.editor-textarea {
  width: 100%;
  height: 100%;
  min-height: 480px;
  padding: 1.25rem;
  border: none;
  border-right: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  outline: none;
}

.editor-preview {
  padding: 1.25rem;
  overflow-y: auto;
  max-height: 650px;
  background: var(--bg-primary);
}

.drop-zone {
  border: 2px dashed var(--border-color);
  padding: 1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  background: var(--bg-secondary);
  cursor: pointer;
}

.drop-zone.dragover {
  background: var(--bg-tertiary);
  border-style: solid;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
}

.form-control:focus {
  outline: 2px solid var(--border-color);
  outline-offset: 1px;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  width: 90%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: 8px 8px 0px var(--border-color);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

/* Banner Alerts */
.alert {
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.alert-info { border-left: 4px solid var(--border-color); }
.alert-success { background: var(--bg-tertiary); }

/* Footer */
footer.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
  padding: 2.5rem 0;
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

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

/* Utilities */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 1rem; }

/* Filter Panel & Controls */
.filter-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
}

.filter-tab {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  border-color: var(--border-color);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent-invert);
  color: var(--accent-text-invert);
  border-color: var(--accent-invert);
  font-weight: 600;
}

.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}

.page-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  border-radius: 3px;
  cursor: pointer;
  min-width: 34px;
  text-align: center;
  transition: all 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--border-color);
}

.page-btn.active {
  background: var(--accent-invert);
  color: var(--accent-text-invert);
  border-color: var(--accent-invert);
  font-weight: 700;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .filter-controls-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

@media (max-width: 640px) {
  .hero-title { font-size: 2rem; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 1rem 0; gap: 1rem; }
  nav.main-nav { width: 100%; justify-content: space-between; order: 3; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .filter-controls-grid {
    grid-template-columns: 1fr !important;
  }
}

/* App Details & Features Board */
.app-details-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 0 3rem 0;
}

.app-screenshot-card img {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.features-board-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 900px) {
  .features-board-grid {
    grid-template-columns: 1fr !important;
  }
}

.feature-col {
  min-height: 200px;
}

.feature-card {
  box-shadow: 2px 2px 0px var(--border-light);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0px var(--border-color);
}

.feature-comment-bubble {
  border-left: 3px solid var(--accent-invert) !important;
}

.btn-vote.btn-primary {
  background: var(--accent-invert);
  color: var(--accent-text-invert);
}
