* { box-sizing: border-box; }

[data-theme="light"] {
  --bg: #f8fafc;
  --card: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}
[data-theme="dark"] {
  --bg: #16131f;
  --card: rgba(255, 255, 255, 0.06);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.12);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.back-portfolio {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 700;
  border-radius: 999px;
}

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
.nav-links { font-size: 0.875rem; color: var(--muted); }

.wrap { max-width: 900px; margin: 0 auto; padding: 1.5rem; }
.intro { color: var(--muted); margin: 0 0 1.25rem; max-width: 50ch; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.seg {
  border: 1px solid var(--border);
  background: transparent;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.seg.on { background: #6366f1; color: #fff; border-color: #6366f1; }

section { margin-bottom: 2rem; }
section h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.b-primary, .b-sec, .b-ghost {
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}
.b-primary { background: #6366f1; color: #fff; }
.b-sec { background: #e0e7ff; color: #3730a3; }
[data-theme="dark"] .b-sec { background: rgba(129, 140, 248, 0.25); color: #c7d2fe; }
.b-ghost { background: transparent; border: 1px solid var(--border); color: inherit; }

label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; max-width: 360px; }
input, textarea {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font: inherit;
  background: var(--bg);
  color: inherit;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.card {
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
}
.card.elevated { box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08); }
.stat { font-size: 1.75rem; font-weight: 800; color: #6366f1; margin: 0.25rem 0; }
.cap { margin: 0; font-size: 0.8rem; color: var(--muted); }

.swatches { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.sw {
  width: 100px;
  height: 72px;
  border-radius: 10px;
  display: flex;
  align-items: flex-end;
  padding: 0.5rem;
  font-size: 0.65rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
