@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,500;12..96,700&family=League+Gothic&display=swap");

:root {
  --bg: #f6f0e4;
  --bg-soft: #fffaf0;
  --ink: #152536;
  --muted: #42566c;
  --card: #fffef9;
  --line: #e2d7bf;
  --accent: #cf4b1a;
  --accent-soft: #f2bb7a;
  --zyte: #B02CCE;
  --personal: #1f77b4;
  --community: #1b9e77;
  --shadow: 0 16px 40px rgba(26, 29, 42, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(170deg, #f6f0e4 0%, #fbf6eb 55%, #f0e7d5 100%);
  font-family: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  min-height: 100vh;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(circle at 15% 12%, rgba(207, 75, 26, 0.16), transparent 36%),
    radial-gradient(circle at 83% 20%, rgba(17, 92, 122, 0.16), transparent 39%),
    radial-gradient(circle at 52% 92%, rgba(242, 187, 122, 0.3), transparent 45%);
}

a {
  color: inherit;
}

.shell {
  width: min(1050px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 0;
}

.brand {
  font-family: "League Gothic", "Arial Narrow", sans-serif;
  font-size: clamp(2rem, 4vw, 2.6rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
}

.site-nav a,
.lang-pill {
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.site-nav .icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
}

.site-nav .icon-link svg {
  width: 1.02rem;
  height: 1.02rem;
  fill: currentColor;
}

.site-nav .codeberg-link {
  color: #2185d0;
}

.site-nav .gitlab-link {
  color: #fc6d26;
}

.site-nav .github-link {
  color: #181717;
}

.site-nav a:hover,
.lang-pill:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.lang-switch {
  display: flex;
  gap: 0.45rem;
}

.lang-pill.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

main {
  padding-bottom: 3rem;
}

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72) 0%, rgba(255, 255, 255, 0.92) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero {
  padding: .1rem 1rem
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}

h1,
h2 {
  font-family: "League Gothic", "Arial Narrow", sans-serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 0.95;
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 8.2vw, 5rem);
  margin-top: 0.5rem;
}

h2 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
}

.lede {
  margin-top: 0.9rem;
  font-size: 1.02rem;
  color: var(--muted);
}

.home-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 1.3rem;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  border: 1px solid var(--accent);
  color: #fff;
  background: linear-gradient(180deg, #de6234 0%, #c3471a 100%);
  border-radius: 12px;
  padding: 0.62rem 1rem;
  font-weight: 700;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  filter: saturate(1.1);
}

.button.ghost {
  color: var(--ink);
  border-color: var(--ink);
  background: transparent;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.1rem;
}

.quick-grid article {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  padding: 0.9rem;
}

.quick-grid p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.page-head {
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card {
  padding: 1rem 1rem 1rem calc(1rem + 10px);
  position: relative;
}

/* Colored accent stripe + matching value color for the time cards
   (Zyte / Personal / Community) so readers can infer funding at a glance */
.stat-grid .stat-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  border-top-left-radius: var(--radius);
  border-bottom-left-radius: var(--radius);
  background: transparent;
}

.stat-grid .stat-card:nth-child(1)::before { background: var(--zyte); }
.stat-grid .stat-card:nth-child(2)::before { background: var(--personal); }
.stat-grid .stat-card:nth-child(3)::before { background: var(--community); }

.stat-grid .stat-card:nth-child(1) .stat-value { color: var(--zyte); }
.stat-grid .stat-card:nth-child(2) .stat-value { color: var(--personal); }
.stat-grid .stat-card:nth-child(3) .stat-value { color: var(--community); }

.stat-label {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}

.stat-value {
  margin: 0.3rem 0;
  font-family: "League Gothic", "Arial Narrow", sans-serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.9;
  color: var(--accent);
}

.stat-meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.pledge-track {
  margin: 0.9rem 0 0.8rem;
  width: 100%;
  height: 0.65rem;
  background: #e8e2d6;
  border-radius: 999px;
  overflow: hidden;
}

.pledge-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #f3c25c 0%, #d08d23 100%);
}

.community-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.6rem;
}

.help-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 0.36rem 0.6rem;
  border-radius: 10px;
  font-size: 1.72rem;
  line-height: 1;
  cursor: pointer;
}

.help-button:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.help-button[aria-expanded="true"] {
  background: var(--accent-soft);
}

.explain[hidden] {
  display: none;
}

.explain {
  padding: 1rem 1.1rem;
}

.formula {
  margin: 0.7rem 0 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff7e9;
  font-family: "Courier New", monospace;
  line-height: 1.5;
  font-size: 0.95rem;
}

.impact-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.impact-list li {
  margin-bottom: 0.8rem;
}

.legend-panel {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
}

.legend-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.8rem;
}

.legend-grid p {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
}

.dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  display: inline-block;
}

.project-list {
  display: grid;
  gap: 0.9rem;
}

.project-item {
  padding: 0.95rem;
}

.project-item header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.7rem;
}

.group-item .expand-toggle {
  cursor: pointer;
}

.group-item .project-row {
  cursor: default;
}

.group-item a.project-link,
.group-item .project-row.project-link,
.group-item .project-row button {
  cursor: pointer;
}

.hours {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.members {
  margin: 0.35rem 0 0.8rem;
  color: var(--muted);
}

.project-track {
  height: 1rem;
  border-radius: 999px;
  background: #ebe2d1;
  overflow: hidden;
}

.project-row .project-track {
  height: 0.5rem;
}

.project-fill {
  height: 100%;
  min-width: 0;
  display: flex;
}

.slice {
  display: block;
  height: 100%;
}

/* Make only the project summary area clickable in linked rows */
a.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

a.project-link:focus {
  outline: 3px solid rgba(20, 37, 54, 0.08);
  outline-offset: 2px;
}

/* Group expansion and project rows */
.group-item {
  transition: background 0.12s ease;
  cursor: zoom-in;
}

.group-item.expanded {
  cursor: zoom-out;
}

.expand-toggle {
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.28rem 0.45rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

.expand-toggle[aria-expanded="true"] {
  transform: rotate(90deg);
}

.group-projects {
  margin-top: 0.8rem;
  gap: 0.6rem;
  display: none;
}

.group-item.expanded .group-projects {
  display: grid;
}

.project-row {
  padding: 0.6rem;
  background: transparent;
  border: 1px dashed var(--line);
}

.project-text {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.project-text > :first-child {
  margin-top: 0;
}

.project-text > :last-child {
  margin-bottom: 0;
}

.zyte {
  background: var(--zyte);
}

.personal {
  background: var(--personal);
}

.community {
  background: var(--community);
}

.update-note {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.prose-block {
  padding: 1rem 1.1rem;
}

@media (max-width: 900px) {
  .site-head {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .site-nav {
    justify-content: flex-start;
  }

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

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

@media (max-width: 560px) {
  .shell {
    width: min(1050px, calc(100% - 1rem));
  }

  .site-nav {
    gap: 0.45rem;
  }

  .site-nav a,
  .lang-pill {
    padding: 0.38rem 0.62rem;
    font-size: 0.93rem;
  }

  .site-nav .icon-link {
    width: 1.95rem;
    height: 1.95rem;
    padding: 0;
  }

  .site-nav .icon-link svg {
    width: 0.92rem;
    height: 0.92rem;
  }

  .button {
    width: 100%;
  }

  .home-actions {
    flex-direction: column;
  }
}

section {
  margin-bottom: 1rem;
}

h2 {
  padding: .5rem 1rem;
}

h3 {
  margin: 0;
  margin-bottom: 0.5rem;
}

h4 {
  margin: 0;
  margin-bottom: 0.5rem;
}