/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a6b4a;
  --primary-dark: #145538;
  --primary-light: #e8f5ee;
  --accent: #d97706;
  --accent-light: #fef3c7;
  --text: #1c1917;
  --text-muted: #78716c;
  --bg: #faf9f7;
  --bg-card: #ffffff;
  --bg-warm: #f5f0e8;
  --border: #e7e2d9;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 6px 24px rgba(26, 107, 74, 0.13);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

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

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

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

/* ===== Layout ===== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

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

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  flex-shrink: 0;
}

.logo:hover {
  text-decoration: none;
  color: var(--primary);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-nav a {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

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

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ===== Hero — Split Layout ===== */
.hero {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 480px;
  align-items: stretch;
}

.hero-left {
  padding: 64px 48px 64px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 20px;
  width: fit-content;
}

.hero h1 {
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 18px;
}

.hero h1 em {
  font-style: normal;
  color: var(--primary);
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  max-width: 440px;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
}

.hero-stat strong {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1;
}

.hero-stat span {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Search bar in hero */
.search-bar {
  display: flex;
  max-width: 420px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 28px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 74, 0.1);
}

.search-bar input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 11px 16px;
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--font);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar button {
  background: var(--primary);
  border: none;
  padding: 11px 18px;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s;
  font-family: var(--font);
}

.search-bar button:hover {
  background: var(--primary-dark);
}

/* Hero right panel */
.hero-right {
  background: var(--bg-warm);
  border-left: 1px solid var(--border);
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.hero-right-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-cat-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.hero-cat-pill:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-hover);
  transform: translateX(3px);
  text-decoration: none;
  color: var(--primary);
}

.hero-cat-pill .pill-icon {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-cat-pill .pill-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Section ===== */
.section {
  padding: 60px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}

.section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-link:hover {
  text-decoration: underline;
}

/* ===== Intro Strip ===== */
.intro-strip {
  background: var(--bg-warm);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 48px 0;
}

.intro-strip-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
}

.intro-point {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.intro-point-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.intro-point h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.intro-point p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===== Category Grid ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  cursor: pointer;
  display: block;
  color: var(--text);
  text-decoration: none;
}

.category-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  border-color: var(--primary);
  text-decoration: none;
  color: var(--text);
}

.cat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.category-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.cat-count {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 700;
  background: var(--primary-light);
  padding: 2px 9px;
  border-radius: 20px;
}

/* ===== Resource Cards ===== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.resource-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.resource-card h3 {
  font-size: 0.97rem;
  font-weight: 700;
}

.resource-card h3 a {
  color: var(--text);
}

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

.tag {
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.resource-card p {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.resource-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  font-family: var(--font);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
  text-decoration: none;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

.ext-link {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ext-link:hover {
  color: var(--primary);
}

/* ===== Pros / Cons ===== */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.pros,
.cons {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--border);
}

.pros {
  border-left: 3px solid #16a34a;
}

.cons {
  border-left: 3px solid #dc2626;
}

.pros h4 {
  color: #15803d;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.cons h4 {
  color: #b91c1c;
  margin-bottom: 10px;
  font-size: 0.88rem;
  font-weight: 700;
}

.pros ul,
.cons ul {
  list-style: none;
}

.pros ul li,
.cons ul li {
  font-size: 0.87rem;
  color: var(--text-muted);
  padding: 4px 0;
  padding-left: 18px;
  position: relative;
}

.pros ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}

.cons ul li::before {
  content: '✗';
  position: absolute;
  left: 0;
  color: #dc2626;
  font-weight: 700;
}

/* ===== Detail Page ===== */
.detail-hero {
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 40px;
}

.detail-hero h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.detail-hero p {
  color: var(--text-muted);
  max-width: 600px;
  font-size: 0.97rem;
}

.breadcrumb {
  font-size: 0.8rem;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb span {
  margin: 0 6px;
  opacity: 0.5;
}

.detail-body {
  padding: 48px 0;
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 36px;
  align-items: start;
}

.detail-content h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--text);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.detail-content h2:first-child {
  margin-top: 0;
}

.detail-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.85;
  margin-bottom: 14px;
}

.detail-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 76px;
}

.detail-sidebar h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.meta-list {
  list-style: none;
}

.meta-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  gap: 8px;
}

.meta-list li:last-child {
  border-bottom: none;
}

.meta-list .label {
  color: var(--text-muted);
  flex-shrink: 0;
}

.meta-list .value {
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.visit-btn {
  display: block;
  text-align: center;
  margin-top: 16px;
  padding: 11px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.15s;
}

.visit-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}

/* ===== Category / Page Hero ===== */
.page-hero {
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  padding: 44px 0;
}

.page-hero h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 600px;
}

/* ===== Legal Pages ===== */
.legal-content {
  max-width: 740px;
  margin: 0 auto;
  padding: 52px 24px;
}

.legal-content h1 {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.legal-content .updated {
  color: var(--text-muted);
  font-size: 0.83rem;
  margin-bottom: 36px;
}

.legal-content h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 32px 0 10px;
  color: var(--text);
}

.legal-content p,
.legal-content li {
  color: var(--text-muted);
  font-size: 0.93rem;
  line-height: 1.85;
  margin-bottom: 10px;
}

.legal-content ul {
  padding-left: 20px;
}

/* ===== About / Contact ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: start;
  padding: 56px 0;
}

.contact-form {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 0;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: var(--font);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 107, 74, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

/* ===== Footer ===== */
.site-footer {
  background: #1c1917;
  color: #a8a29e;
  padding: 52px 0 24px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  color: #e7e5e4;
  margin-bottom: 12px;
}

.footer-brand .logo-icon {
  background: var(--primary);
}

.footer-brand p {
  font-size: 0.87rem;
  line-height: 1.75;
  max-width: 260px;
  color: #78716c;
}

.footer-col h4 {
  color: #e7e5e4;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 9px;
}

.footer-col ul li a {
  color: #a8a29e;
  font-size: 0.87rem;
  transition: color 0.15s;
}

.footer-col ul li a:hover {
  color: #e7e5e4;
  text-decoration: none;
}

.footer-bottom {
  border-top: 1px solid #292524;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: #57534e;
}

.footer-bottom-links {
  display: flex;
  gap: 18px;
}

.footer-bottom-links a {
  color: #57534e;
}

.footer-bottom-links a:hover {
  color: #e7e5e4;
  text-decoration: none;
}

/* ===== Back to Top ===== */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(26, 107, 74, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 999;
}

#back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top:hover {
  transform: translateY(-3px);
  background: var(--primary-dark);
}

/* ===== Color Tags ===== */
.tag-job {
  background: #dcfce7;
  color: #15803d;
}

.tag-free {
  background: #fef9c3;
  color: #a16207;
}

.tag-collab {
  background: #e0f2fe;
  color: #0369a1;
}

.tag-fin {
  background: #fce7f3;
  color: #be185d;
}

.tag-time {
  background: #f3e8ff;
  color: #7e22ce;
}

.tag-legal {
  background: #ffedd5;
  color: #c2410c;
}

/* ===== Utility ===== */
.text-muted {
  color: var(--text-muted);
}

.mt-4 {
  margin-top: 16px;
}

.mb-4 {
  margin-bottom: 16px;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-left {
    padding: 48px 0 32px;
  }

  .hero-right {
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 32px 0;
  }

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

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-sidebar {
    position: static;
  }

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

  .intro-strip-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 640px) {
  .site-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    height: 100vh;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    gap: 4px;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-left {
    padding: 40px 0 28px;
  }

  .hero-stats {
    gap: 20px;
  }

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

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .pros-cons {
    grid-template-columns: 1fr;
  }

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

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

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

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