:root {
  --bg: #f6f6f1;
  --surface: #ffffff;
  --header-bg: #1a1a1a;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --green: #95bf46;
  --green-dark: #1e4b3f;
  --border: #e0ddd6;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 12px;
}

@font-face {
  font-family: 'ShopifySans';
  src: url('https://cdn.shopify.com/static/fonts/ShopifySans--medium.woff2') format('woff2');
}

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

html, body {
  font-family: ShopifySans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

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

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

img {
  max-width: 100%;
}

/* ── Pagewidth ── */
.pagewidth {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero / Header ── */
.hero {
  background-color: var(--header-bg);
  color: #ffffff;
  text-align: center;
  padding: 48px 24px 40px;
  position: relative;
}

.hero .hero-lines {
  display: none;
}

.hero-header {
  margin-bottom: 16px;
}

.hero-header .logo--ie {
  display: inline-block;
}

.hero-header .logo {
  height: 40px;
  width: auto;
}

.hero-inner {
  max-width: 700px;
  margin: 0 auto;
}

.hero-text,
.hero-inner h1 {
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.6;
  color: #a0a0a0;
  margin-bottom: 12px;
}

.hero-inner h2 {
  font-size: 0.95rem;
  font-weight: 400;
  color: #a0a0a0;
}

.hero-inner a {
  color: var(--green);
  text-decoration: underline;
}

.hero-inner a:hover {
  color: #ffffff;
}

/* ── Inline stats (hidden via CORB comment but keep styles) ── */
.inline-list {
  list-style: none;
  display: flex;
  gap: 20px;
  justify-content: center;
  color: #a0a0a0;
  font-size: 0.9rem;
}

.git-stat {
  font-weight: 600;
  color: #ffffff;
}

.git-stat.is-loading {
  display: inline-block;
  width: 20px;
  height: 14px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  vertical-align: middle;
}

/* ── Filter bar ── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.filter-bar--left {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.filter-bar--right {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-bar .btn {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
}

.filter-bar .btn:hover {
  border-color: var(--green-dark);
  color: var(--green-dark);
  text-decoration: none;
}

.filter-bar .btn.is-active {
  background-color: var(--green-dark);
  color: #ffffff;
  border-color: var(--green-dark);
}

/* ── Repo wrapper ── */
.repoWrap {
  padding-bottom: 48px;
}

/* ── Repo grid (Isotope) ── */
#repos {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#repos.is-loaded {
  display: flex;
}

/* ── Repo card ── */
.repo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  width: 100%;
}

.repo:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
  transform: translateY(-2px);
}

.repo-header {
  padding: 20px 20px 0;
}

.repo-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.repo-header h2 a {
  color: var(--text);
  text-decoration: none;
}

.repo-header h2 a:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.repo-header h2 img,
.repo-header h2 .homepage-link img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

.repo-header h2 .homepage-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.repo-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding-top: 8px;
}

.repo-git a {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--green-dark);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.repo-git a:hover {
  text-decoration: underline;
}

.repo-stats {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.repo-lang {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
}

.repo p {
  padding: 12px 20px 20px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.repo.no-desc .repo-header {
  padding-bottom: 20px;
}

/* Grid items within repo header (for Handlebars template) */
.repo .grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.repo .grid-item {
  flex: 1;
  min-width: 0;
}

.repo .grid-item.large--one-half {
  flex: 0 0 auto;
}

.repo .grid-item.large--one-half:first-child {
  flex: 1;
  min-width: 0;
}

/* ── Icons ── */
.icon-github,
.icon-star,
.icon-forks,
.icon-world {
  display: inline-block;
  width: 16px;
  height: 16px;
  vertical-align: middle;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.5;
}

.icon-github {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a1a1a' d='M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z'/%3E%3C/svg%3E");
}

.icon-star {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a1a1a' d='M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z'/%3E%3C/svg%3E");
}

.icon-forks {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a1a1a' d='M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z'/%3E%3C/svg%3E");
}

.icon-world {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%231a1a1a' d='M1.543 7.25h2.733c.144-2.074.866-3.756 1.58-4.948C3.81 3.262 2.072 5.06 1.543 7.25zm0 1.5c.529 2.19 2.267 3.988 4.313 4.948-.714-1.192-1.436-2.874-1.58-4.948H1.543zm8.601 4.948c2.046-.96 3.784-2.758 4.313-4.948h-2.733c-.144 2.074-.866 3.756-1.58 4.948zM14.457 7.25c-.529-2.19-2.267-3.988-4.313-4.948.714 1.192 1.436 2.874 1.58 4.948h2.733zM8 1.5c-1.076 0-2.559 2.56-2.72 5.75h5.44C10.559 4.06 9.076 1.5 8 1.5zM5.28 8.75C5.441 11.94 6.924 14.5 8 14.5s2.559-2.56 2.72-5.75H5.28zM8 0a8 8 0 110 16A8 8 0 018 0z'/%3E%3C/svg%3E");
}

/* ── Loading spinner ── */
.repo-loader {
  text-align: center;
  padding: 60px 0;
}

.repo-loader--inner {
  display: inline-block;
}

#repos.is-loaded + .repo-loader {
  display: none;
}

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--green-dark);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-large {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Join / CTA section ── */
.hero-header:last-of-type {
}

.hero-header .grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.hero-header .grid-item {
  flex: 1;
  min-width: 280px;
}

.hero-header .grid-item.xlarge--one-half {
  flex: 1;
  min-width: 280px;
}

.join-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 24px;
}

.join-section .pagewidth {
  max-width: 960px;
  margin: 0 auto;
}

.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.join-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
}

.join-card h2 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.join-card p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.join-card .btn {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
}

.join-card .btn.is-active {
  background-color: var(--green-dark);
  color: #ffffff;
  border-color: var(--green-dark);
}

.join-card .btn.is-active:hover {
  background-color: #163a30;
  text-decoration: none;
}

/* ── Bottom links section ── */
.bottom-links {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px 48px;
}

.bottom-links .hero-text,
.bottom-links h1 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.bottom-links a {
  color: var(--green-dark);
  text-decoration: underline;
}

.bottom-links a:hover {
  color: var(--green);
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 32px 24px 48px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
}

.footer a {
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  color: var(--green);
  text-decoration: underline;
}

.footer .grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.footer .grid-item {
  flex: 1;
  min-width: 200px;
}

.twitter-link .under {
  text-decoration: underline;
}

/* ── Utility: text alignment ── */
.xlarge--text-left { text-align: left; }
.xlarge--text-center { text-align: center; }
.xlarge--text-right { text-align: right; }

/* ── Error state ── */
.limit-error {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .repo {
    width: 100%;
  }

  .repo-meta {
    justify-content: flex-start;
    padding-top: 10px;
  }

  .filter-bar {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .xlarge--text-left,
  .xlarge--text-right {
    text-align: center;
  }
}
