:root {
  --ink: #1c2d27;
  --muted: #69766f;
  --paper: #f5f4ed;
  --white: #fffefa;
  --yellow: #e4c24c;
  --yellow-soft: #f8edb8;
  --green: #1f4a3d;
  --green-deep: #16372d;
  --line: #dedfd6;
  --shadow: 0 14px 38px rgb(29 45 39 / 6%);
  --sidebar-width: 264px;
  --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:
    radial-gradient(circle at 89% 5%, rgb(228 194 76 / 12%), transparent 22rem),
    var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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: 30px 18px 22px;
  overflow-y: auto;
  background: linear-gradient(160deg, var(--green-deep), var(--green));
  color: #f8f5e9;
}

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

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

.brand__roof {
  position: absolute;
  top: 10px;
  left: 9px;
  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: 21px;
  line-height: 0.92;
}

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

.sidebar__nav {
  margin-top: 62px;
}

.sidebar__label {
  margin: 0 0 12px 13px;
  color: #a4b9ae;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: center;
  margin: 4px 0;
  padding: 12px 13px;
  border-radius: 10px;
  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 / 8%);
  color: white;
}

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

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

.nav-link--active::before {
  position: absolute;
  left: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgb(228 194 76 / 14%);
  content: "";
}

.page-content {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  overflow: hidden;
}

.page-content::before {
  position: absolute;
  z-index: -1;
  top: -220px;
  right: -150px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(228 194 76 / 10%), transparent 68%);
  content: "";
  pointer-events: none;
}

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

.page-header {
  max-width: 760px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgb(31 74 61 / 15%);
}

.eyebrow {
  margin: 0 0 10px;
  color: #8b7531;
  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(46px, 5.4vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.page-intro {
  margin: 18px 0 0;
  color: var(--muted);
  font-family: var(--font-serif);
  max-width: 48ch;
  font-size: 20px;
  line-height: 1.45;
}

.empty-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  max-width: 760px;
  margin-top: 40px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 254 250 / 82%);
  box-shadow: var(--shadow);
}

.empty-panel__icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 15px;
  background: var(--yellow-soft);
  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 {
  display: inline-flex;
  align-items: center;
  padding: 12px 15px;
  border-radius: 9px;
  white-space: nowrap;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background 150ms ease, transform 150ms ease;
}

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

.button-link:hover {
  background: var(--green-deep);
  transform: translateY(-1px);
}

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

.sidebar__account {
  margin-top: auto;
  padding: 18px 13px 0;
  border-top: 1px solid rgb(255 255 255 / 13%);
  color: #bfd0c6;
  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: 14px;
  max-width: 760px;
  margin-top: 40px;
}

.feed-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgb(255 254 250 / 78%);
  box-shadow: 0 4px 13px rgb(29 45 39 / 2%);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.feed-card:hover {
  border-color: rgb(31 74 61 / 25%);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

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

.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 .feed-card__status {
  margin-top: 9px;
  color: #8b8171;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed-card .feed-card__status--enabled {
  color: #39734a;
}

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

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

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

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

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

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

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

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

.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: 14px;
}

.metric-card {
  display: flex;
  min-height: 128px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgb(255 254 250 / 78%);
}

.metric-card--total {
  border-color: #d5b744;
  background: var(--yellow);
  color: var(--green-deep);
}

.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: #315447;
}

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

.feed-summary-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 254 250 / 78%);
  box-shadow: 0 4px 13px rgb(29 45 39 / 2%);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.feed-summary-card:hover {
  border-color: rgb(31 74 61 / 25%);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.feed-summary-card__preview {
  position: relative;
  display: grid;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  place-items: center;
  border-radius: 9px;
  background: #101613;
}

.feed-summary-card__preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  object-fit: contain;
  transition: opacity 180ms ease;
}

.feed-summary-card__preview--loaded img {
  opacity: 1;
}

.feed-summary-card__placeholder {
  color: #9aa59f;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.feed-summary-card__preview--loaded .feed-summary-card__placeholder {
  opacity: 0;
}

.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;
  border-radius: 999px;
  background: #eeece3;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.feed-summary-card__status--online {
  background: #e0eddf;
  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;
  border-radius: 7px;
  background: #f1f1eb;
  text-transform: capitalize;
}

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

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

.video-player {
  position: relative;
  width: 100%;
  max-width: 960px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgb(31 74 61 / 17%);
  border-radius: 14px;
  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: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 254 250 / 78%);
  box-shadow: 0 4px 13px rgb(29 45 39 / 2%);
}

.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;
  border-radius: 8px;
  background: #f1f1eb;
}

.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:
    radial-gradient(circle at 80% 15%, rgb(228 194 76 / 26%), transparent 22rem),
    linear-gradient(135deg, var(--green-deep), var(--green));
}

.login-card {
  width: min(100%, 430px);
  padding: 38px;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 18px;
  background: rgb(255 254 250 / 96%);
  box-shadow: 0 24px 60px rgb(8 29 23 / 24%);
}

.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: 8px;
  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;
  border-radius: 8px;
  background: var(--yellow);
  color: var(--green);
  cursor: pointer;
  font: 700 11px var(--font-sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background 150ms ease, transform 150ms ease;
}

.login-form button:hover {
  background: #d7b337;
  transform: translateY(-1px);
}

.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: 9px;
    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;
  }
}
