:root {
  --ink: #071820;
  --night: #061820;
  --teal: #009bd3;
  --green: #8fcf50;
  --yellow: #f2e500;
  --orange: #f8bd59;
  --paper: #f8f8f1;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(242, 229, 0, 0.95) 0 8px, transparent 8px 100%),
    linear-gradient(90deg, var(--night), #0b3d4c 54%, #eff7f2 54%);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.home-link {
  position: fixed;
  z-index: 20;
  top: 18px;
  left: 18px;
  min-height: 42px;
  border-radius: 8px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
  backdrop-filter: blur(14px);
}

.modern-shell {
  display: grid;
  grid-template-rows: clamp(86px, 14vh, 118px) minmax(0, 1fr) clamp(82px, 13vh, 116px) clamp(104px, 16vh, 128px);
  width: 100vw;
  height: 100vh;
  padding: clamp(18px, 2.2vw, 34px);
}

.modern-top {
  position: relative;
  display: grid;
  grid-template-columns: minmax(210px, 320px) 1fr auto;
  align-items: center;
  gap: clamp(22px, 3vw, 48px);
  min-height: 0;
  border-radius: 8px;
  padding: 0 clamp(18px, 2vw, 28px);
  background: linear-gradient(90deg, rgba(6, 24, 32, 0.96), rgba(11, 61, 76, 0.92), rgba(6, 24, 32, 0.72));
}

.brand {
  width: 100%;
  max-height: 88px;
  object-fit: contain;
  object-position: left center;
}

.top-title {
  color: #ffffff;
}

.top-title p {
  margin: 0 0 5px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.top-title h1 {
  margin: 0;
  font-size: clamp(2rem, 3.3vw, 4rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.counter {
  display: grid;
  min-width: 102px;
  min-height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 900;
}

.modern-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 43vw);
  align-items: center;
  gap: clamp(20px, 3vw, 52px);
  min-height: 0;
  padding: clamp(10px, 1.8vw, 34px) clamp(54px, 6vw, 92px);
}

.modern-hero::before {
  content: "";
  position: absolute;
  inset: 5% 47% 5% 0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(242, 229, 0, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  pointer-events: none;
}

.details {
  position: relative;
  z-index: 1;
  max-width: 820px;
  padding-left: clamp(32px, 4vw, 58px);
  color: #ffffff;
}

.period-badge {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  border-radius: 8px;
  padding: 0 18px;
  background: linear-gradient(90deg, var(--yellow), var(--green) 46%, var(--teal));
  color: var(--ink);
  font-size: clamp(1.05rem, 1.5vw, 1.45rem);
  font-weight: 950;
}

h2 {
  max-width: 760px;
  margin: clamp(14px, 2vw, 26px) 0 clamp(10px, 1.6vw, 18px);
  color: #ffffff;
  font-size: clamp(3.1rem, 6vw, 7.2rem);
  line-height: 0.9;
  letter-spacing: 0;
  text-wrap: balance;
}

#office {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.25rem, 2vw, 2.1rem);
  font-weight: 720;
  line-height: 1.18;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(12px, 2vw, 28px);
}

.meta-row span {
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-weight: 850;
  backdrop-filter: blur(14px);
}

.portrait-frame {
  position: relative;
  justify-self: end;
  width: min(100%, 470px);
  aspect-ratio: 0.82;
  max-height: 100%;
  min-height: 0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(7, 24, 32, 0.28);
}

.portrait-frame::before {
  content: "";
  position: absolute;
  inset: -18px 18px 18px -18px;
  z-index: -1;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--yellow), var(--green) 36%, var(--teal) 66%, var(--orange));
}

.portrait {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
  object-position: center center;
  transition: opacity 220ms ease, transform 520ms ease;
}

.portrait.is-changing {
  opacity: 0;
  transform: scale(1.025);
}

.color-stack {
  position: absolute;
  z-index: 2;
  right: 18px;
  bottom: 18px;
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 7px;
}

.color-stack span {
  height: 10px;
  border-radius: 999px;
}

.color-stack span:nth-child(1) {
  background: var(--yellow);
}

.color-stack span:nth-child(2) {
  background: var(--green);
}

.color-stack span:nth-child(3) {
  background: var(--teal);
}

.color-stack span:nth-child(4) {
  background: var(--orange);
}

.nav-button {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  width: clamp(66px, 6vw, 96px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 999px;
  background: rgba(7, 24, 32, 0.74);
  color: #ffffff;
  box-shadow: 0 18px 45px rgba(7, 24, 32, 0.24);
  cursor: pointer;
  transform: translateY(-50%);
}

.nav-button span {
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1;
}

.nav-button:hover,
.nav-button:focus-visible {
  background: var(--teal);
  outline: none;
}

.previous {
  left: 22px;
}

.next {
  right: 22px;
}

.modern-controls {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 14px;
  padding: 0 clamp(54px, 6vw, 92px) 10px;
}

.search-wrap,
.decade-tabs,
.timeline {
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 54px rgba(7, 24, 32, 0.13);
  backdrop-filter: blur(18px);
}

.search-wrap {
  display: grid;
  gap: 7px;
  padding: 10px 13px;
}

.search-wrap label {
  color: #34545c;
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-wrap input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(7, 24, 32, 0.12);
  border-radius: 8px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--ink);
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0, 155, 211, 0.16);
}

.decade-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 10px;
}

.decade-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #304e56;
  font-weight: 950;
  cursor: pointer;
}

.decade-tabs button.active {
  background: linear-gradient(90deg, var(--yellow), var(--green), var(--teal));
  color: var(--ink);
}

.timeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(172px, 1fr);
  gap: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 clamp(54px, 6vw, 92px);
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) transparent;
}

.timeline-item {
  display: grid;
  align-content: center;
  min-height: 82px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.timeline-item.active {
  background:
    linear-gradient(90deg, rgba(242, 229, 0, 0.2), rgba(0, 155, 211, 0.16)),
    #ffffff;
  box-shadow: inset 0 5px 0 var(--teal);
}

.item-period {
  color: #0076a2;
  font-size: 0.78rem;
  font-weight: 950;
}

.item-name {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 950;
  line-height: 1.08;
  text-overflow: ellipsis;
}

.item-office {
  display: none;
}

.empty-state {
  padding: 22px;
  color: #38545c;
  font-weight: 850;
}

@media (max-width: 1080px) {
  body {
    overflow: auto;
  }

  .modern-shell {
    height: auto;
    min-height: 100vh;
  }

  .modern-top,
  .modern-hero,
  .modern-controls {
    grid-template-columns: 1fr;
  }

  .portrait-frame {
    justify-self: start;
    max-width: 420px;
  }
}
