:root {
  --page-bg: #f3f3f1;
  --surface: #ffffff;
  --surface-soft: #f4f4f3;
  --line: #dededb;
  --text: #222221;
  --muted: #6e6e69;
  --wine: #8f1732;
  --wine-dark: #731126;
  --gold: #cda35b;
  --green: #4d8a62;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.035);
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(calc(100% - 48px), var(--container));
  margin: 0 auto;
  padding: 72px 0 90px;
}

.hero {
  position: relative;
  min-height: 250px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(90deg, rgba(0,0,0,.84) 0%, rgba(0,0,0,.54) 43%, rgba(0,0,0,.08) 73%),
    url("../img/hero-garitas.jpg") center / cover no-repeat;
  box-shadow: var(--shadow);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.12), rgba(0,0,0,0));
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 54px 44px;
  color: #fff;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: clamp(2.7rem, 5vw, 4.75rem);
  line-height: .98;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.hero__subtitle {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 700;
}

.hero__updated {
  margin: 18px 0 0;
  font-size: .98rem;
  color: rgba(255,255,255,.92);
}

.section {
  margin-top: 46px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px 18px;
  color: #585854;
}

.section-heading__icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.section-heading h2 {
  margin: 0;
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .025em;
}

.crossing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.crossing-card {
  min-height: 302px;
  padding: 24px 24px 22px;
  background: var(--surface);
  border: 1px solid #e7e7e3;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.crossing-card__header {
  padding-bottom: 12px;
  border-bottom: 1px solid #e6e6e2;
}

.crossing-card__title {
  margin: 0;
  color: var(--wine);
  font-size: 1.14rem;
  line-height: 1.15;
  font-weight: 800;
  text-transform: uppercase;
}

.crossing-card__location {
  margin: 4px 0 0;
  color: var(--gold);
  font-size: .8rem;
}

.crossing-card__rows {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.crossing-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 8px 12px;
  border-radius: 10px;
}

.crossing-row--soft {
  background: var(--surface-soft);
}

.crossing-row__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.crossing-row__icon img {
  width: 24px;
  height: 24px;
}

.crossing-row__icon--general {
  background: var(--wine);
}

.crossing-row__icon--sentri {
  background: var(--gold);
}

.crossing-row__icon--pedestrian {
  background: var(--green);
}

.crossing-row__label {
  min-width: 0;
}

.crossing-row__name {
  display: block;
  margin-bottom: 3px;
  font-size: .92rem;
  font-weight: 600;
  text-transform: uppercase;
}

.crossing-row__doors {
  display: block;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.25;
}

.crossing-row__time {
  min-width: 58px;
  padding-left: 16px;
  border-left: 1px solid #deded9;
  text-align: center;
}

.crossing-row__minutes {
  display: block;
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 800;
}

.crossing-row__minutes--general { color: var(--wine); }
.crossing-row__minutes--sentri { color: var(--gold); }
.crossing-row__minutes--pedestrian { color: var(--green); }

.crossing-row__unit {
  display: block;
  margin-top: 3px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.section-divider {
  height: 1px;
  margin: 44px 0 0;
  background: #c9c9c4;
}

.camera-list {
  display: grid;
  gap: 42px;
}

.camera-card {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .95fr);
  gap: 28px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid #e6e6e2;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.camera-card__media {
  min-width: 0;
}

.camera-viewer {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: #171717;
}

.camera-viewer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-live {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
}

.camera-live::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ff3048;
}

.camera-expand {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: rgba(0,0,0,.58);
  cursor: pointer;
}

.camera-expand img {
  width: 19px;
  height: 19px;
}

.camera-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: #fff;
  font-size: .86rem;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.65);
}

.camera-tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.camera-tab {
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 0;
  border-radius: 7px;
  background: #eee;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
}

.camera-tab.is-active {
  background: var(--wine);
  color: #fff;
}

.camera-card__details {
  padding-left: 30px;
  border-left: 1px solid #dfdfda;
}

.camera-card__title {
  margin: 10px 0 20px;
  color: var(--gold);
  font-size: 1.65rem;
  line-height: 1.1;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-label {
  margin: 0 0 8px;
  color: #666;
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
}

.detail-main {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.1;
}

.detail-sub {
  margin: 6px 0 0;
  font-size: .84rem;
  color: #4e4e4a;
}

.status-box {
  margin-top: 30px;
  padding: 24px;
  background: var(--surface-soft);
  border: 1px solid #ddddda;
  border-radius: 18px;
}

.status-box__title {
  margin: 0 0 18px;
  font-size: .86rem;
  font-weight: 500;
}

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

.status-item {
  text-align: center;
}

.status-item__name {
  display: block;
  margin-bottom: 4px;
  font-size: .73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-item__time {
  display: block;
  font-size: 1.78rem;
  line-height: 1;
  font-weight: 800;
}

.status-item__unit {
  display: block;
  margin-top: 3px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.status-item--general .status-item__time { color: var(--wine); }
.status-item--sentri .status-item__time { color: var(--gold); }
.status-item--pedestrian .status-item__time { color: var(--green); }

.empty-state {
  display: grid;
  place-items: center;
  min-height: 62px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: #898983;
  font-size: .78rem;
}

@media (max-width: 980px) {
  .page-shell {
    width: min(calc(100% - 32px), var(--container));
    padding-top: 32px;
  }

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

  .crossing-card {
    min-height: auto;
  }

  .camera-card {
    grid-template-columns: 1fr;
  }

  .camera-card__details {
    padding: 4px 0 0;
    border-left: 0;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(calc(100% - 22px), var(--container));
    padding: 16px 0 56px;
  }

  .hero {
    min-height: 220px;
    border-radius: 18px;
    background-position: 62% center;
  }

  .hero__content {
    padding: 34px 24px;
  }

  .hero h1 {
    max-width: 360px;
    font-size: 2.45rem;
  }

  .hero__subtitle {
    max-width: 270px;
    font-size: 1rem;
  }

  .section {
    margin-top: 34px;
  }

  .section-heading {
    margin-left: 4px;
  }

  .section-heading h2 {
    font-size: .78rem;
  }

  .crossing-grid {
    gap: 16px;
  }

  .crossing-card {
    padding: 20px 18px;
    border-radius: 16px;
  }

  .camera-list {
    gap: 24px;
  }

  .camera-card {
    gap: 18px;
    padding: 16px;
    border-radius: 18px;
  }

  .camera-viewer {
    border-radius: 14px;
  }

  .camera-card__title {
    margin-top: 2px;
    font-size: 1.35rem;
  }

  .status-box {
    margin-top: 22px;
    padding: 18px 12px;
  }

  .status-grid {
    gap: 8px;
  }

  .status-item__time {
    font-size: 1.45rem;
  }
  .camera-viewer__media {
  width: 100%;
  height: 100%;
}

.camera-viewer__video,
.camera-viewer__media .video-js {
  width: 100%;
  height: 100%;
}

.camera-stream-logo {
  position: absolute;
  right: 15px;
  bottom: 15px;
  max-width: 160px;
  z-index: 5;
}
}
