:root {
  --bg: #2e2e2e;
  --panel: #383838;
  --panel-soft: #424242;
  --line: #5b5b5b;
  --text: #e7e7e7;
  --muted: #bdbdbd;
  --orange: #dd6900;
  --orange-bright: #ff8c00;
  --cream: #ffffde;
  --shadow: rgba(0, 0, 0, .4);
  --focus: #ffd05c;
}

* {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #4a4a4a 0, var(--bg) 420px);
  color: var(--text);
  font: 14px Verdana, Arial, Helvetica, sans-serif;
}

body.high-contrast {
  --bg: #111;
  --panel: #202020;
  --panel-soft: #2b2b2b;
  --line: #8a8a8a;
  --text: #fff;
  --muted: #d7d7d7;
  --orange: #ff9d2e;
  --orange-bright: #ffbd5b;
}

a {
  color: var(--orange);
  text-decoration: none;
}

a:hover {
  color: #a9a9a9;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

#wrap {
  min-height: calc(100vh - 86px);
}

.site-header {
  background: #252525;
}

.header-top {
  min-height: 150px;
  position: relative;
  overflow: hidden;
  background: #1f1f1f;
}

.header-top::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,.55), rgba(0,0,0,.08));
}

.header-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.header-top h1 {
  position: absolute;
  left: 52%;
  top: 104px;
  margin: 0;
  font-size: clamp(20px, 3vw, 34px);
  line-height: 1.1;
  text-shadow: 2px 2px 0 #000;
  z-index: 2;
}

.header-top h1 a {
  color: var(--text);
}

.header-tools {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-end;
  padding: 10px 18px 0;
  font-size: 12px;
  font-weight: bold;
  z-index: 3;
}

.header-tools a,
.header-tools button {
  border: 0;
  background: rgba(0, 0, 0, .32);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: bold;
  padding: 5px 8px;
  cursor: pointer;
}

.header-tools button:hover,
.header-tools a:hover {
  color: var(--orange-bright);
}

.header-bottom {
  min-height: 42px;
  position: relative;
  background: linear-gradient(#4b4b4b, #1f1f1f);
  border-top: 1px solid #111;
  border-bottom: 1px solid #111;
}

.header-search {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 6px 16px;
}

.header-search input,
.table-tools input,
.chart-layout select {
  border: 1px inset #545454;
  background: var(--cream);
  color: #222;
  min-height: 30px;
  padding: 4px 8px;
}

.header-search button {
  width: 31px;
  min-height: 30px;
  border: 1px solid #545454;
  background: #1f1f1f url("../images/go.png") center / 18px 18px no-repeat;
  cursor: pointer;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 11px 12px 13px;
  background: #2a2a2a;
  position: sticky;
  top: 0;
  z-index: 20;
}

.main-nav a {
  min-width: 104px;
  padding: 10px 13px;
  border: 1px solid #3c3c3c;
  border-bottom-color: var(--orange);
  background: linear-gradient(#363636, #202020);
  color: var(--text);
  font-size: 12px;
  text-align: center;
}

.main-nav a:hover,
.main-nav a.active {
  border-color: var(--orange-bright);
  background: #272727;
}

.divider {
  height: 4px;
  background: linear-gradient(90deg, #111, #777, #111);
}

#content {
  max-width: 1220px;
  margin: 0 auto;
  padding: 22px 18px 36px;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 22px;
  align-items: start;
}

.main-column,
.side-column {
  display: grid;
  gap: 18px;
}

.hero-panel {
  min-height: 250px;
  padding: 30px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(0,0,0,.72), rgba(39,39,39,.82)),
    url("../images/header.jpg") center / cover no-repeat;
  box-shadow: 0 16px 36px var(--shadow);
}

.kicker {
  margin: 0 0 10px;
  color: var(--orange-bright);
  font-weight: bold;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-panel h2 {
  max-width: 760px;
  margin: 0 0 12px;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1.05;
  font-weight: normal;
  text-shadow: 2px 2px #000;
}

.hero-panel p {
  max-width: 760px;
  color: #f0f0f0;
  font-size: 16px;
  line-height: 1.6;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.quick-actions a,
.media-card a,
.video-card a,
.profile-actions button,
.profile-actions a {
  padding: 9px 12px;
  border: 1px solid var(--orange);
  background: rgba(0, 0, 0, .28);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.block {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 8px 20px var(--shadow);
}

.blockheader {
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid #1b1b1b;
  background: linear-gradient(#555, #2a2a2a);
  color: var(--text);
  font-size: 18px;
  font-weight: normal;
}

.blockcontent {
  padding: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 14px;
  border: 1px solid #555;
  background: #303030;
  transition: transform .18s ease, border-color .18s ease;
}

.stat-card:hover,
.feature-card:hover {
  transform: translateY(-2px);
  border-color: var(--orange-bright);
}

.stat-card strong {
  display: block;
  color: var(--orange-bright);
  font-size: 25px;
}

.stat-card span {
  color: var(--muted);
  font-size: 12px;
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-box {
  padding: 15px;
  border: 1px solid #575757;
  background: #303030;
}

.news-box h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.news-box time {
  color: var(--muted);
  font-size: 12px;
}

.news-box p,
.prose p {
  line-height: 1.65;
}

.icon-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  text-align: center;
}

.icon-links a {
  min-height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid #555;
  background: #303030;
  color: var(--text);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud a {
  padding: 6px 8px;
  border: 1px solid #545454;
  background: #292929;
}

.compact-list {
  display: grid;
  gap: 9px;
}

.compact-list a {
  display: block;
  padding: 8px;
  border-bottom: 1px solid #4d4d4d;
}

.table-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.alpha-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.alpha-bar button,
.pager button {
  border: 1px solid #555;
  background: #252525;
  color: var(--text);
  min-height: 30px;
  padding: 4px 8px;
  cursor: pointer;
}

.alpha-bar button.active,
.pager button:hover {
  border-color: var(--orange-bright);
  color: var(--orange-bright);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 10px;
  border-bottom: 1px solid #515151;
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--orange-bright);
  font-weight: normal;
}

.data-table tr:hover td {
  background: #333;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.person-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: start;
}

.person-name {
  margin: 0;
  font-size: clamp(26px, 4vw, 46px);
  font-weight: normal;
}

.person-id {
  color: var(--muted);
}

.facts-grid,
.relatives-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.fact {
  padding: 13px;
  border: 1px solid #555;
  background: #303030;
}

.fact b {
  display: block;
  margin-bottom: 5px;
  color: var(--orange-bright);
}

.chart-layout {
  display: grid;
  gap: 20px;
}

.chart-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.relationship-map {
  min-height: 330px;
}

.network-svg {
  width: 100%;
  min-height: 310px;
  border: 1px solid #555;
  background:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px),
    #303030;
  background-size: 28px 28px;
}

.network-svg text {
  fill: var(--text);
  font-size: 12px;
}

.network-svg .node {
  fill: #272727;
  stroke: var(--orange-bright);
  stroke-width: 2;
}

.network-svg .root-node {
  fill: #4a2b0d;
}

.network-svg line {
  stroke: #777;
  stroke-width: 1.5;
}

.tree-chart {
  overflow: auto;
  max-height: 680px;
  padding: 12px;
  border: 1px solid #555;
  background: #303030;
}

.tree-node {
  margin: 6px 0 6px 14px;
  padding-left: 12px;
  border-left: 1px solid #666;
}

.tree-node > a {
  color: var(--text);
}

.tree-node small {
  display: block;
  color: var(--muted);
}

.place-list {
  columns: 2;
}

.place-item {
  break-inside: avoid;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #4c4c4c;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.media-intro {
  max-width: 760px;
  margin-top: 0;
  color: var(--muted);
  line-height: 1.6;
}

.channel-link {
  margin-bottom: 18px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.video-card,
.media-card {
  padding: 16px;
  border: 1px solid #555;
  background: #303030;
}

.video-card h3,
.media-card h3 {
  margin: 12px 0;
  line-height: 1.35;
}

.video-frame {
  aspect-ratio: 16 / 9;
  background: #111;
  border: 1px solid #555;
  overflow: hidden;
}

.video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.media-documents {
  margin-top: 18px;
}

.noscript-seo {
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px;
  color: var(--text);
}

.web3-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-card {
  min-height: 210px;
  padding: 16px;
  border: 1px solid #555;
  background:
    linear-gradient(160deg, rgba(255,140,0,.14), rgba(255,255,255,.03) 45%, rgba(0,0,0,.2)),
    #303030;
  transition: transform .18s ease, border-color .18s ease;
}

.feature-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--orange);
  color: var(--orange-bright);
  font-weight: bold;
}

.feature-card h3 {
  margin: 16px 0 8px;
}

.feature-card p {
  color: var(--muted);
  line-height: 1.6;
}

footer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 14px 20px 18px;
  color: var(--muted);
  font-size: 12px;
}

footer div:nth-child(2) {
  text-align: center;
}

footer div:nth-child(3) {
  text-align: right;
}

.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;
}

@media (max-width: 900px) {
  .home-grid,
  .chart-columns,
  .facts-grid,
  .relatives-grid,
  .video-grid,
  .web3-grid,
  footer {
    grid-template-columns: 1fr;
  }

  .header-top h1 {
    left: 20px;
    right: 20px;
    top: 96px;
  }

  .header-tools {
    justify-content: flex-start;
    padding-left: 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .place-list {
    columns: 1;
  }

  footer div,
  footer div:nth-child(2),
  footer div:nth-child(3) {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .header-search {
    justify-content: stretch;
  }

  .header-search input {
    width: 100%;
  }

  .main-nav a {
    min-width: calc(50% - 6px);
  }

  .person-head,
  .profile-actions {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .profile-actions a,
  .profile-actions button {
    width: 100%;
    text-align: center;
  }

  .hero-panel {
    padding: 22px;
  }

  .stats-grid,
  .icon-links {
    grid-template-columns: 1fr;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table thead {
    display: none;
  }

  .network-svg text {
    font-size: 10px;
  }
}
