@import url("/css/site-nav.css");

:root {
  --paper: #f6f3ec;
  --paper-2: #efe9de;
  --ink: #1c1916;
  --ink-soft: #4a4540;
  --muted: #7a736a;
  --line: rgba(28, 25, 22, 0.1);
  --accent: #b84a1c;
  --accent-soft: rgba(184, 74, 28, 0.1);
  --signal: #2d6a4f;
  --signal-soft: rgba(45, 106, 79, 0.1);
  --card: #fffdf9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 25, 22, 0.06), 0 8px 24px rgba(28, 25, 22, 0.05);
  --serif: "Source Serif 4", Georgia, "Songti SC", serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --max: 920px;
}

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

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(184, 74, 28, 0.06), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 10%, rgba(45, 106, 79, 0.05), transparent 50%);
  pointer-events: none;
}

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

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.back { color: var(--muted); font-size: 0.9rem; }

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card);
}

.lang-btn {
  padding: 0.3rem 0.6rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
  position: relative;
}

.hero { margin-bottom: 2rem; }

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 0.6rem;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.65rem, 5vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  max-width: 18ch;
}

.lede {
  color: var(--ink-soft);
  font-size: 1.02rem;
  max-width: 42ch;
}

.view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.75rem;
}

.view-tab {
  padding: 0.45rem 0.9rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.view-tab:hover { color: var(--ink); background: var(--paper-2); }

.view-tab.active {
  background: var(--card);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.view { display: none; }
.view.active { display: block; }

.section-intro {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
  max-width: 52ch;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.85rem;
}

.cat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  text-align: left;
  font: inherit;
  color: inherit;
  width: 100%;
}

.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(28, 25, 22, 0.08);
}

.cat-icon {
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.cat-card h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
}

.cat-tagline {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.cat-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--signal);
}

.projects-toolbar { margin-bottom: 1rem; }

.search {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  font: inherit;
  color: var(--ink);
  margin-bottom: 0.65rem;
}

.search:focus {
  outline: 2px solid var(--accent-soft);
  border-color: rgba(184, 74, 28, 0.35);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.filter-row label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
}

.filter-row select {
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  font: inherit;
  color: var(--ink);
}

.count {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.project-head h3 {
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.3;
  flex: 1;
  min-width: 200px;
}

.signal-meter {
  flex-shrink: 0;
  text-align: right;
}

.signal-num {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--signal);
  line-height: 1;
}

.signal-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.chip {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
}

.chip.method { border-color: rgba(184, 74, 28, 0.2); color: var(--accent); background: var(--accent-soft); }
.chip.pattern { border-color: rgba(45, 106, 79, 0.2); color: var(--signal); background: var(--signal-soft); }
.chip.auto { border-style: dashed; }

.field { margin-bottom: 0.45rem; font-size: 0.88rem; }
.field strong { color: var(--ink); font-weight: 600; }
.field span { color: var(--ink-soft); }

.project-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.meta-pill {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: var(--paper-2);
  font-size: 0.75rem;
}

.method-detail {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--paper);
  overflow-y: auto;
  padding: 1rem 1.25rem 3rem;
}

.method-detail[hidden] { display: none !important; }

.detail-close {
  border: none;
  background: none;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  margin-bottom: 1rem;
  font-weight: 500;
}

.detail-hero h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  margin-bottom: 0.35rem;
}

.detail-hero p { color: var(--ink-soft); margin-bottom: 1rem; }

.detail-block {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: var(--shadow);
}

.detail-block h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.phrase-list, .channel-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.phrase-list li {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  background: var(--paper-2);
  border-radius: 6px;
}

.channel-list li { font-size: 0.88rem; }

.detail-projects h4 { margin: 1.25rem 0 0.75rem; font-family: var(--serif); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem;
}

.foot {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.foot-meta { margin-top: 0.35rem; font-size: 0.75rem; }

@media (max-width: 600px) {
  .hero h1 { max-width: none; }
  .filter-row .count { margin-left: 0; width: 100%; }
}
