:root {
  --red: #ef233c;
  --red-dark: #c9152d;
  --ink: #111111;
  --paper: #ffffff;
  --screen: #fff3b0;
  --screen-bright: #fff9d9;
  --muted: #69675f;
  --blue: #bde6f8;
  --green: #ccefb5;
  --purple: #dec8ff;
  --orange: #ffd390;
  --pink: #ffc6df;
  --line: 3px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --display: "Press Start 2P", ui-monospace, monospace;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: #f4f3ee; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(17,17,17,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17,17,17,.035) 1px, transparent 1px),
    #f4f3ee;
  background-size: 24px 24px;
  font-family: var(--mono);
  font-size: 15px;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 4px solid #218bd5;
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pokedex-shell {
  width: min(1500px, calc(100% - 24px));
  height: calc(100vh - 24px);
  min-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  margin: 12px auto;
  overflow: hidden;
  background: var(--paper);
  border: 5px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 10px 0 rgba(17,17,17,.16);
}

.topbar {
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  color: #fff;
  background: var(--red);
  border-bottom: 5px solid var(--ink);
}

.brand, .topbar-actions, .brand > div:first-child, .applicant-count, .export-button,
.roster-heading, .search-field, .toolbar, .entry-number-row, .profile-links a,
.activity-dot, .role-card, .project-row, footer > div { display: flex; align-items: center; }

.brand { gap: 22px; }
.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(22px, 2.6vw, 40px);
  line-height: 1.2;
  letter-spacing: -.04em;
}
.brand p { margin: 8px 0 0; font-weight: 600; font-size: 16px; }

.pokeball {
  position: relative;
  width: 56px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  overflow: hidden;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(to bottom, var(--red) 0 44%, var(--ink) 44% 56%, #fff 56% 100%);
}
.pokeball::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 18px;
  aspect-ratio: 1;
  translate: -50% -50%;
  border: 5px solid var(--ink);
  border-radius: 50%;
  background: #fff;
}
.pokeball--large { width: 72px; background: linear-gradient(to bottom, var(--red-dark) 0 44%, var(--ink) 44% 56%, #fff 56% 100%); }
.pokeball--mini { width: 27px; border-width: 3px; }
.pokeball--mini::after { width: 7px; border-width: 3px; }

.topbar-actions { gap: 18px; }
.applicant-count, .export-button {
  min-height: 62px;
  padding: 10px 18px;
  color: var(--ink);
  background: var(--screen-bright);
  border: var(--line);
  border-radius: 11px;
  box-shadow: 3px 3px 0 rgba(17,17,17,.28);
}
.applicant-count { min-width: 170px; align-items: flex-start; flex-direction: column; }
.applicant-count span { font-family: var(--display); font-size: 11px; text-transform: uppercase; }
.applicant-count strong { margin-top: 7px; font-size: 18px; }
.export-button { gap: 10px; font-weight: 700; text-transform: uppercase; }
.export-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2.5; }

.app-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  overflow: hidden;
}

.roster-panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 18px 18px;
  overflow: hidden;
  border-right: 4px solid var(--ink);
}
.roster-heading { justify-content: space-between; margin: 0 2px 16px; }
.roster-heading h2, .entry-card h3, .projects-panel h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 12px;
  line-height: 1.45;
  text-transform: uppercase;
}
.roster-heading span { font-weight: 700; }

.search-field {
  min-height: 52px;
  flex: 1 1 360px;
  gap: 12px;
  padding: 0 16px;
  background: var(--screen-bright);
  border: var(--line);
  border-radius: 10px;
  box-shadow: inset 0 -3px 0 rgba(239,35,60,.08);
}
.search-field--small { min-height: 46px; width: 100%; flex: 0 0 auto; }
.search-field svg { width: 23px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2.7; }
.search-field input {
  min-width: 0;
  width: 100%;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}
.search-field input::placeholder { color: #77736a; }

.quick-filters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.quick-filter {
  min-height: 36px;
  padding: 6px;
  background: var(--screen-bright);
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  box-shadow: 2px 2px 0 rgba(17,17,17,.2);
}
.quick-filter.active { color: #fff; background: var(--red); }

.roster-list {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  flex: 1;
  gap: 10px;
  padding: 4px 10px 8px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding: 4px 10px 8px 4px;
  scrollbar-gutter: stable;
}
.roster-item {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  text-align: left;
  white-space: normal;
  background: var(--screen-bright);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 2px 2px 0 rgba(17,17,17,.16);
}
.roster-copy {
  min-width: 0;
  display: flex;
  align-self: stretch;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.roster-item:hover { translate: 2px -2px; box-shadow: 4px 4px 0 rgba(17,17,17,.2); }
.roster-item[aria-selected="true"] { border-color: var(--red); box-shadow: 0 0 0 2px var(--ink), 4px 4px 0 var(--red); }
.roster-item img { width: 50px; height: 50px; object-fit: cover; image-rendering: auto; background: #dbe8eb; border: 2px solid var(--ink); border-radius: 7px; }
.roster-number { display: block; font-size: 11px; font-weight: 800; line-height: 1.2; }
.roster-name { display: block; overflow-wrap: anywhere; font-family: var(--display); font-size: 12px; line-height: 1.45; }
.roster-specialty { display: block; overflow-wrap: anywhere; font-size: 11px; line-height: 1.4; white-space: normal; }
.roster-arrow {
  width: 20px;
  height: 32px;
  display: grid;
  place-items: center;
  justify-self: end;
  align-self: center;
  overflow: hidden;
  color: var(--red);
  font-family: var(--display);
  font-size: 22px;
  line-height: 1;
}

.main-panel { min-width: 0; min-height: 0; padding: 18px; overflow-y: auto; }
.toolbar { gap: 14px; margin-bottom: 18px; }
.select-control { flex: 0 0 175px; }
.select-control select, .clear-button {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--screen-bright);
  border: var(--line);
  border-radius: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.clear-button { width: auto; display: flex; align-items: center; gap: 10px; }
.clear-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 2.5; }

.entry-card {
  padding: 16px;
  background: linear-gradient(135deg, var(--screen-bright), var(--screen));
  border: 4px solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.identity-grid {
  display: grid;
  grid-template-columns: 166px minmax(300px, 1fr) minmax(270px, .72fr);
  gap: 22px;
  align-items: stretch;
}
.avatar-frame { position: relative; margin: 0; }
.avatar-frame img { width: 100%; aspect-ratio: 1; display: block; object-fit: cover; background: #dce9ea; border: 4px solid var(--ink); border-radius: 15px; }
.avatar-frame figcaption {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 7px;
  color: #fff;
  background: var(--ink);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.identity-copy { min-width: 0; }
.entry-number-row { justify-content: space-between; gap: 16px; }
.entry-number { font-family: var(--display); font-size: 22px; }
.activity-dot { gap: 7px; color: #118d37; font-family: var(--display); font-size: 9px; text-transform: uppercase; }
.activity-dot i { width: 12px; height: 12px; border: 3px solid #27ad4c; border-radius: 50%; background: #fff; }
.identity-copy h2 { margin: 12px 0 14px; font-family: var(--display); font-size: clamp(26px, 3vw, 42px); line-height: 1.2; letter-spacing: -.04em; }
.profile-links { align-items: flex-start; flex-direction: column; gap: 7px; }
.profile-links a { min-width: 0; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.profile-links svg { width: 21px; flex: 0 0 auto; fill: currentColor; }
.profile-links strong { width: 20px; height: 20px; display: grid; place-items: center; color: #fff; background: #0a66c2; border-radius: 2px; font-family: Arial, sans-serif; font-size: 14px; }
.persona-summary { max-width: 700px; margin: 16px 0 0; line-height: 1.45; }

.skills-panel { padding: 15px; background: rgba(255,255,255,.48); border: 2px solid var(--ink); border-radius: 9px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.skill-tag, .project-tech {
  padding: 6px 9px;
  background: var(--blue);
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 1px 1px 0 rgba(17,17,17,.15);
}
.skill-tag:nth-child(5n+2), .project-tech:nth-child(5n+2) { background: var(--green); }
.skill-tag:nth-child(5n+3), .project-tech:nth-child(5n+3) { background: var(--purple); }
.skill-tag:nth-child(5n+4), .project-tech:nth-child(5n+4) { background: var(--orange); }
.skill-tag:nth-child(5n+5), .project-tech:nth-child(5n+5) { background: var(--pink); }

.roles-panel, .projects-panel { margin-top: 16px; padding: 14px; background: rgba(255,255,255,.7); border: 2px solid var(--ink); border-radius: 9px; }
.role-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 13px; margin-top: 13px; }
.role-card { min-height: 85px; gap: 12px; padding: 12px; background: #fff; border: 2px solid var(--ink); border-radius: 7px; box-shadow: 2px 2px 0 rgba(17,17,17,.14); }
.role-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; background: var(--screen); border: 2px solid var(--ink); border-radius: 7px; font-size: 21px; }
.role-name { display: block; font-family: var(--display); font-size: 10px; line-height: 1.5; }
.role-desc { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.35; }

.stats-strip { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); margin-top: 16px; background: rgba(255,255,255,.3); border: 2px solid var(--ink); border-radius: 9px; }
.stat { min-width: 0; padding: 13px 10px; text-align: center; }
.stat + .stat { border-left: 1px solid #97937e; }
.stat span { display: block; font-family: var(--display); font-size: 9px; line-height: 1.4; text-transform: uppercase; }
.stat strong { display: block; margin: 9px 0 4px; color: var(--red); font-family: var(--display); font-size: 22px; }
.stat small { color: var(--muted); font-size: 10px; }

.project-list { display: grid; gap: 8px; margin-top: 12px; }
.project-row { min-height: 48px; display: grid; grid-template-columns: minmax(145px,.8fr) minmax(180px,1.4fr) minmax(190px,1fr) 28px; gap: 16px; padding: 7px 11px; background: var(--screen-bright); border: 2px solid var(--ink); border-radius: 7px; }
.project-title { min-width: 0; font-weight: 800; }
.project-description { min-width: 0; overflow: hidden; color: #3e3d39; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.project-techs { display: flex; flex-wrap: wrap; gap: 6px; }
.project-tech { padding: 4px 7px; font-size: 9px; }
.project-link { width: 26px; color: var(--ink); }
.project-link svg { width: 22px; fill: currentColor; }

.empty-state { min-height: 580px; display: grid; place-items: center; align-content: center; gap: 18px; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-state h2 { margin: 6px 0 0; font-family: var(--display); font-size: 22px; }
.empty-state p { margin: 0; color: var(--muted); }
.empty-state button { padding: 11px 16px; color: #fff; background: var(--red); border: var(--line); border-radius: 8px; font-weight: 800; }

footer { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 28px; color: #fff; background: var(--red); border-top: 5px solid var(--ink); font-weight: 600; }
footer > div { gap: 12px; }

@media (max-width: 1180px) {
  .app-layout { grid-template-columns: 300px minmax(0,1fr); }
  .identity-grid { grid-template-columns: 145px 1fr; }
  .skills-panel { grid-column: 1 / -1; }
  .role-grid { grid-template-columns: repeat(3,1fr); }
  .toolbar { flex-wrap: wrap; }
  .toolbar .search-field { flex-basis: 100%; }
}

@media (max-width: 820px) {
  .pokedex-shell { width: 100%; height: auto; min-height: 100vh; display: block; margin: 0; border-width: 0; border-radius: 0; }
  .topbar { min-height: 74px; padding: 12px 16px; }
  .pokeball--large { width: 46px; border-width: 4px; }
  .pokeball--large::after { width: 12px; border-width: 4px; }
  .brand { gap: 12px; }
  .brand h1 { font-size: 18px; }
  .brand p, .applicant-count { display: none; }
  .export-button { min-height: 44px; padding: 8px 11px; font-size: 11px; }
  .app-layout { display: block; overflow: visible; }
  .roster-panel { display: block; padding: 14px; overflow: visible; border-right: 0; border-bottom: 4px solid var(--ink); }
  .roster-heading, .roster-panel > .search-field--small, .quick-filters { display: none; }
  .roster-list { min-height: auto; display: flex; align-items: stretch; gap: 9px; padding: 4px 8px 12px; overflow-x: auto; overflow-y: hidden; scroll-padding: 4px 8px 12px; scroll-snap-type: x mandatory; scrollbar-gutter: auto; }
  .roster-item { width: 210px; min-width: 210px; min-height: 86px; grid-template-columns: 45px minmax(0, 1fr); gap: 9px; padding: 8px 10px; scroll-snap-align: start; }
  .roster-item img { width: 45px; height: 45px; }
  .roster-number { font-size: 10px; }
  .roster-name { font-size: 11px; line-height: 1.45; }
  .roster-arrow, .roster-specialty { display: none; }
  .main-panel { padding: 12px; overflow: visible; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 12px; }
  .toolbar .search-field { grid-column: 1 / -1; }
  .select-control { min-width: 0; width: auto; }
  .select-control select, .clear-button, .search-field { min-height: 46px; }
  .clear-button { width: 100%; justify-content: center; }
  .entry-card { padding: 10px; border-width: 3px; border-radius: 13px; box-shadow: 3px 3px 0 var(--ink); }
  .identity-grid { grid-template-columns: 112px 1fr; gap: 14px; }
  .entry-number { font-size: 15px; }
  .identity-copy h2 { margin: 10px 0; font-size: 21px; }
  .persona-summary { grid-column: 1 / -1; font-size: 12px; }
  .profile-links a { max-width: 100%; overflow: hidden; }
  .profile-links a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .skills-panel { grid-column: 1 / -1; }
  .role-grid { grid-template-columns: repeat(5, 58px); overflow-x: auto; padding-bottom: 7px; }
  .role-card { min-height: 64px; display: grid; place-items: center; padding: 7px; }
  .role-icon { width: 32px; height: 32px; }
  .role-name { font-size: 7px; text-align: center; }
  .role-desc { display: none; }
  .stats-strip { grid-template-columns: repeat(5, 104px); overflow-x: auto; }
  .stat { padding: 10px 8px; }
  .stat strong { font-size: 17px; }
  .project-row { grid-template-columns: minmax(120px,.8fr) 1fr 24px; gap: 9px; }
  .project-description { display: none; }
  footer { padding: 12px 16px; font-size: 11px; }
  footer > span { display: none; }
}

@media (max-width: 500px) {
  .export-button { width: 44px; padding: 0; justify-content: center; font-size: 0; }
  .brand h1 { font-size: 14px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .clear-button { grid-column: 1 / -1; }
  .identity-grid { grid-template-columns: 90px 1fr; }
  .avatar-frame figcaption { display: none; }
  .activity-dot span { display: none; }
  .persona-summary { font-size: 11px; }
  .project-row { grid-template-columns: 1fr 22px; }
  .project-techs { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .roster-item, button { transition: translate .14s ease, box-shadow .14s ease, background-color .14s ease; }
  button:active { translate: 1px 1px; }
}
