:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #fffcf6;
  --surface-soft: #eee8df;
  --ink: #202326;
  --muted: #62676a;
  --line: #d8d0c4;
  --blue: #355f7c;
  --green: #587565;
  --gold: #a7782d;
  --red: #9d4f45;
  --shadow: 0 16px 38px rgba(31, 35, 38, .08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background: linear-gradient(180deg, #fffcf6 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 0 max(16px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid rgba(31, 35, 38, .1);
  background: rgba(244, 241, 234, .92);
  backdrop-filter: blur(16px);
}

.brand,
.topbar nav,
.topbar nav a,
button {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  overflow: visible;
  filter: drop-shadow(0 6px 8px rgba(31, 35, 38, .12));
}

.topbar nav {
  gap: 7px;
  overflow-x: auto;
}

.topbar nav a,
button {
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.topbar nav a:hover {
  border-color: rgba(53, 95, 124, .42);
  background: #fff;
}

button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: .68;
}

.shell {
  width: calc(100% - 32px);
  max-width: 1040px;
  margin: 0 auto;
  padding: 26px 0 44px;
}

.current-band {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr);
  gap: 12px;
  margin-bottom: 12px;
}

.identity,
.panel,
.system-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 246, .96);
  box-shadow: var(--shadow);
}

.identity {
  min-height: 174px;
  padding: 22px;
}

.label,
.status-grid span,
.system-grid span,
.video-row span,
.skill-row span {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(58px, 8vw, 96px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: .86;
}

h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 930;
  letter-spacing: 0;
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.25;
}

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

.status-grid article,
.system-grid article {
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(31, 35, 38, .12);
  border-radius: 8px;
  background: rgba(255, 252, 246, .78);
}

.status-grid strong,
.system-grid strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.source-panel {
  margin-bottom: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.source-line,
.current-state {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(53, 95, 124, .2);
  border-radius: 8px;
  background: rgba(53, 95, 124, .07);
}

.source-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 0;
}

.source-line a {
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
  overflow-wrap: anywhere;
  text-align: right;
  text-decoration: none;
}

.source-line a:hover {
  text-decoration: underline;
}

.source-line span,
.current-state span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.current-state span {
  margin-bottom: 6px;
}

.current-state strong {
  display: block;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.24;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(320px, .96fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.count-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.video-list,
.skill-map {
  display: grid;
  gap: 8px;
}

.video-row,
.skill-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid rgba(31, 35, 38, .12);
  border-radius: 8px;
  background: rgba(244, 241, 234, .58);
}

.video-row a {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 880;
  line-height: 1.22;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.video-row a:hover {
  color: var(--blue);
}

.video-row em,
.skill-row em {
  display: inline-flex;
  min-width: 34px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(31, 35, 38, .12);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.skill-summary {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(88, 117, 101, .24);
  border-radius: 8px;
  background: rgba(88, 117, 101, .08);
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.22;
}

.skill-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.12;
}

.skill-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.25;
}

.skill-row[data-status="Strong signal"] span {
  color: var(--green);
}

.skill-row[data-status="Needs work"] span,
.skill-row[data-status="Regression"] span {
  color: var(--red);
}

.system-band {
  display: grid;
  grid-template-columns: minmax(170px, .28fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 16px;
}

.empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed rgba(31, 35, 38, .2);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 780;
}

@media (max-width: 820px) {
  .current-band,
  .work-grid,
  .system-band {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding: 12px;
  }

  .topbar nav {
    width: 100%;
  }

  .shell {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .identity {
    min-height: auto;
    padding: 18px;
  }

  h1 {
    font-size: 62px;
  }

  .status-grid,
  .system-grid,
  .panel-head,
  .action-row {
    display: grid;
    justify-content: stretch;
  }

  .source-line {
    align-items: start;
    flex-direction: column;
  }

  .source-line a {
    text-align: left;
  }

  .video-row,
  .skill-row {
    grid-template-columns: 1fr;
  }

  .video-row em,
  .skill-row em {
    justify-self: start;
  }
}
