:root {
  color-scheme: light;
  --institutional: #084C9E;
  --primary: #0875D9;
  --canvas: #EDF7FA;
  --card: #F5FBFD;
  --white: #FFFFFF;
  --text: #172B3A;
  --muted: #526575;
  --line: #D4E1E7;
  --green: #42B883;
  --orange: #FF9635;
  --purple: #B478E8;
  --red: #E34D59;

  --content-width: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-height: 66px;
  --nav-height: 0px;
  --card-shadow: 0 2px 6px color-mix(in srgb, var(--text) 5%, transparent);

  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--canvas);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }

body { margin: 0; }
p, h1, h2, h3 { margin: 0; }
a { color: inherit; text-decoration: none; }

a:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: -4px;
  border-radius: 4px;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  z-index: 1;
  top: 0;
  color: var(--white);
  background: var(--institutional);
}

.topbar-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(16px, 3vw, 44px);
  max-width: var(--content-width);
  min-height: var(--header-height);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--white) 40%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--white) 12%, transparent);
}

.brand-mark .icon { width: 18px; height: 18px; }

.navigation {
  display: flex;
  align-self: stretch;
  gap: 8px;
}

.navigation a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 12px;
  box-shadow: inset 0 -3px transparent;
  color: color-mix(in srgb, var(--white) 86%, var(--institutional));
  font-size: .9375rem;
  font-weight: 600;
  white-space: nowrap;
}

.navigation a .icon { width: 17px; height: 17px; }

.navigation a:hover,
.navigation a[aria-current="location"] {
  color: var(--white);
  background: color-mix(in srgb, var(--white) 8%, transparent);
}

.navigation a[aria-current="location"] {
  box-shadow: inset 0 -3px var(--white);
}

.app-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.app-name {
  font-size: .9375rem;
  font-weight: 650;
}

.app-version {
  padding: 4px 9px;
  border: 1px solid color-mix(in srgb, var(--white) 40%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--white) 12%, transparent);
  font-size: .8125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.main {
  max-width: var(--content-width);
  margin-inline: auto;
  padding: 32px var(--gutter) 40px;
}

.main, .projects {
  scroll-margin-top: calc(var(--header-height) + var(--nav-height) + 12px);
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 24px;
}

.page-heading h1 {
  font-size: clamp(1.625rem, 3.2vw, 2.25rem);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -.04em;
}

.page-heading p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.environment {
  display: flex;
  flex: none;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.environment .icon { width: 17px; height: 17px; color: var(--institutional); }
.environment strong, .environment small { display: block; }
.environment strong { font-size: .8125rem; line-height: 1.35; }
.environment small { margin-top: 2px; color: var(--muted); font-size: .75rem; line-height: 1.35; }

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

.metric {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "value icon"
    "label label";
  align-items: center;
  gap: 8px 6px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--card-shadow);
}

[data-color="green"] { --accent: var(--green); }
[data-color="amber"] { --accent: var(--orange); }
[data-color="indigo"] { --accent: var(--purple); }
[data-color="slate"] { --accent: var(--muted); }
[data-color="blue"], .metric-icon[data-color="slate"] { --accent: var(--primary); }

.tile, .status {
  color: color-mix(in srgb, var(--text) 71%, var(--accent));
  background: color-mix(in srgb, var(--white) 83%, var(--accent));
}

.tile {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.tile .icon { width: 19px; height: 19px; }

.metric-icon {
  grid-area: icon;
  border-radius: 50%;
  color: color-mix(in srgb, var(--text) 58%, var(--accent));
  background: color-mix(in srgb, var(--white) 76%, var(--accent));
}

.metric-label {
  grid-area: label;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
}

.metric-value {
  grid-area: value;
  font-size: 2.125rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: -.05em;
}

.projects {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--card-shadow);
}

.projects-heading { padding: 15px 18px; }

.projects-heading h2 {
  font-size: 1.1875rem;
  line-height: 1.25;
  letter-spacing: -.025em;
}

.project {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
}

.project h3 { font-size: .975rem; line-height: 1.35; font-weight: 680; }

.project p {
  margin-top: 3px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.4;
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 10px;
}

.project-version {
  color: var(--muted);
  font-size: .8125rem;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 116px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 650;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

@media (max-width: 650px) {
  :root {
    --header-height: 54px;
    --nav-height: 44px;
  }

  .topbar-content {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: var(--header-height) var(--nav-height);
    gap: 0 8px;
  }

  .brand { gap: 7px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-mark .icon { width: 16px; height: 16px; }

  .navigation {
    grid-area: 2 / 1 / 3 / -1;
    border-top: 1px solid color-mix(in srgb, var(--white) 24%, transparent);
  }

  .navigation a { min-height: 0; }
  .app-identity { gap: 7px; }

  .main { padding-block: 22px 30px; }
  .page-heading { flex-wrap: wrap; gap: 12px; margin-bottom: 17px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
  .metric { padding: 12px; }
  .metric-value { font-size: 1.875rem; }
  .projects-heading { padding: 13px 14px; }

  .project {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 10px;
    padding: 11px 14px;
  }

  .project-icon { align-self: start; width: 34px; height: 34px; }
  .project-meta { grid-column: 2; flex-wrap: wrap; justify-content: start; gap: 6px 9px; }
  .status { order: -1; min-width: 0; }
}

@media (max-width: 350px) {
  .brand { font-size: .875rem; }
  .app-name, .app-version { font-size: .75rem; }
}
