:root {
  --ink: #1e2b27;
  --muted: #66716c;
  --paper: #f8f6ee;
  --white: #fffefa;
  --yellow: #e9c83e;
  --yellow-soft: #f5e992;
  --green: #26483d;
  --line: #dcd8ca;
  --sidebar-width: 276px;
  --font-sans: "DM Sans", sans-serif;
  --font-serif: "Newsreader", Georgia, serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 38px 24px 28px;
  overflow-y: auto;
  background: var(--green);
  color: #f8f5e9;
}

.brand__link {
  display: flex;
  gap: 14px;
  align-items: center;
  text-decoration: none;
}

.brand__mark {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  background: var(--yellow);
}

.brand__roof {
  position: absolute;
  top: 11px;
  left: 10px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--green);
  border-bottom: 0;
  transform: rotate(45deg);
}

.brand__door {
  position: absolute;
  bottom: 8px;
  left: 17px;
  z-index: 1;
  width: 9px;
  height: 13px;
  background: var(--green);
}

.brand__name {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 0.9;
}

.brand__name--accent {
  color: var(--yellow);
}

.sidebar__nav {
  margin-top: 72px;
}

.sidebar__label {
  margin: 0 0 14px 15px;
  color: #9db1a7;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-link {
  display: flex;
  gap: 13px;
  align-items: center;
  margin: 5px 0;
  padding: 13px 15px;
  border-radius: 4px;
  color: #cbd6d0;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: 150ms ease;
}

.nav-link svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-link:hover {
  background: rgb(255 255 255 / 7%);
  color: white;
}

.nav-link--active {
  background: var(--yellow);
  color: var(--green);
}

.nav-link--active:hover {
  background: var(--yellow-soft);
  color: var(--green);
}

.page-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.page-wrap {
  width: min(1040px, calc(100% - 96px));
  margin: 0 auto;
  padding: 88px 0;
}

.page-header {
  max-width: 760px;
  padding-bottom: 48px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 10px;
  color: #8a7844;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

h1,
h2,
p {
  overflow-wrap: break-word;
}

h1,
h2 {
  margin-top: 0;
  font-family: var(--font-serif);
  font-weight: 500;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(48px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.035em;
}

.page-intro {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 20px;
}

.empty-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  max-width: 760px;
  margin-top: 48px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--white);
}

.empty-panel__icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--green);
}

.empty-panel__icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.empty-panel h2 {
  margin-bottom: 5px;
  font-size: 25px;
}

.empty-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.button-link {
  padding: 12px 16px;
  white-space: nowrap;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.button-link span {
  display: inline-block;
  margin-left: 5px;
  transition: transform 150ms ease;
}

.button-link:hover span {
  transform: translateX(3px);
}

.sidebar__account {
  margin-top: auto;
  padding: 18px 15px 0;
  border-top: 1px solid rgb(255 255 255 / 12%);
  color: #aabbb2;
  font-size: 11px;
}

.sidebar__account span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__account form {
  margin-top: 10px;
}

.sidebar__account button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--yellow);
  cursor: pointer;
  font: 700 10px var(--font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 760px;
  margin-top: 48px;
}

.feed-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid var(--line);
  background: var(--white);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.feed-card:hover {
  border-color: #a9a493;
  transform: translateY(-2px);
}

.feed-card__preview {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  background: var(--yellow);
}

.feed-card__preview svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.feed-card strong,
.feed-card small {
  display: block;
}

.feed-card strong {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
}

.feed-card small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-card__arrow {
  color: var(--muted);
}

.back-link {
  display: inline-block;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.back-link:hover {
  color: var(--ink);
}

.page-header--detail {
  padding-bottom: 34px;
}

.page-wrap--wide {
  width: min(1320px, calc(100% - 96px));
}

.detection-dashboard,
.dashboard-section {
  margin-top: 48px;
}

.dashboard-section + .dashboard-section {
  margin-top: 64px;
}

.section-heading {
  display: flex;
  gap: 28px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 34px;
}

.section-note {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
}

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

.metric-card {
  display: flex;
  min-height: 134px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--white);
}

.metric-card--total {
  background: var(--green);
  color: white;
}

.metric-card--quiet {
  grid-column: span 2;
}

.metric-card__value {
  font-family: var(--font-serif);
  font-size: 48px;
  line-height: 1;
}

.metric-card__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.metric-card--total .metric-card__label {
  color: #b7c7bf;
}

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

.feed-summary-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 24px;
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--white);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.feed-summary-card:hover {
  border-color: #a9a493;
  transform: translateY(-2px);
}

.feed-summary-card__header {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
}

.feed-summary-card__header > span:first-child {
  min-width: 0;
}

.feed-summary-card strong,
.feed-summary-card small {
  display: block;
}

.feed-summary-card strong {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 500;
}

.feed-summary-card small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-summary-card__status {
  flex: 0 0 auto;
  padding: 5px 8px;
  background: #eee9dc;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.feed-summary-card__status--online {
  background: #dcebdd;
  color: #2c633b;
}

.feed-summary-card__counts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.feed-summary-card__counts span {
  padding: 7px 9px;
  background: var(--paper);
  text-transform: capitalize;
}

.feed-summary-card__counts b {
  color: var(--ink);
}

.feed-monitor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
  margin-top: 36px;
}

.video-player {
  position: relative;
  width: 100%;
  max-width: 960px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: #111;
}

.video-player video {
  display: block;
  width: 100%;
  height: 100%;
  background: #111;
  object-fit: contain;
}

.detection-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.detection-panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--white);
}

.detection-panel h2 {
  margin-bottom: 7px;
  font-size: 30px;
}

.detection-panel__status {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.detection-counts {
  display: grid;
  gap: 7px;
  margin-top: 24px;
}

.detection-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--paper);
}

.detection-count span {
  font-size: 12px;
  text-transform: capitalize;
}

.detection-count strong {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
}

.detection-counts__empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.detection-panel__note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
  background: var(--green);
}

.login-card {
  width: min(100%, 430px);
  padding: 42px;
  background: var(--white);
}

.login-card__brand {
  color: var(--green);
}

.brand__name--login-accent {
  color: #9a7e16;
}

.login-card__heading {
  margin-top: 52px;
}

.login-card h1 {
  font-size: 48px;
}

.form-error {
  margin: 22px 0;
  padding: 12px;
  border-left: 3px solid #a73b2e;
  background: #f7e7e3;
  color: #7e2c22;
  font-size: 12px;
}

.login-form {
  display: grid;
  gap: 9px;
  margin-top: 28px;
}

.login-form label {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-form input {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: white;
  color: var(--ink);
  font: 14px var(--font-sans);
}

.login-form input:focus {
  border-color: var(--green);
  outline: 2px solid rgb(38 72 61 / 12%);
}

.login-form button {
  margin-top: 16px;
  padding: 13px 16px;
  border: 0;
  background: var(--yellow);
  color: var(--green);
  cursor: pointer;
  font: 700 11px var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-toggle,
.nav-scrim {
  display: none;
}

@media (max-width: 899px) {
  :root {
    --sidebar-width: 278px;
  }

  .sidebar {
    box-shadow: 8px 0 35px rgb(24 39 34 / 20%);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .page-content {
    margin-left: 0;
  }

  .feed-monitor {
    grid-template-columns: 1fr;
  }

  .video-player {
    max-width: none;
  }

  .detection-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
    column-gap: 28px;
  }

  .detection-panel .eyebrow,
  .detection-panel h2,
  .detection-panel__status {
    grid-column: 1;
  }

  .detection-counts {
    grid-column: 2;
    grid-row: 1 / span 4;
    margin-top: 0;
  }

  .detection-panel__note {
    grid-column: 1;
  }

  .nav-toggle {
    position: fixed;
    z-index: 25;
    top: 18px;
    right: 18px;
    display: flex;
    gap: 9px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--white);
    color: var(--ink);
    font: 700 10px var(--font-sans);
    letter-spacing: 0.09em;
    text-transform: uppercase;
  }

  .nav-toggle__icon,
  .nav-toggle__icon::before,
  .nav-toggle__icon::after {
    display: block;
    width: 17px;
    height: 1px;
    background: currentColor;
  }

  .nav-toggle__icon {
    position: relative;
  }

  .nav-toggle__icon::before,
  .nav-toggle__icon::after {
    position: absolute;
    left: 0;
    content: "";
  }

  .nav-toggle__icon::before { top: -5px; }
  .nav-toggle__icon::after { top: 5px; }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 20;
    width: 100%;
    border: 0;
    background: rgb(20 32 28 / 48%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .nav-open {
    overflow: hidden;
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-open .nav-scrim {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 600px) {
  .page-wrap {
    width: calc(100% - 36px);
    padding: 86px 0 60px;
  }

  h1 {
    font-size: 50px;
  }

  .page-intro {
    font-size: 18px;
  }

  .empty-panel {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 22px;
  }

  .empty-panel .button-link {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .feed-grid {
    grid-template-columns: 1fr;
  }

  .page-wrap--wide {
    width: calc(100% - 36px);
  }

  .section-heading {
    display: block;
  }

  .section-note {
    margin-top: 8px;
  }

  .metric-grid,
  .feed-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card--quiet {
    grid-column: 1 / -1;
  }

  .feed-summary-card {
    grid-column: 1 / -1;
  }

  .detection-panel {
    display: block;
  }

  .detection-counts {
    margin-top: 24px;
  }

  .login-card {
    padding: 32px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
