:root {
  --bg: #0b0c10;
  --bg-elevated: rgba(255, 255, 255, 0.05);
  --bg-elevated-strong: rgba(255, 255, 255, 0.08);
  --text: #eef2f7;
  --muted: #a6afbe;
  --border: rgba(255, 255, 255, 0.16);
  --chip: rgba(255, 255, 255, 0.08);
  --chip-active: rgba(255, 255, 255, 0.24);
  --shadow: 0 24px 44px rgba(0, 0, 0, 0.34);
  --card-radius-scale: 0.8;
  --radius: calc(18px * var(--card-radius-scale));
  --radius-lg: calc(24px * var(--card-radius-scale));
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 340px at 10% -10%, rgba(255, 255, 255, 0.08), transparent 68%),
    radial-gradient(800px 320px at 90% 0%, rgba(87, 103, 128, 0.18), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "SF Pro Display", "Helvetica Neue", sans-serif;
}

main,
.page-header {
  width: min(1200px, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.page-header {
  padding: var(--space-7) 0 var(--space-5);
}

.page-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin: var(--space-2) 0 0;
  color: var(--muted);
}

.toolbar {
  margin-top: var(--space-5);
  display: grid;
  grid-template-columns: 1fr minmax(180px, 260px);
  gap: var(--space-4);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(7, 11, 18, 0.94);
  color: var(--text);
  padding: 0.7rem 0.8rem;
}

select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #d9e3f0 50%),
    linear-gradient(135deg, #d9e3f0 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.1rem;
}

select option {
  background: #0b111a;
  color: #eef2f7;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
.card:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.62);
  outline-offset: 2px;
}

.category-filters,
.advanced-filters {
  margin-top: var(--space-5);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--chip);
  color: var(--text);
  padding: 0.45rem 0.82rem;
  cursor: pointer;
  font-size: 0.86rem;
}

.chip.is-active {
  background: var(--chip-active);
}

.advanced-filters__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: var(--space-3);
}

.results-section {
  padding-bottom: 3rem;
}

.results-count {
  margin: 0 0 var(--space-4);
  color: var(--muted);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: var(--space-4);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  padding: var(--space-4);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transform: translateY(12px) scale(0.985);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease, border-color 0.24s ease;
}

.card.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px) scale(1.01);
}

.card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.card__name {
  margin: 0;
  font-size: 0.97rem;
}

.card__title {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.badge {
  margin-top: var(--space-3);
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.22rem 0.62rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.card__meta {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.card__meta .badge {
  margin-top: 0;
}

.card__meta-item {
  display: inline-flex;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.22rem 0.62rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.card__summary {
  margin: var(--space-3) 0 0;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.45;
}

.empty-state {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  padding: var(--space-6);
  text-align: center;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 9, 14, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 40;
}

.drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.profile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  height: 100vh;
  width: min(760px, 100%);
  border-left: 1px solid var(--border);
  background: rgba(10, 12, 16, 0.96);
  transform: translateX(102%);
  transition: transform 0.3s ease;
  z-index: 50;
  display: grid;
  grid-template-rows: auto 1fr;
}

.profile-drawer.is-open {
  transform: translateX(0%);
}

.profile-drawer__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.profile-drawer__name {
  margin: 0;
  font-size: 1.1rem;
}

.profile-drawer__content {
  overflow: auto;
  padding: var(--space-5);
  display: grid;
  gap: var(--space-5);
}

.profile-drawer__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border);
}

.profile-hero__actions {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.profile-drawer__deep-dive {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
  text-align: center;
  border: 1px solid rgba(114, 216, 255, 0.58);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(30, 48, 70, 0.92), rgba(22, 38, 56, 0.92));
  color: #d9f8ff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.62rem 1.05rem;
  box-shadow: 0 0 0 1px rgba(114, 216, 255, 0.16), 0 8px 18px rgba(8, 17, 30, 0.35);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-drawer__deep-dive:hover,
.profile-drawer__deep-dive:focus-visible {
  border-color: rgba(114, 216, 255, 0.86);
  background: linear-gradient(180deg, rgba(35, 56, 82, 0.96), rgba(25, 43, 64, 0.96));
  box-shadow: 0 0 0 1px rgba(114, 216, 255, 0.26), 0 10px 22px rgba(8, 17, 30, 0.45);
  transform: translateY(-1px) scale(1.02);
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
}

.profile-hero {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-4);
}

.profile-hero__image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid var(--border);
  object-fit: cover;
}

.profile-meta {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-2);
  color: var(--muted);
}

.profile-dossier-wrap {
  margin-top: 0.65rem;
}

.profile-meta-separator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 0.75rem;
  margin: 0.7rem 0 0.95rem;
}

.profile-meta-separator::before,
.profile-meta-separator::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
}

.profile-meta-separator span {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: rgba(205, 214, 226, 0.7);
}

.profile-dossier {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.85rem;
}

.profile-dossier__row {
  display: grid;
  grid-template-columns: 12px 128px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
}

.profile-dossier__icon {
  width: 12px;
  height: 12px;
  color: rgba(198, 210, 226, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.profile-dossier__icon svg {
  width: 11px;
  height: 11px;
  display: block;
}

.profile-dossier__label {
  font-size: 0.82rem;
  line-height: 1.2;
  font-weight: 700;
  color: rgba(236, 242, 250, 0.88);
  letter-spacing: 0.02em;
}

.profile-dossier__value {
  font-size: 0.82rem;
  line-height: 1.4;
  color: rgba(186, 198, 214, 0.86);
}

.profile-dossier__split {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin: 0.1rem 0;
  height: 0;
}

.profile-inline-back {
  margin: 0 0 var(--space-4);
}

.profile-inline-back--bottom {
  text-align: right;
  margin-top: var(--space-4);
}

.external-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0.34rem 0.6rem;
  text-decoration: none;
  font-size: 0.8rem;
}

.external-link__icon {
  width: 1rem;
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.9;
}

.tabs {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}

#personProfileContent > .tabs {
  margin-top: var(--space-3);
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.tab-section {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.tab-section:last-child {
  border-bottom: 0;
}

.tab-section__title {
  margin: 0 0 var(--space-2);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.tab-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-size: 0.75rem;
  padding: 0.3rem 0.58rem;
  cursor: pointer;
}

.tab-button[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.2);
}

.tab-panel {
  padding: var(--space-4);
  text-align: left;
}

.tab-section .tab-panel {
  padding: 0;
}

.profile-text-list {
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.profile-text-list li {
  margin: 0.3rem 0;
  padding-left: 0.9rem;
  position: relative;
  color: var(--muted);
  text-align: left;
}

.profile-text-list li::before {
  content: "-";
  position: absolute;
  left: 0;
  top: 0;
  color: #5ad4ff;
  font-size: 0.9em;
  font-weight: 700;
  line-height: 1.5;
}

.profile-text-list a {
  color: #8edfff;
}

.profile-text-list a:hover {
  color: #b6ebff;
}

.tab-panel[hidden] {
  display: none;
}

.tab-placeholder {
  margin: 0;
  color: var(--muted);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-3);
}

.related-card {
  border: 1px solid var(--border);
  border-radius: calc(14px * var(--card-radius-scale));
  background: var(--bg-elevated);
  color: inherit;
  text-align: left;
  padding: var(--space-3);
  cursor: pointer;
}

.skeleton {
  height: 142px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.03) 8%, rgba(255, 255, 255, 0.12) 18%, rgba(255, 255, 255, 0.03) 33%);
  background-size: 200% 100%;
  animation: shimmer 1.35s linear infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.back-to-top-saucer {
  position: fixed;
  left: 50%;
  bottom: 1.3rem;
  transform: translateX(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(7, 16, 31, 0.75);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  box-shadow: 0 14px 28px rgba(2, 8, 20, 0.35);
  backdrop-filter: blur(6px);
  transition: opacity 0.24s ease, transform 0.24s ease, background-color 0.24s ease;
  z-index: 12;
}

.back-to-top-saucer.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.back-to-top-saucer:hover,
.back-to-top-saucer:focus-visible {
  background: rgba(11, 28, 46, 0.92);
  transform: translateX(-50%) translateY(-2px);
}

@media (max-width: 980px) {
  .toolbar {
    grid-template-columns: 1fr;
  }

  .advanced-filters__grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }
}

@media (max-width: 720px) {
  .page-header,
  main {
    width: calc(100% - 1rem);
  }

  .profile-dossier__row {
    grid-template-columns: 11px 104px minmax(0, 1fr);
    column-gap: 9px;
  }

  .back-to-top-saucer {
    bottom: 1rem;
    width: 2.8rem;
    height: 2.8rem;
  }

  .profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-hero__image {
    width: 100px;
    height: 100px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
