@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@700;800&display=swap');

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

html, body {
  width: 100vw; height: 100vh;
  overflow: hidden;
  background: #0e1117;
  color: #c9d1d9;
  font-family: 'Inter', system-ui, sans-serif;
}

.page {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

/* ── Header ── */
.header {
  flex: 0 0 auto;
  text-align: center;
  padding: 1.2vh 1vw 0.6vh;
  background: linear-gradient(180deg, #161b22 0%, #0e1117 100%);
  border-bottom: 1px solid #21262d;
}

.header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 2.4vw, 2rem);
  font-weight: 800;
  background: linear-gradient(135deg, #e2b45a, #f0d48a, #e2b45a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.04em;
}

.header .subtitle {
  font-size: clamp(0.65rem, 1vw, 0.85rem);
  color: #8b949e;
  margin-top: 0.2vh;
  font-weight: 300;
}

/* ── Legend bar ── */
.legend {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  padding: 0.6vh 1vw;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: clamp(0.55rem, 0.8vw, 0.72rem);
  color: #8b949e;
}

.legend-dot {
  width: 0.6rem; height: 0.6rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Sentiment colours ── */
.sentiment-open       { background: #3fb950; }
.sentiment-cautious   { background: #d29922; }
.sentiment-neutral    { background: #58a6ff; }
.sentiment-reserved   { background: #f78166; }
.sentiment-varies     { background: #bc8cff; }
.sentiment-awakening  { background: #c084fc; box-shadow: 0 0 6px #c084fc88; }

.tag-open       { color: #3fb950; border-color: #3fb95044; }
.tag-cautious   { color: #d29922; border-color: #d2992244; }
.tag-neutral    { color: #58a6ff; border-color: #58a6ff44; }
.tag-reserved   { color: #f78166; border-color: #f7816644; }
.tag-varies     { color: #bc8cff; border-color: #bc8cff44; }
.tag-awakening  { color: #c084fc; border-color: #c084fc44; text-shadow: 0 0 8px #c084fc66; }

/* ── Grid ── */
.grid-wrap {
  flex: 1 1 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1vh 1.5vw 2vh;
  scrollbar-width: thin;
  scrollbar-color: #30363d #0e1117;
}

.grid-wrap::-webkit-scrollbar { width: 6px; }
.grid-wrap::-webkit-scrollbar-track { background: #0e1117; }
.grid-wrap::-webkit-scrollbar-thumb { background: #30363d; border-radius: 3px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* ── Card ── */
.card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 0.6rem;
  padding: 1rem 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.card:hover {
  border-color: #30363d;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-icon {
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  line-height: 1;
  flex-shrink: 0;
}

.card-title-block {
  flex: 1;
}

.card-title {
  font-weight: 600;
  font-size: clamp(0.8rem, 1.1vw, 0.95rem);
  color: #e6edf3;
  line-height: 1.2;
}

.card-adherents {
  font-size: clamp(0.55rem, 0.75vw, 0.68rem);
  color: #6e7681;
  margin-top: 0.1rem;
}

.card-tag {
  font-size: clamp(0.5rem, 0.7vw, 0.62rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid;
  border-radius: 1rem;
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
  align-self: flex-start;
  margin-top: 0.1rem;
}

.card-body {
  font-size: clamp(0.62rem, 0.85vw, 0.78rem);
  line-height: 1.5;
  color: #9eaab6;
}

.card-key {
  font-size: clamp(0.55rem, 0.75vw, 0.68rem);
  color: #6e7681;
  font-style: italic;
  margin-top: auto;
  padding-top: 0.3rem;
  border-top: 1px solid #21262d;
}

/* ── Back link ── */
.back-link {
  position: fixed;
  top: 0.8vh;
  left: 1vw;
  color: #58a6ff;
  text-decoration: none;
  font-size: clamp(0.65rem, 0.9vw, 0.8rem);
  z-index: 10;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.back-link:hover { opacity: 1; }

/* ── Footer ── */
.footer {
  flex: 0 0 auto;
  text-align: center;
  padding: 0.5vh 1vw;
  font-size: clamp(0.5rem, 0.7vw, 0.62rem);
  color: #484f58;
  border-top: 1px solid #21262d;
  background: #0e1117;
}
