:root {
  --ink: #10222a;
  --muted: #6b7a80;
  --paper: #f7f8f2;
  --panel: rgba(255, 255, 255, 0.84);
  --line: rgba(16, 34, 42, 0.12);
  --teal: #009bd3;
  --green: #8fcf50;
  --yellow: #f2e500;
  --orange: #f8bd59;
  --deep: #071820;
  --shadow: 0 24px 70px rgba(7, 24, 32, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 18%, rgba(242, 229, 0, 0.26), transparent 27%),
    linear-gradient(145deg, #edf6f2 0%, #f8f8f1 46%, #e8f1f5 100%);
  color: var(--ink);
  font-family: "Segoe UI", "Inter", 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(7, 24, 32, 0.86);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(330px, 26vw, 460px);
  gap: clamp(18px, 2vw, 30px);
  width: 100vw;
  height: 100vh;
  padding: clamp(18px, 2.2vw, 34px);
}

.stage,
.control-deck {
  min-width: 0;
  min-height: 0;
}

.stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(247, 248, 242, 0.94);
  box-shadow: var(--shadow);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(190px, 22vw) 1fr auto;
  align-items: center;
  gap: 22px;
  padding: clamp(18px, 2.2vw, 30px);
  background: linear-gradient(90deg, rgba(7, 24, 32, 0.98), rgba(11, 54, 67, 0.95));
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

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

.title-block {
  min-width: 0;
}

.kicker,
.counter,
.search-wrap label {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 4px 0 0;
  color: #ffffff;
  font-size: clamp(1.8rem, 3vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.counter {
  min-width: 92px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #ffffff;
  text-align: center;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 41%) minmax(0, 1fr);
  min-height: 0;
  isolation: isolate;
}

.portrait-panel {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
}

.portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.01);
  transition: opacity 220ms ease, transform 520ms ease;
}

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

.portrait-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 58%, rgba(7, 24, 32, 0.32));
  pointer-events: none;
}

.details {
  align-self: center;
  max-width: 780px;
  padding: clamp(38px, 6vw, 96px);
}

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

h2 {
  max-width: 760px;
  margin: 26px 0 16px;
  color: var(--deep);
  font-size: clamp(2.8rem, 5.4vw, 6.4rem);
  line-height: 0.94;
  letter-spacing: 0;
  text-wrap: balance;
}

#office {
  max-width: 720px;
  margin: 0;
  color: #31535c;
  font-size: clamp(1.15rem, 1.8vw, 2rem);
  font-weight: 650;
  line-height: 1.22;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.meta-row span {
  min-height: 44px;
  padding: 12px 16px;
  border: 1px solid rgba(0, 155, 211, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #25434a;
  font-weight: 750;
}

.nav-button {
  position: absolute;
  z-index: 5;
  top: 50%;
  display: grid;
  width: clamp(62px, 5.8vw, 92px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(7, 24, 32, 0.72);
  color: #ffffff;
  box-shadow: 0 16px 38px rgba(7, 24, 32, 0.22);
  cursor: pointer;
  transform: translateY(-50%);
  transition: transform 180ms ease, background 180ms ease;
}

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

.nav-button:hover,
.nav-button:focus-visible {
  background: var(--teal);
  outline: none;
  transform: translateY(-50%) scale(1.04);
}

.previous {
  left: clamp(14px, 1.4vw, 24px);
}

.next {
  right: clamp(14px, 1.4vw, 24px);
}

.control-deck {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  overflow: hidden;
  border-radius: 8px;
}

.search-wrap,
.decade-tabs,
.timeline {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(7, 24, 32, 0.1);
  backdrop-filter: blur(18px);
}

.search-wrap {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.search-wrap label {
  color: #476069;
}

.search-wrap input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.05rem;
  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(5, 1fr);
  gap: 8px;
  padding: 10px;
}

.decade-tabs button {
  min-height: 46px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #38545c;
  font-weight: 850;
  cursor: pointer;
}

.decade-tabs button.active {
  background: var(--deep);
  color: #ffffff;
}

.timeline {
  overflow-y: auto;
  padding: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) transparent;
}

.timeline-item {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  width: 100%;
  min-height: 78px;
  margin-bottom: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.timeline-item:hover,
.timeline-item:focus-visible {
  border-color: rgba(0, 155, 211, 0.36);
  outline: none;
}

.timeline-item.active {
  border-color: transparent;
  background: linear-gradient(90deg, rgba(0, 155, 211, 0.16), rgba(248, 189, 89, 0.22));
  box-shadow: inset 4px 0 0 var(--teal);
}

.item-period {
  color: #006a91;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.12;
}

.item-name {
  display: block;
  color: var(--deep);
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.12;
}

.item-office {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.18;
}

.empty-state {
  padding: 20px;
  color: var(--muted);
  font-weight: 750;
}

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

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .stage {
    min-height: 680px;
  }

  .control-deck {
    min-height: 420px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .stage {
    min-height: 780px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .brand {
    grid-column: 1 / -1;
    max-width: 330px;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(320px, 46vh) auto;
  }

  .details {
    padding: 28px;
  }

  h2 {
    max-width: 12ch;
    font-size: clamp(2.7rem, 14vw, 4.6rem);
  }

  .nav-button {
    top: 38%;
  }

  .decade-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}
