/* ============================================================
   Indie Page styles
   Edit the :root / .dark variables to change the whole look.
   Full guide → GUIDE.md
   ============================================================ */

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

:root {
  --bg: #f3f3f4;
  --card-bg: #ffffff;
  --text: #18181b;
  --text-muted: #71717a;
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-soft: #fef3c7;
  --border: #e4e4e7;
  --shadow: 0 1px 2px rgba(0,0,0,0.03), 0 3px 12px rgba(0,0,0,0.04);
  --shadow-hover: 0 10px 28px rgba(0,0,0,0.07);
  --radius: 16px;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --chart-color: #f59e0b;
  --mrr-color: #059669;
  --link-bg: #fafafa;
  --link-hover: #f4f4f5;
  --tag-bg: #f4f4f5;
  --count-bg: #e4e4e7;
}

/* Dark mode */
html.dark {
  --bg: #0c0c0e;
  --card-bg: #161618;
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --accent: #fbbf24;
  --accent-hover: #f59e0b;
  --accent-soft: #422006;
  --border: #27272a;
  --shadow: 0 1px 2px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.25);
  --shadow-hover: 0 12px 32px rgba(0,0,0,0.4);
  --chart-color: #fbbf24;
  --mrr-color: #34d399;
  --link-bg: #1c1c1f;
  --link-hover: #27272a;
  --tag-bg: #1c1c1f;
  --count-bg: #27272a;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background 0.2s ease, color 0.2s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Theme toggle ===== */
.theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.theme-toggle:hover {
  transform: scale(1.06);
  box-shadow: var(--shadow-hover);
}

.theme-icon.moon { display: none; }
html.dark .theme-icon.sun { display: none; }
html.dark .theme-icon.moon { display: inline; }

/* ===== Layout ===== */
.page {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 2.5rem;
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.75rem 1.5rem 4rem;
  min-height: calc(100vh - 64px);
}

/* ===== Sidebar ===== */
.sidebar {
  position: sticky;
  top: 2.25rem;
  align-self: start;
}

.profile {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.75rem 1.35rem;
  box-shadow: var(--shadow);
  text-align: center;
  border: 1px solid var(--border);
  transition: background 0.2s, border-color 0.2s;
}

.avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  margin: 0 auto 1.1rem;
  object-fit: cover;
  border: 3px solid var(--accent-soft);
  box-shadow: 0 0 0 3px var(--card-bg);
}

.name {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.25rem;
}

.location {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

/* Total MRR highlight (like real Indie Page) */
.total-mrr {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
  padding: 0.65rem 0.9rem;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.08), rgba(5, 150, 105, 0.03));
  border: 1px solid rgba(5, 150, 105, 0.2);
  border-radius: 12px;
}

html.dark .total-mrr {
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(52, 211, 153, 0.04));
  border-color: rgba(52, 211, 153, 0.25);
}

.total-mrr-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.total-mrr-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--mrr-color);
  letter-spacing: -0.02em;
}

.total-mrr-period {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.3rem;
  line-height: 1.55;
}

.tagline strong {
  color: var(--text);
  font-weight: 600;
}

.links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.4rem;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.48rem 0.75rem;
  border-radius: 10px;
  background: var(--link-bg);
  font-size: 0.85rem;
  font-weight: 500;
  transition: background 0.15s, transform 0.15s, border-color 0.15s;
  border: 1px solid transparent;
}

.link-item:hover {
  background: var(--link-hover);
  transform: translateY(-1px);
  border-color: var(--border);
}

.emoji {
  font-size: 1rem;
}

/* Subscribe */
.subscribe {
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  text-align: left;
}

.subscribe-label {
  font-size: 0.8rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.subscribe-form {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--link-bg);
}

.subscribe-form input {
  flex: 1;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  background: transparent;
  color: var(--text);
  min-width: 0;
}

.subscribe-form input::placeholder {
  color: var(--text-muted);
}

.subscribe-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  white-space: nowrap;
}

.subscribe-form button:hover {
  background: var(--accent-hover);
}

.subscribe-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

/* ===== Main ===== */
.main-header {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.main-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.project-count {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--count-bg);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.main-header p {
  width: 100%;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.1rem;
}

/* ===== Project Card ===== */
.project-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.2s;
  border: 1px solid var(--border);
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.project-title {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.3;
}

.project-title .icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.badge.active       { background: #dcfce7; color: #166534; }
.badge.building     { background: #fef3c7; color: #92400e; }
.badge.paused       { background: #e0e7ff; color: #3730a3; }
.badge.acquired     { background: #fce7f3; color: #9d174d; }
.badge.discontinued { background: #f4f4f5; color: #71717a; }

html.dark .badge.active       { background: #052e16; color: #4ade80; }
html.dark .badge.building     { background: #422006; color: #fbbf24; }
html.dark .badge.paused       { background: #1e1b4b; color: #a5b4fc; }
html.dark .badge.acquired     { background: #500724; color: #f9a8d4; }
html.dark .badge.discontinued { background: #27272a; color: #a1a1aa; }

/* Big MRR on card (the cool part) */
.project-mrr-block {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin: 0.1rem 0 0.15rem;
}

.project-mrr {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mrr-color);
  letter-spacing: -0.02em;
}

.project-mrr-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.project-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
}

/* Tags */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: -0.05rem;
}

.tag {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--tag-bg);
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Sparkline */
.sparkline-wrap {
  margin: 0.15rem 0 0;
}

.sparkline {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 0.2rem;
  min-height: 1.1rem;
}

.project-link {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
}

.project-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 1.35rem 1rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.footer a {
  color: var(--accent);
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .page {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem 3rem;
    gap: 1.75rem;
  }

  .sidebar {
    position: static;
  }

  .profile {
    padding: 1.4rem 1.2rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .theme-toggle {
    top: 0.85rem;
    right: 0.85rem;
  }
}

@media (max-width: 480px) {
  .name {
    font-size: 1.25rem;
  }

  .avatar {
    width: 92px;
    height: 92px;
  }

  .total-mrr-value {
    font-size: 1.25rem;
  }
}
