/* Clean Light Operational Design System */
:root {
  --bg-primary: #f3f4f6;
  --bg-surface: #ffffff;
  --bg-surface-hover: #fafafa;
  --bg-muted: #f8fafc;
  --border-color: #e5e7eb;
  --border-strong: #cbd5e1;
  --border-focus: #2563eb;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-accent: #0284c7;

  --status-live-bg: #ecfdf5;
  --status-live-border: #a7f3d0;
  --status-live-text: #047857;

  --status-building-bg: #fffbe6;
  --status-building-border: #fde68a;
  --status-building-text: #b45309;

  --status-ideas-bg: #eff6ff;
  --status-ideas-border: #bfdbfe;
  --status-ideas-text: #1d4ed8;

  --status-archived-bg: #f1f5f9;
  --status-archived-border: #cbd5e1;
  --status-archived-text: #475569;

  --font-sans: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

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

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

/* Header */
.app-header {
  border-bottom: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  background-color: var(--bg-surface);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
}

.brand-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-accent);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.main-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.main-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* Main Container */
.app-main {
  flex: 1;
  padding: 2rem 1.5rem 4rem;
}

.main-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* Status Tabs */
.status-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.tab-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-item:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.tab-item.active {
  background: #ffffff;
  color: var(--text-primary);
  border-color: var(--border-focus);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  color: var(--text-muted);
}

.tab-item.active .tab-count {
  background: var(--border-focus);
  color: #fff;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

/* Project Card */
.project-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.08);
}

/* Card Header Image */
.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #e2e8f0;
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.project-card:hover .card-media img {
  transform: scale(1.02);
}

.media-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.media-badge.Live {
  background: var(--status-live-bg);
  border-color: var(--status-live-border);
  color: var(--status-live-text);
}

.media-badge.Building {
  background: var(--status-building-bg);
  border-color: var(--status-building-border);
  color: var(--status-building-text);
}

.media-badge.Ideas {
  background: var(--status-ideas-bg);
  border-color: var(--status-ideas-border);
  color: var(--status-ideas-text);
}

.media-badge.Archived {
  background: var(--status-archived-bg);
  border-color: var(--status-archived-border);
  color: var(--status-archived-text);
}

/* Card Content */
.card-content {
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.card-oneliner {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-accent);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px dashed var(--border-color);
}

/* Three Points Section */
.card-points {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  flex: 1;
  font-size: 0.88rem;
}

.point-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.point-label {
  font-size: 0.75rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.point-val {
  color: var(--text-secondary);
}

.point-val.impact {
  color: #059669;
  font-weight: 600;
}

/* Card Footer Action Bar */
.card-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-detail-hint {
  font-size: 0.825rem;
  color: var(--text-accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  background: var(--text-primary);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s ease;
}

.action-btn:hover {
  opacity: 0.88;
}

/* Sub-page Detail Modal */
.detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.detail-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.detail-window {
  position: relative;
  z-index: 1001;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: var(--bg-muted);
}

.detail-title-group h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.detail-title-group p {
  font-size: 0.95rem;
  color: var(--text-accent);
  font-weight: 500;
}

.detail-close {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.detail-close:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.detail-body {
  padding: 2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.detail-section-title {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.gallery-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-muted);
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.gallery-item img:hover {
  transform: scale(1.02);
}

.gallery-caption {
  padding: 0.65rem 0.85rem;
  font-size: 0.825rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  background: #ffffff;
}

/* Dev Notes & Changelog */
.dev-notes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dev-notes-list li {
  padding: 0.85rem 1rem;
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--border-focus);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.changelog-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.changelog-ver {
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.changelog-content {
  flex: 1;
}

.changelog-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.changelog-note {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Detail Footer CTA */
.detail-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-muted);
  display: flex;
  justify-content: flex-end;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.35rem;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
  transition: all 0.15s ease;
}

.cta-button:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin-top: 1rem;
}

.empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.empty-state h3 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

/* Footer */
.app-footer {
  border-top: 1px solid var(--border-color);
  padding: 1.5rem;
  background: var(--bg-surface);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-brand {
  font-weight: 600;
  color: var(--text-secondary);
}

.footer-divider {
  margin: 0 0.5rem;
}

@media (max-width: 640px) {
  .main-title {
    font-size: 1.45rem;
  }
  .desktop-only {
    display: none;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .detail-window {
    max-height: 95vh;
  }
  .detail-body {
    padding: 1.25rem;
  }
}
