/* ========================================
   Library — Public project catalog
   Matches main site: DM Sans + DM Serif Display
   ======================================== */

:root {
  --blue: #3b5ffc;
  --blue-hover: #2a4be0;
  --beige: #d5c8b8;
  --beige-light: #e8ddd1;
  --white: #ffffff;
  --off-white: #fafafa;
  --charcoal: #1a1a1a;
  --dark: #2c2c2c;
  --gray: #555555;
  --gray-light: #888888;
  --font-heading: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--charcoal);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: var(--charcoal);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover { color: var(--blue); }

/* ---- Navbar (identical to main site) ---- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 3rem;
  background: var(--white);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.06);
  transition: padding 0.3s;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.nav-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--charcoal);
}

.nav-sep {
  color: var(--gray-light);
  font-weight: 300;
}

.nav-title {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--gray-light);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--charcoal);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0; height: 2px;
  background: var(--blue);
  transition: width 0.3s;
}

.nav-links a:hover::after { width: 100%; }
.nav-links a:hover { color: var(--blue); }

.nav-links a.active {
  color: var(--blue);
}

.nav-links a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--charcoal);
  transition: all 0.3s;
}

.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---- Hero ---- */
.lib-hero {
  padding: 8rem 3rem 4rem;
  background: var(--beige-light);
  text-align: center;
}

.lib-hero h1 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--charcoal);
  margin-bottom: 0.75rem;
}

.lib-hero-sub {
  font-size: 1.05rem;
  color: var(--gray);
  max-width: 600px;
  margin: 0 auto 1rem;
  line-height: 1.7;
}

.lib-count {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-light);
}

/* ---- Grid ---- */
.lib-section {
  padding: 4rem 3rem 6rem;
  max-width: 1000px;
  margin: 0 auto;
}

.lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* ---- Card ---- */
.lib-card {
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: 2px;
  padding: 2rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

.lib-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.lib-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.lib-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  line-height: 1;
}

.lib-version {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-light);
}

.lib-card-name {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.lib-card-desc {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 1.5rem;
}

.lib-card-actions {
  display: flex;
  gap: 0.75rem;
}

.lib-btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.lib-btn-primary {
  background: var(--blue);
  color: var(--white);
  border: 2px solid var(--blue);
}

.lib-btn-primary:hover {
  background: var(--blue-hover);
  border-color: var(--blue-hover);
}

.lib-btn-primary.copied {
  background: #059669;
  border-color: #059669;
}

.lib-btn-outline {
  background: transparent;
  color: var(--charcoal);
  border: 2px solid var(--charcoal);
}

.lib-btn-outline:hover {
  background: var(--charcoal);
  color: var(--white);
}

/* ---- Empty state ---- */
.lib-empty {
  display: none;
  text-align: center;
  padding: 4rem 2rem;
}

.lib-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.3;
}

.lib-empty h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.lib-empty p {
  font-size: 0.9rem;
  color: var(--gray);
}

/* ---- How It Works ---- */
.lib-how {
  padding: 4rem 3rem;
  background: var(--beige-light);
}

.lib-how-inner {
  max-width: 800px;
  margin: 0 auto;
}

.lib-how h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--charcoal);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.accent-square {
  display: inline-block;
  width: 14px; height: 14px;
  background: var(--blue);
  flex-shrink: 0;
}

.lib-steps {
  display: flex;
  gap: 2rem;
}

.lib-step {
  flex: 1;
  background: var(--white);
  padding: 1.5rem;
  text-align: center;
  transition: transform 0.3s;
}

.lib-step:hover {
  transform: translateY(-2px);
}

.lib-step-num {
  width: 36px; height: 36px;
  background: var(--blue);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 auto 1rem;
}

.lib-step h3 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--charcoal);
  margin-bottom: 0.5rem;
}

.lib-step p {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 2rem;
  background: var(--charcoal);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
}

/* ---- Responsive ---- */
@media (max-width: 1220px) {
  .nav-title, .nav-sep { display: none; }
}

@media (max-width: 900px) {
  .navbar { padding: 1rem 1.5rem; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    gap: 0;
  }

  .nav-links.open { display: flex; }
  .nav-links a { padding: 0.75rem 0; border-bottom: 1px solid #f0f0f0; }
  .nav-toggle { display: flex; }
  .nav-title, .nav-sep { display: none; }

  .lib-hero { padding: 6rem 1.5rem 3rem; }
  .lib-hero h1 { font-size: 2rem; }

  .lib-section { padding: 3rem 1.5rem 4rem; }
  .lib-grid { grid-template-columns: 1fr; }

  .lib-how { padding: 3rem 1.5rem; }
  .lib-steps { flex-direction: column; gap: 1rem; }

  .lib-card-actions { flex-direction: column; }
  .lib-btn { text-align: center; }
}
