*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

:root {
  --bg:         #f8f9fb;
  --surface:    #ffffff;
  --border:     #e5e7eb;
  --text:       #111827;
  --muted:      #6b7280;
  --muted-bg:   #f3f4f6;
  --radius:     10px;
  --gap:        24px;
  --font:       -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;

  --c-writers:    #8b5cf6;
  --c-actors:     #f43f5e;
  --c-musicians:  #0ea5e9;
  --c-painters:   #f97316;
  --c-scientists: #06b6d4;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px var(--gap);
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--text); }
.sep { opacity: .4; }

/* ── Main ── */
.site-main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 32px var(--gap) 48px;
}

/* ── Results header ── */
.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  transition: color .15s, border-color .15s;
}
.back-btn:hover { color: var(--text); border-color: var(--text); }
.results-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.results-count {
  font-size: .85rem;
  color: var(--muted);
}

/* ── Tiles grid ── */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

/* ── Person tile ── */
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  transition: box-shadow .15s, transform .15s;
}
.tile:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
  transform: translateY(-1px);
}
.tile-name {
  font-size: .98rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.tile-years {
  font-size: .8rem;
  color: var(--muted);
}
.tile-desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 4px;
}
.tile-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 2px;
}
.tile-meta-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: .78rem;
  color: var(--muted);
  overflow: hidden;
}
.tile-meta-row .icon { flex-shrink: 0; font-size: .8rem; }
.tile-meta-row .value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.tile-award {
  margin-top: 4px;
  font-size: .72rem;
  background: var(--muted-bg);
  border-radius: 4px;
  padding: 3px 7px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Accent colors per type */
.tile--writers    { --accent: var(--c-writers); }
.tile--actors     { --accent: var(--c-actors); }
.tile--musicians  { --accent: var(--c-musicians); }
.tile--painters   { --accent: var(--c-painters); }
.tile--scientists { --accent: var(--c-scientists); }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 20px var(--gap);
  font-size: .8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .tiles-grid { grid-template-columns: 1fr 1fr; }
  .type-grid  { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 380px) {
  .tiles-grid { grid-template-columns: 1fr; }
  .type-grid  { grid-template-columns: 1fr; }
}
